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
78 int i, num_equal = 0, winner=-1, highest = -1;
124 nprintf((
"Network",
"TVT : adding %d points to team %d (total == %d)\n", points, team,
Multi_team_score[team]));
132 nprintf((
"Network",
"MULTI TEAM : resetting\n"));
170 nprintf((
"Network",
"MULTI TEAM : Server/Host setting player %s to team %d and locking\n",pl->
m_player->
callsign,team));
182 nprintf((
"Network",
"MULTI TEAM : Sending team change request to server\n"));
195 nprintf((
"Network",
"MULTI TEAM : Server ignoring team change request because player is locked\n"));
200 nprintf((
"Network",
"MULTI TEAM : Server changing player %s to team %d from client request\n",pl->
m_player->
callsign,team));
222 int player_count,
idx;
235 if(player_count < 2){
238 team0_count = player_count / 2;
243 while(team0_count > 0){
255 while(idx < MAX_PLAYERS){
278 int team0_cap,team1_cap;
325 int team0_captains,team1_captains;
326 int 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;
352 return ((team0_captains == 1) && (team1_captains == 1) && team0_count && team1_count) ? 1 : 0;
359 int team0_cap, team1_cap;
373 int team0_count, team1_count;
375 if(team0_count <= 0){
379 if(team1_count <= 0){
412 int team_check = team0_cap ? 1 : 0;
440 int team0_count,team1_count,
idx,team_select;
479 if((team0_count == team1_count) || (team0_count < team1_count)){
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);
575 char report[400] =
"";
645 int req_index,req_team;
655 if( (req_index == -1) || (player_index == -1) ){
656 nprintf((
"Network",
"Could not find player to process team change request !\n"));
774 if(player_index != -1){
805 int team0_count,team0_cap;
806 int team1_count,team1_cap;
int multi_team_process_team_update(ubyte *data)
void multi_team_level_init()
#define MULTI_END_ERROR_TEAM1_EMPTY
#define PACKET_SET_SIZE()
GLsizei const GLfloat * points
void multi_team_handle_drop()
#define MULTI_STANDALONE(np)
void multi_team_host_assign_default_teams()
#define NETINFO_FLAG_OBSERVER
void multi_io_send_to_all_reliable(ubyte *data, int length, net_player *ignore)
void multi_io_send_reliable(net_player *pl, ubyte *data, int len)
int find_player_id(short player_id)
void multi_team_maybe_add_score(int points, int team)
#define END_OF_LIST(head)
#define NETINFO_FLAG_TEAM_LOCKED
void multi_team_host_lock_all()
char callsign[CALLSIGN_LEN+1]
#define MT_CODE_TEAM_REQUEST
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
#define NETINFO_FLAG_AM_MASTER
#define MULTI_END_ERROR_CAPTAIN_LEFT
#define MT_CODE_TEAM_UPDATE
void multi_team_send_update()
void multi_team_get_player_counts(int *team0, int *team1)
void multi_team_mark_ship(ship *sp)
sprintf(buf,"(%f,%f,%f)", v3->xyz.x, v3->xyz.y, v3->xyz.z)
void multi_team_process_team_change_request(net_player *pl, net_player *who_from, int team)
float scoring_get_scale_factor()
#define NETINFO_FLAG_TEAM_CAPTAIN
#define NETINFO_FLAG_GAME_HOST
void multi_team_process_packet(unsigned char *data, header *hinfo)
object Objects[MAX_OBJECTS]
const char * XSTR(const char *str, int index)
int TVT_wings[MAX_TVT_WINGS]
void multi_team_handle_join(net_player *pl)
#define MULTI_END_NOTIFY_NONE
int multi_quit_game(int prompt, int notify_code, int err_code, int wsa_error)
#define MULTI_PERM_OBSERVER(np)
void send_host_captain_change_packet(short player_id, int captain_change)
void multi_team_sync_captains()
#define MULTI_CONNECTED(np)
#define MULTIPLAYER_MASTER
GLenum GLsizei GLenum GLenum const GLvoid * data
void multi_team_send_team_request(net_player *pl, int team)
#define SEND_AND_DISPLAY(mesg)
int multi_team_ok_to_commit()
void multi_team_set_captain(net_player *pl, int set)
int Multi_team_score[MAX_TVT_TEAMS]
#define MULTI_END_ERROR_TEAM0_EMPTY
#define NETGAME_STATE_FORMING
void multi_team_set_team(net_player *pl, int team)
void multi_team_mark_all_ships()
net_player Net_players[MAX_PLAYERS]