Basic connection between server and unit

This commit is contained in:
Kayne Ruse
2013-05-10 19:57:53 +10:00
parent a667fae21a
commit 4671afe900
18 changed files with 891 additions and 42 deletions
+22 -23
View File
@@ -24,36 +24,35 @@ This outline is only the most basic example of the server's operation possible,
-------------------------
class Client:
Player:
ID --unique, incremental
socket --connection socket
position
motion
avatarName --make sure you've transfered the assets first
GetID
GetSocket
GetIP --wrapper for GetPeerAddress
Update(int)
--handle dropped connections by destroying this client
int Send(data, len);
int Recv(data, maxlen);
Set
Get
--close the socket, and cleanup any other stuff
CloseSocket()
GetPosition()
GetMotion()
GetAvatarName()
end
[stuff]
[things]
class PlayerManager:
maxPlayers
currentPlayers
ticker --incremental
class ClientManager:
Init(max)
Init(maxPlayers)
Quit()
CheckNewClients()
Send(id, data, len)
SendAll(data, len)
Recv(id, data, maxlen)
UpdateAll(int)
Get(id)
Close(id)
NewPlayer(...)
GetPlayer(index)
DeletePlayer(...)
GetRaw() --the internal container
--iteratable
DeleteAll()
end