示例#1
0
        public void SendInventoryCSV()
        {
            MsgBody body = new MsgBody();

            body.Write(inventory.csv._rows.Count);
            for (int row = 0; row < inventory.csv._rows.Count; row++)
            {
                body.Write(inventory.csv._rows[row].Length);
                for (int col = 0; col < inventory.csv._rows[row].Length; col++)
                {
                    body.Write(inventory.csv._rows[row][col]);
                }
            }

            Say(ExtensionOpcodes.opInventoryAck, body);
        }
示例#2
0
        public void hSockTcpKilllogReq(sbyte killerType, int killer, sbyte victimType, int victim, int weaponBy, int slot, int category, int hitpart, Dictionary <int, int> damageLog)
        {
            MsgBody msgBody = new MsgBody();
            int     id      = UnityEngine.Random.Range(0, int.MaxValue);

            msgBody.Write(id);
            msgBody.Write(killerType);
            msgBody.Write(killer);
            msgBody.Write(victimType);
            msgBody.Write(victim);
            msgBody.Write(weaponBy);
            msgBody.Write(slot);
            msgBody.Write(category);
            msgBody.Write(hitpart);
            if (damageLog == null)
            {
                msgBody.Write(0);
            }
            else
            {
                msgBody.Write(damageLog.Count);
                foreach (KeyValuePair <int, int> item in damageLog)
                {
                    msgBody.Write(item.Key);
                    msgBody.Write(item.Value);
                }
            }

            ClientExtension.instance.lastKillLogMsg = msgBody;
            ClientExtension.instance.lastKillLogId  = id;

            CSNetManager.Instance.Sock.Say(44, msgBody);
        }