File: network.h

package info (click to toggle)
ale-clone 1.15pre16.3-1
  • links: PTS
  • area: contrib
  • in suites: potato
  • size: 2,432 kB
  • ctags: 3,217
  • sloc: ansic: 37,483; sh: 1,105; makefile: 343
file content (90 lines) | stat: -rw-r--r-- 3,310 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
**	A clone of a famous game.
*/
/**@name network.h	-	The network header file. */
/*
**	(c) Copyright 1998,1999 by Lutz Sammer
**
**	$Id: network.h,v 1.9 1999/11/21 21:59:57 root Exp $
*/

#ifndef __NETWORK_H__
#define __NETWORK_H__

//@{

/*----------------------------------------------------------------------------
--	Includes
----------------------------------------------------------------------------*/

#include "unittype.h"
#include "unit.h"

/*----------------------------------------------------------------------------
--	Defines
----------------------------------------------------------------------------*/

/*----------------------------------------------------------------------------
--	Variables
----------------------------------------------------------------------------*/

extern int NetworkFildes;		/// Network file descriptor
extern int NetworkInSync;		/// Network is in sync

/*----------------------------------------------------------------------------
--	Functions
----------------------------------------------------------------------------*/

extern void InitNetwork(void);		/// initialise network module
extern void ExitNetwork(void);		/// cleanup network module
extern void NetworkEvent(void);		/// handle network events
extern void NetworkSync(void);		/// hold in sync
extern void NetworkQuit(void);		/// quit game
extern void NetworkChatMessage(const char*msg);	/// send chat message

    /// Send stop command
extern void SendCommandStopUnit(Unit* unit);
    /// Send stand ground command
extern void SendCommandStandGround(Unit* unit);
    /// Send move command
extern void SendCommandMoveUnit(Unit* unit,int x,int y);
    /// Send repair command
extern void SendCommandRepair(Unit* unit,int x,int y);
    /// Send attack command
extern void SendCommandAttack(Unit* unit,int x,int y,Unit* dest);
    /// Send attack ground command
extern void SendCommandAttackGround(Unit* unit,int x,int y);
    /// Send patrol command
extern void SendCommandPatrolUnit(Unit* unit,int x,int y);
    /// Send board command
extern void SendCommandBoard(Unit* unit,Unit* dest);
    /// Send unload command
extern void SendCommandUnload(Unit* unit,int x,int y,Unit* what);
    /// Send build building command
extern void SendCommandBuildBuilding(Unit* unit,int x,int y,UnitType* what);
    /// Send cancel building command
extern void SendCommandCancelBuilding(Unit* unit,Unit* peon);
    /// Send harvest command
extern void SendCommandHarvest(Unit* unit,int x,int y);
    /// Send mine gold command
extern void SendCommandMineGold(Unit* unit,Unit* dest);
    /// Send haul oil command
extern void SendCommandHaulOil(Unit* unit,Unit* dest);
    /// Send return goods command
extern void SendCommandReturnGoods(Unit* unit);
    /// Send train command
extern void SendCommandTrainUnit(Unit* unit,UnitType* what);
    /// Send cancel training command
extern void SendCommandCancelTraining(Unit* unit);
    /// Send upgrade to command
extern void SendCommandUpgradeTo(Unit* unit,UnitType* what);
    /// Send research command
extern void SendCommandResearch(Unit* unit,int what);
    /// Send upgrade command
extern void SendCommandUpgradeUnit(Unit* unit,int what);
    /// Send demolish command
extern void SendCommandDemolish(Unit* unit,int x,int y,Unit* dest);

//@}

#endif	// !__NETWORK_H__