Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/proxy/src/lib/network/README.NETWORK @ 9597

Last change on this file since 9597 was 9597, checked in by patrick, 18 years ago

new address space works, there is probably a permission error somewhere

File size: 3.6 KB
Line 
1
2
3WORD OF WARNING:
4================
5 - Allways keep the network_settings.conf file from the data repos up-to-date!! Its very important, that the user numbers are synchronized!
6
7
8WORKING_STACK:
9==============
10 - it works to connecto to a master server which is connected to a proxy itself
11
12
13
14UNSOLVED:
15=========
16 - the clients cant get its ip in the handleHandshakes without throwing sigseg
17 - MessageManager: proxy/server forward the messages always. Perhaps there is a case, where messages get forwarded forever if there is a loop in the network. think about it again.
18 - Permissions: Proxy Servers shouldn't be able to create new eneitites on the server
19 - the nick name must be handled new
20
21
22
23This readme just gives some hints for the general network programming:
24
25ARCHITECTURE:
26The NetworkStream is in the center of this structure.
27
28
29UserId:
30=======
31containing the id of a user (==client). This id must be unique within a orxonox network its used especialy in the NetworkStream for node identification and also in the Synchronizeable base class for permissions checking (PERMISSION_OWNER)
32
33the connections belonging tu toe userId's are stored in the NetworkStream::peers std::map. As a keyvalue the userId's are used. Therefore the usage of this peers map is very delicate. Don't ever try to add anything you are not sure about the id stuff.
34
35There are some reserved id's, don't mess with them:
360 :                  Master Server
371 :                  First Proxy Server
382 :                  Second Proxy Server
393 :                  Third Proxy Server
404 :                  Fourth Proxy Server
41.
42.
43.
44NET_MAX_PROXY        The maximal number of proxy servers
45NET_MAX... + 1       First Client
46NET_MAX... + 2       Second Client
47.
48.
49.
50NET_MAX_CONNECTION   Last client
51
52The proxy server ids are assigned as stated in the data/trunk/config/network_settings.conf, the first proxy server in the list gets the id NET_ID_PROXY_01 and so on.
53
54
55The ids are created by the master/proxy servers. Each server receives an address space of 1000 nodes where it is able to assign nodes to. This address space could be extended quite easely, since we got plenty of numbers in 4bytes (integer)
56
57The handshake sync has always the uniqueId == userId. This is why there are some reserved uniqueIds
58
59
60uniqueId:
61=========
62uniqueId is an id (unique :D) for each synchronizeable to be identified in a network. the number space for uniqueIds goes from 0 to maxplayers - 1
63
64The handshake sync has always the uniqueId == userId. This is why there are some reserved uniqueIds
65
66
67permissions:
68============
69Each synchronizeable variable has some write permissions. this permission systems allows to manage which network nodes are able to write the variables.
70PERMISSION_MASTER_SERVER       : only the master server can write this variable
71PERMISSION_PROXY_SERVER        : only the proxy server can write this variable
72PERMISSION_OWNER               : only the owner can write this variable
73PERMISSION_ALL                 : all clients can write this variable
74
75Only the master server should have the permission to create new WorldEntities and to add them to the game
76
77
78
79
80NetworkStream PeerInfo list: (peers)
81=====================================
82The network node with the offset 0 is always the server to which the client must connect to (in case there are connections to other hosts at the same time).
83
84
85
86MessageManager:
87===============
88The message manager has special handling if its a master/proxy: the messages will simply be forwarded to the other server
89
90
91Proxy Control:
92==============
93The ProxyControl class manages the state of the network by exchanging state messages.
Note: See TracBrowser for help on using the repository browser.