New Multiplayer Lobby

Ideas and suggestions for how to improve the Warzone 2100 base game only. Ideas for mods go in Mapping/Modding instead. Read sticky posts first!
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: New Multiplayer Lobby

Post by Zarel »

In general, XML should not be used. It's a very clunky format. JSON is usually better.

As for format, that's up to you, really. I can give you feedback on it to some extent, but constructing it is up to you.
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

add game json string:

Code: Select all

{
  "userid"       : "[email protected]",  # User/Pass combination
  "userpass"     : "mypass",            # (using the forums db?!)
  "lobbyversion" : "1",                 # The lobbyserver version
  "gameversion"  : "2.3.1",             # The hosts game version
  "command"      : "addgame",           # The command (addgame, changegame, deletegame, startgame, listgame)
  "query"       : {                     # The query values for addgame
  	"hostip"      : "80.90.100.200",    # The hosts Ip Address
  	"hostport"    : "2100",             # The hosts Port
    "name"        : "My Game Name",     # Game Name is limited by Client Ui (how many chars?)
    "usepass"     : "0",                # or "1" for passworded games, only the host knows it
    "map"         : "Sk-Rush",          # Map name obv.
    "maxplayers"  : "4",                # Max players
    "tierlevel"   : "1"                 # The tier level (1,2,3)
  }
}
change game json string:

Code: Select all

{
  "userid"       : "[email protected]",
  "userpass"     : "mypass",
  "lobbyversion" : "1",
  "gameversion"  : "2.3.1",
  "command"      : "changegame",
  "query"       : {                     # The query values for chgame
    "map"         : "Sk-Rush",          # Map name (Can in-lobby map switching be implemented?)
    "players"     : "2",                # Players in game
    "tierlevel"   : "1"                 # The tier level (1,2,3)
  }
}
With the change game query we can update joining/parting players and the t-level. Can map-switching from inside a allready opened game be implemented? if so, we can update this aswell, if not i just drop it ;)

delete/start game json string:

Code: Select all

{
  "userid"       : "[email protected]",
  "userpass"     : "mypass",
  "lobbyversion" : "1",
  "gameversion"  : "2.3.1",
  "command"      : "deletegame"           # Or startgame
}
if the host closes or starts his game, this command should be sent to the server. The server will check if a port is open but to limit delay we can use the clients to send their new status immediately. The startgame query can also be used to store that game in the database for later use, maybe the clients could send their game summary to the server after the game ends?!


list games json string:

Code: Select all

{
  "userid"       : "[email protected]",
  "userpass"     : "mypass",
  "lobbyversion" : "1",
  "gameversion"  : "2.3.1",
  "command"      : "listgame"
}
the client sends this command to get a list of running games from the lobbyserver, note that with sending the users version we can filter games...

running games (JSON)

Code: Select all

{
  "lobbyversion" : "1",                 # The lobbyserver version
  "gameversion"  : "2.3.1",             # The requesting clients game version
  "games"       : {                     # All stored games
    "id1"   : [ "My Game Name", "80.90.100.200", "2100", "0", "Sk-Rush", "4", "1" ],
    # gameID # The games name  # host ip    # port  # use pass? # map # players # tier level
    "id2"   : [ "Another Game", "200.100.90.80", "2100", "1", "Sk-Rush2", "4", "3" ]
  }
}
what do you think about those strings? are those even fully correct? i have not finished my parser ^^
Last edited by m1ndgames on 07 Jul 2010, 21:23, edited 1 time in total.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: New Multiplayer Lobby

Post by Zarel »

Heck, if you use JSON, I can write the server for you in PHP; you just need to write the client in C/C++ for Warzone. :P It'd be better for me to write the server, actually, since then I can hook into the forum login system.

There's no need to abbreviate "chgame" and "delgame", by the way.

For the list of games, I think we can do better than arrays. Just use a game object - you could even use the same one you use in addgame.
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

the problem is: i cant cant code c very well and need help at the client side. im sorry to say that but if you want the server in php, i cant reallly help the project. i guess your time is more limited then mine, so those features will be on a todo list for a long time... :/

for the hooking: i could use a sample db and when the testing finished, you gain control over the loby server code and connect it to the db.
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: New Multiplayer Lobby

Post by Zarel »

You can always learn! :D

Honestly, the part I'd have the most trouble with is the socket stuff. I can probably do everything else.
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

hm... sure i could learn c++, but.. i just dont want to... im learning ruby atm and messing around with perl 6

for the php socket thing: php is a mess when it comes to sockets and real client-server apps.. good luck with that, but i bet you where better of with perl, ruby or even c. (i dont really understand why it should be php-server anyways)
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

