C# tcp client dont work with GF login packet

03/13/2020 15:14 DonkeyKong69XD#1
Hello, I want make login script with C#, but when I send login packet with tcp client i get "failc 1". probably there is something wrong with my login packet, but it is fine because I generated new login packet in C# and it works perfectly fine with QtTcpSocket. I dont know what to do, i tried few different tcp clients library and always i get failc 1. I don't know maybe it's this char between random hex number and nostale version, but i tried everything(\v; (char)0xB; tab; space) and nothing worked. Is there anyone here who wrote a working C# login to GF nostale and want to share knowledge?
03/13/2020 15:47 Roxeez#2
Here is the code i'm using for a personal project and it work just fine.
Ofc you will need to modify it to make it work for you


Btw you're receiving failc1 if your client is outdated so it's probably coming from your hashes
03/13/2020 16:07 DonkeyKong69XD#3
Quote:
Originally Posted by Roxeez View Post
Btw you're receiving failc1 if your client is outdated so it's probably coming from your hashes
Thanks, but my hashes are just fine. My code works, but there is something wrong with tcp client. I generated login packet in C# and then I tested it with C++ QtTcpSocket and I get list of servers. So idk. Can you share with me the LoginClient class?
03/13/2020 16:50 Roxeez#4
Quote:
Originally Posted by DonkeyKong69XD View Post
Thanks, but my hashes are just fine. My code works, but there is something wrong with tcp client. I generated login packet in C# and then I tested it with C++ QtTcpSocket and I get list of servers. So idk. Can you share with me the LoginClient class?
It's just a wrapper around a System.Net.Sockets.Socket who encrypt/decrypt packets send/received
03/14/2020 14:56 DonkeyKong69XD#5
Quote:
Originally Posted by Roxeez View Post
It's just a wrapper around a System.Net.Sockets.Socket who encrypt/decrypt packets send/received
I don't know how, but somehow I fixed it :cool:
Thanks for help.
Maybe you could help me with one more problem? How to detect GF staff?
03/14/2020 15:44 Apourtartt#6
Check the in packet :
Code:
Authority PacketIn1::getAuthority()
{
    return static_cast<Authority>(packet[8].toShort());
}