/// <summary> /// Called when a <see cref="AvatarProfileFullEntryMessage"/> is received. /// </summary> internal void AvatarProfileFullEntryMessageReceived(AvatarProfileFullEntryMessage message) { byte[] sessionId = message.RemoveSessionId(); if (NetAvatarSessionManager.TryGet(sessionId, out NetAvatarSession session)) { AvatarProfileMessage avatarProfileMessage = new AvatarProfileMessage(); avatarProfileMessage.SetAvatarProfileFullEntry(message.RemoveAvatarProfileFullEntry()); session.SendPiranhaMessage(NetUtils.SERVICE_NODE_TYPE_PROXY_CONTAINER, avatarProfileMessage); } }
/// <summary> /// Called when a <see cref="UpdateServerEndPointMessage"/> is received. /// </summary> internal void UpdateServerEndPointMessageReceived(UpdateServerEndPointMessage message) { byte[] sessionId = message.RemoveSessionId(); if (NetAvatarSessionManager.TryGet(sessionId, out NetAvatarSession session)) { if (message.GetServerType() != ServiceCore.ServiceNodeType) { session.SetServiceNodeId(message.GetServerType(), message.GetServerId()); } } }
/// <summary> /// Called when a <see cref="AvatarEntryMessage"/> is received. /// </summary> internal void AvatarEntryMessageReceived(AvatarEntryMessage message) { byte[] sessionId = message.RemoveSessionId(); if (NetAvatarSessionManager.TryGet(sessionId, out NetAvatarSession session)) { message.RemoveAvatarEntry().CopyTo(session.AvatarAccount.AvatarEntry); if (session.GetServiceNodeEndPoint(NetUtils.SERVICE_NODE_TYPE_GLOBAL_CHAT_CONTAINER) != null) { AvatarEntryMessage avatarEntryMessage = new AvatarEntryMessage(); avatarEntryMessage.SetAvatarEntry(session.AvatarAccount.AvatarEntry); session.SendMessage(NetUtils.SERVICE_NODE_TYPE_GLOBAL_CHAT_CONTAINER, avatarEntryMessage); } } }
/// <summary> /// Called when a <see cref="ForwardPiranhaMessage"/> is received. /// </summary> internal void ForwardPiranhaMessageReceived(ForwardPiranhaMessage message) { byte[] sessionId = message.RemoveSessionId(); if (NetAvatarSessionManager.TryGet(sessionId, out NetAvatarSession session)) { PiranhaMessage piranhaMessage = message.RemovePiranhaMessage(); if (piranhaMessage != null) { try { piranhaMessage.Decode(); session.PiranhaMessageManager.ReceiveMessage(piranhaMessage); } catch (Exception exception) { Logging.Warning("NetAvatarMessageManager::forwardPiranhaMessageReceived piranha message handle exception, trace: " + exception); } } } }
/// <summary> /// Called when a <see cref="ExecuteAdminCommandMessage"/> is received. /// </summary> private void ExecuteAdminCommandMessageReceived(ExecuteAdminCommandMessage message) { byte[] sessionId = message.RemoveSessionId(); if (NetAvatarSessionManager.TryGet(sessionId, out NetAvatarSession session)) { AdminCommand adminCommand = message.RemoveDebugCommand(); if (adminCommand.GetServiceNodeType() == ServiceCore.ServiceNodeType) { switch (adminCommand.GetCommandType()) { default: Logging.Print(string.Format("executeAdminCommandMessageReceived unknown debug command received ({0})", adminCommand.GetCommandType())); break; } } else { Logging.Print(string.Format("executeAdminCommandMessageReceived invalid debug command received ({0})", adminCommand.GetCommandType())); } } }