Users can no longer submit multiple sentences in acrophobia

This commit is contained in:
Kwoth 2017-01-26 08:08:40 +01:00
parent 5d5a67b477
commit f40dbc7bec

View File

@ -69,6 +69,7 @@ namespace NadekoBot.Modules.Games
private readonly ConcurrentDictionary<string, IGuildUser> submissions = new ConcurrentDictionary<string, IGuildUser>(); private readonly ConcurrentDictionary<string, IGuildUser> submissions = new ConcurrentDictionary<string, IGuildUser>();
public IReadOnlyDictionary<string, IGuildUser> Submissions => submissions; public IReadOnlyDictionary<string, IGuildUser> Submissions => submissions;
private readonly ConcurrentHashSet<ulong> usersWhoSubmitted = new ConcurrentHashSet<ulong>();
private readonly ConcurrentHashSet<ulong> usersWhoVoted = new ConcurrentHashSet<ulong>(); private readonly ConcurrentHashSet<ulong> usersWhoVoted = new ConcurrentHashSet<ulong>();
private int spamCount = 0; private int spamCount = 0;
@ -191,8 +192,7 @@ namespace NadekoBot.Modules.Games
catch { } catch { }
} }
//user didn't input something already //user didn't input something already
IGuildUser throwaway; if (!usersWhoSubmitted.Add(guildUser.Id))
if (submissions.TryGetValue(input, out throwaway))
return; return;
var inputWords = input.Split(' '); //get all words var inputWords = input.Split(' '); //get all words