OnPlayerUpdate Randomly Stop Working
#1

So I have this issue which I have narrowed down to OnPlayerUpdate as I have certain thing that happen under OnPlayerUpdate that don't happen once you get in this "desynced" state so basically you end up at a point where you can't spawn any vehicles, see any players, any players you do see are completely frozen, /freeze doesn't work on you.. you appear on the map to other people standing still.. and the only way to resolve this is to relog. I can't pin it to a specific time or event it just randomly happens and is a reoccurring problem in my script which is causing massive issues and I could use some help pinning down the problem. Thanks.
Reply
#2

If you return 0 in OnPlayerUpdate, 'this player will not be replicated to other clients'.

If you're sure that you don't return 0 in OnPlayerUpdate, please can you show us your code?
Reply
#3

Also if you have to much checks under OnPlayerUpdate than it can be lag to...(server just freeze)
Reply
#4

I am still having this issue and it wasn't OnPlayerUpdate as I commented out all the code I thought ti would be

Below is a message I sent to Kalcor but I received no response and the problem persist.
---

I have had an issue with my script for some time now. I have an issue which my community has nicknamed the "desync bug" It occurs are random times.. Their seems to be no individual thing that ties it down. I've tried commenting out MANY things.. Even commented out all the stuff inside OnPlayerUpdate.. tried playing with no one on but myself but people always end up getting "desynced" in which sometimes they can type text and other players will see it but not them.. time textdraws will stop working.. they can't see people moving around.. objects stop loading.. than they semi come back where they see text again and everything stops again. Sometimes they start seeing people move around yet. They can't be frozen or teleported. Pressing F5 reveals normal network statistics. I am at the wits end with diagnosing the problem. I'm on a Burstnet dedicated which I heard there are some problems with network lag and such but.. This isn't lag this is disconnection of some sort. Sometimes you can't even see when players join as the player list becomes stuck. Pings go to 0 or remain in the same position. I hope you might be able to point me in the right direction. It happens so.. spontanously its difficult to pinpoint. I could be driving on a motorcycle by myself and all of a sudden my text appears to be "lagging" (even though people claim when its happening they see me typing just fine) and objects start vanishing. The only way to ever correct this bug fully has been to relog or to force disconnect someone by adding their IP to the samp ban list and unbanning it when they reconnect. I would appreciate any help. My players have reported it appears to be happen alot when entering/exiting vehicles but I haven't found anything that could be a problem. Its the only major bug with the script I have (And I've done alot of overhauling to alot of it and still nothing changed its been going on for 6 months +)
Reply
#5

Have you tried a different host?( Or even a blank GM? ) I see you mentioned "Burstnet" and network lag. There can be a lot of factors that could be messing up your server.

Loops that don't end.
Coding mistakes - Are you freeing MySQL - SQL result when needed, etc..?
Heavy timers?
Updated plugins?
Have you tried the Profiler plugin? Not sure if that will work since you mentioned "Network lag", but it's always an option. That can pretty much tell you what's using the most resources.
Reply
#6

Well I do have some pretty heavy timers but the CPU usage is pretty consistently low and it doesn't lag other than when this "desync" happens. Lots of plugins aswell. I use Files aswell not MySQL.

I have an idea of a specific system that may be the problem I'm gonna give a try but I'm also gonna try the profiler plugin.

Would there be something wrong with having a timer for speeometer that starts when you get in a vehicle and ends when you get on? I heard theirs a problem with multiple timers of the same ms causing problems (if 500 people we're on the server at once their would be 500 times all running at 1000ms) but I thought it'd be better than having a loop checking if EVERY player online was in a vehicle every second than just to have it start / end the timer when the player enters / exits a vehicle.

I haven't tried a different host yet.
Reply
#7

Quote:
Originally Posted by ******
Посмотреть сообщение
If you have narrowed the problem down the OnPlayerUpdate you need to add print statements through the callback to see what is and isn't being run. It sounds like something is crashing (often an array-out-of-bounds problem, try the crash plugin), causing the callback to end prematurely and return the default value of 0. OnPlayerUpdate returning 0 tells the server to not sync that packet to other players (i.e. desyncs).
Thats what I thought but I actually commented out all the data inside and it appears to not be OnPlayerUpdate anymore. I'll give the crash plugins / profiler plugins a try to see if I can narrow down the issue but I commented out my speedometer and have yet to experience a desync yet but I am still testing it. If it is the speedometer I'll probably post the code here for further assistance.

It doesn't actually crash though.. The client just.. looses connection in different ways. Either objects stop loading.. text appears to "lag" (however other players see ir normally) they stop moving around on other players screen and become unfreezeable soemtimes they sync back partially but never fully (the clock freezing up is one sign.. If your desynced your time is always off - I use a custom clock I should note)
Reply
#8

Is there anything wrong with calling this function in a timer? Cause I can't find anything in the speedometer that would cause this problem (other than the timer issue that I mentioned above that I'm not 100% sure of)

Код:
stock IsVehicleUpsideDown(vehicleid)
{
    new Float:quat_w,Float:quat_x,Float:quat_y,Float:quat_z;
    GetVehicleRotationQuat(vehicleid,quat_w,quat_x,quat_y,quat_z);
    new Float:y = atan2(2*((quat_y*quat_z)+(quat_w*quat_x)),(quat_w*quat_w)-(quat_x*quat_x)-(quat_y*quat_y)+(quat_z*quat_z));
    return (y > 90 || y < -90);
}
Reply
#9

This issue still persists with nearly every avenue exhausted. I'm trying to the crash detect plugin working properly but it isn't running right.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)