[Help] How i confirm character spawn

06/03/2015 17:28 ramy_11_1#1
i parser opcodes while i use /wp command , its give me these opcodes :

Code:
[C -> S][7010]
10 00                                             ................
EC 63                                             .c..............
01 00 6B 44 40 7C EB 3A FF 3F 6C 44               ..kD@|.:.?lD....
01 00                                             ................

[S -> C][B010]
01                                                ................
10 00                                             ................

[C -> S][34B6]

[S -> C][34B5]
EC 63                                             .c..............

[S -> C][3013]
now my question is how i confirm my spawn after using warp packet.
i already added in agent.cs each these lines :

Code:
                            else if (current.Opcode == 0xB010)
                            {
                                Packet p = new Packet(0x34B6);
                                Send(p);
                            }

                            else if (current.Opcode == 0x34B5)
                            {
                                Packet p = new Packet(0x34B6);
                                Send(p);
                            }
then i create a new button and give it a /wp packet function by parameters of this packet ..

Code:
            Packet warp = new Packet(0x7010);
            warp.WriteUInt8(0x10); //static 
            warp.WriteUInt8(0); //static 
            warp.WriteInt16(25753); //regionID 
            warp.WriteSingle(1539); //x 
            warp.WriteSingle(-8); //Y 
            warp.WriteSingle(1027); //Z 
            warp.WriteInt8(1); //worldid 
            warp.WriteUInt8(0); //static 
            Agent.Send(warp);
Nothing happened just i get instant dc when i press the button when i open character again i find it in the new region..
So how i fix this spawn problem ?
also in /gotown and /movetouser.

i hope to find answer.

thank you epvp
06/03/2015 17:38 Anonymous-6723#2
Code:
                        if (sqlDataReader1.Read())
                        {
                            if (newposx == 0 && newposy == 0 && newposz == 0)
                            {
                            string Name = sqlDataReader1.GetString(0);
                            int region = Int16.Parse(sqlDataReader1["Region"].ToString());
                            string region1 = string.Format("0x{0:x}", region);
                            int posx = Int32.Parse(sqlDataReader1["X"].ToString());
                            string posx1 = string.Format("0x{0:x}", posx);
                            int posy = Int32.Parse(sqlDataReader1["Y"].ToString());
                            string posy1 = string.Format("0x{0:x}", posy);
                            int posz = Int32.Parse(sqlDataReader1["Z"].ToString());
                            string posz1 = string.Format("0x{0:x}", posz);
                            int worldid = Int32.Parse(sqlDataReader1["worldID"].ToString());
                            string worldid1 = string.Format("0x{0:x}", worldid);
                            Int32 region2 = Convert.ToInt32(region1, 16);
                            Int32 posx2 = Convert.ToInt32(posx1, 16);
                            Int32 posy2 = Convert.ToInt32(posy1, 16);
                            Int32 posz2 = Convert.ToInt32(posz1, 16);
                            Int32 worldid2 = Convert.ToInt32(worldid1, 16);
                            Packet packet15 = new Packet(0x7010);
                            packet15.WriteInt8(0x10); //static
                            packet15.WriteInt8(0); //static
                            packet15.WriteInt16(region2); //regionID to hex
                            packet15.WriteInt32(posx2); //x to hex
                            packet15.WriteInt32(posy2); //y to hex
                            packet15.WriteInt32(posz2); //z to hex
                            packet15.WriteInt8(worldid2); //worldid to hex
                            packet15.WriteInt8(0); //static
                            Agent.Send(packet15);
                            Thread.Sleep(1000);
                            Packet confirm1 = new Packet(0x34B6);
                            Agent.Send(confirm1);
                            sqlDataReader1.Close();
                            Globals.MainWindow.Log("\nMoving to location (/wp): " + region + " " + posx + " " + posy + " " + posz + ". Location name: " + Name, new object[0]);
                            }
                            else
                            {
                                Int32 newregion2 = Convert.ToInt32(newregion1, 16);
                                Int32 newposx2 = Convert.ToInt32(newposx1, 16);
                                Int32 newposy2 = Convert.ToInt32(newposy1, 16);
                                Int32 newposz2 = Convert.ToInt32(newposz1, 16);
                                Int32 newworldid2 = Convert.ToInt32(newworldid1, 16);
                                Packet packet15 = new Packet(0x7010);
                                packet15.WriteInt8(0x10); //static
                                packet15.WriteInt8(0); //static
                                packet15.WriteInt16(newregion2); //regionID to hex
                                packet15.WriteInt32(newposx2); //x to hex
                                packet15.WriteInt32(newposy2); //y to hex
                                packet15.WriteInt32(newposz2); //z to hex
                                packet15.WriteInt8(newworldid2); //worldid to hex
                                packet15.WriteInt8(0); //static
                                Agent.Send(packet15);
                                Thread.Sleep(1000);
                                Packet confirm2 = new Packet(0x34B6);
                                Agent.Send(confirm2);
                                Globals.MainWindow.Log("\nMoving to location (/wp): " + newregion + " " + newposx + " " + newposy + " " + newposz + ". Location name: custom", new object[0]);
                            }

reads from SQL table for X Y Z RegID and WorldID
06/03/2015 18:59 ramy_11_1#3
from where i can get these parameters ?
i understood all your codes i get by sql reader Region , X , Y , Z , worldID then i convert them then i send first packet of warp then sleep 1 second then send spawn packet , but you did 2 cases first is : if (newposx == 0 && newposy == 0 && newposz == 0) second is : else
so from where you got newposx , newposy , newposz ?

by the way i tried to send a warp packet without converting values from string to int then sleep 1 second then send a spawn packet , also its not work .. i think it's need to sent when receive a packet from server to client , like login spawn.

#Fixed
#Close