Jump to content

[C++] "Family Friendly" version checker


Guest Ezrekith

Recommended Posts

Guest Ezrekith

Hi folks!

 

Basically you check the version from the client src and from the auth version file and if its not correct the client will give you a popup msg at the login phase like: "Your client is outdated as fun ;) , please use the patcher program!"

Lets go:
 

Binary / packet.h

 

Search for:

typedef struct command_login3

Add this into the list:

DWORD	dwClientKey;

 

Binary / AccountConnector.cpp

Add #include "Locale_inc.h" into your includes

Search for:

m_strPassword = "";

You can see this little friend right there:

		for (DWORD i = 0; i < 4; ++i)
			LoginPacket.adwClientKey[i] = g_adwEncryptKey[i];

Replace with this:

		for (DWORD i = 0; i < 4; ++i)
			LoginPacket.adwClientKey[i] = g_adwEncryptKey[i];

		LoginPacket.dwClientKey = KLIENS_VERZIO_SZAMSOR;

 

Binary / Locale_inc.h

Add this:

#define KLIENS_VERZIO_SZAMSOR 3333

 

Server Source / game / packet.h

Search for:

typedef struct command_login3

Add this into the list:

DWORD	dwClientNumber;

 

Server Source / game / input_auth.cpp

 

Search for:

TPacketCGLogin3 * pinfo = (TPacketCGLogin3 *) c_pData;

Add above:

	DWORD dwClientNumber;
	str_to_number(dwClientNumber, g_stClientVersion.c_str());

Search for this:

	if (!g_bAuthServer)
	{
		sys_err ("CInputAuth class is not for game server. IP %s might be a hacker.", 
			inet_ntoa(d->GetAddr().sin_addr));
		d->DelayedDisconnect(5);
		return;
	}

Add under this:

	if (dwClientNumber != pinfo->dwClientNumber)
	{
		LoginFailure(d, "VERSION");
		return;
	}

 

Now go to your cd /usr/game/auth folder

-Create a file named VERSION

-Write 3333 into it

 

Client / root / intrologin.py

Search for this:

self.loginFailureMsgDict={

Add this into the list:

"VERSION"	: "Your client is outdated as fun ;) , please use the patcher program!",

 

Have fun with it!

 

EDIT:
 

If you don't have the client version check enabled:

Server Source / game / config.cpp

Search for this:

// END_OF_LOG_KEEP_DAYS_EXTEND

Add under this:

LoadClientVersion();

Edited by Ezrekith
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...