Files
JohnAFernandez 186fe51344 Object update packet upgrade (#2752)
* Object Update Refactor

    1. Keeps the object update packet aligned, even if the ship is dying or has not yet arrived on the client.
    2. Properly handles model point shields (yes, that's what was causing multi to crash the most!)
    3. Reworks positional interpolation timing and adds rotational interpolation, by sending timing information with every object update packet in a header shared between objects.
    4. Saves a lot of bandwidth by only sending data that is changing. (no more sending all subsystems once per second!)
    5. Better handles out of order packets (but can still use their information if recent enough!)
    6. Builds the basis for Rollback by beginning to record the positions and orientations and velocities of ships for the last 30 frames.
    7. Adds subsystem rotation -- Yeah, you saw that right, subsystems will now spin in multi.
    8. Waypoint movement is now enabled via sexp, and time to arrival of waypoints is updated on the target info gauge.

* Fix edge case crash and Incorporate feedback

* Clean Up Interpolate Angles Quick

* Restrain the client

* How was this still here???

* Make sure every part of OO uses OOC_INDEX_NULLPTR_SUBSYSTEM define

* Fix Way to Store Return Values

* Ok travis, we get it

* Ok travis.........
2020-10-08 15:29:06 -04:00

60 lines
1.7 KiB
C++

/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#include "hud/hudconfig.h"
#include "hud/hudobserver.h"
#include "hud/hudtargetbox.h"
#include "network/multi.h"
#include "ship/ship.h"
// use these to redirect Player_ship and Player_ai when switching into ai mode
ship Hud_obs_ship;
ai_info Hud_obs_ai;
/**
* Initialize observer hud stuff
*/
void hud_observer_init(ship *shipp, ai_info *aip)
{
// setup the pseduo ship and ai
Hud_obs_ai = *aip;
// (we used to do a memcpy here, but that doesn't work any longer, so let's just assign the values we need)
Hud_obs_ship.clear();
strcpy_s(Hud_obs_ship.ship_name, shipp->ship_name);
Hud_obs_ship.display_name = shipp->display_name;
Hud_obs_ship.team = shipp->team;
Hud_obs_ship.ai_index = shipp->ai_index;
Hud_obs_ship.flags = shipp->flags;
Hud_obs_ship.ship_info_index = shipp->ship_info_index;
Hud_obs_ship.objnum = shipp->objnum;
Hud_obs_ship.wingnum = shipp->wingnum;
Hud_obs_ship.alt_type_index = shipp->alt_type_index;
Hud_obs_ship.callsign_index = shipp->callsign_index;
Hud_obs_ship.ship_max_hull_strength = shipp->ship_max_hull_strength;
Hud_obs_ship.ship_max_shield_strength = shipp->ship_max_shield_strength;
Hud_obs_ship.weapons = shipp->weapons;
HUD_config.is_observer = 1;
HUD_config.show_flags = HUD_observer_default_flags;
HUD_config.show_flags2 = HUD_observer_default_flags2;
HUD_config.popup_flags = 0x0;
HUD_config.popup_flags2 = 0x0;
// shutdown any playing static animations
hud_init_target_static();
}
void hud_obs_render_player(int /*loc*/,net_player * /*pl*/)
{
}