'u' flag and bridge bot interface -- protocol info

'u' flag and bridge bot interface -- protocol info

Discuss development of lobby clients, server, autohosts and auto-download software.

Moderators: Moderators, Lobby Developers

Post Reply
User avatar
Silentwings
Moderator
Posts: 3593
Joined: 25 Oct 2008, 00:23

'u' flag and bridge bot interface -- protocol info

Post by Silentwings » 08 Feb 2019, 13:09

As announced in viewtopic.php?f=64&t=38922, uberserver now has support for bridge bots to external chat channels e.g. Discord, ZK, IRC. This allows chat messages to appear natively e.g. "<[Some]Dude:Discord> oh hai", and for a lobby to show the bridged users in their userlists.

With this comes a change: the chat for a battle now takes place inside a channel. This permits autohosts to also act as bridge bots e.g. "<[Some]Dude:DarkEnergy7> my tank just died", and also reduces duplicated code within the lobbyserver. Consequently SAYBATTLE and SAYBATTLEEX are deprecated.

A client signifies they are ready for both of these updates by sending the 'u' compatibility flag.

Protocol changes for ordinary clients who provide 'u':
  • A new sentence arg of BATTLEOPENED informs the client of the name of the channel associated to the battle. Clients joining (/leaving) this battle will be automatically joined (/left) from this channel, with the usual notifications sent to other clients supporting 'u'. The server controls which clients are present in this channel e.g. a 'normal' JOIN command is not allowed.
  • The battle chat takes place through SAID and SAID** commands in this channel, just like a normal channel.
  • JOINEDFROM, LEFTFROM, SAIDFROM to notify that a bridged user joined/left/spoke in a channel.
  • CLIENTSFROM, sent alongisde the usual CLIENTS when a user joins a channel, providing a list of currently bridged users in that channel.

Protocol changes for (auto)hosts who provide 'u':
  • Send a ex-style message within the battle to a single user with BATTLEHOSTMSG. This functions as a SAIDEX sent to just a single user, and is only accessible to battle hosts.
Protocol changes for bridge bots, only accessible with 'u': Clients supporting this functionality should send the 'u' compatibility flag. Bridge bots using the interface must send the flag, and also require a botflag unless they are a battle host bridging into its own battleroom and using the hosts own username as the location.

Ordinary clients, including hosts, that fail to support 'u' are supported with (near complete) backwards compatibility using SAYBATTLE etc.
0 x

User avatar
bibim
Lobby Developer
Posts: 901
Joined: 06 Dec 2007, 11:12

Re: 'u' flag and bridge bot interface -- protocol info

Post by bibim » 18 Feb 2019, 09:18

Silentwings wrote:
08 Feb 2019, 13:09
Bridge bots using the interface must send the flag, and also require a botflag.
So this means autohosts without bot flag can't use the bridge interface for in-game players ?
0 x

User avatar
Silentwings
Moderator
Posts: 3593
Joined: 25 Oct 2008, 00:23

Re: 'u' flag and bridge bot interface -- protocol info

Post by Silentwings » 18 Feb 2019, 10:13

I think I see why you're asking - I'll relax this restriction to allow a host with no botflag to bridge into its own battle, provided that the host uses its own username as the location.

edit: done, modified OP.
0 x

User avatar
bibim
Lobby Developer
Posts: 901
Joined: 06 Dec 2007, 11:12

Re: 'u' flag and bridge bot interface -- protocol info

Post by bibim » 18 Feb 2019, 15:41

From a autohost named "Spads":

Code: Select all

20190218153434 - DEBUG    - [SpringLobbyInterface] Sending to lobby server: "BRIDGECLIENTFROM spads testId testName"
20190218153434 - DEBUG    - [SpringLobbyInterface] Received from lobby server: "FAILED msg=You cannot bridge a location named after another bot user	cmd=BRIDGECLIENTFROM"
Also, is there any reason to prevent bridging by the host in private battles ?
0 x

User avatar
Silentwings
Moderator
Posts: 3593
Joined: 25 Oct 2008, 00:23

Re: 'u' flag and bridge bot interface -- protocol info

Post by Silentwings » 18 Feb 2019, 18:52

From a autohost named "Spads":
"BRIDGECLIENTFROM spads testId testName"
Please have another go, there was a bug https://github.com/spring/uberserver/co ... 88a07e6f1d (and note that usernames are case sensitive!)
Also, is there any reason to prevent bridging by the host in private battles ?
It's allowed as in viewtopic.php?f=64&t=38984&p=589982#p589980, but they can only bridge into their own battleroom. That restriction exists because bridge bots can effectively impersonate other users, so "full" bridging rights need to be controlled.
0 x

User avatar
bibim
Lobby Developer
Posts: 901
Joined: 06 Dec 2007, 11:12

Re: 'u' flag and bridge bot interface -- protocol info

Post by bibim » 18 Feb 2019, 22:44

Silentwings wrote:
18 Feb 2019, 18:52
and note that usernames are case sensitive!
Yes that's what I tried initially, but then here is what happened:

Code: Select all

FAILED msg=Invalid syntax: Only lower case ASCII chars, [], _, 0-9 and . are allowed in location names.	cmd=BRIDGECLIENTFROM
Silentwings wrote:
18 Feb 2019, 18:52
Also, is there any reason to prevent bridging by the host in private battles ?
It's allowed as in viewtopic.php?f=64&t=38984&p=589982#p589980, but they can only bridge into their own battleroom. That restriction exists because bridge bots can effectively impersonate other users, so "full" bridging rights need to be controlled.
Actually by "private battles" I meant passworded battles.
Here is what happens when a autohost tries to use the bridge interface inside a passworded battleroom:

Code: Select all

FAILED cmd=JOINFROM	msg=Cannot bridge to private channels
0 x

User avatar
Silentwings
Moderator
Posts: 3593
Joined: 25 Oct 2008, 00:23

Re: 'u' flag and bridge bot interface -- protocol info

Post by Silentwings » 18 Feb 2019, 23:02

Yes, privacy, if bridges out of passworded channels existed then the users would in some sense expect privacy but also have lost sight of where their chat was being sent to. I've (just now) added an exception for passworded battle hosts bridging into their own battles. The upper/lower case issue should also be fine now.
0 x

Post Reply

Return to “Lobby Clients & Server”