Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/leychan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -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)
Expand Down
9 changes: 4 additions & 5 deletions src/leysourceengineclient.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -173,7 +173,6 @@ int doreceivethink()
return 1;
}


int dosendthinkloading()
{

Expand Down Expand Up @@ -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);
Expand Down
7 changes: 5 additions & 2 deletions src/oob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include "datagram.h"
#include "oob.h"

unsigned long serverchallenge = 0;
unsigned long _ourchallenge = 0;

OOB::OOB()
{
Expand Down Expand Up @@ -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();


Expand Down Expand Up @@ -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];
Expand Down
3 changes: 3 additions & 0 deletions src/oob.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ class leynet_udp;
class Datagram;
class Steam;

extern unsigned long serverchallenge;
extern unsigned long _ourchallenge;

class OOB
{
private:
Expand Down