private void OnRequestSpawnMap(AckResponseCode responseCode, BaseAckMessage messageData) { ResponseSpawnMapMessage castedMessage = messageData as ResponseSpawnMapMessage; if (LogInfo) { Debug.Log("Spawn Map Ack Id: " + messageData.ackId + " Status: " + responseCode + " Error: " + castedMessage.error); } if (responseCode == AckResponseCode.Error || responseCode == AckResponseCode.Timeout) { // Remove warping characters who warping to instance map HashSet <uint> instanceMapWarpingCharacters; if (instanceMapWarpingCharactersByInstanceId.TryGetValue(castedMessage.instanceId, out instanceMapWarpingCharacters)) { BasePlayerCharacterEntity playerCharacterEntity; foreach (uint warpingCharacter in instanceMapWarpingCharacters) { if (Assets.TryGetSpawnedObject(warpingCharacter, out playerCharacterEntity)) { playerCharacterEntity.IsWarping = false; } } instanceMapWarpingCharactersByInstanceId.Remove(castedMessage.instanceId); } instanceMapWarpingLocations.Remove(castedMessage.instanceId); } }
/// <summary> /// This is function which read response from map spawn server /// </summary> /// <param name="messageHandler"></param> protected void HandleResponseSpawnMap(LiteNetLibMessageHandler messageHandler) { TransportHandler transportHandler = messageHandler.transportHandler; ResponseSpawnMapMessage message = messageHandler.ReadMessage <ResponseSpawnMapMessage>(); transportHandler.ReadResponse(message.ackId, message.responseCode, message); }
private void ReponseMapSpawn(uint ackId, ResponseSpawnMapMessage.Error error) { ResponseSpawnMapMessage responseMessage = new ResponseSpawnMapMessage(); responseMessage.ackId = ackId; responseMessage.responseCode = error == ResponseSpawnMapMessage.Error.None ? AckResponseCode.Success : AckResponseCode.Error; responseMessage.error = error; CentralAppServerRegister.ClientSendPacket(DeliveryMethod.ReliableOrdered, MMOMessageTypes.ResponseSpawnMap, responseMessage.Serialize); }
private void ReponseMapSpawn(uint ackId, ResponseSpawnMapMessage.Error error) { ResponseSpawnMapMessage responseMessage = new ResponseSpawnMapMessage(); responseMessage.ackId = ackId; responseMessage.responseCode = error == ResponseSpawnMapMessage.Error.None ? AckResponseCode.Success : AckResponseCode.Error; responseMessage.error = error; ClientSendPacket(SendOptions.ReliableOrdered, MMOMessageTypes.ResponseSpawnMap, responseMessage); }
private void ReponseMapSpawn(uint ackId, ResponseSpawnMapMessage.Error error) { ResponseSpawnMapMessage responseMessage = new ResponseSpawnMapMessage(); responseMessage.ackId = ackId; responseMessage.responseCode = error == ResponseSpawnMapMessage.Error.None ? AckResponseCode.Success : AckResponseCode.Error; responseMessage.error = error; CentralAppServerRegister.SendResponse(MMOMessageTypes.ResponseSpawnMap, responseMessage); }
protected void OnRequestSpawnMap(AckResponseCode responseCode, BaseAckMessage messageData) { ResponseSpawnMapMessage castedMessage = messageData as ResponseSpawnMapMessage; if (LogInfo) { Debug.Log("Spawn Map Ack Id: " + messageData.ackId + " Status: " + responseCode + " Error: " + castedMessage.error); } }
protected void OnRequestSpawnMap(AckResponseCode responseCode, BaseAckMessage messageData) { ResponseSpawnMapMessage castedMessage = messageData as ResponseSpawnMapMessage; if (LogInfo) { Logging.Log(LogTag, "Spawn Map Ack Id: " + messageData.ackId + " Status: " + responseCode + " Error: " + castedMessage.error); } // Forward responses to map server transport handler KeyValuePair <TransportHandler, uint> requestSpawnMapHandler; if (requestSpawnMapHandlers.TryGetValue(castedMessage.ackId, out requestSpawnMapHandler)) { requestSpawnMapHandler.Key.ReadResponse(requestSpawnMapHandler.Value, castedMessage.responseCode, castedMessage); } }