New lobby server software
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
New lobby server software
I've been writing new lobby server software in ANSI C. I'm no good with network programming, so it's a little ugly in places, but I've got it technically working so far. It's possible to host games with it and to join them.
I plan to add a simplistic protocol for lobby chat, and support for a text-based 'list' command to make game retrieval simpler. The latter will be done soon.
Let me know if you have ideas for improvement.
It supports 3.1 and 2.3 based versions, but it's tuned to use some custom protocols, like with 'list', a binary minutes integer sent after the last game that specifies the time in minutes the last game was hosted.
Here's the code.
EDIT: Fixed a bug in the code that made 3.1.x games look odd
EDIT 2: Fixed more bugs, completed basic status-logging-etc, licensed under GPL2.
EDIT 3: Now reliable, games removed after two hours (for dead ones), 'txlist' (txlist) command for text based listings which is good for bots, and both 'txlist' and 'list' versions of a 'last game hosted <number> minutes ago.', incompatible with 3.1.x's way of showing this.
I plan to add a simplistic protocol for lobby chat, and support for a text-based 'list' command to make game retrieval simpler. The latter will be done soon.
Let me know if you have ideas for improvement.
It supports 3.1 and 2.3 based versions, but it's tuned to use some custom protocols, like with 'list', a binary minutes integer sent after the last game that specifies the time in minutes the last game was hosted.
Here's the code.
EDIT: Fixed a bug in the code that made 3.1.x games look odd
EDIT 2: Fixed more bugs, completed basic status-logging-etc, licensed under GPL2.
EDIT 3: Now reliable, games removed after two hours (for dead ones), 'txlist' (txlist) command for text based listings which is good for bots, and both 'txlist' and 'list' versions of a 'last game hosted <number> minutes ago.', incompatible with 3.1.x's way of showing this.
You do not have the required permissions to view the files attached to this post.
Also known as Subsentient.
-
Terminator
- Regular

- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
Re: New lobby server software
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
@Terminator: More like the system that gives your program something to connect TO. Without a lobby server, everyone must join games by IP only, and they must tell each other about the games when they host them.
To use it, compile it with a decent C compiler, and just execute it. Port 9990 should be unblocked. You should then be able to edit your warzone config file, change masterserver to your IP and host a game, and it should then appear in your new lobby server!
To use it, compile it with a decent C compiler, and just execute it. Port 9990 should be unblocked. You should then be able to edit your warzone config file, change masterserver to your IP and host a game, and it should then appear in your new lobby server!
Also known as Subsentient.
-
Terminator
- Regular

- Posts: 1077
- Joined: 05 Aug 2006, 13:46
- Location: Ukraine
Re: New lobby server software
Simply just a new master server.
there are few new master sever protocols on wiki. which protocol are you useing ?
Death is the only way out... sh*t Happens !
Russian-speaking Social network Group http://vk.com/warzone2100
Russian-speaking Social network Group http://vk.com/warzone2100
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
I am using the old protocol, with some changes. All 2.3 and 3.1 are able to use it without changes right now, but some things that my lobby server supports are not usable by 2.3 or 3.1, only planned for Legacy.
The old protocol is not bad. :^)
The old protocol is not bad. :^)
Also known as Subsentient.
-
Rman Virgil
- Professional

- Posts: 3812
- Joined: 25 Sep 2006, 01:06
- Location: USA
Re: New lobby server software
.
Is it too early to inquire after what impactful features your Lobby Server will support that will be for Legacy only users ?
.
Is it too early to inquire after what impactful features your Lobby Server will support that will be for Legacy only users ?
.
.
Impact = C x (R + E + A + T + E)
Contrast
Reach
Exposure
Articulation
Trust
Echo
.
Impact = C x (R + E + A + T + E)
Contrast
Reach
Exposure
Articulation
Trust
Echo
.
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
@Rman Virgil: Implementing support for 3.1 for all these things is welcome, but chat in the lobby and binary 'last hosted m minutes ago' are the biggest. Other stuff like support for lobby ban administration in the lobby screen may be coming. It's not because it's my plan to make sure that only Legacy supports this, it's just that I don't expect the devs to implement it in the official game.
Also known as Subsentient.
-
Rman Virgil
- Professional

- Posts: 3812
- Joined: 25 Sep 2006, 01:06
- Location: USA
Re: New lobby server software
.
Thanks Bendib.
One area of particular interest, are Lobby-based Matchmaking features. Recently I was looking over Steamworks API in this area.
.
Thanks Bendib.
One area of particular interest, are Lobby-based Matchmaking features. Recently I was looking over Steamworks API in this area.
.
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
@Rman Not sure I follow, can you elaborate?
Also known as Subsentient.
-
Rman Virgil
- Professional

