public override void Initialize(IServer server) { // Get dependencies SpawnersModule = server.GetModule <SpawnersModule>(); RoomsModule = server.GetModule <RoomsModule>(); factories ??= new Dictionary <string, ILobbyFactory>(); lobbies ??= new Dictionary <int, ILobby>(); server.RegisterMessageHandler((short)MstMessageCodes.CreateLobby, CreateLobbyHandle); server.RegisterMessageHandler((short)MstMessageCodes.JoinLobby, JoinLobbyHandler); server.RegisterMessageHandler((short)MstMessageCodes.LeaveLobby, LeaveLobbyHandler); server.RegisterMessageHandler((short)MstMessageCodes.SetLobbyProperties, SetLobbyPropertiesMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.SetMyProperties, SetMyPropertiesMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.JoinLobbyTeam, JoinLobbyTeamMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.SendMessageToLobbyChat, SendMessageToLobbyChatMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.SetLobbyAsReady, SetLobbyAsReadyMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.StartLobbyGame, StartLobbyGameMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.GetLobbyRoomAccess, GetLobbyRoomAccessMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.GetLobbyMemberData, GetLobbyMemberDataMessageHandler); server.RegisterMessageHandler((short)MstMessageCodes.GetLobbyInfo, GetLobbyInfoMessageHandler); }
public override void Initialize(IServer server) { // Get dependencies SpawnersModule = server.GetModule <SpawnersModule>(); RoomsModule = server.GetModule <RoomsModule>(); factories = factories ?? new Dictionary <string, ILobbyFactory>(); lobbies = lobbies ?? new Dictionary <int, ILobby>(); server.SetHandler((short)MstMessageCodes.CreateLobby, CreateLobbyRequestHandle); server.SetHandler((short)MstMessageCodes.JoinLobby, JoinLobbyRequestHandler); server.SetHandler((short)MstMessageCodes.LeaveLobby, HandleLeaveLobby); server.SetHandler((short)MstMessageCodes.SetLobbyProperties, HandleSetLobbyProperties); server.SetHandler((short)MstMessageCodes.SetMyLobbyProperties, HandleSetMyProperties); server.SetHandler((short)MstMessageCodes.JoinLobbyTeam, HandleJoinTeam); server.SetHandler((short)MstMessageCodes.LobbySendChatMessage, HandleSendChatMessage); server.SetHandler((short)MstMessageCodes.LobbySetReady, HandleSetReadyStatus); server.SetHandler((short)MstMessageCodes.LobbyStartGame, HandleStartGame); server.SetHandler((short)MstMessageCodes.GetLobbyRoomAccess, HandleGetLobbyRoomAccess); server.SetHandler((short)MstMessageCodes.GetLobbyMemberData, HandleGetLobbyMemberData); server.SetHandler((short)MstMessageCodes.GetLobbyInfo, HandleGetLobbyInfo); }