• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Małe przerobienie klienta

- - - Updated - - -

Nie znam się na tym ale się wtrącę. Może coś nie teges z tym status server? Da coś zmienie 1.0.0 na 100?
Nie to jest tylko wersja serwera która jest sprawdzana z
#define VERSION_CHECK "http://moje.eu/version.xml"
#define VERSION_PATCH 0
#define VERSION_TIMESTAMP 1261647210
#define VERSION_BUILD 3429
#define VERSION_DATABASE 23
#endif
Ale dzięki za chęci :>

- - - Updated - - -

Spróbuj dodać wypisywanie w konsoli jaka wersja klienta próbuje się połączyć.
Tego akurat nie wiem jak zrobić
 
Protocollogin.cpp:

Code:
void ProtocolLogin::onRecvFirstMessage(NetworkMessage& msg)
{
        if(g_game.getGameState() == GAMESTATE_SHUTDOWN)
        {
                getConnection()->close();
                return;
        }

        uint32_t clientIp = getConnection()->getIP();
        msg.skip(2); // client platform
        uint16_t version = msg.get<uint16_t>();

po tym dopisać

Code:
std::cout << "Client version: " << version << std::endl;
 
[15/07/2012 21:07:42] Client version: 100
[15/07/2012 21:07:49] Client version: 100
jest taki i próbowałem zmienić na \/ i nadal jest to samo że niby aktualizacja potrzebna.
#define STATUS_SERVER_PROTOCOL "100"
 
Nie powinno tam być

Code:
#define CLIENT_VERSION_MIN 100
#define CLIENT_VERSION_MAX 100
#define CLIENT_VERSION_STRING "Only for Client! 1.00 \n\n Check Download (v1.00): \n - bla bla"

?

tzn te liczby 100 bez "
 
Nie wiem, skoro serwer wypisuje, że klient łączy się z wersją 100 to znaczy, że moja przeróbka działa :) Kombinuj... wklej reszte kodu z ProtocolLogin::eek:nRecvFirstMessage
 
kurde nie mam pomysłów ...;/ może ktoś już miał z tym styczność?
 
Lua:
bool ProtocolLogin::parseFirstPacket(NetworkMessage& msg)
{
	if(
#if defined(WINDOWS) && !defined(__CONSOLE__)
		!GUI::getInstance()->m_connections ||
#endif
		g_game.getGameState() == GAME_STATE_SHUTDOWN)
	{
		getConnection()->close();
		return false;
	}

	uint32_t clientIp = getConnection()->getIP();
	/*uint16_t operatingSystem = msg.GetU16();*/msg.SkipBytes(2);
	uint16_t version = msg.GetU16();
	std::cout << "Client version: " << version << std::endl;

	msg.SkipBytes(12);
	if(!RSA_decrypt(msg))
	{
		getConnection()->close();
		return false;
	}

	uint32_t key[4] = {msg.GetU32(), msg.GetU32(), msg.GetU32(), msg.GetU32()};
	enableXTEAEncryption();
	setXTEAKey(key);

	std::string name = msg.GetString(), password = msg.GetString();
	if(name.empty())
	{
		if(!g_config.getBool(ConfigManager::ACCOUNT_MANAGER))
		{
			disconnectClient(0x0A, "Invalid account name.");
			return false;
		}

		name = "1";
		password = "1";
	}

	if(version < CLIENT_VERSION_MIN || version > CLIENT_VERSION_MAX)
	{
		disconnectClient(0x0A, CLIENT_VERSION_STRING);
		return false;
	}

	if(g_game.getGameState() < GAME_STATE_NORMAL)
	{
		disconnectClient(0x0A, "Server is just starting up, please wait.");
		return false;
	}

	if(g_game.getGameState() == GAME_STATE_MAINTAIN)
	{
		disconnectClient(0x0A, "Server is under maintenance, please re-connect in a while.");
		return false;
	}

	if(ConnectionManager::getInstance()->isDisabled(clientIp, protocolId))
	{
		disconnectClient(0x0A, "Too many connections attempts from your IP address, please try again later.");
		return false;
	}

	if(IOBan::getInstance()->isIpBanished(clientIp))
	{
		disconnectClient(0x0A, "Your IP is banished!");
		return false;
	}

	uint32_t id = 1;
	if(!IOLoginData::getInstance()->getAccountId(name, id))
	{
		ConnectionManager::getInstance()->addAttempt(clientIp, protocolId, false);
		disconnectClient(0x0A, "Invalid account name.");
		return false;
	}

	Account account = IOLoginData::getInstance()->loadAccount(id);
	if(!encryptTest(password, account.password))
	{
		ConnectionManager::getInstance()->addAttempt(clientIp, protocolId, false);
		disconnectClient(0x0A, "Invalid password.");
		return false;
	}
U mnie ten kod inaczej się nazywa
 
Zamień

Code:
if(version < CLIENT_VERSION_MIN || version > CLIENT_VERSION_MAX)

na

Code:
if(version != 100)

(to samo w musisz zrobić w ProtocolGame)
 
Yeach!!! działa :> A możesz powiedzieć jak tego hexa zmieniań np jakbym chciał v 1.10, 1.02, 1.60, 1.20 itp?
 
Nie zauważyłem że sensi dał już kodzik sorki.
 
Last edited:
Dziękuje za pomoc sensi :> jesteś zajebisty gdyby paypal mnie nie ojebało to bym ci coś kaski dał ;/
 
Siemka, to znowu ja mam pytanie otóż gdy zmieniłem w hexach bit wersji na "6e 00 00 00" (wersja 1.10) i zapisałem klienta to bez wpisywania passów gdy klikam error jest debug klienta, wiecie może o co chodzi?
 
Jaki debug? "Bez wpisywania passow" to znaczy odrazu po włączeniu klienta?
 
Back
Top