[C#] Packet based login...Client doesnt show chars

09/27/2012 09:42 lukas2abc#1
hey there!!
It's just a little mistake that is not that important but would be nice to be solved...
The packet based login works but when i come to the "Char Scene" there is no character even though i can read the names of them in the B007 packet...and i also forward that packet to client so i don't know why it doesn't show them up in client...

btw i use that code to select the char and start and that really works!:
Code:
Packet p = new Packet(0x7001);
            p.WriteAscii(char_Box.Text);//Listbox with all chars from packet, works great
            Program.ag_remote_security.Send(p);
09/27/2012 14:49 DaxterSoul#2
You're probably using rSRO.
You have to use the Cyrillic code page for your strings to read them correctly.
Drew's API uses West European Latin codepage (1252) as default what works great for iSRO, so you have to change it to 1251 — Cyrillic.

Code:
//Read Cyrillic.
name = packet.ReadAscii(1251);

//Write Cyrillic
response.WriteAscii(name, 1251);
09/27/2012 16:01 lukas2abc#3
well, i can read the names and can add them to listbox and log in , and spawn my player via my gui login application, but the player models dont show up in client at the Character Selection Screen....it is the original client for that server(phSro) and when i login without my proxy i can see them with the same client
so its not the codepage because i forward the B007 packet 1:1
Any other suggestions?
09/27/2012 16:15 vorosmihaly#4
you probably modify the packet somehow before redirecting it to the client,and it just cannot read it correctly :)
09/27/2012 17:23 lukas2abc#5
no its not edited....the byte that i receive is exactly the same as the client receives, so client get original packet from silkroad server...that is soo strange..-.-
09/28/2012 17:59 lukas2abc#6
fixed...i didn't let the 2001 packet with the string "AgentServer" through to client and got the 6103 packet from client and dont let it through to server and editet the id and pw bacause sro client doesnt know them because i sent login data by my proxy. Then i send the fixed 6103 packet to server
That was the mistake. Now i can login select char and do everything as without proxy :)
thanks for help though!!!!

SOLUTION
how i got the wrong 6103 packet and send the right 6103:
Code:
if (packet.Opcode == 0x6103)
                            {
                                Packet p = new Packet(0x6103);
                                p.WriteUInt32(Globals.session_id);
                                p.WriteAscii(Globals.login_id);
                                p.WriteAscii(Globals.login_pw);
                                p.WriteUInt8(Globals.locale);
                                p.WriteUInt8(00);
                                p.WriteUInt8(00);
                                p.WriteUInt8(00);
                                p.WriteUInt8(00);
                                p.WriteUInt8(00);
                                p.WriteUInt8(00);
                                ag_remote_security.Send(p);
                                continue;//important so it doesnt send the original 6103 Packet with no id and no pw!!!!
                            }

ag_remote_security.Send(packet);//the  original 6103 doesnt get here because of continue
04/01/2014 21:51 FireBlow#7
Hello... I know its pretty old post, but I don't know where do I get session_id... I always get C9 error and I believe its because of wrong session_id...
04/01/2014 23:43 amra85#8
Hello. its 0xA102
Code:
sessionID = packet.ReadUInt32();
ip = packet.ReadAscii();
port = packet.ReadUInt16();
04/02/2014 00:10 FireBlow#9
Thank you...