Removed old stuff

This commit is contained in:
Master Kwoth 2017-07-27 18:44:45 +02:00
parent 2fe812c4ac
commit 53661b3337

View File

@ -153,133 +153,5 @@ $@"--
await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); await Context.Channel.EmbedAsync(embed).ConfigureAwait(false);
} }
} }
//public enum AcroPhase
//{
// Submitting,
// Idle, // used to wait for some other actions while transitioning through phases
// Voting
//}
////todo 85 Isolate, this shouldn't print or anything like that.
//public class OldAcrophobiaGame
//{
// private readonly ITextChannel _channel;
// private readonly int _time;
// private readonly NadekoRandom _rng;
// private readonly ImmutableArray<char> _startingLetters;
// private readonly CancellationTokenSource _source;
// private AcroPhase phase { get; set; } = AcroPhase.Submitting;
// private readonly ConcurrentDictionary<string, IGuildUser> _submissions = new ConcurrentDictionary<string, IGuildUser>();
// public IReadOnlyDictionary<string, IGuildUser> Submissions => _submissions;
// private readonly ConcurrentHashSet<ulong> _usersWhoSubmitted = new ConcurrentHashSet<ulong>();
// private readonly ConcurrentHashSet<ulong> _usersWhoVoted = new ConcurrentHashSet<ulong>();
// private int _spamCount;
// //text, votes
// private readonly ConcurrentDictionary<string, int> _votes = new ConcurrentDictionary<string, int>();
// private readonly Logger _log;
// private readonly DiscordSocketClient _client;
// private readonly NadekoStrings _strings;
// public OldAcrophobiaGame(DiscordSocketClient client, NadekoStrings strings, ITextChannel channel, int time)
// {
// _log = LogManager.GetCurrentClassLogger();
// _client = client;
// _strings = strings;
// _channel = channel;
// _time = time;
// _source = new CancellationTokenSource();
// _rng = new NadekoRandom();
// var wordCount = _rng.Next(3, 6);
// var lettersArr = new char[wordCount];
// for (int i = 0; i < wordCount; i++)
// {
// var randChar = (char)_rng.Next(65, 91);
// lettersArr[i] = randChar == 'X' ? (char)_rng.Next(65, 88) : randChar;
// }
// _startingLetters = lettersArr.ToImmutableArray();
// }
// private Task PotentialAcro(SocketMessage arg)
// {
// var _ = Task.Run(async () =>
// {
// try
// {
// var msg = arg as SocketUserMessage;
// if (msg == null || msg.Author.IsBot || msg.Channel.Id != _channel.Id)
// return;
// ++_spamCount;
// var guildUser = (IGuildUser)msg.Author;
// var input = msg.Content.ToUpperInvariant().Trim();
// if (phase == AcroPhase.Submitting)
// {
// // all good. valid input. answer recorded
// await _channel.SendConfirmAsync(GetText("acrophobia"),
// GetText("acro_submit", guildUser.Mention,
// _submissions.Count));
// try
// {
// await msg.DeleteAsync();
// }
// catch
// {
// await msg.DeleteAsync(); //try twice
// }
// }
// else if (phase == AcroPhase.Voting)
// {
// if (_spamCount > 10)
// {
// _spamCount = 0;
// try { await _channel.EmbedAsync(GetEmbed()).ConfigureAwait(false); }
// catch { }
// }
// //if (submissions.TryGetValue(input, out usr) && usr.Id != guildUser.Id)
// //{
// // if (!usersWhoVoted.Add(guildUser.Id))
// // return;
// // votes.AddOrUpdate(input, 1, (key, old) => ++old);
// // await channel.SendConfirmAsync("Acrophobia", $"{guildUser.Mention} cast their vote!").ConfigureAwait(false);
// // await msg.DeleteAsync().ConfigureAwait(false);
// // return;
// //}
// int num;
// if (int.TryParse(input, out num) && num > 0 && num <= _submissions.Count)
// {
// var kvp = _submissions.Skip(num - 1).First();
// var usr = kvp.Value;
// //can't vote for yourself, can't vote multiple times
// if (usr.Id == guildUser.Id || !_usersWhoVoted.Add(guildUser.Id))
// return;
// _votes.AddOrUpdate(kvp.Key, 1, (key, old) => ++old);
// }
// }
// }
// catch (Exception ex)
// {
// _log.Warn(ex);
// }
// });
// return Task.CompletedTask;
// }
//}
} }
} }