SendToAll() public method

public SendToAll ( BinaryWriter packet ) : void
packet System.IO.BinaryWriter
return void
Beispiel #1
0
        private void SendToAll(CoreMessage msg)
        {
            byte[]           buffer = msg.CreateBuffer();
            GameServerPacket packet = new GameServerPacket(msg.Message);

            packet.Write(buffer);
            Game.SendToAll(packet);
        }
Beispiel #2
0
        private void SendToAll(CoreMessage msg)
        {
            byte[]           buffer = msg.CreateBuffer();
            GamePacketWriter packet = GamePacketFactory.Create(msg.Message);

            packet.Write(buffer);
            Game.SendToAll(packet);
        }
Beispiel #3
0
 private void SendToAll(CoreMessage msg, int length)
 {
     if (length == 0)
     {
         Game.SendToAll(GamePacketFactory.Create(msg.Message));
         return;
     }
     msg.Reader.ReadBytes(length);
     SendToAll(msg);
 }
Beispiel #4
0
        private void OnSet(CoreMessage msg)
        {
            msg.Reader.ReadBytes(4);
            byte[]           raw    = msg.Reader.ReadBytes(4);
            GamePacketWriter packet = GamePacketFactory.Create(GameMessage.Set);

            packet.Write(0);
            packet.Write(raw);
            Game.SendToAll(packet);
        }
Beispiel #5
0
 private void SendToAll(CoreMessage msg, int length)
 {
     if (length == 0)
     {
         Game.SendToAll(new GameServerPacket(msg.Message));
         return;
     }
     msg.Reader.ReadBytes(length);
     SendToAll(msg);
 }
Beispiel #6
0
        private void OnSet(CoreMessage msg)
        {
            msg.Reader.ReadBytes(4);
            byte[]           raw    = msg.Reader.ReadBytes(4);
            GameServerPacket packet = new GameServerPacket(GameMessage.Set);

            packet.Write(0);
            packet.Write(raw);
            Game.SendToAll(packet);
        }
Beispiel #7
0
        private void OnConfirmCards(CoreMessage msg)
        {
            int player = msg.Reader.ReadByte();
            int count  = msg.Reader.ReadByte();

            msg.Reader.ReadBytes(count * 7);

            byte[]           buffer = msg.CreateBuffer();
            GamePacketWriter packet = GamePacketFactory.Create(msg.Message);

            packet.Write(buffer);
            if ((CardLocation)buffer[7] == CardLocation.Hand)
            {
                Game.SendToAll(packet);
            }
            else
            {
                Game.CurPlayers[player].Send(packet);
            }
        }
Beispiel #8
0
        private void OnHint(CoreMessage msg)
        {
            int type   = msg.Reader.ReadByte();
            int player = msg.Reader.ReadByte();

            msg.Reader.ReadInt32();

            byte[]           buffer = msg.CreateBuffer();
            GamePacketWriter packet = GamePacketFactory.Create(msg.Message);

            packet.Write(buffer);

            switch (type)
            {
            case 1:
            case 2:
            case 3:
            case 4:
            case 5:
                Game.CurPlayers[player].Send(packet);
                break;

            case 6:
            case 7:
            case 8:
            case 9:
                Game.SendToAllBut(packet, player);
                break;

            case 10:
                if (Game.IsTag)
                {
                    Game.CurPlayers[player].Send(packet);
                }
                else
                {
                    Game.SendToAll(packet);
                }
                break;
            }
        }