Working on the networking protocol

Kayne Ruse
2013-06-08 03:30:49 +10:00
parent 1cb429bf7d
commit 84153a5160
4 changed files with 22 additions and 22 deletions
+1 -1
@@ -25,7 +25,7 @@ If this wiki is missing something, it means I haven't gotten to it yet.
* NPCs
* Technical Information
* [Program Architecture](wiki/program-architecture)
* server & client communication protocol
* [Networking Protocol](wiki/networking-protocol)
* modding outline
* [Notes](wiki/notes) & [Scraps](wiki/scrapped-gdd)
* [Todo List](wiki/todo-list)
+18 -21
@@ -1,22 +1,19 @@
Networking protocol:
//connections
ping:
ping the server
pong:
a response to a ping
join request:
from client to server, this is the initial contact the client makes. it carries all of the client's information, like the handle, avatar, etc.
join confirm:
the response to a join request, this makes the client enter the game proper, and carries the client's playerID.
disconnect:
from either the client or server, this officially ends communications between the two programs
These are the basic networking protocols used by the client and server programs.
#### Packet Types
* ping "are you there?"
* pong "I am here"
* broadcast request "what servers are available?"
* broadcast response "I am available"
* join request "can I play? here's my data"
* join confirm "yes, here's your data"
* disconnect "I/you need to go"
* synchronize
* new player
* delete player
* movement
#### Procedure
//information control
synchronize:
update both the server and client
new player:
a new player enters the world. carries all player info
delete player:
a player leaves the world, carries the player ID
movement:
this is the initial position and motion of a player in the world. it is relayed to all clients, and progresses using delta progression
+2
@@ -74,6 +74,8 @@ All entities on the server have a unique, unsigned index.
* client index
* channel
* address
* last contact time
* ping count (number of times this client has been pinged, disconnect if it's too high)
* player index
#### Player Information
+1
@@ -8,3 +8,4 @@
* zero the packet data?
* Update the networking outline
* I should really use "index" instead of "ID" for naming things
* What if a bounding box could have a vector added to it?