spring / uberserver

uberserver, a matchmaking/chat lobby server for the spring rts project
https://springrts.com/wiki/Uberserver
Other
33 stars 38 forks source link

add a method to sync bridged users in one or more chunks #378

Closed TurBoss closed 3 years ago

TurBoss commented 3 years ago

currently at appservice boot it joins all the bridged rooms and syns one by one all the users

havinf 300 in gamedev takes like 1 or 2 mins to send all of them

and the users can talk meanwhile...

could some bulk sync be added?

silentwings commented 3 years ago

It could be added, but the server time involved here is mostly spent telling other clients that the new bridged clients exist, so I'm not sure it would actually help. (At least, not without breaking changes elsewhere.)

What matters is that messages are sent to the server in an order that makes sense e.g. you should send the message saying that a bridge client exists before you send a message in which the client talks (ideally, you would also wait to hear a successful BRIDGEDCLIENTFROM back too). It doesn't matter if the messages sit in a queue for a bit; as long as they are in the right order they will still be dealt with correctly.

Probably best: ignore an external clients chat messages until after you get a successful BRIDGEDCLIENTFROM message for them.

abma commented 3 years ago

currently at appservice boot

how often is the appservice restarted?

i guess not this often?!

silentwings commented 3 years ago

Outside of testing/developing, I guess not often.

abma commented 3 years ago

am i right with it, that the appservice syncs like this:

users = getusersfromdiscord()
for user in users:
       uberserver.send(user joined...)
       assert(uberserver.recv() == "joined")

shouldn't it be sth. like this:

users = getusersfromdiscord()
uberserver.send("\n".join(users))
...

afaik thats supported by uberserver.

silentwings commented 3 years ago

Yep, can send multiple commands in a single message, separated by newline chars.

TurBoss commented 3 years ago

that great I'll test it

TurBoss commented 3 years ago

ok thanks this will do