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

TFS 1.X+ Is possible to check in source, if player are using otclient ou normal client?

roriscrave

Advanced OT User
Joined
Dec 7, 2011
Messages
1,188
Solutions
34
Reaction score
200
Hi guys, is possible to check in source if player is using otclient or normal client?
see line 6..
using tfs 1.3

C++:
void ProtocolGame::parseAttack(NetworkMessage& msg)
{
    uint32_t creatureId = msg.get<uint32_t>();
    // msg.get<uint32_t>(); creatureId (same as above)

    if (usingOTC) {
        std::cout << "Player is using OTC" << std::endl;
    else {
        std::cout << "Player isn't using OTC" << std::endl;
    }
      
    addGameTask(&Game::playerSetAttackedCreature, player->getID(), creatureId);
}
 
Hi guys, is possible to check in source if player is using otclient or normal client?
see line 6..
using tfs 1.3

C++:
void ProtocolGame::parseAttack(NetworkMessage& msg)
{
    uint32_t creatureId = msg.get<uint32_t>();
    // msg.get<uint32_t>(); creatureId (same as above)

    if (usingOTC) {
        std::cout << "Player is using OTC" << std::endl;
    else {
        std::cout << "Player isn't using OTC" << std::endl;
    }
     
    addGameTask(&Game::playerSetAttackedCreature, player->getID(), creatureId);
}

There is already a function within TFS for it:

Lua:
Player.isUsingOtClient(self)

You can use it like:

Lua:
if myPlayer:isUsingOtClient() then
  print('Hey, myPlayer is using OtClient!')
else
  print('Well, myPlayer is NOT using OtClient.')
end
 
Hi guys, is possible to check in source if player is using otclient or normal client?
see line 6..
using tfs 1.3

C++:
void ProtocolGame::parseAttack(NetworkMessage& msg)
{
    uint32_t creatureId = msg.get<uint32_t>();
    // msg.get<uint32_t>(); creatureId (same as above)

    if (usingOTC) {
        std::cout << "Player is using OTC" << std::endl;
    else {
        std::cout << "Player isn't using OTC" << std::endl;
    }
   
    addGameTask(&Game::playerSetAttackedCreature, player->getID(), creatureId);
}
Here's the pre-made function that checks whether a player is using OTC or not.

It uses the function player:getClient().os to get the players operating system.
Once you know their operating system, you can compare it to the operating systems predefined numbers located in enums.h
 
There is already a function within TFS for it:

Lua:
Player.isUsingOtClient(self)

You can use it like:

Lua:
if myPlayer:isUsingOtClient() then
  print('Hey, myPlayer is using OtClient!')
else
  print('Well, myPlayer is NOT using OtClient.')
end
not it bro, i need in source file, in this code that i sended.

Here's the pre-made function that checks whether a player is using OTC or not.

It uses the function player:getClient().os to get the players operating system.
Once you know their operating system, you can compare it to the operating systems predefined numbers located in enums.h
I'm using OTC with player, but it printed, why? I'm using OTC (android)
Player System: 2
Linux Check: 10
NOT OTC
C++:
  std::cout << "Player System: " <<player->getOperatingSystem() << std::endl;
    std::cout << "Linux Check: " << CLIENTOS_OTCLIENT_LINUX << std::endl;
 
    if (player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX) {
        std::cout << "Player is using OTC" << std::endl;
    } else {
        std::cout << "NOT OTC" << std::endl;
    }

edit2:
I logged 2 players into the game, one for tibia cip, and the other for otclient (android).
Lua:
print("player client:", getClient().os)
either printed:
player client: 2
 
Last edited:
not it bro, i need in source file, in this code that i sended.


I'm using OTC with player, but it printed, why? I'm using OTC (android)

C++:
  std::cout << "Player System: " <<player->getOperatingSystem() << std::endl;
    std::cout << "Linux Check: " << CLIENTOS_OTCLIENT_LINUX << std::endl;

    if (player->getOperatingSystem() >= CLIENTOS_OTCLIENT_LINUX) {
        std::cout << "Player is using OTC" << std::endl;
    } else {
        std::cout << "NOT OTC" << std::endl;
    }

edit2:
I logged 2 players into the game, one for tibia cip, and the other for otclient (android).
Lua:
print("player client:", getClient().os)
either printed:
I'm not well versed in c++, unfortunately.

But...
In your Lua test script, you are not supplying the function with the player data...

Lua:
print("player client:", getClient().os)
Lua:
print("player client:", player:getClient().os)

Not sure why it would print 2 instead of nil though. 🤔
 
TFS gets info from this message:

That can be really anything, but the default values for otclients are:

Maybe your os in your otclient is spoofed?
 
Back
Top