Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

some small doc entry

File size: 3.4 KB
RevLine 
[9396]1
2
[9494]3
4WORKING_STACK:
5==============
6 - it works to connecto to a master server which is connected to a proxy itself
7
8
9
10UNSOLVED:
11=========
12 - what if the proxy server gets a new client and wants to add it to the game? There are some problems waiting in the network game manager
13 - actualy the whole message sending system won't work in this network topic. proxys have to relay messages to clients
14 - the clients cant get its ip in the handleHandshakes without throuwing sigseg
[9514]15 - 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.
[9540]16 - Permissions: Proxy Servers shouldn't be able to create new eneitites on the server
[9494]17
18
19
[9396]20This readme just gives some hints for the general network programming:
21
[9397]22ARCHITECTURE:
23The NetworkStream is in the center of this structure.
24
25
[9396]26UserId:
[9494]27=======
[9396]28containing 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)
29
[9494]30the 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.
[9396]31
[9494]32There are some reserved id's, don't mess with them:
330 :                  Master Server
341 :                  First Proxy Server
352 :                  Second Proxy Server
363 :                  Third Proxy Server
374 :                  Fourth Proxy Server
38.
39.
40.
41NET_MAX_PROXY        The maximal number of proxy servers
42NET_MAX... + 1       First Client
43NET_MAX... + 2       Second Client
44.
45.
46.
47NET_MAX_CONNECTION   Last client
48
49The 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.
50
51
[9531]52The 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)
[9494]53
[9531]54
55
[9400]56uniqueId:
[9494]57=========
[9400]58uniqueId 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
59
60
[9494]61permissions:
62============
63Each synchronizeable variable has some write permissions. this permission systems allows to manage which network nodes are able to write the variables.
64PERMISSION_MASTER_SERVER       : only the master server can write this variable
65PERMISSION_PROXY_SERVER        : only the proxy server can write this variable
66PERMISSION_OWNER               : only the owner can write this variable
67PERMISSION_ALL                 : all clients can write this variable
68
[9540]69Only the master server should have the permission to create new WorldEntities and to add them to the game
[9494]70
71
72
73
[9396]74NetworkStream PeerInfo list: (peers)
[9494]75=====================================
76The 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).
77
78
79
[9514]80MessageManager:
81===============
[9540]82The message manager has special handling if its a master/proxy: the messages will simply be forwarded to the other server
83
84
85Proxy Control:
86==============
87The ProxyControl class manages the state of the network by exchanging state messages.
Note: See TracBrowser for help on using the repository browser.