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

Game freezes when loot is being sold by mass quantity in backpacks to NPC

Serene

Premium User
Premium User
Joined
Mar 3, 2016
Messages
40
Solutions
2
Reaction score
20
Hello Otland friends, I have a problem in my server that I believe is a recurrence in majority of TFS, however I believe that not a lot of people know about this bug, or else it would've been fixed. I didnt find any topic regarding this, thats why I'm posting here.

When a player sell loot to the NPC and this loot is divided within many backpacks (by many i mean a lot ranging from thousands) the server begins to freeze and lag constantly. I believe that this forces the server to search a lot within these backpacks of loot.


I tried resolving this by placing an exhaust on the sale to the NPC however it did not help, it still feezes.
 
an easy solution is to limit the number of backpacks a player can use, the issue comes from the server searching through hundreds of backpacks trying to find items to sell, then removing them all, there are some ways you can get around this by caching the items players loot (but it will take A LOT of extra memory though)

id say easiest solution is just limiting how many bps a player can have via weight on bps, and no weight on other items, then youll never have this issue
 
an easy solution is to limit the number of backpacks a player can use, the issue comes from the server searching through hundreds of backpacks trying to find items to sell, then removing them all, there are some ways you can get around this by caching the items players loot (but it will take A LOT of extra memory though)

id say easiest solution is just limiting how many bps a player can have via weight on bps, and no weight on other items, then youll never have this issue

your solution was very good. But how to make it in a highexp server with resets? players have infinite amounts of cap.

is there a way to limit the cap?
 
set cap gained on lvl for each vocation to 0, set all backpacks weight to whatever you want (1, 10, 100, etc, easy to use), then set the starting cap for players to however many backpacks you want as a limit, multiplied by bp weight (so if you want 50 bp cap, put 1 weight on them, and give 50 cap)
doing this you also have to remove the weight from all items currently in items.xml (except backpacks, just use search+replace to set all weight to 0, and manually set bps to something)
and if server is already online you have to reduce current players cap, player:setCapacity or doPlayerSetCapacity depending on tfs function i believe
 
set cap gained on lvl for each vocation to 0, set all backpacks weight to whatever you want (1, 10, 100, etc, easy to use), then set the starting cap for players to however many backpacks you want as a limit, multiplied by bp weight (so if you want 50 bp cap, put 1 weight on them, and give 50 cap)
doing this you also have to remove the weight from all items currently in items.xml (except backpacks, just use search+replace to set all weight to 0, and manually set bps to something)
and if server is already online you have to reduce current players cap, player:setCapacity or doPlayerSetCapacity depending on tfs function i believe

:0 You saved my life.

Thanks for the solution.
 
Back
Top