what client version is your server?How to add ping on OTCv8? Im using OTX 2 (TFS 0.3.7)
View attachment 63551
7.72what client version is your server?
Well, ping support added in newer versions of tibia. So 7.72 doesn’t have this feature.7.72
There is no way to modify sources to add?Well, ping support added in newer versions of tibia. So 7.72 doesn’t have this feature.
I have no idea about this really.There is no way to modify sources to add?
dont know how to start, dont know wich files is :s, im beginnerJust open tfs1.2 sources and copy and paste function responsible for ping to your server
You can find all the server source modification heredont know how to start, dont know wich files is :s, im beginner
I can try yelling "WORK DAMN YOU!" at the pictures you provided but probably would do better if you provided the code for the ping where it checks connection strength/ping so we can see why/where the values are coming from. For all we know, the values are technically displaying correctly and the script isn't modified to ping your server but instead pings another IP which you indeed have a bad connection too.
Here ping stuffs that i have in my sourcesI can try yelling "WORK DAMN YOU!" at the pictures you provided but probably would do better if you provided the code for the ping where it checks connection strength/ping so we can see why/where the values are coming from. For all we know, the values are technically displaying correctly and the script isn't modified to ping your server but instead pings another IP which you indeed have a bad connection too.
TL/DR: Provide code for analysis.
bool Game::playerReceivePing(uint32_t playerId)
{
Player* player = getPlayerByID(playerId);
if(!player || player->isRemoved())
return false;
player->receivePing();
return true;
}
lastLoad = lastPing = lastPong = lastAttack = lastMail = OTSYS_TIME();
void Player::onThink(uint32_t interval)
{
Creature::onThink(interval);
int64_t timeNow = OTSYS_TIME();
if(timeNow - lastPing >= 5000)
{
lastPing = timeNow;
if(hasClient())
client->sendPing();
else if(g_config.getBool(ConfigManager::STOP_ATTACK_AT_EXIT))
setAttackedCreature(NULL);
}
if((timeNow - lastPong) >= 60000 && !getTile()->hasFlag(TILESTATE_NOLOGOUT)
&& !isConnecting && !pzLocked && !hasCondition(CONDITION_INFIGHT))
{
if(hasClient())
client->logout(true, true);
else if(g_creatureEvents->playerLogout(this, false))
g_game.removeCreature(this, true);
}
messageTicks += interval;
if(messageTicks >= 1500)
{
messageTicks = 0;
addMessageBuffer();
}
void receivePing() {lastPong = OTSYS_TIME();}
virtual void onThink(uint32_t interval);
int64_t lastPong;
int64_t lastPing;
void ProtocolGame::parseReceivePing(NetworkMessage&)
{
addGameTask(&Game::playerReceivePing, player->getID());
void sendPing();
void sendPing()
{
if(!owner)
return;
owner->sendPing();
for(SpectatorList::iterator it = spectators.begin(); it != spectators.end(); ++it)
it->first->sendPing();
}
solution? (2)solution?