FS2_Open
Open source remastering of the Freespace 2 engine
multi_team.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
4  * All source code herein is the property of Volition, Inc. You may not sell
5  * or otherwise commercially exploit the source or things you created based on the
6  * source.
7  *
8 */
9 
10 
11 
12 
13 #include "network/multi_team.h"
14 #include "globalincs/linklist.h"
15 #include "network/multimsgs.h"
16 #include "network/multiutil.h"
17 #include "network/multi_endgame.h"
18 #include "network/multi_pmsg.h"
19 #include "network/multi.h"
20 #include "object/object.h"
21 #include "ship/ship.h"
22 #include "iff_defs/iff_defs.h"
23 #include "stats/scoring.h"
24 
25 #ifndef NDEBUG
26 #include "playerman/player.h"
27 #endif
28 
29 
30 // ------------------------------------------------------------------------------------
31 // MULTIPLAYER TEAMPLAY DEFINES/VARS
32 //
33 
34 // packet codes
35 #define MT_CODE_TEAM_UPDATE 0 // send a full team update on a player-per-player basis
36 #define MT_CODE_TEAM_REQUEST 1 // a request sent to the host to be be on a given team
37 
38 //XSTR:OFF
39 
40 // score for teams for this mission
42 
43 // ------------------------------------------------------------------------------------
44 // MULTIPLAYER TEAMPLAY FORWARD DECLARATIONS
45 //
46 
47 // process a request to change a team
49 
50 // send a packet to the host requesting to change my team
52 
53 // have the netgame host assign default teams
55 
56 // check to make sure all teams have a proper captain.
58 
59 // process a team update packet, return bytes processed
61 
62 
63 // ------------------------------------------------------------------------------------
64 // MULTIPLAYER TEAMPLAY FUNCTIONS
65 //
66 
67 // call before level load (pre-sync)
69 {
70  // score for teams 0 and 1 for this mission
71  for (int i = 0; i < MAX_TVT_TEAMS; i++)
72  Multi_team_score[i] = 0;
73 }
74 
75 // call to determine who won the sw match, -1 == tie, 0 == team 0, 1 == team 1
77 {
78  int i, num_equal = 0, winner=-1, highest = -1;
79 
80  // determine highest score
81  for (i = 0; i < Num_teams; i++)
82  {
83  if (Multi_team_score[i] > highest)
84  {
85  highest = Multi_team_score[i];
86  winner = i;
87  }
88  }
89 
90  // see if there are any ties
91  for (i = 0; i < Num_teams; i++)
92  {
93  if (Multi_team_score[i] == highest)
94  num_equal++;
95  }
96 
97  // tie situation?
98  if (num_equal > 1)
99  return -1;
100 
101  return winner;
102 }
103 
104 // call to add score to a team
106 {
107  // if we're not in multiplayer mode
108  if(!(Game_mode & GM_MULTIPLAYER)){
109  return;
110  }
111 
112  // if not squad war
114  return;
115  }
116 
117  // if i'm not the server of the game, bail here
118  if(!MULTIPLAYER_MASTER){
119  return;
120  }
121 
122  // add team score
124  nprintf(("Network", "TVT : adding %d points to team %d (total == %d)\n", points, team, Multi_team_score[team]));
125 }
126 
127 // reset all players and assign them to default teams
129 {
130  int idx;
131 
132  nprintf(("Network","MULTI TEAM : resetting\n"));
133 
134  // unset everyone's captaincy and locked flags
135  for(idx=0;idx<MAX_PLAYERS;idx++){
136  if(MULTI_CONNECTED(Net_players[idx])){
137  Net_players[idx].p_info.team = 0;
139  }
140  }
141 
142  // host should divvy up the teams, send a reset notice to all players and assign captains
144  // divvy up the teams here
146  }
147 }
148 
149 // set the captaincy status of this player
151 {
152  // only the host should ever get here!
154 
155  // set the player flags as being a captain and notify everyone else of this
156  if(set){
157  nprintf(("Network","MULTI TEAM : Server setting player %s team %d captain\n",pl->m_player->callsign,pl->p_info.team));
159  } else {
160  nprintf(("Network","MULTI TEAM : Server unsetting player %s as team %d captain\n",pl->m_player->callsign,pl->p_info.team));
162  }
163 }
164 
165 // 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)
167 {
168  // if i'm the server of the game, do it now
170  nprintf(("Network","MULTI TEAM : Server/Host setting player %s to team %d and locking\n",pl->m_player->callsign,team));
171 
172  pl->p_info.team = team;
173 
176  }
177  pl->flags &= ~(NETINFO_FLAG_TEAM_CAPTAIN);
178 
179  // check to see if the resulting team rosters need a captain
181  } else {
182  nprintf(("Network","MULTI TEAM : Sending team change request to server\n"));
184  }
185 
186  // verify that we have valid team stuff
188 }
189 
190 // process a request to change a team
192 {
193  // if this player has already been locked, don't do anything
194  if((pl->flags & NETINFO_FLAG_TEAM_LOCKED) && !(who_from->flags & NETINFO_FLAG_GAME_HOST)){
195  nprintf(("Network","MULTI TEAM : Server ignoring team change request because player is locked\n"));
196  return;
197  }
198 
199  // otherwise set the team for the player and send an update
200  nprintf(("Network","MULTI TEAM : Server changing player %s to team %d from client request\n",pl->m_player->callsign,team));
201  pl->p_info.team = team;
202  pl->flags &= ~(NETINFO_FLAG_TEAM_CAPTAIN);
203 
204  // if this came from the host, lock the player down
205  if(who_from->flags & NETINFO_FLAG_GAME_HOST){
207  }
208 
209  // check to see if the resulting team rosters need a captain
211 
212  // send a team update
214 
215  // verify that we have valid team stuff
217 }
218 
219 // have the netgame host assign default teams
221 {
222  int player_count,idx;
223  int team0_count;
224 
225  // first determine how many players there are in the game
226  player_count = 0;
227  for(idx=0;idx<MAX_PLAYERS;idx++){
228  // count anyone except the standalone server (if applicable)
230  player_count++;
231  }
232  }
233 
234  // determine how many players should be stuck on team 0
235  if(player_count < 2){
236  team0_count = 1;
237  } else {
238  team0_count = player_count / 2;
239  }
240 
241  // assign the players to team 0
242  idx = 0;
243  while(team0_count > 0){
245  Net_players[idx].p_info.team = 0;
248  team0_count--;
249  }
250 
251  idx++;
252  }
253 
254  // assign the remaining players to team 1
255  while(idx < MAX_PLAYERS){
257  Net_players[idx].p_info.team = 1;
260  }
261  idx++;
262  }
263 
264  // sync captains up
266 
267  // send a full update to all players
269 
270  // verify that we have valid team stuff
272 }
273 
274 // check to see if the team this player on needs a captain and assign him if so
276 {
277  int idx;
278  int team0_cap,team1_cap;
279 
280  // if I'm not the server, bail
281  if(!MULTIPLAYER_MASTER){
282  return;
283  }
284 
285  // determine if any team now needs a captain
286  team0_cap = 0;
287  team1_cap = 0;
288  for(idx=0;idx<MAX_PLAYERS;idx++){
290  switch(Net_players[idx].p_info.team){
291  case 0 :
292  team0_cap = 1;
293  break;
294  case 1 :
295  team1_cap = 1;
296  break;
297  }
298  }
299  }
300 
301  // if team 0 needs a captain, get one
302  if(!team0_cap){
303  for(idx=0;idx<MAX_PLAYERS;idx++){
306  break;
307  }
308  }
309  }
310 
311  // if team 1 needs a captain, get one
312  if(!team1_cap){
313  for(idx=0;idx<MAX_PLAYERS;idx++){
316  break;
317  }
318  }
319  }
320 }
321 
322 // is it ok for the host to hit commit
324 {
325  int team0_captains,team1_captains;
326  int team0_count,team1_count;
327  int idx;
328 
329  // verify that we have valid team stuff
331 
332  // check to see if both teams have a captain
333  team0_captains = 0;
334  team1_captains = 0;
335 
336  for(idx=0;idx<MAX_PLAYERS;idx++){
338  // if this is team 0's captain
340  team0_captains++;
341  } else if((Net_players[idx].p_info.team == 1) && (Net_players[idx].flags & NETINFO_FLAG_TEAM_CAPTAIN)){
342  team1_captains++;
343  }
344  }
345  }
346 
347  // check to see if both teams has <= 4 players
348  multi_team_get_player_counts(&team0_count,&team1_count);
349  team0_count = ((team0_count <= 4) && (team0_count > 0)) ? 1 : 0;
350  team1_count = ((team1_count <= 4) && (team1_count > 0)) ? 1 : 0;
351 
352  return ((team0_captains == 1) && (team1_captains == 1) && team0_count && team1_count) ? 1 : 0;
353 }
354 
355 // handle a player drop
357 {
358  int idx;
359  int team0_cap, team1_cap;
360 
361  // if I'm not the server, bail
362  if(!MULTIPLAYER_MASTER){
363  return;
364  }
365 
366  // if we're not in a team vs team situation, we don't care
368  return;
369  }
370 
371  // is either team at 0 players, ingame?
372  if(Game_mode & GM_IN_MISSION){
373  int team0_count, team1_count;
374  multi_team_get_player_counts(&team0_count, &team1_count);
375  if(team0_count <= 0){
377  return;
378  }
379  if(team1_count <= 0){
381  return;
382  }
383  }
384 
385  // check to see if a team captain has left the game
386  team0_cap = 0;
387  team1_cap = 0;
388  for(idx=0;idx<MAX_PLAYERS;idx++){
390  switch(Net_players[idx].p_info.team){
391  case 0 :
392  team0_cap = 1;
393  break;
394  case 1 :
395  team1_cap = 1;
396  break;
397  }
398  }
399  }
400 
401  // if we have lost a team captain and we're not in the forming state, abort the game
402  if((!team0_cap || !team1_cap) && (Netgame.game_state != NETGAME_STATE_FORMING)){
403  // if we're in-mission, just sync up captains
404  if(Game_mode & GM_IN_MISSION){
405  // sync up captains
407 
408  // send a team update
410 
411  // find the player who is the new captain
412  int team_check = team0_cap ? 1 : 0;
413  for(idx=0; idx<MAX_PLAYERS; idx++){
414  if(MULTI_CONNECTED(Net_players[idx]) && (Net_players[idx].flags & NETINFO_FLAG_TEAM_CAPTAIN) && (Net_players[idx].p_info.team == team_check)){
416  }
417  }
418  return;
419  }
420 
421  // quit the game
423  }
424  // otherwise sync things up and be done with it.
425  else {
426  // sync up team captains
428 
429  // send a team update
431 
432  // verify that we have valid team stuff
434  }
435 }
436 
437 // handle a player join
439 {
440  int team0_count,team1_count,idx,team_select;
441 
442  // if we're not in a team vs team situation, we don't care
444  return;
445  }
446 
447  // if the joining player is joining as an observer, don't put him on a team
448  if(pl->flags & NETINFO_FLAG_OBSERVER){
449  return;
450  }
451 
452  // only the host should ever do this
455  return;
456  }
457 
458  // count the # of players on each time
459  team0_count = 0;
460  team1_count = 0;
461  for(idx=0;idx<MAX_PLAYERS;idx++){
463  // player is on team 0
464  if(Net_players[idx].p_info.team == 0){
465  team0_count++;
466  }
467  // player is on team 1
468  else if(Net_players[idx].p_info.team == 1){
469  team1_count++;
470  }
471  // some other case - should never happen
472  else {
473  Int3();
474  }
475  }
476  }
477 
478  // determine what team he should be on
479  if((team0_count == team1_count) || (team0_count < team1_count)){
480  team_select = 0;
481  } else {
482  team_select = 1;
483  }
484 
485  // place him on the team, but don't lock him yet
486  multi_team_set_team(pl,team_select);
487  pl->flags &= ~(NETINFO_FLAG_TEAM_LOCKED);
488 
489  // send a team update
491 
492  // verify that we have valid team stuff
494 }
495 
496 // set all ships in the mission to be marked as the proper team (TEAM_HOSTILE, TEAM_FRIENLY)
498 {
499  ship_obj *moveup;
500 
501  // look through all ships in the mission
502  moveup = GET_FIRST(&Ship_obj_list);
503  while(moveup!=END_OF_LIST(&Ship_obj_list)){
505 
506  moveup = GET_NEXT(moveup);
507  }
508 
509  // verify that we have valid team stuff
511 }
512 
513 // set the proper team for the passed in ship
515 {
516  int i;
517 
518  // look through TVT wings... each wing corresponds to a team
519  for (i = 0; i < MAX_TVT_WINGS; i++)
520  {
521  if (sp->wingnum == TVT_wings[i])
522  sp->team = i;
523  }
524 
525  // verify that we have valid team stuff
527 }
528 
529 // host locks all players into their teams
531 {
532  int idx;
533 
534  // lock all players down
535  for(idx=0;idx<MAX_PLAYERS;idx++){
538  }
539  }
540 
541  // verify that we have valid team stuff
543 }
544 
545 // get the player counts for team 0 and team 1 (NULL values are valid)
546 void multi_team_get_player_counts(int *team0, int *team1)
547 {
548  int idx;
549 
550  // initialize the values
551  if(team0 != NULL){
552  (*team0) = 0;
553  }
554  if(team1 != NULL){
555  (*team1) = 0;
556  }
557 
558  // check all players
559  for(idx=0;idx<MAX_PLAYERS;idx++){
561  if((Net_players[idx].p_info.team == 0) && (team0 != NULL)){
562  (*team0)++;
563  } else if((Net_players[idx].p_info.team == 1) && (team1 != NULL)){
564  (*team1)++;
565  }
566  }
567  }
568 }
569 
570 // report on the winner/loser of the game via chat text
571 #define SEND_AND_DISPLAY(mesg) do { send_game_chat_packet(Net_player, mesg, MULTI_MSG_ALL, NULL, NULL, 1); multi_display_chat_msg(mesg, 0, 0); } while(0);
573 {
574  int i;
575  char report[400] = "";
576 
577  // a little header
578  SEND_AND_DISPLAY("----****");
579 
580  // display scores
581  for (i = 0; i < Num_teams && i < MAX_TVT_TEAMS; i++)
582  {
583  // Retail FS2 teams (i.e red or green)
584  if (i < 2)
585  {
586  sprintf(report, XSTR("<Team %d had %d points>", (1275+i)), Multi_team_score[i]);
587  }
588  // Karajorma - If the SCP has added more teams we won't have a XSTR to handle it. So just output in english for now
589  else
590  {
591  sprintf(report, "Team %d had %d points>", (i+1), Multi_team_score[i]);
592  }
593 
594  SEND_AND_DISPLAY(report);
595  }
596 
597  // display winner
598  switch(multi_team_winner())
599  {
600  case -1:
601  SEND_AND_DISPLAY(XSTR("<Match was a tie>", 1277));
602  break;
603 
604  case 0:
605  SEND_AND_DISPLAY(XSTR("<Team 1 (green) is the winner>", 1278));
606  break;
607 
608  case 1:
609  SEND_AND_DISPLAY(XSTR("<Team 2 (red) is the winner>", 1279));
610  break;
611 
612  default:
613  // need to come up with a new message here
614  Int3();
615  break;
616  }
617 
618  // a little header
619  SEND_AND_DISPLAY("----****");
620 }
621 
622 
623 // ------------------------------------------------------------------------------------
624 // MULTIPLAYER TEAMPLAY PACKET HANDLERS
625 //
626 
627 // process an incoming team update packet
628 void multi_team_process_packet(unsigned char *data, header *hinfo)
629 {
630  ubyte code;
631  int player_index;
632  int offset = HEADER_LENGTH;
633 
634  // find out who is sending this data
635  player_index = find_player_id(hinfo->id);
636 
637  // get the packet opcode
638  GET_DATA(code);
639 
640  // take action absed upon the opcode
641  switch((int)code){
642  // a request to set the team for a player
645  int req_index,req_team;
646 
648 
649  // get the packet data
650  GET_USHORT(player_id);
651  GET_INT(req_team);
652 
653  // if i'm the host of the game, process here
654  req_index = find_player_id(player_id);
655  if( (req_index == -1) || (player_index == -1) ){
656  nprintf(("Network","Could not find player to process team change request !\n"));
657  } else {
658  multi_team_process_team_change_request(&Net_players[req_index],&Net_players[player_index],req_team);
659  }
660  break;
661 
662  // a full team update
663  case MT_CODE_TEAM_UPDATE:
664  offset += multi_team_process_team_update(data+offset);
665  break;
666  }
667 
668  PACKET_SET_SIZE();
669 
670  // verify that we have valid team stuff
672 }
673 
674 // send a packet to the host requesting to change my team
676 {
678  int packet_size = 0;
679 
680  // build the header and add the opcode
682  code = MT_CODE_TEAM_REQUEST;
683  ADD_DATA(code);
684 
685  // add the address of the guy we want to change
686  ADD_SHORT(pl->player_id);
687 
688  // add the team I want to be on
689  ADD_INT(team);
690 
691  // send to the server of the game (will be routed to host if in a standalone situation)
692  multi_io_send_reliable(Net_player, data, packet_size);
693 }
694 
695 // send a full update on a player-per-player basis (should call this to update all players after other relevant function calls)
697 {
699  int idx;
700  int packet_size = 0;
701 
702  // if I'm not the server, bail
703  if(!MULTIPLAYER_MASTER){
704  return;
705  }
706 
707  // first, verify that we have valid settings
709 
710  // build the header and add the opcode
712  val = MT_CODE_TEAM_UPDATE;
713  ADD_DATA(val);
714 
715  // add the info for all players;
716  for(idx=0;idx<MAX_PLAYERS;idx++){
718  // add a stop byte
719  stop = 0x0;
720  ADD_DATA(stop);
721 
722  // add this guy's id
724 
725  // pack all his data into a byte
726  val = 0x0;
727 
728  // set bit 0 if he's on team 1
729  if(Net_players[idx].p_info.team == 1){
730  val |= (1<<0);
731  }
732 
733  // set bit 1 if he's a team captain
735  val |= (1<<1);
736  }
737  ADD_DATA(val);
738  }
739  }
740 
741  // add the final stop byte
742  stop = 0xff;
743  ADD_DATA(stop);
744 
745  // if i'm the server, I should broadcast to this to all players, otherwise I should send it to the standalone
747  multi_io_send_to_all_reliable(data, packet_size);
748  } else {
749  multi_io_send_reliable(Net_player, data, packet_size);
750  }
751 }
752 
753 // process a team update packet, return bytes processed
755 {
756  ubyte stop,flags;
757  short player_id;
758  int player_index;
759  int offset = 0;
760 
761  // if I'm the server, bail
763 
764  // process all players
765  GET_DATA(stop);
766  while(stop != 0xff){
767  // get the net address and flags for the guy
768  GET_SHORT(player_id);
769  GET_DATA(flags);
770 
771  // do a player lookup
772  if(!MULTIPLAYER_MASTER){
773  player_index = find_player_id(player_id);
774  if(player_index != -1){
775  // set his team correctly
776  if(flags & (1<<0)){
777  Net_players[player_index].p_info.team = 1;
778  } else {
779  Net_players[player_index].p_info.team = 0;
780  }
781 
782  // set his captaincy flag correctly
783  Net_players[player_index].flags &= ~(NETINFO_FLAG_TEAM_CAPTAIN);
784  if(flags & (1<<1)){
786  }
787  }
788  }
789 
790  // get the next stop byte
791  GET_DATA(stop);
792  }
793 
794  // verify that we have valid team stuff
796 
797  // return bytes processed
798  return offset;
799 }
800 
801 // verify that we have valid team stuff
803 {
804 #ifndef NDEBUG
805  int team0_count,team0_cap;
806  int team1_count,team1_cap;
807  int idx;
808 
809  // determine how many players we have on team 0 and if they have a captain
810  team0_count = 0;
811  team0_cap = 0;
812  for(idx=0;idx<MAX_PLAYERS;idx++){
814  // if he's on team 0
815  if(Net_players[idx].p_info.team == 0){
816  team0_count++;
817 
818  // if he's a captain
820  team0_cap++;
821  }
822  }
823  }
824  }
825  // if the team has members
826  if(team0_count > 0){
827  // make sure it also has a captain
828  Assert(team0_cap > 0);
829 
830  // make sure it only has 1 captain
831  Assert(team0_cap == 1);
832  }
833 
834  // determine how many players we have on team 1 and if they have a captain
835  team1_count = 0;
836  team1_cap = 0;
837  for(idx=0;idx<MAX_PLAYERS;idx++){
839  // if he's on team 1
840  if(Net_players[idx].p_info.team == 1){
841  team1_count++;
842 
843  // if he's a captain
845  team1_cap++;
846  }
847  }
848  }
849  }
850  // if the team has members
851  if(team1_count > 0){
852  // make sure it also has a captain
853  Assert(team1_cap > 0);
854 
855  // make sure it only has 1 captain
856  Assert(team1_cap == 1);
857  }
858 #endif
859 }
int i
Definition: multi_pxo.cpp:466
void multi_team_report()
Definition: multi_team.cpp:572
int multi_team_process_team_update(ubyte *data)
Definition: multi_team.cpp:754
#define GET_DATA(d)
Definition: multimsgs.h:47
int team
Definition: ship.h:606
int Game_mode
Definition: systemvars.cpp:24
void multi_team_level_init()
Definition: multi_team.cpp:68
net_player * Net_player
Definition: multi.cpp:94
#define MULTI_END_ERROR_TEAM1_EMPTY
Definition: multi_endgame.h:55
#define PACKET_SET_SIZE()
Definition: multimsgs.h:57
player * m_player
Definition: multi.h:459
GLsizei const GLfloat * points
Definition: Glext.h:7583
#define ADD_DATA(d)
Definition: multimsgs.h:37
void multi_team_handle_drop()
Definition: multi_team.cpp:356
#define MULTI_STANDALONE(np)
Definition: multi.h:139
void multi_team_host_assign_default_teams()
Definition: multi_team.cpp:220
Assert(pm!=NULL)
#define NETINFO_FLAG_OBSERVER
Definition: multi.h:605
void multi_io_send_to_all_reliable(ubyte *data, int length, net_player *ignore)
Definition: multimsgs.cpp:496
CButton * team
void multi_io_send_reliable(net_player *pl, ubyte *data, int len)
Definition: multimsgs.cpp:459
int find_player_id(short player_id)
Definition: multiutil.cpp:465
void multi_team_verify()
Definition: multi_team.cpp:802
void multi_team_maybe_add_score(int points, int team)
Definition: multi_team.cpp:105
int flags
Definition: multi.h:463
#define Int3()
Definition: pstypes.h:292
#define NETINFO_FLAG_TEAM_LOCKED
Definition: multi.h:611
void multi_team_host_lock_all()
Definition: multi_team.cpp:530
int packet_size
Definition: multi_sexp.cpp:41
#define MAX_TVT_WINGS
Definition: globals.h:59
char callsign[CALLSIGN_LEN+1]
Definition: player.h:91
int game_state
Definition: multi.h:498
#define MT_CODE_TEAM_REQUEST
Definition: multi_team.cpp:36
#define ADD_INT(d)
Definition: multimsgs.h:40
HWND DWORD code
Definition: vddraw.h:425
int objnum
Definition: ship.h:1483
#define MAX_PACKET_SIZE
Definition: psnet2.h:34
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
int instance
Definition: object.h:150
GLintptr offset
Definition: Glext.h:5497
net_player_info p_info
Definition: multi.h:473
int type_flags
Definition: multi.h:493
#define NETINFO_FLAG_AM_MASTER
Definition: multi.h:599
#define MULTI_END_ERROR_CAPTAIN_LEFT
Definition: multi_endgame.h:56
#define nprintf(args)
Definition: pstypes.h:239
#define GM_MULTIPLAYER
Definition: systemvars.h:18
#define BUILD_HEADER(t)
Definition: multimsgs.h:36
#define MT_CODE_TEAM_UPDATE
Definition: multi_team.cpp:35
int wingnum
Definition: ship.h:623
netgame_info Netgame
Definition: multi.cpp:97
void multi_team_reset()
Definition: multi_team.cpp:128
void multi_team_send_update()
Definition: multi_team.cpp:696
void multi_team_get_player_counts(int *team0, int *team1)
Definition: multi_team.cpp:546
void multi_team_mark_ship(ship *sp)
Definition: multi_team.cpp:514
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
#define NG_TYPE_TEAM
Definition: multi.h:650
void multi_team_process_team_change_request(net_player *pl, net_player *who_from, int team)
Definition: multi_team.cpp:191
int Num_teams
float scoring_get_scale_factor()
Definition: scoring.cpp:1447
#define NETINFO_FLAG_TEAM_CAPTAIN
Definition: multi.h:612
#define MAX_PLAYERS
Definition: pstypes.h:32
short player_id
Definition: multi.h:460
#define ADD_SHORT(d)
Definition: multimsgs.h:38
#define NETINFO_FLAG_GAME_HOST
Definition: multi.h:603
Definition: ship.h:534
void multi_team_process_packet(unsigned char *data, header *hinfo)
Definition: multi_team.cpp:628
int idx
Definition: multiui.cpp:761
object Objects[MAX_OBJECTS]
Definition: object.cpp:62
unsigned char ubyte
Definition: pstypes.h:62
const char * XSTR(const char *str, int index)
Definition: localize.cpp:851
#define GM_IN_MISSION
Definition: systemvars.h:23
int TVT_wings[MAX_TVT_WINGS]
Definition: ship.cpp:136
void multi_team_handle_join(net_player *pl)
Definition: multi_team.cpp:438
#define MULTI_END_NOTIFY_NONE
Definition: multi_endgame.h:32
GLbitfield flags
Definition: Glext.h:6722
#define PROMPT_NONE
Definition: multi_endgame.h:26
GLuint GLfloat * val
Definition: Glext.h:6741
int multi_quit_game(int prompt, int notify_code, int err_code, int wsa_error)
ship Ships[MAX_SHIPS]
Definition: ship.cpp:122
#define MULTI_PERM_OBSERVER(np)
Definition: multi.h:142
void send_host_captain_change_packet(short player_id, int captain_change)
Definition: multimsgs.cpp:8566
void multi_team_sync_captains()
Definition: multi_team.cpp:275
#define MULTI_CONNECTED(np)
Definition: multi.h:136
#define GET_USHORT(d)
Definition: multimsgs.h:49
int multi_team_winner()
Definition: multi_team.cpp:76
Definition: multi.h:385
unsigned short ushort
Definition: pstypes.h:63
ship_obj Ship_obj_list
Definition: ship.cpp:162
int HEADER_LENGTH
Definition: multi.cpp:106
#define MULTIPLAYER_MASTER
Definition: multi.h:130
GLenum GLsizei GLenum GLenum const GLvoid * data
Definition: Gl.h:1509
short id
Definition: multi.h:390
void multi_team_send_team_request(net_player *pl, int team)
Definition: multi_team.cpp:675
#define MAX_TVT_TEAMS
Definition: globals.h:57
#define SEND_AND_DISPLAY(mesg)
Definition: multi_team.cpp:571
int multi_team_ok_to_commit()
Definition: multi_team.cpp:323
#define GET_SHORT(d)
Definition: multimsgs.h:48
void multi_team_set_captain(net_player *pl, int set)
Definition: multi_team.cpp:150
#define GET_INT(d)
Definition: multimsgs.h:50
int Multi_team_score[MAX_TVT_TEAMS]
Definition: multi_team.cpp:41
#define MULTI_END_ERROR_TEAM0_EMPTY
Definition: multi_endgame.h:54
#define NETGAME_STATE_FORMING
Definition: multi.h:664
void multi_team_set_team(net_player *pl, int team)
Definition: multi_team.cpp:166
void multi_team_mark_all_ships()
Definition: multi_team.cpp:497
net_player Net_players[MAX_PLAYERS]
Definition: multi.cpp:93
#define TEAM_UPDATE
Definition: multi.h:189