Multiplayer game PHP (socket programming)

I want to make a simple online card game with several players using PHP / Ajax. I probably need socket programming (I want it to be in real time). I worked with sockets before in Java, but not for an online program, but only for a network game. I searched, but I really did not find comprehensive code. Also another problem is that several games can be played simultaneously, and I do not want them to interrupt each other. How to manage them?

Could you guys give me a simple idea of ​​how to do this? Do I need to write two codes, one for management (host) and another for clients? Is it possible to test such programs on localhost (xampp)?

Any simple codes will also be appreciated.

Thanks in advance.

+1
source share
3 answers

You can take a look at this project.

+2
source

I don't think PHP is the right language for this. In addition, there is a difference between Ajax and sockets. However, despite my objections, the least I can do is point to the right resources. My 2 cents.

Github - php-websocket

Google code - phpwebsocket

+3
source

APE, .

, , , , Windows. , , , Windows LAMP, , Linux LAMP - , .

, , , . , .

0

Source: https://habr.com/ru/post/1692827/


All Articles