Created
October 21, 2017 02:05
-
-
Save prail/cd14e938b3fb715f5165cacbc34c0a97 to your computer and use it in GitHub Desktop.
Just pseudocode for a simple multiplayer system.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if is host | |
while waiting for all clients. | |
send an accept packet to client. | |
send start packet to all clients. | |
while gameloop running | |
while not all data packets recieved | |
collect data packets from client. | |
send all packets to each client excluding sender. | |
update game state. | |
if is client | |
connect to host | |
while connected to host | |
do game input and process | |
send data to host | |
wait and recieve data from host. | |
update game state. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment