add messages for real time quiz

This commit is contained in:
SilicaAndPina 2021-04-16 00:09:17 +12:00
parent 661320317f
commit 753abb5231
5 changed files with 81 additions and 7 deletions

View file

@ -158,6 +158,9 @@ namespace HISP.Game.Chat
else if (message.ToUpper().StartsWith("!HEAR"))
return Command.UnMute(message, args, user);
else if (message.ToUpper().StartsWith("!QUIZ"))
return Command.Quiz(message, args, user);
else if (message.ToUpper().StartsWith("!WARP"))
return Command.Warp(message, args, user);

View file

@ -368,6 +368,32 @@ namespace HISP.Game.Chat
return true;
}
public static bool Quiz(string message, string[] args, User user)
{
bool quizActive = false;
// TODO: Check quiz event is running.
if (quizActive)
{
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
byte[] enteredRealTimeQuiz = PacketBuilder.CreateChat(Messages.EventEnteredRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(enteredRealTimeQuiz);
byte[] chatPacket = PacketBuilder.CreateChat(formattedmessage, PacketBuilder.CHAT_BOTTOM_LEFT);
user.LoggedinClient.SendPacket(chatPacket);
return true;
}
else
{
byte[] quizUnavailable = PacketBuilder.CreateChat(Messages.EventUnavailableRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
user.LoggedinClient.SendPacket(quizUnavailable);
return false;
}
}
public static bool Mute(string message, string[] args, User user)
{
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));