• 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!

C++ message update tfs 1.3

ZeroSkyer

Member
Joined
May 17, 2019
Messages
62
Reaction score
9
Location
EEUU
Hello friends, I am trying to get old clients to receive the message that they have to update the client. Is there a way to do it with the RSA Key? I found the function in the protocollogin but it gives me debug when I connect with the client that does not have the RSA key of the server. Does anyone know how I can do it? Thanks in advance.

original function:
C++:
if (!Protocol::RSA_decrypt(msg)) {
    std::cout << "[ProtocolLogin::onRecvFirstMessage] RSA Decrypt Failed" << std::endl;
    disconnect();
    return;
}

custom function
C++:
if (!Protocol::RSA_decrypt(msg)) {
    std::cout << "[ProtocolLogin::onRecvFirstMessage] RSA Decrypt Failed" << std::endl;
    disconnectClient("Your client version is outdated. Download a new version on our website.", version);
    return;
}
 
I don't think that is possible because the RSA is needed in order for the client to "connect" with the server, if the RSA is different, client will not know server response :/ you better bet is to use protocol "versions" in order to "force" client to connect
 
I don't think that is possible because the RSA is needed in order for the client to "connect" with the server, if the RSA is different, client will not know server response :/ you better bet is to use protocol "versions" in order to "force" client to connect
Thanks for answering, then I'll stop trying haha. Do you know how to get the dat and spr from here in this part of the source to prevent a login with dat and spr that are not the official ones?
 
You'll have to do it on client side, so if RSA/decryption is invalid then popup a message saying download the newest client. Alternatively you can add code to OTClient so that if RSA decryption fails then try to connect without encryption and rewrite TFS so it first checks without encryption, this way you can send any new arbitrary message you want on server side, but of course this is insecure against MITM attacks because encryption is disabled, so it's not recommended, better to just add it on client side.

Signatures are skipped in ProtocolLogin::eek:nRecvFirstMessage but are easy to add.
 
Back
Top