Gamestudio Links
Zorro Links
Newest Posts
Change chart colours
by 7th_zorro. 05/11/24 09:25
Data from CSV not parsed correctly
by dr_panther. 05/06/24 18:50
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
1 registered members (Ayumi), 662 guests, and 3 spiders.
Key: Admin, Global Mod, Mod
Newest Members
Hanky27, firatv, wandaluciaia, Mega_Rod, EternallyCurious
19051 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Server search? #113851
02/25/07 23:17
02/25/07 23:17
Joined: Jun 2005
Posts: 130
K
khanoftruth Offline OP
Member
khanoftruth  Offline OP
Member
K

Joined: Jun 2005
Posts: 130
Has anyone successfully created a visual server finder (like those present in many FPS's). I want players to be able to join the server across internet. It would need to search for servers and display them so that users could click and join.

Examples include the Halo or Swat 4 or CS servers.

I don't want to hear about cost or size or server limitations. I just want to know if anyone created one.

If you did, could you explain how. Thanks.


The Galvanic Productions Hompage: www.GalvanicProductions.tk For our current project, click on the Nirvana link.
Re: Server search? [Re: khanoftruth] #113852
02/26/07 04:23
02/26/07 04:23
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
You don't actually "search" the internet for other players. When a user creates a session, you need to have that session store it's info in a database on YOUR own server. Then when a user searches for available sessions, they query the database for hosts (title of session + ping rate + etc). Then they select one, you get the info they need from it (IP address).


xXxGuitar511
- Programmer
Re: Server search? [Re: xXxGuitar511] #113853
02/26/07 05:44
02/26/07 05:44
Joined: Jun 2005
Posts: 130
K
khanoftruth Offline OP
Member
khanoftruth  Offline OP
Member
K

Joined: Jun 2005
Posts: 130
I see. Did you create said visual database log? Or just theoretical (means I have to make it from scratch).


The Galvanic Productions Hompage: www.GalvanicProductions.tk For our current project, click on the Nirvana link.
Re: Server search? [Re: khanoftruth] #113854
02/26/07 14:28
02/26/07 14:28
Joined: Mar 2006
Posts: 2,503
SC, United States
xXxGuitar511 Offline
Expert
xXxGuitar511  Offline
Expert

Joined: Mar 2006
Posts: 2,503
SC, United States
You have to make it...

Check out the MySQL thread in the user contributions... This will allow you to read/write to your database.


xXxGuitar511
- Programmer
Re: Server search? [Re: xXxGuitar511] #113855
02/26/07 14:59
02/26/07 14:59
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I've made such a system for a client once.

What I did was create a few php scripts that fetch the list of servers (with an optional selection, like only deathmatch games), add a server to the list, remove a server from the list (note that you will also have to put in a timeout for servers that 'forget' to remove themselves from the list.

Then just run those scripts on a webserver with a database and call those webpages from c-script with the GSHTTP plugin (search for it).

If you go with the MySQL plugin, make sure you give the database user only the privileges it needs, because the MySQL plugin sends entire queries to the server. A hacker might send a query that corrupts your database. If you use the php approach, you can disallow TCP traffic for your database, so that only the queries that are created by your php script can be executed (still have to be carefull with SQL injection then!).

Re: Server search? [Re: Excessus] #113856
02/26/07 21:14
02/26/07 21:14
Joined: Jun 2005
Posts: 130
K
khanoftruth Offline OP
Member
khanoftruth  Offline OP
Member
K

Joined: Jun 2005
Posts: 130
Thanks guys. Big help.


The Galvanic Productions Hompage: www.GalvanicProductions.tk For our current project, click on the Nirvana link.
Re: Server search? [Re: Excessus] #113857
02/28/07 20:03
02/28/07 20:03
Joined: Jun 2005
Posts: 4,875
broozar Offline
Expert
broozar  Offline
Expert

Joined: Jun 2005
Posts: 4,875
Quote:

What I did was create a few php scripts that fetch the list of servers (with an optional selection, like only deathmatch games), add a server to the list, remove a server from the list (note that you will also have to put in a timeout for servers that 'forget' to remove themselves from the list.




that's exactly what i am programming atm, same approach (php/GS_HTTP). are you using a flatfile base or MySQL?

i decided for the flatfile system. i hang on 2 points,
--->1) how do you create the timeout? i thought about
a)just displaying the files whose age is under 2 hours (bad, the server could be on for less time)
b)before exiting, sending a "delete entry"-command (bad, what if the game crashes?)
--->2)making a file on the server is no problem. retrieving data from a whole buch of files is (disadvantage of flatfile system i guess). sometimes i do not get a response quick enough, and GS_HTTP is showing "".

