41 #define RESPAWN_BROADCAST 0x1 // server to clients - create this ship, and if you're the respawner, set it to be your object
42 #define RESPAWN_REQUEST 0x2 // client to server requesting a respawn (observer or normal)
43 #define AI_RESPAWN_NOTICE 0x3 // respawn an AI ship
46 #define MAX_AI_RESPAWNS MAX_PLAYERS
47 #define AI_RESPAWN_TIME (7000) // should respawn 2.0 seconds after they die
65 #define MAX_MULTI_RESPAWN_POINTS MAX_PLAYERS
71 #define MAX_PRIORITY_POINTS 10
125 if(player_index != -1){
150 if ( Ai_respawns[i].pobjp == NULL ) {
151 Ai_respawns[
i].
pobjp = pobjp;
156 Assert( i < MAX_AI_RESPAWNS );
208 if ( Ai_respawns[i].pobjp == NULL ) {
209 Ai_respawns[
i].
pobjp = pobjp;
326 int objnum,
team, slot_index;
340 Assert( slot_index != -1 );
353 if (team != -1 && slot_index != -1) {
428 if(cur_link_status & (1<<0)){
433 if(cur_link_status & (1<<1)){
477 memset(&Multi_ship_status_bi, 0,
sizeof(
button_info));
580 val = (
ubyte)as_observer;
625 char cur_primary_bank,cur_secondary_bank;
630 char parse_name[1024] =
"";
635 if(player_index == -1){
636 nprintf((
"Network",
"Couldn't find player for processing respawn packet!\n"));
665 if(player_index == -1){
666 nprintf((
"Network",
"Couldn't find player to respawn!\n"));
684 if(player_index == -1){
685 nprintf((
"Network",
"Received respawn request from unknown player!\n"));
688 nprintf((
"Network",
"Received respawn request for player %s\n",
Net_players[player_index].m_player->callsign));
692 nprintf((
"Network",
"This player shouldn't be respawning!\n"));
696 nprintf((
"Network",
"This is a respawn observer request from a player who shouldn't be respawning as an observer!\n"));
710 if(
Net_players[player_index].p_info.p_objp != NULL){
738 Ai_respawns[
i].
pobjp = NULL;
749 if ( Ai_respawns[i].pobjp != NULL ) {
758 Ai_respawns[
i].
pobjp = NULL;
778 object *pri_obj = NULL;
790 pri = &
Ships[lookup];
797 if((pri != NULL) && (pri_obj != NULL)){
845 while(!lookup && (count < 13)){
880 #define WITHIN_BBOX() do { \
882 float scale = 2.0f; \
884 vec3d temp = new_obj->pos; \
886 vm_vec_sub2(&temp, &hit_check->pos); \
887 vm_vec_rotate(&gpos, &temp, &hit_check->orient); \
888 if((gpos.xyz.x >= pm->mins.xyz.x * scale) && (gpos.xyz.y >= pm->mins.xyz.y * scale) && (gpos.xyz.z >= pm->mins.xyz.z * scale) && (gpos.xyz.x <= pm->maxs.xyz.x * scale) && (gpos.xyz.y <= pm->maxs.xyz.y * scale) && (gpos.xyz.z <= pm->maxs.xyz.z * scale)) { \
894 #define MOVE_AWAY_BBOX() do { \
896 switch((int)frand_range(0.0f, 3.9f)){ \
898 new_obj->pos.xyz.x += 200.0f; \
901 new_obj->pos.xyz.x -= 200.0f; \
904 new_obj->pos.xyz.y += 200.0f; \
907 new_obj->pos.xyz.y -= 200.0f; \
910 new_obj->pos.xyz.z -= 200.0f; \
944 new_obj->
pos.
xyz.x += 1.0f;
int timestamp(int delta_ms)
#define PLAYER_FLAGS_MATCH_TARGET
void obj_set_flags(object *obj, uint new_flags)
char wing_status_wing_pos
char ship_name[NAME_LENGTH+1]
struct respawn_point respawn_point
void multi_respawn_build_points()
np_update np_updates[MAX_PLAYERS]
void vm_vec_scale_add(vec3d *dest, const vec3d *src1, const vec3d *src2, float k)
float frand_range(float min, float max)
Return a floating point number in the range min..max.
polymodel * model_get(int model_num)
#define PACKET_SET_SIZE()
char wing_status_wing_index
void multi_respawn_make_observer(net_player *pl)
void multi_respawn_player_leave(net_player *pl)
void multi_respawn_server()
void prevent_spawning_collision(object *new_obj)
void multi_respawn_send_request(int as_observer)
int next_secondary_fire_stamp[MAX_SHIP_SECONDARY_BANKS]
void multi_ts_get_team_and_slot(char *ship_name, int *team_index, int *slot_index, bool mantis2757switch)
#define NETINFO_FLAG_OBSERVER
void multi_io_send_to_all_reliable(ubyte *data, int length, net_player *ignore)
int weapon_recharge_index
void multi_respawn_normal()
struct vec3d::@225::@227 xyz
void wl_bash_ship_weapons(ship_weapon *swp, wss_unit *slot)
void multi_io_send_reliable(net_player *pl, ubyte *data, int len)
int find_player_id(short player_id)
#define SHIP_INDEX(shipp)
ai_info Ai_info[MAX_AI_INFO]
#define END_OF_LIST(head)
respawn_point Multi_respawn_priority_ships[MAX_PRIORITY_POINTS]
#define NETINFO_FLAG_OBS_PLAYER
void multi_respawn_handle_invul_players()
int current_secondary_bank
void multi_respawn_send_ai_respawn(ushort net_signature)
#define AI_RESPAWN_NOTICE
#define RESPAWN_BROADCAST
respawn_point Multi_respawn_points[MAX_MULTI_RESPAWN_POINTS]
int Multi_next_respawn_point
#define PLAYER_FLAGS_AUTO_MATCH_SPEED
#define CLAMP(x, min, max)
void HUD_init_fixed_text()
void multi_ping_reset(ping_struct *ps)
typedef int(SCP_EXT_CALLCONV *SCPDLL_PFVERSION)(SCPDLL_Version *)
void multi_respawn_place(object *new_obj, int team)
p_object * mission_parse_get_arrival_ship(const char *name)
Returns the parse object on the ship arrival list associated with the given name. ...
GLdouble GLdouble GLdouble r
struct matrix::@228::@230 vec
#define NETINFO_FLAG_AM_MASTER
int Multi_respawn_priority_count
void multi_respawn_ai(p_object *pobjp)
void multi_respawn_init()
void multi_team_mark_ship(ship *sp)
void multi_respawn_check_ai()
#define MULTI_OBSERVER(np)
int engine_recharge_index
#define SF_PRIMARY_LINKED
net_player_server_info s_info
#define RESPAWN_INVUL_TIMESTAMP
#define OF_COULD_BE_PLAYER
void multi_respawn_check(object *objp)
int Multi_respawn_point_count
button_info Multi_ship_status_bi
object Objects[MAX_OBJECTS]
void hud_config_as_observer(ship *shipp, ai_info *aif)
#define NETINFO_FLAG_LIMBO
#define P_OF_PLAYER_START
float forward_cruise_percent
typedef float(SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID)()
void obj_delete(int objnum)
int vm_vec_same(const vec3d *v1, const vec3d *v2)
#define SF_SECONDARY_DUAL_FIRE
#define MAX_MULTI_RESPAWN_POINTS
void multi_respawn_as_observer()
#define MULTI_CONNECTED(np)
fix last_full_update_time
fix timer_get_fixed_seconds()
ai_respawn Ai_respawns[MAX_AI_RESPAWNS]
#define NETINFO_FLAG_RESPAWNING
void hud_set_wingman_status_alive(int wing_index, int wing_pos)
#define MULTIPLAYER_MASTER
void multi_respawn_player(net_player *pl, char cur_primary_bank, char cur_secondary_bank, ubyte cur_link_status, ushort ship_ets, ushort net_sign, char *parse_name, vec3d *pos=NULL)
SCP_vector< ship_info > Ship_info
GLenum GLsizei GLenum GLenum const GLvoid * data
struct ai_respawn ai_respawn
#define timestamp_elapsed(stamp)
#define OF_SHOULD_BE_DEAD
wss_unit Wss_slots_teams[MAX_TVT_TEAMS][MAX_WSS_SLOTS]
void change_ship_type(int n, int ship_type, int by_sexp)
void multi_respawn_observer()
void multi_respawn_broadcast(net_player *player)
int ship_index[MAX_SHIPS_PER_WING]
void multi_respawn_wing_stuff(ship *shipp)
#define MAX_PRIORITY_POINTS
int ship_name_lookup(const char *name, int inc_players)
void multi_respawn_process_packet(ubyte *data, header *hinfo)
int multi_find_player_by_object(object *objp)
int parse_create_object(p_object *pobjp)
net_player Net_players[MAX_PLAYERS]
void gameseq_post_event(int event)
int shield_recharge_index
char ship_name[NAME_LENGTH]
int multi_respawn_common_stuff(p_object *pobjp)
void multi_obs_create_observer(net_player *pl)