|
@@ -81,13 +81,13 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
|
|
|
public async Task SpeakAction(int seconds = 60, bool enableTimer = false)
|
|
|
{
|
|
|
- TalkingActionComplete.Reset();
|
|
|
await Room.PlayersCh.SendTo(Player.ChatId, $"{strings.your_turn}", Keyboard.InGamePlayerMenuWithEndTurn);
|
|
|
Player.IsSpeaker = true;
|
|
|
var timer = new Timer(seconds * 1000) {AutoReset = false};
|
|
|
timer.Elapsed += (_, _) => TalkingActionComplete.Set();
|
|
|
if (Room.TimerEnabled || enableTimer) timer.Start();
|
|
|
TalkingActionComplete.WaitOne();
|
|
|
+ TalkingActionComplete.Reset();
|
|
|
if (Room.TimerEnabled || enableTimer) timer.Stop();
|
|
|
await Room.PlayersCh.SendTo(Player.ChatId, strings.your_turn_ended, Keyboard.InGamePlayerMenu);
|
|
|
Player.IsSpeaker = false;
|
|
@@ -102,7 +102,6 @@ namespace MafiaTelegramBot.Game.GameRooms
|
|
|
Keyboard.VoteKeyboard(alivePlayers, Player.Id, !Player.IsFirst));
|
|
|
voteTimer.Elapsed += async (_, _) =>
|
|
|
{
|
|
|
- Console.WriteLine("this");
|
|
|
if (Player.IsFirst) await Room.PutUpVote(Player.Id, Player.Id, message.MessageId);
|
|
|
else await Room.PutUpVote(Player.Id, 0, message.MessageId);
|
|
|
VoteActionComplete.Set();
|