source: abuse/trunk/src/client.hpp @ 97

Last change on this file since 97 was 57, checked in by Sam Hocevar, 11 years ago
  • Move each header to the same directory as its corresponding source, to get a better idea of which files are likely to export symbols.
File size: 1.5 KB
Line 
1/*
2 *  Abuse - dark 2D side-scrolling platform game
3 *  Copyright (c) 1995 Crack dot Com
4 *
5 *  This software was released into the Public Domain. As with most public
6 *  domain software, no warranty is made or implied by Crack dot Com or
7 *  Jonathan Clark.
8 */
9
10#ifndef __CLIENT_HPP_
11#define __CLIENT_HPP_
12/*
13
14  Client duties :
15
16       - Get local inputs
17       - Send current inputs
18
19       - read server commands until
20       - process commands
21       - ability to detach from server
22       - ability to "talk" with a local server
23         through global local_server
24           and functions local_server->insert_received_packet(pk);
25                         local_server->get_output_packet(pk);
26
27
28*/
29#include "macs.hpp"
30#include "packet.hpp"
31class view;
32
33class game_client
34{
35  int process_command(uchar cmd, view *player, packet &pk);
36  int need_to_read_views;
37public :
38  int cnum;
39  game_client(int client_number);
40  void request_entry();                   // asks server for entry into the game
41  void wait_entry();                      // wait for signal from server so we can download level
42  void entry_continue();                  // server needs ack before continue from above
43  void get_local_inputs(packet &pk);      // writes inputs to packet as commands
44  void send_local_request(packet &pk);    // sends commands to server
45
46  void read_server_commands(packet &pk);  // reads everybodies commands
47  void process_packet(packet &pk);
48  void quit_server();
49  void read_views();
50} ;
51
52extern game_client *local_client;
53
54#endif
55
56
57
Note: See TracBrowser for help on using the repository browser.