Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] Refresh clients data more often #40

Closed
Guillaume351 opened this issue Sep 2, 2016 · 10 comments
Closed

[REQUEST] Refresh clients data more often #40

Guillaume351 opened this issue Sep 2, 2016 · 10 comments

Comments

@Guillaume351
Copy link

Hello,
I use 3 clients right now :
Hub - game1 - game2.

On hub, I get playercount of game1 and game2 using the client data of synapse.
However, the playercount is only refreshed if a new Synapse client connects to Nemisys.
So the data is not refreshed unless game1 or game2 reboots.

Would it be possible to refresh every X seconds or when a new player connects/disconnects ?

Thanks

@SleepSpace9
Copy link
Contributor

It would also be great if the names of all online players were put into the synapse client data array
(of course only if it doesn't decrease performance).

@Guillaume351
Copy link
Author

Maybe an API to get manually informations from a certain client ... As this, it doesn't refresh for people that don't use this data.

@XFuryMCPE
Copy link
Contributor

How about you connect a useless test client to the server, which reboots everytime you want to refresh the counts?

@XFuryMCPE
Copy link
Contributor

Just tested that ^^ works

@SleepSpace9
Copy link
Contributor

SleepSpace9 commented Sep 6, 2016

@XFuryMCPE Sounds more like a workaround, I would prefer a clean solution.
But thanks for tip! 👍

@PeratX
Copy link
Member

PeratX commented Sep 10, 2016

The client info is the response to the HeartbeatPacket, so you can change the heartbeat time in client.

@PeratX PeratX closed this as completed Sep 10, 2016
@Guillaume351
Copy link
Author

@PeratX But the heartbeat refresh data on the Nemisys server, it doesn't send the info of game1 and 2 to hub ? (In my example)

@SleepSpace9
Copy link
Contributor

The line this.server.updateClientData(); is missing in the heartbeat section in Client.java.
It's only done at "case SynapseInfo.CONNECT_PACKET: ..." and that's the reason why the client data only refreshs at connect. After I put it also at "case SynapseInfo.HEARTBEAT_PACKET: ..." it works!

@Guillaume351
Copy link
Author

@PeratX Please reopen :/ @SleepSpace9 fix is working for me, could you apply it ? I don't really know how to create a clean pull request :/

@SleepSpace9
Copy link
Contributor

@Guillaume351 If you use my fork (update to 0.15.9 still missing there) you even get a comma separated list of all Synapse players in ClientData.

You can fetch it like this:

foreach($this->getServer()->getSynapse()->getClientData() as $cdata){
    echo "Players on server ".$cdata["description"].":\n".$cdata["playerNames"]."\n";
}

I use it for my own /list command. Possibly some more people like it. 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants