Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/dummyserver3.cc @ 458

Last change on this file since 458 was 446, checked in by scheusso, 17 years ago

corrected clientinformation::removeClient(enet event)

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