View Full Version : Socket server with PHP for gaming?
Frenchy
01-16-2007, 09:10 PM
I'm interested in setting up my own socket server for multiplayer flash games using PHP/Apache. I have intermediate experience with actionscript, limited knowledge of PHP and Apache, and I want to know if anyone has suggestions as to where to start. Is there an easier or better (perhaps non-commercial) solution out there than just coding my own? And does anyone know if PHP is ideal for real-time multiplayer games?
BernzSed
01-17-2007, 04:22 AM
On the Flash side, you will be using the XMLSocket class. Look it up in LiveDocs.
As for PHP...
I tried to do something similar a while back, and I learned something:
PHP is NOT very good with sockets.
PHP can deal with sockets, but it wasn't made to. Your best bet would be to use a language which can handle multiple threads, like Java.
Though, if you insist on using PHP, I could point you to one of the online resources I used:
http://www.phpfreaks.com/tutorials/50/0.php
I could also dig up some of my old code for you, but I won't guarantee that it works.
jsebrech
01-17-2007, 07:48 AM
I agree, you're better off looking towards java, because it was actually designed for things like being a socket server, whereas PHP is just not meant to do that (even if you can force it to).
Frenchy
01-17-2007, 05:08 PM
Java, huh? Good thing I'm learning it. I know it's platform independant too, so that's good. Too bad I'm not a big fan. I guess it's one of those necessary evils. But, I might just get flamed for saying so in this forum. Good thing I LOVE flash, eh? Anyway, thanks for the replies. At least I know where to start so I'm not wasting my time with something that won't really work anyway.
CyanBlue
01-17-2007, 06:24 PM
Howdy and Welcome... :)
How about using a ready-made ones like ElectroServer or Unity???
http://www.electrotank.com/electroserver/
http://www.moock.org/unity/
Frenchy
01-18-2007, 10:23 PM
How about using a ready-made ones like ElectroServer or Unity???
My only problem is money and the lack thereof. I've seen some pretty sweet ready-made socket servers that would make life easy could I afford them. So, I've decided I can at least learn from attempting my own socket server.
BernzSed
01-18-2007, 11:13 PM
I remember hearing about a Java socket server for Flash.
Here:
http://www.gotoandplay.it/_articles/multiplayerCentral/
Check that out, see if you can use it.
CyanBlue
01-19-2007, 02:10 PM
There is(was) a free one called patServer which has stopped development... If you are interested in that...
http://www.php-tools.net/site.php?&PHPSESSID=152cd5c026dc3e4e07a028e1d1fa62a1&file=/misc/patServer.xml
SilverVenom
01-25-2007, 05:23 AM
I made a very simple version to move a movie clip on another computer with perl. But if you want a premade script/server/admin tools etc. then take a look at: http://www.smartfoxserver.com/
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.