Esempio n. 1
0
        void HandleDebugMessage(NetIncomingMessage message)
        {
            switch (message.MessageType)
            {
            case NetIncomingMessageType.DebugMessage:
            {
                NetLog.Debug(message.ReadString());
                break;
            }

            case NetIncomingMessageType.ErrorMessage:
            {
                NetLog.Error(message.ReadString());
                break;
            }

            case NetIncomingMessageType.WarningMessage:
            {
                NetLog.Warn(message.ReadString());
                break;
            }

            case NetIncomingMessageType.VerboseDebugMessage:
            {
                NetLog.Debug(message.ReadString());
                break;
            }
            }
        }
        public static void OnMessageReceievedInvoke(NetPeer peer, SocketConnection c, int dataSize, byte[] data, string msgName)
        {
#if SHOW_GLOBAL_INVOKES
            NetLog.Debug("Invoking callback OnMessageReceieved");
#endif
            foreach (SocketEventListenerBase cb in Callbacks)
            {
                try
                {
                    cb.OnMessageReceieved(peer, c, dataSize, data, msgName);
                }
                catch (System.Exception exn)
                {
                    NetLog.Exception(exn);
                }
            }
        }