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

implement offline messages / channel history (=subscription) #132

Closed abma closed 9 years ago

abma commented 9 years ago

just store to db with date/time and replay at point where user left

gajop commented 9 years ago

I'd like to add the following protocol commands: 1) >SUBSCRIBE(chanName) 2) >UNSUBSCRIBE(chanName) 3) >LISTSUBSCRIPTIONS() 4) <STARTLISTSUBSCRIPTION() 5) <LISTSUBSCRIPTION(chanName) 6) <ENDLISTSUBSCRIPTION()

Extend SAID, SAIDDATA, SAIDDATAPRIVATE, SAIDPRIVATE, SAIDEX, SAIDPRIVATEEX commands to contain a datetime field as well. Do this by using the named arguments.

gajop commented 9 years ago

TODO: discuss these commands on springrts forums

abma commented 9 years ago

discussion: http://springrts.com/phpbb/viewtopic.php?f=71&p=564843

gimmick: show some message on join that this channel is logged

abma commented 9 years ago

hm, thinking abouth this problem:

what to do when user is subscribed to a channel but doesn't join it?

this makes it a requirement to store the last time where user received messages from the channel for every channel. each time he leaves/joins. also this means each subscription needs sth. like a last_history_id / last_history_time.

thats imo bad as on user join/leave all these values needs to be updated.

if all history is sent on login, only one value needs to be updated, but possible a lot more history is sent at once.

thoughts?

current implementation requires that ChanServ is in the channel + history is enabled for the specified channel. imo it shouldn't be allowed by a normal user to enable history for a channel, only mods/admins should be allowed to.

gajop commented 9 years ago

Oh didn't see you already implemented this, nice. Ideally it should only be sent once the user joins the channel, because it's odd for the user to receive messages from a channel he isn't it.

But I think we can also just choose the faster option, and just send it all once the user comes online. The client can then decide if it should immediately display the messages or wait until the user joins the channel (or alternatively discard them if he never does).

"imo it shouldn't be allowed by a normal user to enable history for a channel, only mods/admins should be allowed to." -> I'm not sure about that. What if I have a group of friends I want to play and chat with? Wouldn't it be beneficial if chat history would work in that case as well? (Although these feel more like "private messages" than anything else, but still). I assume you are worried about there being too many messages saved/transmitted, which I don't is necessarily going to be a big problem. It would probably be better to just allow it for now (so small games/devs can utilize it), and we can always look for optimizations later -> which is something we'll need to do anyhow.

abma commented 9 years ago

I assume you are worried about there being too many messages saved/transmitted,

no, i'm worried about storing all messages as default. thats not very intuitive and also bad for privacy. it should be transparent to users that messages are stored in a specific channel.

abma commented 9 years ago

some idea: timestamp should be optional and only used for offline messages. for "online" messages they aren't needed.

gajop commented 9 years ago

I thought this was an obvious optimization. ;) So yes, I agree.