136 Input object which contains InputHandler objects for various classes |
136 Input object which contains InputHandler objects for various classes |
137 of input. One such object is PlayerInput which affects the GameState's |
137 of input. One such object is PlayerInput which affects the GameState's |
138 LocalPlayer. Other object is GuiInput which just modifies what the GUI |
138 LocalPlayer. Other object is GuiInput which just modifies what the GUI |
139 look like on the client side. |
139 look like on the client side. |
140 |
140 |
141 The network code is a bit complicated and has several layers. |
141 The network code is a bit complicated and has several layers. There |
142 |
142 are some nice diagrams about the program structure in the doxygen |
143 % Are these necessary? Can they be simplified. |
143 documentation. |
144 NetworkAddress and NetworkSocket are ClanLib's Socket/IPAddress |
|
145 types. NetworkPackets provide a mechanism to read/write values from/to |
|
146 a byte buffer, and NetworkBuffer is used for buffering socket I/O. |
|
147 |
|
148 NetworkUDP is an UDP socket. NetworkTCPServer is a listen() socket, |
|
149 which spawns NetworkTCPTransports when clients |
|
150 connect. NetworkTCPClient is itself a NetworkTCPTransport with a |
|
151 connect()'d socket. |
|
152 |
|
153 NetworkSession can have a NetworkTCPServer socket, and both client and |
|
154 server NetworkUDP sockets. Connected clients are represented as |
|
155 NetworkNodes. |
|
156 |
|
157 NetworkObjectControllers can be attached to a NetworkSession on a |
|
158 specific NetworkChannelID, and they then manage instances of |
|
159 NetworkObjects, which have NetworkObjectIDs that can be sent across |
|
160 the network. NetworkObjects can be used to send messages with a |
|
161 specific NetworkMessageID. |
|
162 |
|
163 NetworkServer then has a NetworkSession and |
|
164 NetworkObject\_ServerController, and then creates NetworkServerPlayer |
|
165 and NetworkServerProjectile objects (that are |
|
166 NetworkObject\_Server's). |
|
167 |
|
168 NetworkClient then has a NetworkSession and a specialized |
|
169 NetworkClientController (NetworkObject\_ClientController) that creates |
|
170 NetworkClientLocalPlayer/NetworkClientRemotePlayer/NetworkClientProjectile |
|
171 objects when they are received from the server. |
|
172 |
|
173 |
|
174 TODO: Replace the above with some nice diagram, and make the text more |
|
175 brief |
|
176 |
144 |
177 \section{Data structures and algorithms} |
145 \section{Data structures and algorithms} |
178 |
146 |
179 |
147 |
180 \subsection{Basic data structures} |
148 \subsection{Basic data structures} |