public void Serialize(NetDataWriter writer) { time = (int)(System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond); hash = CentralNetworkManager.GetAppServerRegisterHash(peerInfo.peerType, time); peerInfo.Serialize(writer); writer.Put(time); writer.Put(hash); }
public void StartCentralServer() { CentralNetworkManager.useWebSocket = UseWebSocket; CentralNetworkManager.webSocketSecure = WebSocketSecure; CentralNetworkManager.webSocketCertificateFilePath = WebScoketCertificateFilePath; CentralNetworkManager.webSocketCertificatePassword = WebScoketCertificatePassword; CentralNetworkManager.StartServer(); }
public void Serialize(NetDataWriter writer) { time = (int)System.DateTimeOffset.Now.ToUnixTimeSeconds(); hash = CentralNetworkManager.GetAppServerRegisterHash(peerInfo.peerType, time); peerInfo.Serialize(writer); writer.Put(time); writer.Put(hash); }
public bool ValidateHash() { if (string.IsNullOrEmpty(hash)) { return(false); } return(hash.Equals(CentralNetworkManager.GetAppServerRegisterHash(peerInfo.peerType, time))); }
public override void SerializeData(NetDataWriter writer) { if (peerInfo == null) peerInfo = new CentralServerPeerInfo(); time = (int)(System.DateTime.Now.Ticks / System.TimeSpan.TicksPerMillisecond); hash = CentralNetworkManager.GetAppServerRegisterHash(peerInfo.peerType, time); peerInfo.Serialize(writer); writer.Put(time); writer.Put(hash); }
public ClusterServer(CentralNetworkManager centralNetworkManager) : base(new TcpTransport()) { this.centralNetworkManager = centralNetworkManager; #if UNITY_STANDALONE && !CLIENT_BUILD EnableRequestResponse(MMOMessageTypes.Request, MMOMessageTypes.Response); // Generic RegisterRequestHandler <RequestAppServerRegisterMessage, ResponseAppServerRegisterMessage>(MMORequestTypes.RequestAppServerRegister, HandleRequestAppServerRegister); RegisterRequestHandler <RequestAppServerAddressMessage, ResponseAppServerAddressMessage>(MMORequestTypes.RequestAppServerAddress, HandleRequestAppServerAddress); // Map RegisterMessageHandler(MMOMessageTypes.Chat, HandleChat); RegisterMessageHandler(MMOMessageTypes.UpdateMapUser, HandleUpdateMapUser); RegisterMessageHandler(MMOMessageTypes.UpdatePartyMember, HandleUpdatePartyMember); RegisterMessageHandler(MMOMessageTypes.UpdateParty, HandleUpdateParty); RegisterMessageHandler(MMOMessageTypes.UpdateGuildMember, HandleUpdateGuildMember); RegisterMessageHandler(MMOMessageTypes.UpdateGuild, HandleUpdateGuild); // Map-spawn RegisterRequestHandler <RequestSpawnMapMessage, ResponseSpawnMapMessage>(MMORequestTypes.RequestSpawnMap, HandleRequestSpawnMap); RegisterResponseHandler <RequestSpawnMapMessage, ResponseSpawnMapMessage>(MMORequestTypes.RequestSpawnMap, HandleResponseSpawnMap); #endif }
public void RequestSelectCharacter(string characterId, ResponseDelegate <ResponseSelectCharacterMessage> callback) { CentralNetworkManager.RequestSelectCharacter(characterId, (responseHandler, responseCode, response) => OnRequestSelectCharacter(responseHandler, responseCode, response, characterId, callback).Forget()); }
public void RequestDeleteCharacter(string characterId, ResponseDelegate <ResponseDeleteCharacterMessage> callback) { CentralNetworkManager.RequestDeleteCharacter(characterId, callback); }
public void StartCentralClient(string address, int port) { CentralNetworkManager.useWebSocket = UseWebSocket; CentralNetworkManager.webSocketSecure = WebSocketSecure; CentralNetworkManager.StartClient(address, port); }
public void RequestCharacters(ResponseDelegate <ResponseCharactersMessage> callback) { CentralNetworkManager.RequestCharacters(callback); }
public void RequestValidateAccessToken(string userId, string accessToken, ResponseDelegate <ResponseValidateAccessTokenMessage> callback) { CentralNetworkManager.RequestValidateAccessToken(userId, accessToken, (responseHandler, responseCode, response) => OnRequestValidateAccessToken(responseHandler, responseCode, response, callback).Forget()); }
public void RequestUserLogout(ResponseDelegate <INetSerializable> callback) { CentralNetworkManager.RequestUserLogout((responseHandler, responseCode, response) => OnRequestUserLogout(responseHandler, responseCode, response, callback).Forget()); }
public void RequestUserRegister(string username, string password, string email, ResponseDelegate <ResponseUserRegisterMessage> callback) { CentralNetworkManager.RequestUserRegister(username, password, email, callback); }
public void RequestUserLogin(string username, string password, ResponseDelegate <ResponseUserLoginMessage> callback) { CentralNetworkManager.RequestUserLogin(username, password, (responseHandler, responseCode, response) => OnRequestUserLogin(responseHandler, responseCode, response, callback).Forget()); }
public void StopCentralClient() { CentralNetworkManager.StopClient(); }
public void RequestCreateCharacter(PlayerCharacterData characterData, ResponseDelegate <ResponseCreateCharacterMessage> callback) { CentralNetworkManager.RequestCreateCharacter(characterData, callback); }
public void StartCentralClient() { CentralNetworkManager.useWebSocket = UseWebSocket; CentralNetworkManager.webSocketSecure = WebSocketSecure; CentralNetworkManager.StartClient(); }