示例#1
0
        public override void SendMessage <T>(T msg)
        {
            GameMessageBase gameMsg = msg as GameMessageBase;
            var             player  = activePlayers.Find(p => p.ID == gameMsg.Id);

            if (player == CurrentPlayer)
            {
                if (gameMsg is PlayerEffectMessage)
                {
                    PlayerEffectMessage effectMsg = gameMsg as PlayerEffectMessage;
                    Game.GameManager.Instance.
                    GetPlayer(player.ID).
                    Effects.
                    ApplyEffect(effectMsg.Effect,
                                effectMsg.Point,
                                effectMsg.Normal);
                    return;
                }
            }

            player.Connection.Send(gameMsg.Type, msg);
        }
示例#2
0
        public override void SendMessage <T>(T msg)
        {
            GameMessageBase gameMsg = msg as GameMessageBase;

            client.Send(gameMsg.Type, gameMsg);
        }