public void SetPlayer(Character character)
 {
     Name = character.Name;
     Guid = new WoWGuid(character.GUID);
 }
示例#2
0
 static void HandleCharlist(Character[] rlist)
 {
     int x = 0;
     foreach (Character rl in rlist)
     {
         Log.WriteLine(LogType.Normal, "[{0}] {1} - {2}", x + 1, rl.Name, rl.Level); x++;
     }
 }
示例#3
0
        public void LoginPlayer(Character chr)
        {
            PacketOut outpacket = new PacketOut(WorldServerOpCode.CMSG_PLAYER_LOGIN);
            outpacket.Write(chr.GUID);
            Send(outpacket);

            outpacket = new PacketOut(WorldServerOpCode.CMSG_UPDATE_ACCOUNT_DATA);
            outpacket.Write((UInt32)7);
            outpacket.Write((UInt32)5144);
            outpacket.Write(account_data);
            Send(outpacket);

            objectMgr.MapID = chr.MapID;
            objectMgr.playerGuid = new WoWGuid(chr.GUID);
            objectMgr.getPlayerObject().SetPlayer(chr);
            StartHeartbeat();

            movementMgr.Start();
            combatMgr.Start();
            terrainMgr.ChangeMap(chr.MapID);

            Log.WriteLine(LogType.Success, "Logged into world as {0}.", chr.Name);
        }
示例#4
0
 private void HandleCharlist(Character[] list)
 {
     this.UseWaitCursor = false;
     foreach (Character rl in list)
     {
         if (charlist.Items.Contains(rl.Name))
             return;
         this.charlist.Items.Add(rl.Name);
     }
     button1.Text = "Connect to World Server";
     button1.Enabled = true;
     Status = ServiceType.World;
 }
示例#5
0
        public void HandleCharEnum(PacketIn packet)
        {
            byte count = packet.ReadByte();

            Character[] characterList = new Character[count];
            for (int i = 0; i < count; i++)
            {

                characterList[i].GUID = packet.ReadUInt64();
                characterList[i].Name = packet.ReadString();
                characterList[i].Race = packet.ReadByte();
                characterList[i].Class = packet.ReadByte();
                packet.ReadByte();
                packet.ReadUInt32();
                packet.ReadByte();
                packet.ReadByte();
                packet.ReadUInt32();
                characterList[i].MapID = packet.ReadUInt32();
                packet.ReadFloat();
                packet.ReadFloat();
                packet.ReadFloat();
                packet.ReadUInt32();
                packet.ReadUInt32();
                packet.ReadByte();

                packet.ReadUInt32();
                packet.ReadUInt32();
                packet.ReadUInt32();
                packet.ReadBytes(9 * 20);
            }

            Log.WriteLine(LogType.Success, "Received info about {0} characters", count);

            Charlist = characterList;
            mCore.Event(new Event(EventType.EVENT_CHARLIST, "", new object[] { Charlist }));
            PingLoop();
        }