Exemple #1
0
        public void SendCharList()
        {
            BNSLoginPacket p = new BNSLoginPacket()
            {
                Command = "STS/1.0 200 OK",
                Serial  = characterSerial
            };
            string content = "<Reply>\n";

            for (byte i = 0; i < 5; i++)
            {
                if (chars.ContainsKey(i))
                {
                    ActorPC pc = chars[i];
                    System.IO.MemoryStream ms = new System.IO.MemoryStream();
                    pc.AppearenceToSteam(ms);

                    content += string.Format("<CharSlot>\n<SlotId>{0}</SlotId>\n<CharId>{1}</CharId>\n<WorldCode>{4}</WorldCode>\n<CharName>{2}</CharName>\n<CharData>&lt;bns>&lt;pcdbid>{1}&lt;/pcdbid>&lt;showcase>{3}&lt;/showcase>&lt;/bns></CharData>\n</CharSlot>\n",
                                             ((uint)pc.SlotID).ToGUID(), pc.CharID, pc.Name, Convert.ToBase64String(ms.ToArray()), pc.WorldID);
                    ms.Close();
                    ms = null;
                }
                else
                {
                    content += string.Format("<CharSlot><SlotId>{0}</SlotId>\n</CharSlot>\n", ((uint)i).ToGUID());
                }
            }
            p.Content = content + "</Reply>\n";
            p.WritePacket();

            Network.SendPacket(p);
        }