Creating a PHP Socket Server for a Game

I develop a game, have a good idea for the game, and learn the languages โ€‹โ€‹that I thought I needed for the project. This is a simple 2-player web-based text clown of global thermonuclear war.

Players register through the PHP form and are automatically matched. The logic of the game is quite simple. Player A selects one of the territories of player B to attack, the transition goes to the server, which then sends it to Player B. Then player B makes a move and goes on it until there are no territories left. I am learning Javascript and AJAX and can get around in PHP.

The problem I am facing is that apparently can't find anything that could play in creating game servers in php.

Can someone suggest some material that I could read, or where to go from here.

+1
source share
2 answers

Some links to the project -

http://code.google.com/p/phpwebsocket/

http://code.google.com/p/php-websocket-server/

With APE (C-based), you can communicate in real time between the server and the client.

http://www.ape-project.org/

+2
source

Read about Node.js, this is a JavaScript framework. When combined with websites in your browser, it can do some pretty interesting things. For example, Facebook primarily uses the Node.js-like server to keep it updated on Facebook notifications, chat or messages.

You can use this to maintain a connection between the client and the server, which will have to process the actions (interaction with the database, user and clientโ€™s browser).

Easy to use and very fast server creation using Node.js related to websockets, it should do what you ask.

+1
source

All Articles