Beispiel #1
0
        public void OnClientMsg(string from, string to, long msSinceSent, string payload)
        {
            GameNetClientMessage gameNetClientMessage = JsonConvert.DeserializeObject <GameNetClientMessage>(payload);

            if (from == LocalP2pId())
            {
                loopedBackMessageHandlers.Enqueue(() => _HandleClientMessage(from, to, msSinceSent, gameNetClientMessage));
            }
            else
            {
                _HandleClientMessage(from, to, msSinceSent, gameNetClientMessage);
            }
        }
Beispiel #2
0
        // Derived classes Must implment this, as well as client-specific messages
        // that call _SendClientMessage()

        protected abstract void _HandleClientMessage(string from, string to, long msSinceSent, GameNetClientMessage clientMessage);