示例#1
0
 /// <summary>
 /// Setup handlers that requires the ServerCore to be setup
 /// </summary>
 /// <param name="sender"></param>
 public void Init(ServerCore server)
 {
     commandHandler.Add(new MessageHandler_ClientRequest_Login(server));
     commandHandler.Add(new MessageHandler_ClientRequest_Register(server));
     commandHandler.Add(new MessageHandler_ClientRequest_OwnedSpells(server));
     commandHandler.Add(new MessageHandler_ClientRequest_Stats(server));
 }
 public void Setup(ServerCore server, MatchMakerCore matchMakerCore)
 {
     this.matchMakerCore = matchMakerCore;
     this.server         = server;
     commandHandler      = new MessageCommandHandlerServer();
     commandHandler.Add(new MessageHandler_Request_JoinQueue(server, matchMakerCore));
     commandHandler.Add(new MessageHandler_Request_LeaveQueue(server.clientManager, matchMakerCore));
     commandHandler.Add(new MessageHandler_Response_ReadyCheck(matchMakerCore, server));
 }
 /// <summary>
 /// Setup extensions
 /// </summary>
 /// <param name="serverExtensions">Extensions</param>
 /// <param name="matchClock">Clock of the match</param>
 /// <param name="serverCoreEventHandler">Eventhandler of the ServerCore</param>
 internal void Init(List <IServerExtension> serverExtensions, Clock matchClock, MatchServerCoreEventHandler serverCoreEventHandler)
 {
     commandHandler.Add(new MessageHandler_Request_JoinGame(logger, matchThread.GetServer().messageSender, matchThread, serverExtensions, matchGameEventWrapper));
     commandHandler.Add(new MessageHandler_ServerRoundTrip_Ping(logger, matchThread.GetServer().messageSender, matchThread, serverExtensions));
     foreach (var extension in serverExtensions)
     {
         foreach (var msgHandler in extension.CreateMessageHandlers(matchThread.GetServer(), matchThread.pingDeterminer, matchGameEventWrapper, matchClock))
         {
             commandHandler.Add(msgHandler);
         }
         extension.SetupSubscribers(matchThread.GetServer(), serverCoreEventHandler);
     }
 }