Beispiel #1
0
        static void svc_serverinfo(BitBuffer bb, TreeNode node)
        {
            short version = (short)bb.ReadBits(16);

            node.Nodes.Add("Version: " + version);
            node.Nodes.Add("Server count: " + (int)bb.ReadBits(32));
            node.Nodes.Add("SourceTV: " + bb.ReadBool());
            node.Nodes.Add("Dedicated: " + bb.ReadBool());
            node.Nodes.Add("Server client CRC: 0x" + bb.ReadBits(32).ToString("X8"));
            node.Nodes.Add("Max classes: " + bb.ReadBits(16));
            if (version < 18)
            {
                node.Nodes.Add("Server map CRC: 0x" + bb.ReadBits(32).ToString("X8"));
            }
            else
            {
                bb.Seek(128); // TODO: display out map md5 hash
            }
            node.Nodes.Add("Current player count: " + bb.ReadBits(8));
            node.Nodes.Add("Max player count: " + bb.ReadBits(8));
            node.Nodes.Add("Interval per tick: " + bb.ReadFloat());
            node.Nodes.Add("Platform: " + (char)bb.ReadBits(8));
            node.Nodes.Add("Game directory: " + bb.ReadString());
            node.Nodes.Add("Map name: " + bb.ReadString());
            node.Nodes.Add("Skybox name: " + bb.ReadString());
            node.Nodes.Add("Hostname: " + bb.ReadString());
            node.Nodes.Add("Has replay: " + bb.ReadBool()); // ???: protocol version
        }
Beispiel #2
0
 /*
 static string ParseButtons(uint buttons)
 {
     string res = "(none)";
     // TODO: IMPLEMENT
     return res;
 }
 */
 public static void ParseIntoTreeNode(byte[] data, TreeNode node)
 {
     var bb = new BitBuffer(data);
     if (bb.ReadBool()) node.Nodes.Add("Command number: " + bb.ReadBits(32));
     if (bb.ReadBool()) node.Nodes.Add("Tick count: " + bb.ReadBits(32));
     if (bb.ReadBool()) node.Nodes.Add("Viewangle pitch: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Viewangle yaw: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Viewangle roll: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Foward move: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Side move: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Up move: " + bb.ReadFloat().ToString());
     if (bb.ReadBool()) node.Nodes.Add("Buttons: 0x" + bb.ReadBits(32).ToString("X8"));
     if (bb.ReadBool()) node.Nodes.Add("Impulse: " + bb.ReadBits(8));
     // TODO: weaponselect/weaponsubtype, mousedx/dy
 }
Beispiel #3
0
/*
 *      static string ParseButtons(uint buttons)
 *      {
 *          string res = "(none)";
 *          // TODO: IMPLEMENT
 *          return res;
 *      }
 */

        public static void ParseIntoTreeNode(byte[] data, TreeNode node)
        {
            var bb = new BitBuffer(data);

            if (bb.ReadBool())
            {
                node.Nodes.Add("Command number: " + bb.ReadBits(32));
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Tick count: " + bb.ReadBits(32));
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Viewangle pitch: " + bb.ReadFloat());
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Viewangle yaw: " + bb.ReadFloat());
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Viewangle roll: " + bb.ReadFloat());
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Foward move: " + bb.ReadFloat());
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Side move: " + bb.ReadFloat());
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Up move: " + bb.ReadFloat().ToString());
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Buttons: 0x" + bb.ReadBits(32).ToString("X8"));
            }
            if (bb.ReadBool())
            {
                node.Nodes.Add("Impulse: " + bb.ReadBits(8));
            }
            // TODO: weaponselect/weaponsubtype, mousedx/dy
        }
Beispiel #4
0
 /*
 static string ParseButtons(uint buttons)
 {
     string res = "(none)";
     // TODO: IMPLEMENT
     return res;
 }
 */
 public static void ParseIntoTreeNode(byte[] data, TreeNode node)
 {
     var bb = new BitBuffer(data);
     if (bb.ReadBool()) node.Nodes.Add("Command number: " + bb.ReadBits(32));
     if (bb.ReadBool()) node.Nodes.Add("Tick count: " + bb.ReadBits(32));
     if (bb.ReadBool()) node.Nodes.Add("Viewangle pitch: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Viewangle yaw: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Viewangle roll: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Foward move: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Side move: " + bb.ReadFloat());
     if (bb.ReadBool()) node.Nodes.Add("Up move: " + bb.ReadFloat().ToString());
     if (bb.ReadBool()) node.Nodes.Add("Buttons: 0x" + bb.ReadBits(32).ToString("X8"));
     if (bb.ReadBool()) node.Nodes.Add("Impulse: " + bb.ReadBits(8));
     if (bb.ReadBool()) {
         node.Nodes.Add("Weaponselect: " + bb.ReadBits(11).ToString("X8"));
         if(bb.ReadBool()) node.Nodes.Add("Weaponsubtype: " + bb.ReadBits(11).ToString("X8"));
     }
     node.Nodes.Add("BITS LEFT: " + bb.BitsLeft());
     if (bb.ReadBool()) node.Nodes.Add("dx: " + bb.ReadBits(16)); //These are supposed to be shorts - not sure how to read 16 bit short
     if (bb.ReadBool()) node.Nodes.Add("dy: " + bb.ReadBits(16));
     // TODO: weaponselect/weaponsubtype, mousedx/dy
 }
Beispiel #5
0
 static void svc_serverinfo(BitBuffer bb, TreeNode node)
 {
     short version = (short)bb.ReadBits(16);
     node.Nodes.Add("Version: " + version);
     node.Nodes.Add("Server count: " + (int)bb.ReadBits(32));
     node.Nodes.Add("SourceTV: " + bb.ReadBool());
     node.Nodes.Add("Dedicated: " + bb.ReadBool());
     node.Nodes.Add("Server client CRC: 0x" + bb.ReadBits(32).ToString("X8"));
     node.Nodes.Add("Max classes: " + bb.ReadBits(16));
     if (version < 18)
         node.Nodes.Add("Server map CRC: 0x" + bb.ReadBits(32).ToString("X8"));
     else
         bb.Seek(128); // TODO: display out map md5 hash
     node.Nodes.Add("Current player count: " + bb.ReadBits(8));
     node.Nodes.Add("Max player count: " + bb.ReadBits(8));
     node.Nodes.Add("Interval per tick: " + bb.ReadFloat());
     node.Nodes.Add("Platform: " + (char)bb.ReadBits(8));
     node.Nodes.Add("Game directory: " + bb.ReadString());
     node.Nodes.Add("Map name: " + bb.ReadString());
     node.Nodes.Add("Skybox name: " + bb.ReadString());
     node.Nodes.Add("Hostname: " + bb.ReadString());
     node.Nodes.Add("Has replay: " + bb.ReadBool()); // ???: protocol version
 }