dev
textPage 33 of 208
50 messages on this page
Tuesday, August 10, 2021
User a506fe
and as soon as it arrives at server the SavePlayerData api allocs hooks into will trigger and the inmem persistent data is updated
User a506fe
no prob at all
User a506fe
only delay you ll get is the time it takes for the netpackage to travel
User a506fe
it ll sync instantly on death
User a506fe
nah no need looking at above
User bddf69
If it becomes a problem, I can still do it π
User bddf69
cause integrating the other endpoint into my loadPlayerData helper is gonna get messy
User bddf69
Yeh I'll leave like it is then
User bddf69
Sweet :D
User a506fe
so you re good for the /bag thingy
User a506fe
public override void OnEntityDeath()
{
GameManager.Instance.TriggerSendOfLocalPlayerDataFile(0f);
{
GameManager.Instance.TriggerSendOfLocalPlayerDataFile(0f);
User a506fe
death triggers it
User a506fe
ha!
User a506fe
public void TriggerSendOfLocalPlayerDataFile(float _sendItInSeconds) { this.countdownSendPlayerDataFileToServer.SetPassedIn(_sendItInSeconds); }```
User a506fe
getting closer
User a506fe
but above matches with what i /knew/
User bddf69
π
User a506fe
havent gone that deep
User a506fe
there might be triggers that force it
User bddf69
Thats def not waht i was seeing
User bddf69
o.o
User a506fe
30 secs
User a506fe
private CountdownTimer countdownSendPlayerDataFileToServer = new CountdownTimer(30f, true);User a506fe
there we go
User a506fe
countdownSendPlayerDataFileToServer.HasPassed()User a506fe
depending on
User a506fe
doSendLocalPlayerData will send the playerdatafile object to server
User a506fe
LocalPlayerUI uiforPlayer = LocalPlayerUI.GetUIForPlayer(primaryPlayer); if (this.countdownSendPlayerDataFileToServer.HasPassed() && uiforPlayer.xui != null && uiforPlayer.xui.isReady) { this.countdownSendPlayerDataFileToServer.ResetAndRestart(); this.doSendLocalPlayerData(primaryPlayer); } if (this.countdownSendPlayerInventoryToServer.HasPassed()) { this.countdownSendPlayerInventoryToServer.Reset(); this.doSendLocalInventory(primaryPlayer); }```
User a506fe
from GameManager class:
User a506fe
if that even takes /only/ 10 secs you ll have /old/ data in your response
User a506fe
but im more concerned bout that saveplayerdata interval
User a506fe
its still an in mem loop through dict so it wont be seconds
User bddf69
I'll look into switching APIs π
User bddf69
I broke some tests so I'll need to refactor/fix some stuff anyways
User bddf69
Good points :p
User a506fe
if i had a choice, id be using the playersonline api
User a506fe
the latter being faster as much as the persistentplayerlist grows bigger and bigger
User a506fe
getplayersonline only loops through actual online players
User a506fe
but filters on online = true
User a506fe
the playerlist api searches through ALL players ever having been online
User a506fe
and when considdering performance
User a506fe
maybe no so much on a high pop server but dunno
User a506fe
which would it make that there is no big diff in using either api
User a506fe
maybe thats normal
User a506fe
like on every movement or sumthing
User a506fe
but your client is /uploading/ its data a LOT
User a506fe
so no bottleneck there
User a506fe
well allocs data is in mem until server shutdown
User bddf69
That persistent data is getting updated somehow