mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-23 21:25:52 +12:00
add more for real time quiz.
This commit is contained in:
parent
753abb5231
commit
4e8ad17d1c
8 changed files with 227 additions and 17 deletions
|
@ -3,6 +3,7 @@ using HISP.Server;
|
|||
using HISP.Game.Items;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using HISP.Game.Events;
|
||||
|
||||
namespace HISP.Game.Chat
|
||||
{
|
||||
|
@ -371,12 +372,22 @@ namespace HISP.Game.Chat
|
|||
|
||||
public static bool Quiz(string message, string[] args, User user)
|
||||
{
|
||||
bool quizActive = false;
|
||||
// TODO: Check quiz event is running.
|
||||
bool quizActive = (GameServer.QuizEvent != null);
|
||||
if (quizActive)
|
||||
{
|
||||
string formattedmessage = Messages.FormatPlayerCommandCompleteMessage(message.Substring(1));
|
||||
|
||||
RealTimeQuiz.Participent participent = GameServer.QuizEvent.JoinEvent(user);
|
||||
|
||||
if(participent.Quit)
|
||||
{
|
||||
byte[] quizQuit = PacketBuilder.CreateChat(Messages.EventQuitRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
user.LoggedinClient.SendPacket(quizQuit);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
participent.UpdateParticipent();
|
||||
byte[] enteredRealTimeQuiz = PacketBuilder.CreateChat(Messages.EventEnteredRealTimeQuiz, PacketBuilder.CHAT_BOTTOM_RIGHT);
|
||||
user.LoggedinClient.SendPacket(enteredRealTimeQuiz);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue