-1

I have been running into problems recently where the client-side of a networking game never read/recognizes the server. When I tried to use the socket module the client never accepts the socket. I used a module called NetworkZero, but that never returned more than None when I used .discover(). I have no idea what the problem is. Any ideas are appreciated

SundyAgo
  • 63
  • 9
  • Could you add some screenshots, snippets of your code, or include the error messages you are getting? – Martin Jul 12 '20 at 20:50

1 Answers1

1

There are many ways to set up an interface between clients and servers.

The easiest is probably to start with HTTP especially in Python where you can just use requests and poll for your data.

This will get you to prototyping quickly and then you can put your focus into optimizing when you start running into issues.

Of course this may be a less than optimal solution depending upon the nature of your game. Without context I would recommend using simple client/server communication systems you understand.

  • How would I go about using HTTP I am experienced with python but very new to all of the network-y multiplayer things. Thanks! – SundyAgo Jul 12 '20 at 03:05
  • I will look into that library and check back in. thanks! – SundyAgo Jul 12 '20 at 03:18
  • Oh well if you do not have HTTP experience then the library you chose will be easier to get started with. Make sure you are discovering the same name as you are advertising. [Here is the link to advertise in the docs.](https://networkzero.readthedocs.io/en/latest/networkzero.html#networkzero.advertise) – winningwithchase Jul 12 '20 at 03:20
  • I deleted that other comment as HTTP is a lot to learn just to get started sending data over the wire. Though if you want to use it I suggest using [Flask for the server](https://flask.palletsprojects.com/en/1.1.x/) and [Requests for the client](https://requests.readthedocs.io/en/master/). – winningwithchase Jul 12 '20 at 03:22
  • I played around with these commands, and I was wondering if it would be possible to use 3-4 machines/processes to send and receive data in between them – SundyAgo Jul 12 '20 at 03:30
  • I don't know about NetworkZero but I would assume that's possible with it. – winningwithchase Jul 12 '20 at 03:40
  • In regards to Flask and requests it can handle many clients GETing and POSTing data to it. – winningwithchase Jul 12 '20 at 03:43
  • I've heard about flask but when I look it up there is no real clear tutorial on what to do. At this point, I have a finished game and I don't care about learning what to do. Do you have a program where clients send and receive data that I could...... borrow? – SundyAgo Jul 12 '20 at 04:01
  • Or if you could recommend a video that you know works to help me finish the game, because I really want to finish it – SundyAgo Jul 12 '20 at 04:02