source: abuse/tags/pd/macabuse/inc/client.hpp

Last change on this file was 49, checked in by Sam Hocevar, 12 years ago
  • Imported original public domain release, for future reference.
File size: 1.2 KB
Line 
1#ifndef __CLIENT_HPP_
2#define __CLIENT_HPP_
3/*
4
5  Client duties :
6
7       - Get local inputs
8       - Send current inputs
9
10       - read server commands until
11       - process commands
12       - ability to detach from server
13       - ability to "talk" with a local server
14         through global local_server
15           and functions local_server->insert_received_packet(pk);
16                         local_server->get_output_packet(pk);
17
18
19*/
20#include "macs.hpp"
21#include "packet.hpp"
22class view;
23
24class game_client
25{
26  int process_command(uchar cmd, view *player, packet &pk);
27  int need_to_read_views;
28public :
29  int cnum;
30  game_client(int client_number);
31  void request_entry();                   // asks server for entry into the game
32  void wait_entry();                      // wait for signal from server so we can download level
33  void entry_continue();                  // server needs ack before continue from above
34  void get_local_inputs(packet &pk);      // writes inputs to packet as commands
35  void send_local_request(packet &pk);    // sends commands to server
36
37  void read_server_commands(packet &pk);  // reads everybodies commands
38  void process_packet(packet &pk);
39  void quit_server();
40  void read_views();
41} ;
42
43extern game_client *local_client;
44
45#endif
46
47
48
Note: See TracBrowser for help on using the repository browser.