Exemplo n.º 1
0
        public static void sendMessage(ICollection <Player> receiverPlayers, Missile missile)
        {
            RawMessage msg = new RawMessage();

            msg.putInt("id", TypeIdGenerator.getMessageId(typeof(GCreateMissileInfo)));

            // STATCODE
            PlayerStats pStats = missile.ownerTower.board.player.game.statTracker.getPlayerStatsOfPlayer(missile.ownerTower.board.player);

            pStats.missilesFired += 1;

            if (receiverPlayers != null && receiverPlayers.Count != 0)
            {
                msg.putInt("iid", missile.instanceId);
                msg.putInt("bid", missile.ownerTower.board.instanceId);
                msg.putInt("iob", missile.ownerTower.indexOnBoard);
                msg.putInt("tid", TypeIdGenerator.getMissileId(missile.GetType()));
                msg.putInt("mid", missile.targetMinion.instanceId);

                foreach (var receiverPlayer in receiverPlayers)
                {
                    receiverPlayer.user.session.client.SendMessage(msg);
                }
            }
        }
Exemplo n.º 2
0
        public static void SendMessage(Arena arena, Missile missile)
        {
            RawMessage message = PrepareMessageFor(typeof(OM_CreateMissile));

            message.putInt("missileTypeId", TypeIdGenerator.idsOfMissiles[missile.GetType()]);

            message.putInt("missileId", missile.id);
            message.PutVector3("position", missile.position);
            message.PutVector3("direction", missile.movementDirection);

            foreach (var player in arena.players)
            {
                player.user.client.SendMessage(message);
            }
        }