source: abuse/tags/pd/macabuse/src/net/unix/ghandler.hpp @ 49

Last change on this file since 49 was 49, checked in by Sam Hocevar, 11 years ago
  • Imported original public domain release, for future reference.
File size: 990 bytes
Line 
1#ifndef __GHANDLER_HPP_
2#define __GHANDLER_HPP_
3
4#include "netface.hpp"
5
6
7#define DEFAULT_COMM_PORT 20202
8#define DEFAULT_GAME_PORT 20203
9
10
11extern base_memory_struct *base;
12
13class game_handler     // game_client and game_serevr are derived from here
14{
15  public :
16  virtual int process_net()      { return 1; }     // return 0 if net-shutdown need to happen
17  virtual void add_engine_input() { base->input_state=INPUT_PROCESSING; }
18  // request input re-send  ( return 0 if net-shutdown needs to happen)
19  virtual int input_missing()    { return 1; } 
20  virtual int start_reload()      { return 1; }
21  virtual int end_reload(int disconenct=0) { return 1; }
22  virtual int add_client(int type, net_socket *sock, net_address *from) { return 0; }
23  virtual int kill_slackers()     { return 1; }
24  virtual int quit()              { return 1; }  // should disconnect from everone and close all sockets
25  virtual void game_start_wait()  { ; }
26  virtual ~game_handler()         { ; }
27} ;
28
29#endif
30
31
Note: See TracBrowser for help on using the repository browser.