Python Forum

Full Version: COMPLETE BEGINNER TO NETWORKING. HELP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
I am looking to create a LAN game on python. I am currently in the works of a connect four game.

Can anyone tell/show how to setup a server, so it's only with two people, ensure it has a password, and explain to me how to implement the sharing of moves between network?

Thanks!
Is there any sort of boiler plate to this?
The socket documentation has an example of an echo client/server: https://docs.python.org/3/library/socket.html The server reads messages from the client and then sends them back to the sender. Change that to accept two connections and have the server forward messages from one client to the other. Your game mechanics can be encoded as strings, e.g., "MOVE <COLUMN #>" and parsed at each client.
Did you click on the link I posted?
(Jan-04-2018, 07:05 PM)wavic Wrote: [ -> ]Did you click on the link I posted?

I'm not sure if you're asking me or the OP but I'll answer. Yes I did.
I am asking the OP.
What does OP mean? Undecided
Original Poster
I did click on the link, but I'd rather use the socket module.
(Jan-04-2018, 08:47 PM)ShadowWarrior17 Wrote: [ -> ]I did click on the link, but I'd rather use the socket module.

It's good for learning but finally, you will end with something like pyzmq
Pages: 1 2