40 lines
2.5 KiB
Plaintext
40 lines
2.5 KiB
Plaintext
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
|
|
6. Instead of looping through a list of avalible users have a local user dictionary that can be used to lookup clients IPEndPoints
|
|
|
|
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 the server connection closes
|
|
Notify all clients to drop the connections
|
|
Remove the user from the server table
|
|
|
|
Use the Server TCP connection to notify all clients when a user disconnects
|
|
|
|
|
|
Connection Flow:
|
|
1. Connection to server is made working
|
|
Server object is created working
|
|
ServerConnection gets added to the Connections table working
|
|
Server fires user connected event working
|
|
|
|
2. User sends an Auth Packet to server working
|
|
Server responds with Auth sucess or fail and marks the users auth status in the server table. needs work
|
|
After sucessfull auth share the users IPEndPoint with close connections not started
|
|
|
|
3. If the TCP connection closes not started
|
|
Disconnect the user and tell all clients that the user is gone not started |