diff --git a/src/leychan.cpp b/src/leychan.cpp index a307a60..fc4a1a6 100644 --- a/src/leychan.cpp +++ b/src/leychan.cpp @@ -15,6 +15,7 @@ #include "netmsghandlers/net_messages.h" #include "netmsghandlers/svc_messages.h" +#include "netmsghandlers/net/net_disconnect.h" #define _ShouldChecksumPackets true #define _showdrop true @@ -166,6 +167,9 @@ void leychan::Initialize() net_nop* nop = new net_nop; nop->Register(this); + net_disconnect* disconnect = new net_disconnect; + disconnect->Register(this); + net_file* file = new net_file; file->Register(this); @@ -994,7 +998,7 @@ void leychan::SetSignonState(int state, int servercount) this->GetSendData()->WriteUBitLong(6, 6); this->GetSendData()->WriteByte(state); this->GetSendData()->WriteLong(this->m_iServerCount); - + } void leychan::ProcessServerInfo(unsigned short protocolversion, int count) diff --git a/src/leysourceengineclient.cpp b/src/leysourceengineclient.cpp index 42cdb66..3f27fae 100644 --- a/src/leysourceengineclient.cpp +++ b/src/leysourceengineclient.cpp @@ -55,7 +55,7 @@ int doreceivethink() if (!strstr(serverip.c_str(), charip)) { - printf("ip mismatch\n"); + printf("ip mismatch: serverip: %s, charip %s\n", serverip.c_str(), charip); return 0; } @@ -173,7 +173,6 @@ int doreceivethink() return 1; } - int dosendthinkloading() { @@ -210,9 +209,9 @@ int dosendthinkloading() printf("Sending clc_ClientInfo\n"); netchan.GetSendData()->WriteUBitLong(8, 6); netchan.GetSendData()->WriteLong(netchan.m_iServerCount); - netchan.GetSendData()->WriteLong(-1260710316);//clc_ClientInfo crc - netchan.GetSendData()->WriteOneBit(1);//ishltv - netchan.GetSendData()->WriteLong(1337); + netchan.GetSendData()->WriteLong(-180706170);//clc_ClientInfo crc NOTE: for some reason the one displayed by net_showmsg is off by 8192 + netchan.GetSendData()->WriteOneBit(0);//ishltv + netchan.GetSendData()->WriteLong(steam->GetSteamUser()->GetSteamID().ConvertToUint64()); netchan.GetSendData()->WriteUBitLong(0, 21); datagram->Send(&netchan); diff --git a/src/oob.cpp b/src/oob.cpp index fd1c082..3ec9a0f 100644 --- a/src/oob.cpp +++ b/src/oob.cpp @@ -11,6 +11,8 @@ #include "datagram.h" #include "oob.h" +unsigned long serverchallenge = 0; +unsigned long _ourchallenge = 0; OOB::OOB() { @@ -65,8 +67,9 @@ bool OOB::ReceiveQueryPacketGetChallenge( chan->connectstep = 3; long magicnumber = recvdata.ReadLong(); - unsigned long serverchallenge = recvdata.ReadLong(); + serverchallenge = recvdata.ReadLong(); *ourchallenge = recvdata.ReadLong(); + _ourchallenge = *ourchallenge; unsigned long authprotocol = recvdata.ReadLong(); @@ -100,7 +103,7 @@ bool OOB::ReceiveQueryPacketGetChallenge( writeconnect.WriteString(nickname); //nick writeconnect.WriteString(password); // pass - writeconnect.WriteString("2000"); // game version + writeconnect.WriteString("2025.03.26"); // game version unsigned char steamkey[STEAM_KEYSIZE]; diff --git a/src/oob.h b/src/oob.h index c2d7ec7..a990980 100644 --- a/src/oob.h +++ b/src/oob.h @@ -10,6 +10,9 @@ class leynet_udp; class Datagram; class Steam; +extern unsigned long serverchallenge; +extern unsigned long _ourchallenge; + class OOB { private: