pawn-lang / sa-mp-fixes

Includes and plugins to fix various issues in the SA:MP server that can be fixed externally, leaving the devs time for other things.
136 stars 57 forks source link

Sticky GameTexts #26

Closed rt-2 closed 3 years ago

rt-2 commented 7 years ago

Hi, Since I installed the fixes.inc, some Gametext has been sticking on player screens. I have experienced it myself every time I played continuously for a couple of hours. There is two of my gamtext that do it every times, I guess because those are the only one automaticly called all the times. It never did it before I included this.

This one is called every hour for all players:

format(message,sizeof(message),"%s(%i)",tname, targetid);
GameTextForPlayer(playerid, message, 10000, 4);

and this one is called every 10 second for 1 player:

GameTextForPlayer(playerid, "~w~Payday~n~~y~Check", 4000, 1);

So those gametexts will sometimes just stay there and never ever go away. Thank you, rt-2

ziggi commented 7 years ago

Try to disable FIX_GameText and check it again:

#define FIX_GameText 0
#include <fixes>
ziggi commented 7 years ago

Also try fixes from gametextfix branch: https://github.com/Open-GTO/sa-mp-fixes/blob/gametextfix/fixes.inc

rt-2 commented 7 years ago

Yesterday I compiled with the fix disabled last night, Today I will play most of the day and will be able to tell for sure if this fix was the problem or maybe something else also. Then tonight I will compile with the gametextfix branch and see. Thank you, rt-2

rt-2 commented 7 years ago

Unfortunately it didn't worked, I still got sticky GameTexts. rt-2

ziggi commented 7 years ago

Are you sure what you tried the version from the right branch? Because I found a compile problem in the gametextfix branch. Now I merge this into the master branch, check this please again.

rt-2 commented 7 years ago

Ok I will redownload the file and recompile my gamemode with it and give back some news, I think I used the gamtextfix branch.

rt-2 commented 7 years ago

Unfortunately I still have some sticky GameTexts. Thank you, rt-2

ziggi commented 7 years ago

I can't reproduce this. Maybe you have another GameText's in the gamemode?

Y-Less commented 7 years ago

Or a filterscript.

Y-Less commented 7 years ago

Given that I just saw you mention you have filterscripts while you specify FIXES_Single in the code you posted, could that not be the problem?

rt-2 commented 7 years ago

I use

#define FIXES_Single 0
#include <fixes>

In every filterscript and in my gamemode. Is that the correct way? Thank you, rt-2

Y-Less commented 7 years ago

It is the defaut - you don't need the define at all.

rt-2 commented 7 years ago

I have more information about this. Today I was able to reproduce the bug. When I login there is a GameText for 10 seconds. At first server start I use a cmd to start 3-5 intense filterscript. Those jam the server's CPU for a good 15 seconds, like if I do a simple /b test right after I start them, it'll just do it 15 seconds later when the CPU usage drops. If I start the filterscript before the shown GameText is gone, the moment when it should go away will be in the 'lag' and the result is that it stays there in my screen until I log off. Hope this helps, I am not sure if related, but gives the same symptoms. Thank you, rt-2

Y-Less commented 7 years ago

The problem probably comes from supporting both GMs and FSes at once in fixes.inc - the interactions are very complex and not well tested, it is the main reason for developing the plugin instead. I suspect that when the filterscripts are loaded, they confuse things. The better question is why are you loading them with a command like that instead of just with server.cfg?

rt-2 commented 7 years ago

Its really because of my situation, the way I handle system and scripts on my server, the ones I am working on are loaded in scripts that are loaded/reloaded, if I need to fix a bug quick. We'll see if this gets resolved with the plugin then... Thank you, rt-2

rt-2 commented 7 years ago

All week end I haven't seen this happen unless when I was starting the filterscript. I think the original issue have been fixed so I will close this. Thank you everyone for the help. rt-2

Y-Less commented 7 years ago

I think that probably is the root cause, but to put it in perspective how complex solving inter-script functionality is, I literally think scrapping everything and rewriting a plugin is simpler; and the move from YSI 2 to YSI 3 was entirely motivated by the same problem. Previous to y_master, code in YSI would look like the code in fixes.inc, with loads of ifdefs and publics for determining which script should do what, plus huge functions for syncing data between scripts when one ended (a problem I've still not fully solved). It was taking so much development effort I got totally sick of doing it and stopped, redeveloping the whole thing as y_master with the complex foreign and global macros (that I really wish we could use in fixes.inc) for sync. It is a shame I just don't have any of that YSI 2 code any more (I don't think it was ever released, and this was many years ago).

rt-2 commented 7 years ago

The original issue is still happening.

Y-Less commented 7 years ago

Is that with or without FS loading?

rt-2 commented 7 years ago

Without, I suspected maybe something similar, like if the player was Alt-Tabbed while the GameText needed to go off. But I tried testing that and it didn't reproduce the bug. This is not urgent, I guess this would be fixed with the plugin version? Thank you, rt-2

Y-Less commented 7 years ago

It could be, though if that is the problem, then it might be that the plugin won't help because it is a logical issue not an implementation issue.

rt-2 commented 7 years ago

I'm thinking right now, and maybe that from the beginning, all those were at times where I loaded/unloaded FSs, but only realized it later, then blaming 'randomness'.