home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


how can i make a masterserver for my game based on cube???

by NEO on 04/29/2003 17:56, 13 messages, last message: 06/10/2003 15:49, 1614 views, last view: 04/21/2024 23:13

how can i make a masterserver for my game based on cube???

   Board Index   

#1: RE: masterserver

by hungerburg on 04/30/2003 21:02

2min. on ethereal:

the masterserver is a webserver.

the cube_server sends a request to the masterserver. think of forms and CGI, or php. the server then obviously tries to "ping" the calling pc.

I get an error message: this doesnt work for me, as I sit behind a transparent proxy and the REMOTE_ADDR (environment) variable is bogus. (instead its in nonstandard HTTP_CLIENT_IP.)

the cube_client talks to the masterserver the same way.

the magic I guess lies in the "ping". the cube source should explain everything. you may have to use udp sockets in your script on the webserver.

reply to this message

#2: Re: masterserver

by Shockie on 05/04/2003 19:31, refers to #1

im still trying to get this working, but all i get from the server is garbage: wwqFw"4(FGGw

i dont know how to decompress it either...

reply to this message

#3: Re: masterserver

by Shockie on 05/04/2003 20:18, refers to #2

now im getting:


‰w}w"4(FGGw


http://www.ubercuber.com/servertest.php

reply to this message

#4: ummm..

by Skaus on 05/04/2003 22:00

wrong protocol or something like that? Secure server encrypting? Meh, i dunno :\

reply to this message

#5: Re: ummm..

by Shockie on 05/04/2003 22:19, refers to #4

i got a fuction out of serverbrowser.cpp which i then compiled into a program, which i can send the data to. this gives me a number. now i dont know what that numeber is...

reply to this message

#6: ..

by DoubleZ64 on 05/06/2003 04:52

Do u have a firewall? If thishappened before then my theory makes no sense:(

reply to this message

#7: Re: ..

by Shockie_tafe_N325 on 05/06/2003 07:55, refers to #6

well, i have no idea how a firewall comes into it..

reply to this message

#8: Re: ..

by Shockie on 05/06/2003 14:15, refers to #7

that data on the page is just me getting it off the local server (127.0.0.1)....



i wrote the firewall on my server, and cube ports are open

reply to this message

#9: masterserver protocol

by D.plomat on 05/16/2003 13:54

HTTP protocol
A server registers itself by querying:
masterpath + "register.do?action=add" (server.cpp:updatemasterserver), the masterserver get the ip or hostname from the CGI env. variables REMOTE_ADDR REMOTE_HOST adds it to its database.
I suppose there's a TTL for each record on the masterserever db.
A client gets the list from the masterserver by querying:
masterpath + "retrieve.do?item=list" (server.cpp:retrieveservers), the format is very trivial, just look at:
http://wouter.fov120.com/cube/masterserver/retrieve.do?item=list
The masterpath variable can be specified on the command-line, and the default is hardcoded in server.cpp:initserver

reply to this message

#10: proxy/firewall

by D.plomat on 05/16/2003 14:03

You can host a masterserver (as any web server) from behind a proxy only if it has masquerading/nat capability, and port-forwarding rule to forward incoming on :80 to the internal server.
i don't remember what it is *exactly*, but with iptables u have to do something like
# iptables -t nat -A PREROUTING --dport 80 -j DNAT --to <server internal ip>
and allow incoming on :80

It'll probably give you an error, but look on iptables/ipchains docs, and docs on setting a webserver behind masq/nat.

reply to this message

#11: masterserver source?

by D.plomat on 06/10/2003 15:07

Aard, it would be cool if we can d/l the source of masterserver CGI's/php. Of course it won't be hard to code, but... it's just a matter of not re-inventing the wheel ;-)

Or, would it be possible to have the masterserver used for Cube mods, let's say a column with the name of the mod or so.

Eventually auto-launch of the binary corresponding to selected mod would be cool, but i think it would be extra bloat on the code, and too much OS dependant. Maybe this has already been done in an external Cube launcher.

reply to this message

#12: oops... not the right thread

by D.plomat on 06/10/2003 15:48

... Found the answer in an old thread, so there's no source for even the open-source protocol, but we can use the main masterserver, the client TC should filter'em by the 'different protocol' response. But for some reason the CTF doesn't seem to work that way, and uses its own masterserver.
Maybe we could have the masterserver identify the protocol and display the name of the mod...

reply to this message

#13: Re: masterserver source?

by Aardappel on 06/10/2003 15:49, refers to #11

one particular problem with any of this is that the official cube (& thus the masterserver) use a different protocol from any mods anyone makes. Therefore it makes most sense everyone makes their own masterservers.

I know this is inconvenient, but its quite hard to juggle multiplayer, open source & cheating already.

reply to this message

   Board Index   


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
53868104 visitors requested 71643266 pages
page created in 0.020 seconds using 10 queries
hosted by Boost Digital