no answer? i thougt of it again and still dont know why it should be a php server?! just because it can talk to the db?

zarel youre a coder whos already deep in the project, why dont we team up? you could make the changes to to game client and i supply the server. (like i said: the base is allready finished)

i got phpbb and im using its db for testing atm so it will be no problem to change to yours, i dont even need the login credentials. My code is well documented and read-able for any programmer, i used the long forms of any variables so its useable by anyone even if i get hit by a train ;)

btw.: this is the working version so far, still without json, but with working phpbb3 connect (edit: with json now)

http://www.nomorepasting.com/getpaste.php?pasteid=33601

\edit: now i know why you wanted php i guess... it was a bit tricky at first but the connection to the phpass'ed phpbb3 database is now integrated and can be checked by checklogin($email, $password)
Last edited by m1ndgames on 09 Jul 2010, 19:04, edited 2 times in total.
User avatar
macuser
Regular
Regular
Posts: 1052
Joined: 19 Mar 2010, 23:35
Location: USA
Contact:

Re: New Multiplayer Lobby

Post by macuser »

I know php and could do the coding if you want :) . but (yes there is ALWAYS a but) I am rather busy for the next 2-3 weeks :(
ArtRev Website

ImageImage

System: AMD Phenom II x4, 4GB RAM, 640GB HD, Nvidia GeForce GT 240 1GB, Mac OS X 10.6
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

please... dont read just the key words -.-

i ported to json:

telnet to server:

Code: Select all

root@m1ndbox:/usr/share/phpbb3/www/includes# telnet 192.168.1.23 9990
Trying 192.168.1.23...
Connected to 192.168.1.23.
Escape character is '^]'.
connected
lobbyversion 1
{"command":"addgame","hostversion":"2.1.3","hostport":"2100","techlvl":"2","players":"3","maxplayers":"4","map":"sk-rush","player_id":"1","hostip":"127.0.0.1"}
{"command":"listgames"}
[{"hostversion":"2.1.3","hostport":"2100","techlvl":"2","players":1,"maxplayers":"4","map":"sk-rush","player_id":"6","hostip":"127.0.0.1"}]
irc:

Code: Select all

--> lobbytest363 (~wzplayer@ip-***********.unitymediagroup.de) has joined #warzone-lobby
<m1ndgames> !listgames
<lobbytest363> [{"hostversion":"2.1.3","hostport":"2100","techlvl":"2","players":1,"maxplayers":"4","map":"sk-rush","player_id":"6","hostip":"127.0.0.1"}]

so... im almost finished with the server, i need someone to work on the client!

\edit: lastest version: http://www.nomorepasting.com/getpaste.php?pasteid=33601
User avatar
Zarel
Elite
Elite
Posts: 5770
Joined: 03 Jan 2008, 23:35
Location: Minnesota, USA
Contact:

Re: New Multiplayer Lobby

Post by Zarel »

I'm sorry, but I can't do any network coding for the client. And UI code I'm extremely averse to, as well; Warzone doesn't have a very strong UI codebase. I mean, in the long term, yes, I could do that if we really couldn't find anyone else, but my current to-do list will tide me for at least another year.

We really need people working on a client, not just a server.
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

mhh.. okay, im going to re-learn c, just for this project.. but... this will take a while ;)
Sonsalt
Trained
Trained
Posts: 114
Joined: 25 Jul 2007, 22:10

Re: New Multiplayer Lobby

Post by Sonsalt »

Talking about a new multiplayer lobby, would be great if you could disable syncronized research for teamplayers.
User avatar
m1ndgames
Trained
Trained
Posts: 142
Joined: 04 Jun 2010, 20:30
Location: Germany
Contact:

Re: New Multiplayer Lobby

Post by m1ndgames »

thats game client related, so i cant... at this time
Wisler
Trained
Trained
Posts: 132
Joined: 23 Jan 2010, 15:56
Location: England.

Re: New Multiplayer Lobby

Post by Wisler »

hows this project going? i think we need it more than ever now to help identify cheaters which there seems to have been a sudden surge in lately. Wish i could help with the coding and stuff but i have no clue about that kinda thing. If you need anyone to help test it or anything though tell me.
Failure is not falling down but refusing to get up.

Pm me to try out for RBL.
User avatar
macuser
Regular
Regular
Posts: 1052
Joined: 19 Mar 2010, 23:35
Location: USA
Contact:

Re: New Multiplayer Lobby

Post by macuser »

I can help too, just PM me anytime
ArtRev Website

ImageImage

System: AMD Phenom II x4, 4GB RAM, 640GB HD, Nvidia GeForce GT 240 1GB, Mac OS X 10.6
Post Reply