25 lines
1.3 KiB
Plaintext
25 lines
1.3 KiB
Plaintext
Make a username -> connectionID dictionary for quick lookups instaed of using foreach loops with breaks.
|
|
|
|
1. Allow the server to setup a server name
|
|
2. Allow the client to setup a user name
|
|
3. Have the client connect to the server with a welcome packet
|
|
4. Have the server use the welcome packet to fillout the user information on the server
|
|
5. Respond to the client from the server with a server list of UDPEndpoints
|
|
|
|
Test that the datapacket is formatted correctly. The packet size might be off from the actual packet size
|
|
|
|
Have each client update the ingame location to the server every 5 seconds [ Heartbeat ]
|
|
For each user in the server calculate which other players are close enough for a connection
|
|
So the server needs to hold a table of what clients a client is already connected to
|
|
if a new player is now close enough update the client and the servers client table with that information
|
|
have the clients udp together
|
|
if a player goes out of the range update the clients that they no longer need the connection
|
|
drop the player from the table and notify the end user they can close the connection
|
|
|
|
When user a joins a server
|
|
The IP gets added to the servers master list
|
|
The user needs to authenticate for username
|
|
|
|
When user leaves a server
|
|
Notify all clients to drop the connections
|
|
Remove the user from the server table |