3 secs between OnPlayerConnect and OnPlayerRequestClass
#1

I've noticed a thing today about the time required to go from OnPlayerConnect to OnPlayerRequestClass ..so i'm trying to fix it but w/o success :/

I do some speed test:

[14:34:<b>43</b>] tick connect: 5 ms

[14:34:<b>46</b>] Connected to {B9B9BF}server name

[14:34:46] class= 0 ms

[14:34:46] later= 3557 ms

Class = x ms => Time required for complete OnPlayerRequestClass
tick connect = x mx => Time required to complete OnPlayerConnect
later = x ms => Time passed from OnPlayerConnect to OnPlayerRequestClass

Which can be the cause of this? I tried everything but the problem is still here :/
The problem seems to be between OnPlayerConnect and OnPlayerRequestClass

You can see

[14:34:<b>43</b>] tick connect: 5 ms (OnPlayerConnected)

[14:34:<b>46</b>] Connected to {B9B9BF}server name (SA:MP Thing)

the time between the callback and the thing of samp и di circa 3 secondi (see above later= 3557 ms)

I checked timers (maybe a timer can cause this retard?) but w/o success

( sorry for the english :/ i hope you can understand my problem. )
Reply
#2

Because this problem happen only in this gamemode and it's strange.. 3 seconds to show "connected to" and later request class.. and in other gamemodes this will be show immediatly
This is the code of OnPlayerConnect


Know the problem is not here but i can't solve this :/
Reply
#3

LOL,this is not a problem or a error,when player connects to the server,server first read code(checks if player ip is banned,checks player name,remove interior EnterExits etc...) and callback(OnPlayerConnect),then it calls OnPlayerRequestClass for that player,I think
Reply
#4

Yeah, i know but this is usually instantly.. here 3 seconds
Reply
#5

try to remove country detect..
Reply
#6

The problem is later OnPlayerConnected and before OnPlayerRequestclass

Onplayerconnect -> the msg connected to after 3 (or 11 sec!) -> class

i tried to remove all codes inside onplayerconnect and the result is the same
Reply
#7

Quote:
Originally Posted by ******
View Post
I still don't see why you're complaining. This isn't something you can control!
Yeah i know, but i want to know why the gamemode (only this) requires more than 3 secs for this :/

Anyway thx to all.
Reply
#8

What's wrong with waiting 3 seconds, it shouldn't affect much..
Reply
#9

Quote:
Originally Posted by ******
View Post
It's probably due to having to send more initial data to players - this includes objects, classes, vehicles etc which exist already when the player connects.
Yes,like: name check,ip ban check,is player with the same name connected,objects,classes,adding player to score tab,interior enter exits etc.......Sorry for my bad english
Reply
#10

I think name check, ip ban check, same name and something similiar will be done before OnPlayerConnect Anyway thanks ******, the problem was about the objects.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)