Beispiel #1
0
        /// <summary>
        ///     Called when a <see cref="AvatarEntryMessage"/> is received.
        /// </summary>
        internal void AvatarEntryMessageReceived(AvatarEntryMessage message)
        {
            byte[] sessionId = message.RemoveSessionId();

            if (NetGlobalChatSessionManager.TryGet(sessionId, out NetGlobalChatSession session))
            {
                message.RemoveAvatarEntry().CopyTo(session.AvatarEntry);
            }
        }
Beispiel #2
0
        /// <summary>
        ///     Called when a <see cref="UpdateServerEndPointMessage"/> is received.
        /// </summary>
        internal void UpdateServerEndPointMessageReceived(UpdateServerEndPointMessage message)
        {
            byte[] sessionId = message.RemoveSessionId();

            if (NetGlobalChatSessionManager.TryGet(sessionId, out NetGlobalChatSession session))
            {
                if (message.GetServerType() != ServiceCore.ServiceNodeType)
                {
                    session.SetServiceNodeId(message.GetServerType(), message.GetServerId());
                }
            }
        }
Beispiel #3
0
        /// <summary>
        ///     Called when a <see cref="ForwardPiranhaMessage"/> is received.
        /// </summary>
        internal void ForwardPiranhaMessageReceived(ForwardPiranhaMessage message)
        {
            byte[] sessionId = message.RemoveSessionId();

            if (NetGlobalChatSessionManager.TryGet(sessionId, out NetGlobalChatSession session))
            {
                PiranhaMessage piranhaMessage = message.RemovePiranhaMessage();

                if (piranhaMessage != null)
                {
                    try
                    {
                        piranhaMessage.Decode();
                        session.PiranhaMessageManager.ReceiveMessage(piranhaMessage);
                    }
                    catch (Exception exception)
                    {
                        Logging.Warning("NetChatMessageManager::forwardPiranhaMessageReceived piranha message handle exception, trace: " + exception);
                    }
                }
            }
        }