Skip to main content
GameDev.net gamedev.net
🔒 Locked

Multiplayer match server using PHP andMySQL

Started by BS-er Nov 12, 2009 at 8:01 PM 1 replies 1.4k views
Original Post
BS-er
BS-er
I'm trying to conceive an approach for implementing a match server for a multiplayer game. I would use a MySQL table for user account information, likely for a minimal piracy protection. I'm wondering if it's sensible and efficient to use a MySQL table to manage active game sessions that players can join. It would likely need periodic timestamp updating to be done by the player PCs, and a cron job set up to occasionally go through the table and clean it up. This would be done on a fairly basic web hosting account (i.e. LunarPages for example). I don't have a dedicated server or VPS. Hence my motivation to use something like PHP. Since the game sessions are fairly dynamic, I wonder if there's a better way than using a MySQL table, or if that's even a big concern. Any ideas?
Atrix256
Atrix256
As long as your php / mysql script is acting like a lobby server (ie a match server as you put it - matching players together) and NOT for real time game data you will be fine

I've done this numerous times myself and in fact shipped a game for Wii, DS, PC, iPhone, silverlight and flash that utilized this very technique for sharing of user generated content.

it works! (:

it's also a nice way to do things because it's simple and easily works on all platforms that can do an HTTP request (which is basically every platform in existance these days) and it's easy to find hosting for your "server". pretty much every web host has php and mysql support.

and php / mysql are both very efficient and light weight, good technology choice imo (;
Codeka
Codeka
For my game, that's exactly how I'm going to be doing match-making. In fact, I'm going one step further and using phpbb (which is the forum software I've been using) as the "authentication" mechanism*, so that you've got single signon between the game and the forums for the game.

Basically, I have a bunch of very simple PHP pages which the game posts XML to (via lubcurl) to do things like authenticate, find games, and so on.

* Actually, the game uses it's own authentication, I just use the phpbb "users" table.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.