示例#1
0
        int rotationUpdate(PacketStream ps)
        {
            byte  id       = ps.ReadByte();
            float rotation = ps.ReadFloat();

            players[id].Rotation = rotation;

            return(1);
        }
示例#2
0
        int projectile(PacketStream ps)
        {
            byte  player_id = ps.ReadByte();//one who throws the nade
            byte  wpn_id    = ps.ReadByte();
            short x_origin  = ps.ReadShort();
            short y_origin  = ps.ReadShort();
            float angle     = ps.ReadFloat();
            byte  uk0       = ps.ReadByte();

            ps.ReadByte(); // discard 0
            return(1);
        }
示例#3
0
        int roundstart(PacketStream ps)
        {
            ps.ReadByte();//unknown
            int count = ps.ReadByte();

            for (int i = 0; i < count; i++)
            {
                byte id = ps.ReadByte();

                if (id == own_id)
                {
                    botLogics.OnRoundStart();
                }

                short sx     = ps.ReadShort();
                short sy     = ps.ReadShort();
                float rot    = ps.ReadFloat();
                byte  wpn_id = ps.ReadByte();

                /*if (team == 1)
                 *  team = 2;
                 * else if (team == 2)
                 *  team = 1;*/
                byte uk2 = ps.ReadByte();
                byte uk3 = ps.ReadByte();


                if (id > 0 && id < 33)
                {
                    PlayerObject tmp = players[id];
                    tmp.Id = id;
                    //LogConsole(String.Format("mass spawn {0} wpn:{1} uk:{2} uk:{3}", tmp.Name, wpn_id, uk2, uk3));

                    tmp.X      = sx; tmp.Y = sy; tmp.Rotation = rot; tmp.Currentweapon = wpn_id;
                    tmp.Health = 100;
                }
                else
                {
                    return(0);
                }
            }

            short money = ps.ReadShort();

            byte wpnCount = ps.ReadByte();

            for (int j = 0; j < wpnCount; j++)
            {
                ps.ReadByte();
            }

            return(1);
        }
示例#4
0
        int positionRotationUpdate(PacketStream ps)
        {
            byte  id  = ps.ReadByte();
            short x   = ps.ReadShort();
            short y   = ps.ReadShort();
            float rot = ps.ReadFloat();

            if (id >= 0 && id <= 32)
            {
                PlayerObject tmp = players[id];
                tmp.Id       = id;
                tmp.X        = x;
                tmp.Y        = y;
                tmp.Rotation = rot;
                return(1);
            }
            return(0);
        }
示例#5
0
        int roundstart(PacketStream ps)
        {
            ps.ReadByte();//unknown
            int count = ps.ReadByte();
            for (int i = 0; i < count; i++)
            {
                byte id = ps.ReadByte();

                if (id == own_id)
                    botLogics.OnRoundStart();

                short sx = ps.ReadShort();
                short sy = ps.ReadShort();
                float rot = ps.ReadFloat();
                byte wpn_id = ps.ReadByte();
                /*if (team == 1)
                    team = 2;
                else if (team == 2)
                    team = 1;*/
                byte uk2 = ps.ReadByte();
                byte uk3 = ps.ReadByte();

                if (id > 0 && id < 33)
                {
                    PlayerObject tmp = players[id];
                    tmp.Id = id;
                    //LogConsole(String.Format("mass spawn {0} wpn:{1} uk:{2} uk:{3}", tmp.Name, wpn_id, uk2, uk3));

                    tmp.X = sx; tmp.Y = sy; tmp.Rotation = rot; tmp.Currentweapon = wpn_id;
                    tmp.Health = 100;
                }
                else
                    return 0;

            }

            short money = ps.ReadShort();

            byte wpnCount = ps.ReadByte();
            for (int j = 0; j < wpnCount; j++)
            {
                ps.ReadByte();
            }

            return 1;
        }
示例#6
0
        int rotationUpdate(PacketStream ps)
        {
            byte id = ps.ReadByte();
            float rotation = ps.ReadFloat();
            players[id].Rotation = rotation;

            return 1;
        }
示例#7
0
 int projectile(PacketStream ps)
 {
     byte player_id = ps.ReadByte();//one who throws the nade
     byte wpn_id = ps.ReadByte();
     short x_origin = ps.ReadShort();
     short y_origin = ps.ReadShort();
     float angle = ps.ReadFloat();
     byte uk0 = ps.ReadByte();
     ps.ReadByte(); // discard 0
     return 1;
 }
示例#8
0
        int positionRotationUpdate(PacketStream ps)
        {
            byte id = ps.ReadByte();
            short x = ps.ReadShort();
            short y = ps.ReadShort();
            float rot = ps.ReadFloat();

            if (id >= 0 && id <= 32)
            {
                PlayerObject tmp = players[id];
                tmp.Id = id;
                tmp.X = x;
                tmp.Y = y;
                tmp.Rotation = rot;
                return 1;
            }
            return 0;
        }