]> icculus.org git repositories - taylor/freespace2.git/blob - include/multi_team.h
Initial revision
[taylor/freespace2.git] / include / multi_team.h
1 /*
2  * $Logfile: /Freespace2/code/Network/multi_team.h $
3  * $Revision$
4  * $Date$
5  * $Author$
6  *
7  * $Log$
8  * Revision 1.1  2002/05/03 03:28:12  root
9  * Initial revision
10  *  
11  * 
12  * 5     9/04/99 1:54p Dave
13  * externed team scores.
14  * 
15  * 4     4/09/99 2:21p Dave
16  * Multiplayer beta stuff. CD checking.
17  * 
18  * 3     2/17/99 2:11p Dave
19  * First full run of squad war. All freespace and tracker side stuff
20  * works.
21  * 
22  * 2     10/07/98 10:53a Dave
23  * Initial checkin.
24  * 
25  * 1     10/07/98 10:50a Dave
26  * 
27  * 8     5/22/98 9:35p Dave
28  * Put in channel based support for PXO. Put in "shutdown" button for
29  * standalone. UI tweaks for TvT
30  * 
31  * 7     5/15/98 5:16p Dave
32  * Fix a standalone resetting bug.Tweaked PXO interface. Display captaincy
33  * status for team vs. team. Put in asserts to check for invalid team vs.
34  * team situations.
35  * 
36  * 6     4/08/98 2:51p Dave
37  * Fixed pilot image xfer once again. Solidify team selection process in
38  * pre-briefing multiplayer.
39  * 
40  * 5     3/31/98 4:51p Dave
41  * Removed medals screen and multiplayer buttons from demo version. Put in
42  * new pilot popup screen. Make ships in mp team vs. team have proper team
43  * ids. Make mp respawns a permanent option saved in the player file.
44  * 
45  * 4     3/10/98 4:26p Dave
46  * Second pass at furball mode. Fixed several team vs. team bugs.
47  * 
48  * 3     3/09/98 5:54p Dave
49  * Fixed stats to take asteroid hits into account. Polished up UI stuff in
50  * team select. Finished up pilot info popup. Tracked down and fixed
51  * double click bug.
52  * 
53  * 2     3/03/98 8:55p Dave
54  * Finished pre-briefing team vs. team support.
55  * 
56  * 1     3/03/98 5:09p Dave
57  *  
58  * $NoKeywords: $
59  */
60
61 #ifndef _MULTI_TEAMPLAY_HEADER_FILE
62 #define _MULTI_TEAMPLAY_HEADER_FILE
63
64 // ------------------------------------------------------------------------------------
65 // MULTIPLAYER TEAMPLAY DEFINES/VARS
66 //
67
68 // prototypes
69 struct header;
70 struct net_player;
71 struct ship;
72
73 // score for teams 0 and 1 for this mission
74 extern int Multi_team0_score;
75 extern int Multi_team1_score;
76
77 // ------------------------------------------------------------------------------------
78 // MULTIPLAYER TEAMPLAY FUNCTIONS
79 //
80
81 // call before level load (pre-sync)
82 void multi_team_level_init();
83
84 // call to determine who won the sw match, -1 == tie, 0 == team 0, 1 == team 1
85 int multi_team_winner();
86
87 // call to add score to a team
88 void multi_team_maybe_add_score(int points, int team);
89
90 // reset all players and assign them to default teams
91 void multi_team_reset();
92
93 // set the captaincy status of this player
94 void multi_team_set_captain(net_player *pl,int set);
95
96 // set the team of this given player (if called by the host, the player becomes locked, cnad only the host can modify him from thereon)
97 void multi_team_set_team(net_player *pl,int team);
98
99 // is it ok for the host to hit commit
100 int multi_team_ok_to_commit();
101
102 // handle a player drop
103 void multi_team_handle_drop();
104
105 // handle a player join
106 void multi_team_handle_join(net_player *pl);
107
108 // send a full update on a player-per-player basis (should call this to update all players after other relevant function calls)
109 void multi_team_send_update();
110
111 // set all ships in the mission to be marked as the proper team (TEAM_HOSTILE, TEAM_FRIENLY)
112 void multi_team_mark_all_ships();
113
114 // set the proper team for the passed in ship
115 void multi_team_mark_ship(ship *sp);
116
117 // host locks all players into their teams
118 void multi_team_host_lock_all();
119
120 // verify that we have valid team stuff
121 void multi_team_verify();
122
123 // get the player counts for team 0 and team 1 (NULL values are valid)
124 void multi_team_get_player_counts(int *team0,int *team1);
125
126 // report on the winner/loser of the game via chat text
127 void multi_team_report();
128
129 // ------------------------------------------------------------------------------------
130 // MULTIPLAYER TEAMPLAY PACKET HANDLERS
131 //
132
133 // process an incoming team update packet
134 void multi_team_process_packet(unsigned char *data,header *hinfo);
135
136 #endif
137