Jump to content

onPlayerNetworkStatus


IIYAMA

Recommended Posts

  • Moderators

Did anybody tested/used the event onPlayerNetworkStatus?

I am wondering how sensitive this event is. Also if it is for small interruptions or only large ones.

Why I am asking this question?

Because sometimes players have small network interruptions which causes teleportations and I am very curiously if this event can detect those.

https://wiki.multitheftauto.com/wiki/On ... workStatus

Link to comment
  • Moderators

I am already using getNetworkStats > packetlossLastSecond.

But it is kinda hard to check because it is over 1 second and require a timer which gets executed a lot.

So I though that onPlayerNetworkStatus might work better.

Link to comment

I've been running the wiki example since the 1.5 release but instead of writing to debug log I write to the server log and it seems to detect packet loss very well actually, most players never have any packet loss, others have it in intervalls like 100-500ms followed by 30-60s without any issues, followed by packet loss again and so on...

I think that if you freeze a player on the beginning of this event and then unfreeze when their connection works again could be a great way to stop these "teleportations" as you describe it. I haven't tested that idea yet however, only the event itself. Go ahead and try it if you want, the only problem with freezing however is that it probably makes people with bad connections very angry as they will notice these freezes and how their controls disable during the freeze which for them feels like they have some kind of lag on their clients.

It's probably smart to inform them by a dx message or similar about why they are frozen. Also watch up for conflicts in other resources like if you freeze someone with your admin panel, you don't want them to get unfrozen because they had a little packet loss. ;)

Link to comment
  • Moderators

You tested the event: onPlayerNetworkStatus ?

I am freezing the players by using (client)>onClientPreRender+setElementPosition+setElementRotation+elementdata+(server x1)>setElementPosition+setElementRotation+setElementVelocity

It is their problem that they have those connection issues, if I do not do this my server. A special script of mine that detects bullet hits serverside would work sometimes incorrect because the players will not stop moving, but doing what they last suppose to do(last packet they send). GetElementPosition will only return data of the last packet, which as result the players don't know where to shoot this snail.

It's probably smart to inform them by a dx message or similar about why they are frozen.

Already thought of it and added it 1,5 year ago.

It is only the question on how much % of packetloss this should be used. Before I had 30%, 30% does not works on small issues which sometimes last longer than 2 seconds. Now I am applying 5% and I hope that will work.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...