Re: Server search? [Re: broozar] #113858
03/04/07 12:27
03/04/07 12:27
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
I used MySQL. A flatfile system should work fine aswell (don't see any disadvantage unless the load becomes very high). I chose to go with MySQL because I knew SQL but not php at that time, so this seemed the easyest. I still think building SQL queries is easyer than "file fidling".

You should store the datetime in a column and remove those rows who where created more than x seconds/minutes ago, where x is either a static number or a setting that the client can be set within some range by the client. There are datetime compare functions in SQL databases, but for your flatfile system I would just use the system time and count seconds/minutes.

The problem is probably WHEN to do this removal. To always get an up to date list, you must remove all outdated rows before retrieval. In your case, you'll have to check all the rows and remove all outdated ones and then return the rest.

If you expect a very high load on this server, a more efficient but less accurate solution is to only remove rows once every x retrievals (use a counter). You can probably also remove outdated rows periodically, without client interaction but I don't know how.

To improve on this system, you could add a php file that removes a certain client at any given time and let the game server (not the central server) call this when it cancels the game. This does raise security concerns (anyone can use this php file, even from a browser, with any parameters) so you might want to add a random password that is decided by the game server when it joins.

You could also add a way to 'report' crashed/disconnected game servers. If you try to connect to a server from the list and it doesn't work, report that to the central server. The central server checks if it indeed can't connected and removes it if it really crashed/disconnected.

Good luck

Re: Server search? [Re: Excessus] #113859
03/04/07 16:34
03/04/07 16:34
Joined: Mar 2003
Posts: 5,377
USofA
fastlane69 Offline
Senior Expert
fastlane69  Offline
Senior Expert

Joined: Mar 2003
Posts: 5,377
USofA
I don't know php but we've been using MySql for close to a year and I have to say it is the way to go. The MySql plugin is great (has a small memory leak but nothing major), MySql is free, and it's actually easy to setup and use!

Not adding much to the discussion here except to say that if you can, take the time to play with MySql and use it instead of a flatfile system whenever you can... whatever time you spend learning it will pay off in droves in the future in terms of lowered development times and increased performance.

Re: Server search? [Re: fastlane69] #113860
03/04/07 18:53
03/04/07 18:53
Joined: Jan 2004
Posts: 2,013
The Netherlands
E
Excessus Offline
Expert
Excessus  Offline
Expert
E

Joined: Jan 2004
Posts: 2,013
The Netherlands
Quote:

Not adding much to the discussion here except to say that if you can, take the time to play with MySql and use it instead of a flatfile system whenever you can... whatever time you spend learning it will pay off in droves in the future in terms of lowered development times and increased performance.




Yes I agree. Learning SQL will be beneficial, especialy if you expect your system to become more complex, or if it must be very fast under heavy load. Also, since MySQL (and I believe some other RDBMSs aswell) are seamlessly integrated with php, it will be a breeze if you know SQL. However, if you don't know SQL yet, you might want to go with flatfiles if you know it will not be under heavy load and you have to get it done quickly.

Quote:

MySql is free, and it's actually easy to setup and use!



While setting up MySQL is indeed extremely easy, optimizing the settings and your queries is quite challenging. If you don't do it right, flatfiles might give better performance (especially when the load isn't very high).

Quote:

The MySql plugin is great (has a small memory leak but nothing major)



Just FYI:
The way the system I proposed works is that you retrieve a webpage from within 3DGS. This webpage is dynamically created by a php script that runs on the central server. The page is basically a reflection of the database contents. As you can see, you don't need the MySQL plugin here and using it for this purpose (bypassing the HTTP request and the php script; talking directly to the database) will bring you alot of security issues (this is very different from your project where only the server -hosted by you only- directly talks to the database (or atleast I hope so for you )).


Moderated by  HeelX, Spirit 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1