- Posts: 3812
- Joined: 25 Sep 2006, 01:06
- Location: USA
Re: New lobby server software
Well, for example, you have a range of skills and tastes in styles of playing WZ.... many incompatible with one another (not to mention personalities & social skill sets). What features in the Lobby can make it easier for those compatible in skills and prefered styles of play to find each other and get to it with the least amount of fuss or miss-match.bendib wrote:@Rman Not sure I follow, can you elaborate?
Here's an overview of the Steamworks API, just for the heck of it:
https://partner.steamgames.com/documentation/api
..
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
@Rman Actually, that's possible, and it takes no work on the lobby server whatsoever.
There are a couple intentionally unused/spare variables at the end of the structure that the lobby server passes around, and we can actually take advantage of that to create "categories" for the games. It probably wouldn't be too hard to use one of those for a gui that allows filtering games in this manner. I hope that's what you meant. :^)
There are a couple intentionally unused/spare variables at the end of the structure that the lobby server passes around, and we can actually take advantage of that to create "categories" for the games. It probably wouldn't be too hard to use one of those for a gui that allows filtering games in this manner. I hope that's what you meant. :^)
Also known as Subsentient.
-
Rman Virgil
- Professional

- Posts: 3812
- Joined: 25 Sep 2006, 01:06
- Location: USA
Re: New lobby server software
.
That's it, bendib.
.
That's it, bendib.
.
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
I have completed chat support!
Here is the protocol's best explanation, it's really simple, basic stuff:
Receiving end is opened in a dedicated connection on the same port 9990 and started with the 'listen' command. The command returns either 0 or 1 as an 8-bit integer. 1 means success, and then a 4-byte integer that contains a descriptor that must be stored is sent immediately after the 1. At that point, all new chat messages are sent in raw format and terminated with a newline.
To send a message, the 'speak' command is used. 'speak\n' is the sequence, and then you'll either get 0 or 1 as another 8-bit integer. If it's 1, you may proceed to send your message. On successful send, you'll get another 8-bit 1, and then the server closes the connection.
To close a listening connection, you cannot write to the dedicated receiving line, you must instead send the 'dc\n' command, and then the descriptor given to that client when it connected with 'listen'. It's already been formatted with htonl(), so just send it as you received it. Or, you can send a zero as a 4-byte integer, and that closes ALL chat listening connections for the detected IP address.
Text messages are formatted by the client; there is no nick/message division protocol-side. This can allow for announcement-type things, etc.
Let me know if there are further questions.
Here is the protocol's best explanation, it's really simple, basic stuff:
Receiving end is opened in a dedicated connection on the same port 9990 and started with the 'listen' command. The command returns either 0 or 1 as an 8-bit integer. 1 means success, and then a 4-byte integer that contains a descriptor that must be stored is sent immediately after the 1. At that point, all new chat messages are sent in raw format and terminated with a newline.
To send a message, the 'speak' command is used. 'speak\n' is the sequence, and then you'll either get 0 or 1 as another 8-bit integer. If it's 1, you may proceed to send your message. On successful send, you'll get another 8-bit 1, and then the server closes the connection.
To close a listening connection, you cannot write to the dedicated receiving line, you must instead send the 'dc\n' command, and then the descriptor given to that client when it connected with 'listen'. It's already been formatted with htonl(), so just send it as you received it. Or, you can send a zero as a 4-byte integer, and that closes ALL chat listening connections for the detected IP address.
Text messages are formatted by the client; there is no nick/message division protocol-side. This can allow for announcement-type things, etc.
Let me know if there are further questions.
Also known as Subsentient.
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Re: New lobby server software
Fixed most of the findable bugs. Games don't disappear when a different IP asks for a command, port 2100 is routinely scanned, etc.
EDIT: I do want it to be stable for 3.1.x, so if you point your masterserver var in the config file to universe2.us, you can test the new lobby. Point it to lobby.wz2100.net to undo.
https://raw.githubusercontent.com/Subse ... acylobby.c
EDIT: I do want it to be stable for 3.1.x, so if you point your masterserver var in the config file to universe2.us, you can test the new lobby. Point it to lobby.wz2100.net to undo.
https://raw.githubusercontent.com/Subse ... acylobby.c
Also known as Subsentient.
-
bendib
- Regular

- Posts: 1016
- Joined: 29 Aug 2010, 05:22
- Location: Imeuta
Lobby console box, how'd you do it?
I dunno if you guys are gonna care much, but once I get this polished well, I will submit a patch for lobby chat in 3.1 if you guys are interested. In the meantime, I really have nowhere else to go, or I would since I'm sure you're all sick of me by now. :^)
I have a problem with the GUI code that makes no sense to me. I looked at my previous codebase, 3.1_beta11's way, and I still cannot find why the text for the chat box comes up underneath the blue form? The code is nearly identical to the stuff in the game setup screen. I've attached a screenshot. The netcode is funky, but it works in the most basic sense so far. The only thing stopping me is this cosmetic blemish. Thanks in advance.
I have a problem with the GUI code that makes no sense to me. I looked at my previous codebase, 3.1_beta11's way, and I still cannot find why the text for the chat box comes up underneath the blue form? The code is nearly identical to the stuff in the game setup screen. I've attached a screenshot. The netcode is funky, but it works in the most basic sense so far. The only thing stopping me is this cosmetic blemish. Thanks in advance.
You do not have the required permissions to view the files attached to this post.
Last edited by Staff on 29 Mar 2014, 03:40, edited 1 time in total.
Reason: Merged into this topic, since it has nothing to do with our stuff...
Reason: Merged into this topic, since it has nothing to do with our stuff...
Also known as Subsentient.