opentibiabr / canary

Canary Server 13.x for OpenTibia community.
https://docs.opentibiabr.com/
GNU General Public License v2.0
374 stars 617 forks source link

Exiting the client makes the player logout even in no-logout zones #73

Closed BoozieII closed 2 years ago

BoozieII commented 3 years ago

What happened?

When a player xlogs, hard closes the tibia client they log out of the game after 1 minute. This happens in temples and trainers - where no log out zone is specified. I am to believe they should stay logged in for the duration specified in the config.lua file?

I commented the following in the player.cpp and recompiled and players still logout after a minute.

if (noPongTime >= 60000 && canLogout()) { if (g_creatureEvents->playerLogout(this)) { if (client) { client->logout(true, true); } else { g_game.removeCreature(this, true); } } }

How do I prevent my players from logging out after a minute when xloging from the game?

How to Reproduce?

Xlog in temples or nologout zone

Relevant log output

No response

Attach any relevant file

No response

Version

12.x (Default)

What OS are you seeing the problem on?

Linux

Code of Conduct

xThauma commented 3 years ago

Navigate to data/events/creature.lua and look for function Creature:onTargetCombat(target) Before "if target:getIp() == 0 then" add local tile = Tile(target:getPosition()) if tile and tile:isNoLogoutZone() then return true end Now players won't get kicked in no logout zones.

dudantas commented 3 years ago

Your issue will be transferred to the canary repository

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 120 days with no activity.

andersonfaaria commented 2 years ago

Navigate to data/events/creature.lua and look for function Creature:onTargetCombat(target) Before "if target:getIp() == 0 then" add local tile = Tile(target:getPosition()) if tile and tile:isNoLogoutZone() then return true end Now players won't get kicked in no logout zones.

did anyone tested it? @BoozieII ?

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 120 days with no activity.

dudantas commented 2 years ago

Navigate to data/events/creature.lua and look for function Creature:onTargetCombat(target) Before "if target:getIp() == 0 then" add local tile = Tile(target:getPosition()) if tile and tile:isNoLogoutZone() then return true end Now players won't get kicked in no logout zones.

This creates a relatively big problem; if the player's internet drops, log off only after 15 minutes, thus overthrowing the anti connection lost protection. The correct thing is what you did in the source, where you can check if there is a connection loss.

dudantas commented 2 years ago

It's not a server problem but a support request from the issue autor .