Page 1 of 1

Lobby Chat Callback

Posted: Fri Aug 30, 2013 3:04 pm
by Win4fun
Some PM owners have implemented chat commands so that if you type a certain phrase in lobby it triggers an action on the client. Not sure how they managed to program it but its a really useful feature. A way you could make this easier would to have a chat callback that is called when a line in chat starts with a chosen character. For instance i could set my callback character to an exclamation mark and whenever someone starts there chat with one the callback is sent. It would POST the username, time and message to your callback url.

Re: Lobby Chat Callback

Posted: Fri Aug 30, 2013 3:33 pm
by Kent Briggs
Most likely they are just scanning the lobby chat log file stored on the server. A callback is a good idea, though. I'll consider that in version 4.

Re: Lobby Chat Callback

Posted: Mon Sep 16, 2013 2:43 pm
by Kent Briggs
A lobby chat callback event has now been added to version 4.02.

Re: Lobby Chat Callback

Posted: Tue Sep 17, 2013 10:48 am
by Win4fun
Kent Briggs wrote:A lobby chat callback event has now been added to version 4.02.
Thanks for adding this - it makes adding some features way easier :) . However, this feature could be made way more efficient by adding an optional "callback character" that only sends the callback if the line begins with the character of your choice (ex. "!command" would send a callback whereas "command" wouldn't). In a lot of cases you won't want to do anything with the chat line and its a waste of resources to send large volumes of callbacks to your server if only a small fraction of them are actually needed. Either way this is a really cool feature, thanks again for adding it.

Re: Lobby Chat Callback

Posted: Tue Sep 17, 2013 11:27 am
by Kent Briggs
Win4fun wrote:However, this feature could be made way more efficient by adding an optional "callback character" that only sends the callback if the line begins with the character of your choice
Even on a busy site it's unlikely to be called more than once per second so it shouldn't be that often. And just looking for one character might fit your particular needs but probably not for everyone else.