Line | |
---|
1 | #include <iostream> |
---|
2 | #include "PacketManager.h" |
---|
3 | //#include "PacketTypes.h" |
---|
4 | #include "Server.h" |
---|
5 | |
---|
6 | namespace network{ |
---|
7 | |
---|
8 | class dummyserver3 : public Server{ |
---|
9 | public: |
---|
10 | dummyserver3(); |
---|
11 | ~dummyserver3(); |
---|
12 | void loop(); |
---|
13 | private: |
---|
14 | void tick(); |
---|
15 | void processChat( chat *data, int clientId); |
---|
16 | |
---|
17 | |
---|
18 | |
---|
19 | }; |
---|
20 | |
---|
21 | dummyserver3::dummyserver3(){ |
---|
22 | } |
---|
23 | dummyserver3::~dummyserver3(){ |
---|
24 | } |
---|
25 | |
---|
26 | void dummyserver3::loop(){ |
---|
27 | open(); |
---|
28 | while(true){ |
---|
29 | tick(); |
---|
30 | usleep(100); |
---|
31 | } |
---|
32 | } |
---|
33 | |
---|
34 | void dummyserver3::processChat( chat *data, int clientId){ |
---|
35 | std::cout << "Client " << clientId << " sent: " << data->message << std::endl; |
---|
36 | sendMSG(data->message); |
---|
37 | } |
---|
38 | |
---|
39 | void dummyserver3::tick(){ |
---|
40 | processQueue(); |
---|
41 | } |
---|
42 | |
---|
43 | |
---|
44 | } |
---|
45 | |
---|
46 | int main(int argc, char **argv[]){ |
---|
47 | network::dummyserver3 server; |
---|
48 | server.loop(); |
---|
49 | return 0; |
---|
50 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.