mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-10 07:05:41 +12:00
Fix Bug where quiz menu wouldnt close.
This commit is contained in:
parent
7a85eaac5d
commit
160688bf2d
1 changed files with 34 additions and 38 deletions
|
@ -209,45 +209,41 @@ namespace HISP.Game.Events
|
||||||
{
|
{
|
||||||
foreach(Participent participent in Participents)
|
foreach(Participent participent in Participents)
|
||||||
{
|
{
|
||||||
if (participent.UserInstance.LoggedinClient != null)
|
|
||||||
|
if (participent.Quit)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
|
||||||
|
participent.UserInstance.InRealTimeQuiz = false;
|
||||||
|
GameServer.UpdateArea(participent.UserInstance.LoggedinClient);
|
||||||
|
|
||||||
|
int money = 0;
|
||||||
|
|
||||||
|
if (participent.Won)
|
||||||
|
money += 2500;
|
||||||
|
else
|
||||||
|
money += 250;
|
||||||
|
|
||||||
|
money += (participent.CorrectAnswers * 500);
|
||||||
|
money -= (participent.MistakenAnswers * 100);
|
||||||
|
|
||||||
|
if (money < 250)
|
||||||
|
money = 250;
|
||||||
|
|
||||||
|
|
||||||
|
if (participent.Won)
|
||||||
{
|
{
|
||||||
if (GameServer.IsUserOnline(participent.UserInstance.Id))
|
byte[] wonBonusMessage = PacketBuilder.CreateChat(Messages.FormatEventRealTimeQuizWinBonus(money), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
{
|
participent.UserInstance.LoggedinClient.SendPacket(wonBonusMessage);
|
||||||
if (participent.Quit)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
GameServer.UpdateArea(participent.UserInstance.LoggedinClient);
|
|
||||||
|
|
||||||
participent.UserInstance.InRealTimeQuiz = false;
|
|
||||||
|
|
||||||
int money = 0;
|
|
||||||
|
|
||||||
if (participent.Won)
|
|
||||||
money += 2500;
|
|
||||||
else
|
|
||||||
money += 250;
|
|
||||||
|
|
||||||
money += (participent.CorrectAnswers * 500);
|
|
||||||
money -= (participent.MistakenAnswers * 100);
|
|
||||||
|
|
||||||
if (money < 250)
|
|
||||||
money = 250;
|
|
||||||
|
|
||||||
|
|
||||||
if (participent.Won)
|
|
||||||
{
|
|
||||||
byte[] wonBonusMessage = PacketBuilder.CreateChat(Messages.FormatEventRealTimeQuizWinBonus(money), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
|
||||||
participent.UserInstance.LoggedinClient.SendPacket(wonBonusMessage);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
byte[] bonusMessage = PacketBuilder.CreateChat(Messages.FormatEventRealTimeQuizBonus(money), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
|
||||||
participent.UserInstance.LoggedinClient.SendPacket(bonusMessage);
|
|
||||||
}
|
|
||||||
|
|
||||||
participent.UserInstance.Money += money;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
byte[] bonusMessage = PacketBuilder.CreateChat(Messages.FormatEventRealTimeQuizBonus(money), PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||||
|
participent.UserInstance.LoggedinClient.SendPacket(bonusMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
participent.UserInstance.Money += money;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
participents.Clear();
|
participents.Clear();
|
||||||
|
@ -255,7 +251,7 @@ namespace HISP.Game.Events
|
||||||
quizTimer.Dispose();
|
quizTimer.Dispose();
|
||||||
|
|
||||||
Active = false;
|
Active = false;
|
||||||
GameServer.TackShopGiveawayEvent = null;
|
GameServer.QuizEvent = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void quizTimesUp(object state)
|
private void quizTimesUp(object state)
|
||||||
|
|
Loading…
Add table
Reference in a new issue