dev
textPage 34 of 208
50 messages on this page
Tuesday, August 10, 2021
User bddf69
So weird
User bddf69
and I see the same that youre saying
User bddf69
I'm looking at allocs code
User bddf69
Yeh
User a506fe
but could be changed
User a506fe
still cant imagine that happening so often
User a506fe
its an upload of the players ttp file basically
User a506fe
that /used/ to run a lot slower
User bddf69
O damn that GIF is laggy lol
User a506fe
bwoah
User bddf69
So there's a few blocks diff but that's cause there's a few s diff between both calls
User bddf69
top pos is getplayersonline, bottom is getplayerlist

Peek_2021-08-10_12-01.gif
GIF β’ 20.0 MB
User a506fe
public void SavePlayerData (ClientInfo _cInfo, PlayerDataFile _playerDataFile) {
try {
PersistentContainer.Instance.Players [_cInfo.playerId, true].Update (_playerDataFile);
} catch (Exception e) {
Log.Out ("Error in GM_SavePlayerData: " + e);
}
}
try {
PersistentContainer.Instance.Players [_cInfo.playerId, true].Update (_playerDataFile);
} catch (Exception e) {
Log.Out ("Error in GM_SavePlayerData: " + e);
}
}
User a506fe
and the persistent data update is tied to the saveplayerdata api
User a506fe
ingame online players dict
User a506fe
foreach (KeyValuePair<int, EntityPlayer> current in w.Players.dict) {
ClientInfo ci = ConnectionManager.Instance.Clients.ForEntityId (current.Key);
Player player = PersistentContainer.Instance.Players [ci.playerId, false];
ClientInfo ci = ConnectionManager.Instance.Clients.ForEntityId (current.Key);
Player player = PersistentContainer.Instance.Players [ci.playerId, false];
User a506fe
getplayeronline=
User a506fe
allocs data
User a506fe
foreach (KeyValuePair<string, Player> kvp in playersList.Dict) {
Player p = kvp.Value;
Player p = kvp.Value;
User a506fe
Players playersList = PersistentContainer.Instance.Players;
User a506fe
playerlist=
User a506fe
*imagine
User a506fe
i cant image thats in sync all the time
User bddf69
I was just flying around, not dying
User bddf69
Not even
User a506fe
would be great
User a506fe
maybe a death triggers a sync
User a506fe
on every playerdatafile sync
User bddf69
Ahh somethings weird then
User bddf69
Cause in the little test script I did, both calls did the same position
User a506fe
prox every 30 secs
User bddf69
When does allocs persistent data get updated?
User a506fe
getplayersonline uses the current online players so is realtime
User a506fe
so not realtime data
User a506fe
playerlist uses allocs persistent data
User eca9c0
That would be fun on a drop on death server π
User bddf69
Lmao XD
User e5e1a1
/bag as in tea
User bddf69
I died a LOT of times and this seems to work as expected ^^
User e5e1a1
π
User bddf69
π
User bddf69
If I'm not missing something big here, this makes my life easier as I can reuse the old logic π
User bddf69
With 1-2 blocks difference but that's probably cause I'm flying and there's some delay between both calls
User bddf69
/tmp cat test.sh #!/bin/bash curl -L 'https://7d2d.csmm.app/api/getplayersonline?adminuser=csmm&admintoken=aaa' | jq .[].position curl -L 'https://7d2d.csmm.app/api/getplayerlist?adminuser=csmm&admintoken=aaa' | jq .players[].position
Tested like this, seems like both calls get the same location data back
User bddf69
Whatever is triggering it
User bddf69
I think the persistent data is updating in time
User bddf69
Hey @User 36612002 what was the diff between getplayersonline and getplayerlist again?
I remember I was supposed to use getplayersonline to make sure the latest position is recorded but I'm doing both requests at the same time and both return correct locations


