示例#1
0
        /// <summary>
        ///             Buffer:
        ///                     int PacketNum;
        ///                     string race;
        ///                     int spellCount;
        ///                     short[spellCount] spellIndex
        /// </summary>
        private static void HandleSaveSkillBuild(ClientTCP client, byte[] data)
        {
            PacketBuffer buffer = new PacketBuffer();

            buffer.WriteBytes(data);
            buffer.ReadInteger();
            string race       = buffer.ReadString();
            int    spellCount = buffer.ReadInteger();

            string[] spellBuild = new string[spellCount];
            for (int i = 0; i < spellCount; i++)
            {
                string spellIndex = "" + buffer.ReadShort();
                while (spellIndex.Length != 4)
                {
                    spellIndex = "0" + spellIndex;
                }
                string spellType = "" + buffer.ReadShort();
                while (spellType.Length != 4)
                {
                    spellType = "0" + spellType;
                }
                spellBuild[i] = spellIndex + "" + spellType;
            }
            buffer.Dispose();
            //Global.data.SetSkillBuildData(client.nickname, race, spellBuild);
            SendDataTCP.SendBuildSaved(client);
        }