Last change
on this file since 7559 was
7444,
checked in by rennerc, 18 years ago
|
new network system implemented. yet with a lot of empty function bodys
|
File size:
1.3 KB
|
Line | |
---|
1 | /*! |
---|
2 | * @file network_stream.h |
---|
3 | * implementation of a network pipe |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _HANDSHAKE |
---|
7 | #define _HANDSHAKE |
---|
8 | |
---|
9 | #include "base_object.h" |
---|
10 | #include "synchronizeable.h" |
---|
11 | |
---|
12 | #define _INITIAL_DATA 0xF91337A0 |
---|
13 | |
---|
14 | #define _ORXONOX_VERSION 1 |
---|
15 | |
---|
16 | struct HandshakeState { |
---|
17 | int orxId; |
---|
18 | int version; |
---|
19 | |
---|
20 | int networkManagerId; |
---|
21 | int hostId; |
---|
22 | |
---|
23 | int completed; |
---|
24 | |
---|
25 | int error; |
---|
26 | |
---|
27 | std::string errorString; |
---|
28 | }; |
---|
29 | |
---|
30 | class Handshake : public Synchronizeable |
---|
31 | { |
---|
32 | public: |
---|
33 | Handshake( bool server, int clientId = 0, int networkGameManagerId = 0 ); |
---|
34 | inline bool completed(){ return localState.completed != 0 && remoteState.completed != 0; } |
---|
35 | inline bool ok(){ return localState.error == 0 && remoteState.error == 0; } |
---|
36 | inline int getHostId(){ return localState.hostId; } |
---|
37 | inline int getNetworkGameManagerId(){ return localState.networkManagerId; } |
---|
38 | inline void doReject( std::string reason ){ remoteState.error = 1; remoteState.errorString = "the server rejected your connection ["+ reason +"]"; } |
---|
39 | |
---|
40 | virtual void varChangeHandler( std::list<int> & id ); |
---|
41 | |
---|
42 | private: |
---|
43 | HandshakeState localState; |
---|
44 | HandshakeState remoteState; |
---|
45 | |
---|
46 | int netManId_handler; |
---|
47 | int hostId_handler; |
---|
48 | int completed_handler; |
---|
49 | int error_handler; |
---|
50 | int errorString_handler; |
---|
51 | int orxId_handler; |
---|
52 | int version_handler; |
---|
53 | |
---|
54 | }; |
---|
55 | |
---|
56 | |
---|
57 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.