Jump to content

OnPlayerConnected hook causing FPS spikes

Pending 2.2.2

TomNXT
TomNXT

Posted

I've had ocassional lags happening on my server, i have checked the console and whenever FPS spike occured, there was always this line "OnPlayerConnected" is this normal?

 

10/01/2022 14:55:26 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 378ms
10/01/2022 14:53:57 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 348ms
10/01/2022 14:51:40 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 358ms
10/01/2022 14:50:51 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 380ms
10/01/2022 14:46:51 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 372ms
10/01/2022 14:46:45 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 381ms
10/01/2022 14:44:26 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 437ms
10/01/2022 14:41:05 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 331ms
10/01/2022 14:39:54 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 377ms
10/01/2022 14:36:24 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 422ms
10/01/2022 14:36:04 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 353ms
10/01/2022 14:33:19 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 400ms
10/01/2022 14:32:39 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 405ms
10/01/2022 14:31:25 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 352ms
10/01/2022 14:30:11 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 334ms
10/01/2022 14:29:56 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 347ms
10/01/2022 14:29:26 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 347ms
10/01/2022 14:28:31 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 346ms
10/01/2022 14:28:08 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 354ms
10/01/2022 14:27:35 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 365ms
10/01/2022 14:27:21 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 344ms
10/01/2022 14:25:31 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 368ms
10/01/2022 14:22:47 | Calling 'OnPlayerConnected' on 'PlayerRanks v2.2.3' took 343ms 


 

  • Administrator
Steenamaroo

Posted

Hi,
I'll look into this.
Does that look right...Are players joining and leaving your server that frequently?
Also, is your PlayerRanks.json file in the data folder huge?
 

Thanks. 👍

TomNXT

Posted (edited)

well im running only 130pop server... it has 500kb, but i was mainly wondering about those times it takes each time.... 

Edited by TomNXT
  • Administrator
Steenamaroo

Posted

I think I know what it is and should be able to sort it pretty easily.
The questions were relevant to the issue. 👍

Thank you.

TomNXT

Posted

hey, so after a month i just cant help myself but to blame this plugin again, this onplayerconnected hook keeps raising my cpu usage and dropping server fps... what does it do and is there a way to disable this feature please? i like plugin alot but this is killing me

  • Administrator
Steenamaroo

Posted (edited)

Sorry. Honestly, I forgot about you.

Would you mind trying the attached file? (removed...see next reply)
Thank you.

 

Edited by Steenamaroo
TomNXT

Posted (edited)

you replied and explained it via DM's but i just cant find any other thing that could be causing the lag spikes 

PlayerRanks.json

Edited by TomNXT
  • Administrator
Steenamaroo

Posted

Ah yes, I remember.
Please try the attached file, if you're willing.

PlayerRanks.cs

TomNXT

Posted

i tried, what should i look for?

  • Administrator
Steenamaroo

Posted

FPS drops, or the console spam you posted.
I mean, if the issue is gone, it's gone. 🙂

TomNXT

Posted

so you have managed to fix it? in the DM's you explained quite much that its a necessary feature :D, i mean i cant see anymore that onplayerconnected hook and fps seems fine so far, if this will work then sure thank you lol

  • Administrator
Steenamaroo

Posted

I don't know, to be honest. I can't replicate the issue and no one else has reported it but if the changes I made fix the issue on your server I'm happy to consider it solved. 🙂

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.2k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.