37 #include "packets/Missile.h"
52 m_shipMaxAccelTime(0.0f),
63 m_timeToEnterWarp(10.0f),
64 m_shipWarpSpeed(1.0f),
65 m_maxShipSpeed(100.0f),
71 m_targBubble(nullptr),
72 m_warpCapacitorNeed(0.00001f),
135 if (
sConfig.debug.UseProfiling)
198 _log(DESTINY__ERROR,
"Destiny::ProcessState() Error! Ship %s(%u) for Player %s(%u) Has WarpState but checks are false.", \
200 mySE->
GetPilot()->
SendErrorMsg(
"Internal Server Error. Ref: ServerError 35928. Please Dock or Relog to reset your ship.");
202 _log(DESTINY__ERROR,
"Destiny::ProcessState() Error! NPC %s(%u) Has WarpState but checks are false.", \
225 _log(DESTINY__ERROR,
"Destiny::ProcessState() Error! Ship %s(%u) for Player %s(%u) - warp align/speed is incorrect, but time > shipTimeToWarp.", \
228 _log(DESTINY__ERROR,
"Destiny::ProcessState() Error! NPC %s(%u) - warp align/speed is incorrect, but time > shipTimeToWarp.", \
265 _log(DESTINY__MOVE_TRACE,
"Destiny::SetSpeedFraction() - %s(%u): fraction: %.2f, start: %i, stop: %i, prevSpeed:%.2f, accel: %s, decel: %s",
320 bool isMoving =
false;
331 std::vector<PyTuple*> updates;
334 CmdSetSpeedFraction du;
336 du.fraction = fraction;
337 updates.push_back(du.Encode());
344 updates.push_back(ms.Encode());
348 if (!updates.empty())
444 _log(DESTINY__MOVE_TRACE,
"Destiny::UpdateVelocity - %s(%u): Speed Change - USF: %.2f, ASF: %.2f, CSF: %.2f, PSF: %.2f, pSpeed: %.2f, mSpeed: %.2f, accel: %s, decel: %s", \
472 std::string msg =
"";
474 case 1: { msg =
"state == warp. --Begin Decel"; }
break;
475 case 2: { msg =
"USF != 0 and ship isMoving. --Different Heading or Speed"; }
break;
476 case 3: { msg =
"USF != 0 and ship isMoving. --Decel for Turn"; }
break;
477 case 4: { msg =
"USF != 0 and ship isMoving. --Accel after Turn"; }
break;
478 case 5: { msg =
"USF != 0 and ship stopped. --Begin Accel"; }
break;
479 case 6: { msg =
"USF == 0 and ship isMoving. --Stop"; }
break;
480 case 7: { msg =
"USF == 0 and ship stopped. --Halt"; }
break;
482 _log(DESTINY__ERROR,
"Destiny::UpdateVelocity Error! Ship %s(%u) Has No WarpState or Speed Fraction.",
489 _log(DESTINY__MOVE_TRACE,
"Destiny::UpdateVelocity - %s(%u): %s AccelTime: %.2f, USF: %.2f, ASF: %.2f, CSF: %.2f, PSF: %.2f", \
575 _log(DESTINY__MOVE_TRACE,
"Destiny::Halt() - %s(%u): m_shipHeading: %.3f,%.3f,%.3f", \
603 std::vector<Client*> vPlayers;
607 float distance = 0.0f;
608 for (
auto cur : vPlayers) {
611 distance = pos.
distance(cur->GetShipSE()->GetPosition());
612 distance -= (
mySE->
GetRadius() - cur->GetShipSE()->GetRadius());
614 Bump(cur->GetShipSE());
625 if (
sConfig.debug.UseProfiling)
652 std::string msg1 =
"You have bumped ";
658 std::string msg2 =
"You have been bumped by ";
680 std::vector<PyTuple*> updates;
686 updates.push_back(bv.Encode());
692 updates.push_back(du.Encode());
704 _log(DESTINY__MOVE_TRACE,
"Destiny::MoveObject() - %s(%u): stateStamp (%u) > GetStamp (%u).", \
712 _log(DESTINY__MOVE_TRACE,
"Destiny::MoveObject() - ChangeDelay - %s(%u): stateStamp: %u", \
763 std::string move =
"";
773 _log(DESTINY__MOVE_TRACE,
"Destiny::MoveObject() - %s(%u) has decel'd from %.2fm/s to %.2fm/s of max %.2f in %.3fs.", \
783 move =
"at constant speed, going";
790 _log(DESTINY__MOVE_TRACE,
"Destiny::MoveObject() - %s(%u) is at full stop after %.3f seconds.", \
800 move =
"accelerating";
814 _log(DESTINY__ERROR,
"Destiny::MoveObject() - %s(%u) - move checks are not set right. Acc:%s, Dec:%s, Turn:%s, Tic:%u, Tractored:%s, TractorPause:%s", \
838 move =
"decelerating for turn";
841 move =
"decelerating";
875 _log(DESTINY__MOVE_TRACE,
"Destiny::MoveObject() - %s(%u) is %s at %.4f m/s (csf:%.4f asf:%.4f pSpeed:%.2f(%.3f), sec: %.3f).", \
879 _log(DESTINY__MOVE_TRACE,
"Destiny::MoveObject() - %s(%u) is %s at %.4f m/s (csf:%.4f asf:%.4f sec: %.3f).", \
888 _log(DESTINY__MOVE_DEBUG,
"Destiny::MoveObject() - %s(%u) Pos:%.2f,%.2f,%.2f Vel:%.3f,%.3f,%.3f Head:%.3f,%.3f,%.3f", \
892 if (
sConfig.cosmic.BumpEnabled)
900 str +=
itoa(timeStamp);
903 if (iRef.get() !=
nullptr) {
937 if ((dot > 1.0f) or (dot < -1.0f)) {
938 sLog.Error(
"Destiny::IsTurn()",
"%s(%u) - shipHeading has screwed up. dot is %.5f",
mySE->
GetName(),
mySE->
GetID(), dot);
939 _log(DESTINY__ERROR,
"Destiny::IsTurn() m_shipHeading: %.3f,%.3f,%.3f. m_targetHeading: %.3f,%.3f,%.3f, toVec:%.3f,%.3f,%.3f", \
949 if ((dot > 1.0f) or (dot < -1.0f)) {
950 sLog.Error(
"Destiny::IsTurn()",
"%s(%u) - shipHeading has screwed up AGAIN. dot is %.5f",
mySE->
GetName(),
mySE->
GetID(), dot);
961 _log(DESTINY__TURN_TRACE,
"Destiny::IsTurn() - %s(%u): dot: %.5f, radians:%.5f, degrees:%.3f",\
963 _log(DESTINY__TURN_TRACE,
"Destiny::IsTurn() m_shipHeading: %.3f,%.3f,%.3f. m_targetHeading: %.3f,%.3f,%.3f", \
1025 _log(DESTINY__TURN_TRACE,
"Destiny::Turn() - %s(%u): Agility:%.3f, Inertia:%.3f, alignTime:%.3f, turnTime:%.3f, turnFraction:%.3f, m_degPerTic:%.3f", \
1062 float turnPercent(0.1f);
1064 if (degrees > 100) {
1079 if (turnPercent > 1.0) {
1080 _log(DESTINY__ERROR,
"Destiny::Turn() - turnTic:%u, degRemain:%.3f, turnPercent:%.2f",
m_turnTic, degrees, turnPercent);
1083 deltaHeading *= turnPercent;
1086 _log(DESTINY__TURN_TRACE,
"Destiny::Turn() - csf:%.3f, turnTic:%u, degRemain:%.3f (deltaHeading:%.5f, %.5f, %.5f * turnPercent:%.2f) = shipHeading:%.3f, %.3f, %.3f", \
1110 _log(AUTOPILOT__TRACE,
"DestinyManager::Follow() - Target within FollowDistance. SpeedFraction = 0.1.");
1118 std::vector<PyTuple*> updates;
1119 CmdSetSpeedFraction ssf;
1122 updates.push_back(ssf.Encode());
1141 if (m_tractorPause) {
1142 std::vector<PyTuple*> updates;
1143 CmdSetSpeedFraction ssf;
1146 updates.push_back(ssf.Encode());
1149 m_tractorPause =
false;
1219 double edges(centers -
m_radius - Tr);
1221 _log(DESTINY__ORBIT_TRACE,
"1 - %s(%u): time:%u, centers:%.2f, edges:%.2f, target:%u, follow:%u", \
1226 float mPosAdj(0.0f);
1250 _log(DESTINY__ORBIT_TRACE,
"2 - way too far - rads:%.3f, heading: %.3f, %.3f, %.3f", \
1275 _log(DESTINY__ORBIT_TRACE,
"2 - way too close - rads:%.3f, heading: %.3f, %.3f, %.3f", \
1284 _log(DESTINY__ORBIT_TRACE,
"2 - too far");
1290 _log(DESTINY__ORBIT_TRACE,
"2 - too close");
1293 _log(DESTINY__ORBIT_TRACE,
"2 - within tolerance");
1296 #define LogMacro(v) _log(DESTINY__ORBIT_TRACE, "m - " #v ": (%.3f, %.3f, %.3f) len=%.3f", v.x, v.y, v.z, v.length())
1306 float inclination = 45;
1318 mPos.x = radius * cos( theta );
1319 mPos.z = radius * sin( theta );
1320 mPos.y = radius * phi;
1321 _log(DESTINY__ORBIT_TRACE,
"4 - theta:%.5f, phi:%.3f, mu:%.2f period:%.5f, radius:%.3f, inc:%.5f", theta,phi,mu,period,radius,inclination);
1334 mPosNext.
x = radius * cos( theta );
1335 mPosNext.
z = radius * sin( theta );
1336 mPosNext.
y = radius * phi;
1351 _log(DESTINY__ORBIT_TRACE,
"5(%u) - orbiting at %.2f. timestamp:%u, speed:%.2f", \
1395 double i = atan2(opp, adj);
1416 float hyp = sqrt(pow(target.
z, 2) + pow(target.
x, 2));
1417 float inclination = 45;
1429 mPos.
x = radius * cos( theta );
1430 mPos.
z = radius * sin( theta );
1431 mPos.
y = radius * phi;
1438 _log(DESTINY__ERROR,
"mPos calculated as NaN. Stopping Orbit.");
1507 float cruiseTime(0.0f);
1508 double accelDistance(0.0), decelDistance(0.0), cruiseDistance(0.0);
1517 warpSpeedInMeters = accelDistance;
1527 cruiseTime = (cruiseDistance / warpSpeedInMeters);
1537 _log(DESTINY__WARP_TRACE,
"Destiny::InitWarp():Calculate - %s(%u): Warp will accelerate for %us, cruise for %.3f, then decelerate for %us, with total time of %.3fs, and warp speed of %.4f m/s.", \
1539 _log(DESTINY__WARP_TRACE,
"Destiny::InitWarp():Calculate - %s(%u): Accel distance is %.4f. Cruise distance is %.4f. Decel distance is %.4f. Direction is %.3f,%.3f,%.3f.", \
1540 mySE->
GetName(),
mySE->
GetID(), accelDistance, cruiseDistance, decelDistance, warp_vector.
x, warp_vector.
y, warp_vector.
z);
1541 _log(DESTINY__WARP_TRACE,
"Destiny::InitWarp():Calculate - %s(%u): We will exit warp at %.2f,%.2f,%.2f at a distance of %.4f AU (%um).", \
1544 _log(DESTINY__WARP_TRACE,
"Destiny::InitWarp():Calculate - %s(%u): calculated exit is %.2f,%.2f,%.2f and vector is %.4f,%.4f,%.4f.", \
1545 mySE->
GetName(),
mySE->
GetID(), destination.x, destination.y, destination.z, warp_vector.
x, warp_vector.
y, warp_vector.
z);
1547 _log(DESTINY__WARP_TRACE,
"Destiny::InitWarp():Calculate - target vs calculated is %.2fm.", diff.length());
1586 double currentDistance = exp(3 * sec_into_warp);
1592 _log(DESTINY__WARP_TRACE,
"Destiny::WarpAccel(): %s(%u) is being removed from bubble %u.",\
1609 double currentShipSpeed = (3 * currentDistance);
1613 _log(DESTINY__WARP_TRACE,
"Destiny::WarpAccel(): %s(%u) - Warp Accelerating(%us): velocity %.4f m/s with %u m left to go. Current distance %.4f from origin.", \
1629 _log(DESTINY__WARP_TRACE,
"Destiny::WarpCruise(): %s(%u) - Warp Crusing(%us): velocity %.4f m/s. with %u m left to go.", \
1646 _log(DESTINY__WARP_TRACE,
"Destiny::WarpDecel(): %s(%u) - Warp Decelerating(%us/%us): velocity %.4f m/s with %u m left to go.", \
1663 _log(DESTINY__WARP_TRACE,
"Destiny::WarpUpdate() %s(%u): Ship is %f from center of target bubble %u.",\
1667 _log(DESTINY__WARP_TRACE,
"Destiny::WarpUpdate() %s(%u): Ship at %.2f,%.2f,%.2f is calling Add() for bubble %u.", \
1679 _log(DESTINY__WARP_TRACE,
"Destiny::WarpStop(): %s(%u) - Warp complete. Exit velocity %.4f m/s with %u m left to go.", \
1681 _log(DESTINY__WARP_TRACE,
"Destiny::WarpStop(): %s(%u): Ship currently at %.2f,%.2f,%.2f.", \
1706 _log(DESTINY__DEBUG,
"%u: Our target entity has gone away. Stopping.",
mySE->
GetID());
1743 std::vector<PyTuple*> updates;
1744 SetBallAgility sbagility;
1747 updates.push_back(sbagility.Encode());
1748 SetBallMassive sbmassive;
1750 sbmassive.is_massive =
false;
1751 updates.push_back(sbmassive.Encode());
1755 updates.push_back(sbmass.Encode());
1857 du.targetID = pSE->
GetID();
1858 du.range = (
int32)distance;
1876 CmdGotoDirection du;
1894 CmdGotoPoint gtpoint;
1899 PyTuple* up = gtpoint.Encode();
1934 _log(DESTINY__TRACE,
"Destiny::WarpTo() - %s(%u) target bubble: %u m_stopDistance: %i m_targetDistance: %u",
1942 std::vector<PyTuple*> updates;
1950 updates.push_back(wt.Encode());
1952 sfx.guid =
"effects.Warping";
1954 sfx.isOffensive =
false;
1957 updates.push_back(sfx.Encode());
1960 _log(NPC__MESSAGE,
"Destiny::WarpTo() NPC %s(%u) to:%u from:%u, m_targetPoint: %.2f,%.2f,%.2f m_stopDistance: %i m_targetDistance: %u",\
1982 if (
sConfig.debug.PositionHack)
2001 if (capNeeded > currentShipCap) {
2004 if (capNeeded > 1) {
2011 _log(DESTINY__TRACE,
"Destiny::WarpTo():Update - %s(%u) target bubble: %u m_stopDistance: %i m_targetDistance: %u",
2015 pClient->
SendErrorMsg(
"You don't have enough capacitor charge to warp.");
2016 _log(DESTINY__WARNING,
"Destiny::WarpTo() - %s(%u): Capacitor needed vs current %.3f / %.3f",
2025 capNeeded = currentShipCap - capNeeded;
2046 std::vector<PyTuple*> updates;
2055 updates.push_back(wt.Encode());
2058 sfx.guid =
"effects.Warping";
2060 sfx.isOffensive =
false;
2063 updates.push_back(sfx.Encode());
2069 bm.is_massive =
false;
2074 _log(DESTINY__WARP_TRACE,
"Destiny::WarpTo() toBubble:%u from:%u, m_targetPoint: %.2f,%.2f,%.2f m_stopDistance: %i m_targetDistance: %u",
2108 _log(DESTINY__ORBIT_TRACE,
"%s(%u) - Ship Data - agility:%.3f, inertia:%.3f, massMkg:%.3f, maxSpeed:%.2f, radius:%.2f", \
2119 _log(DESTINY__ORBIT_TRACE,
"%s(%u) - Target Data - mass:%.3f, speed:%.2f, radius:%.2f", \
2124 double Rc2 = std::pow(Rc,2);
2125 double Vm2 = std::pow(m_maxShipSpeed,2);
2134 double one = (108 * t2 * Vm2 * Rc2);
2135 double two = (12 * t2 * Vm2 * std::pow(Rc,10));
2136 double three = (12 * std::sqrt(81 * std::pow(
m_shipAgility,4) * std::pow(m_maxShipSpeed,4) + two));
2137 double four = (6 * std::cbrt(one + 8 * std::pow(Rc,6) + three));
2138 double five = std::cbrt( std::sqrt(three * std::pow(Rc,8) + two));
2139 double six = (one + (8 * Rc2) + (12 * five));
2140 m_followDistance = std::sqrt(four + (24 * std::pow(Rc, 4) / six) + 12 * Rc2) / 6;
2142 double velocity = m_maxShipSpeed * ((distance /
m_followDistance) + 0.065);
2150 _log(DESTINY__ORBIT_TRACE,
"%s(%u) - Orbit Data - Rc:%.3f, velocity:%.2f, osf:%.2f, targetDistance:%u, followDistance:%u, orbitTime:%.1f, radTic:%.5f", \
2179 if (m_followDistance == 0) {
2186 du.orbitEntityID = pSE->
GetID();
2238 std::vector<PyTuple*> updates;
2244 updates.push_back(bv.Encode());
2245 CmdGotoDirection du;
2250 updates.push_back(du.Encode());
2259 if (station ==
nullptr) {
2260 codelog(CLIENT__ERROR,
"%s: Station %u not found.", pClient->
GetName(), stationID);
2261 pClient->
SendErrorMsg(
"Station Not Found, Docking Aborted.");
2269 rangeToStationPerimiter -= station->
GetRadius();
2272 _log(DESTINY__TRACE,
"Destiny::AttemptDockOperation() rangeToStationPerimiter is %.2fm", rangeToStationPerimiter);
2273 if (rangeToStationPerimiter > 2500.0) {
2290 if (pClient ==
nullptr)
2298 OnDockingAccepted oda;
2302 oda.station_x = stationPos.
x;
2303 oda.station_y = stationPos.
y;
2304 oda.station_z = stationPos.
z;
2349 _log(DESTINY__TRACE,
"Destiny::SetMaxVelocity() - Ship:%s(%u) Pilot:%s(%u) - AttrMaxDirectionalVelocity is %.1f", \
2353 if (maxVelocity > maxSpeed) {
2377 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost() - nMass: %.5f, nAg: %.5f, csf: %.2f, usf: %.2f, asf: %.3f", \
2379 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost() - pSpeed:%.2f, prevMaxSpeed:%.2f, newMaxShipSpeed:%.2f, fraction: %.3f", \
2399 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost()::Deactivate - decelTime: %.3f, deltaTime: %.3f, maxspeed: %.2f", \
2408 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost()::(psf!=0&csf>usf) - decelerating. - csf: %.3f. asf: %.3f, accelTime: %.3f, newMaxSpeed:%.2f", \
2413 m_currentSpeedFraction = fracCheck;
2420 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost()::(0<asf<=usf) - test: %.2f, asf: %.3f, csf: %.2f, check: %.3f, accelTime: %.3f, newMaxSpeed:%.2f", \
2426 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost()::(usf>asf=0) - sitting still.");
2428 _log(DESTINY__MOVE_TRACE,
"Destiny::SpeedBoost()::(usf=asf=0) - sitting still.");
2433 std::vector<PyTuple*> updates;
2434 SetBallAgility sbagility;
2437 updates.push_back(sbagility.Encode());
2441 updates.push_back(sbmass.Encode());
2445 updates.push_back(sbms.Encode());
2460 std::vector<PyTuple*> updates;
2464 updates.push_back(sbms.Encode());
2534 std::vector<PyTuple*> updates;
2535 SetBallAgility sbagility;
2538 updates.push_back(sbagility.Encode());
2539 SetBallMassive sbmassive;
2541 sbmassive.is_massive =
false;
2542 updates.push_back(sbmassive.Encode());
2546 updates.push_back(sbmass.Encode());
2547 SetBallSpeed sbspeed;
2550 updates.push_back(sbspeed.Encode());
2582 std::vector<PyTuple*> updates;
2583 SetBallSpeed maxspeed;
2584 maxspeed.entityID = pMissile->
GetID();
2586 updates.push_back(maxspeed.Encode());
2587 Rsp_LaunchMissile miss;
2589 miss.targetID = pTarget->
GetID();
2590 miss.missileID = pMissile->
GetID();
2593 updates.push_back(miss.Encode());
2602 if (pClient ==
nullptr)
2625 std::vector<PyTuple*> updates;
2631 shipItem->
SetItem(1, shipData);
2632 updates.push_back(shipItem);
2659 shipItem->
SetItem(1, shipData);
2725 std::vector<PyTuple*> updates;
2729 updates.push_back(ms.Encode());
2733 updates.push_back(bf.Encode());
2736 sbmass.mass = 10000;
2737 updates.push_back(sbmass.Encode());
2738 CmdSetSpeedFraction ssf;
2741 updates.push_back(ssf.Encode());
2744 fb.targetID = pShipSE->
GetID();
2746 updates.push_back(fb.Encode());
2754 std::vector<PyTuple*> updates;
2758 updates.push_back(ms.Encode());
2762 updates.push_back(bf.Encode());
2766 updates.push_back(sbmass.Encode());
2788 OnSpecialFX10 effect;
2790 effect.guid =
"effects.Jettison";
2791 effect.isOffensive = 0;
2794 PyTuple* up = effect.Encode();
2819 OnSpecialFX13 effect;
2823 effect.guid =
"effects.AnchorDrop";
2824 effect.isOffensive = 0;
2828 PyTuple* up = effect.Encode();
2833 OnSpecialFX13 effect;
2837 effect.guid =
"effects.AnchorLift";
2838 effect.isOffensive = 0;
2841 PyTuple* up = effect.Encode();
2887 OnSpecialFX13 effect;
2889 effect.isOffensive = 0;
2891 effect.guid =
"effects.Cloaking";
2895 effect.guid =
"effects.Uncloak";
2897 up = effect.Encode();
2899 OnSpecialFX10 effect;
2901 effect.guid =
"effects.Cloak";
2903 effect.guid =
"effects.Uncloak";
2906 effect.isOffensive = 0;
2909 up = effect.Encode();
2918 OnSpecialFX10 effect;
2919 effect.entityID = entityID;
2920 effect.targetID = targetID;
2922 effect.area =
new PyList();
2923 effect.isOffensive = isOffensive;
2924 effect.start = start;
2925 effect.active = isActive;
2926 PyTuple *up = effect.Encode();
2933 uint32 chargeTypeID, std::string guid,
bool isOffensive,
bool start,
2936 OnSpecialFX13 effect;
2937 effect.entityID = entityID;
2938 effect.moduleID = moduleID;
2939 effect.moduleTypeID = moduleTypeID;
2940 effect.targetID = (targetID == 0 ?
PyStatic.NewNone() :
new PyInt(targetID));
2941 effect.chargeTypeID = (chargeTypeID == 0 ?
PyStatic.NewNone() :
new PyInt(chargeTypeID));
2943 effect.isOffensive = isOffensive;
2944 effect.start = start;
2945 effect.active = isActive;
2946 effect.duration = duration;
2947 effect.repeat = repeat;
2949 effect.graphicInfo = (graphicInfo == 0 ?
PyStatic.NewNone() :
new PyInt(graphicInfo));
2950 PyTuple *up = effect.Encode();
2976 OnSpecialFX10 effect;
2978 effect.targetID = gateID;
2979 effect.guid =
"effects.JumpOut";
2980 effect.isOffensive = 0;
2983 PyTuple *up = effect.Encode();
2989 du.entityID = gateID;
2990 du.guid =
"effects.GateActivity";
3000 SetBallInteractive sbi;
3001 sbi.entityID = shipRef->
itemID();
3002 sbi.interactive = set;
3008 std::vector<PyTuple*> updates;
3011 updates.push_back(du.Encode());
3012 OnSpecialFX10 effect;
3014 effect.targetID = locationID;
3015 effect.guid =
"effects.JumpDriveOut";
3016 effect.isOffensive = 0;
3019 updates.push_back(effect.Encode());
3024 std::vector<PyTuple*> updates;
3025 OnSpecialFX10 effect;
3026 effect.guid =
"effects.JumpDriveIn";
3028 effect.isOffensive = 0;
3031 updates.push_back(effect.Encode());
3032 CmdSetSpeedFraction ssf;
3035 updates.push_back(ssf.Encode());
3036 SetBallVelocity sbv;
3041 updates.push_back(sbv.Encode());
3058 TerminalExplosion du;
3060 du.bubbleID = bubbleID;
3061 du.ballIsGlobal = isGlobal;
3071 _log(DESTINY__MESSAGE,
"Destiny::SendSetState() Called for Ship:%s(%u) Pilot:%s(%u)", \
3087 std::vector<PyTuple*> updates;
3088 std::vector<PyTuple*> events(1, *ev);
3093 std::vector<PyTuple*> updates(1, *up);
3094 std::vector<PyTuple*> events;
3099 std::vector<PyTuple*> events;
3112 _log( DESTINY__UPDATES,
"[%u] BubbleCasting destiny update (u:%u, e:%u) for stamp %u to bubbleID %u from %s(%u)", \
3119 _log(PLAYER__MESSAGE,
"[%u] DestinyManager::SendDestinyUpdate() (u:%i, e:%i) called as 'self_only' for %s(%u)", \
3122 for (std::vector<PyTuple*>::iterator cur = updates.begin(); cur != updates.end(); ++cur) {
3127 for (std::vector<PyTuple*>::iterator cur = events.begin(); cur != events.end(); ++cur) {
3133 _log(DESTINY__UPDATES,
"[%u] BubbleCasting global structure destiny update (u:%u, e:%u) for stamp %u to all bubbles from %s(%u)", \
3139 std::vector<Client*> cv;
3141 for(
auto const& value: cv) {
3142 value->GetShipSE()->SysBubble()->BubblecastDestiny(updates, events,
"destiny");
3146 _log(DESTINY__UPDATES,
"[%u] BubbleCasting destiny update (u:%u, e:%u) for stamp %u to bubbleID %u from %s(%u)", \
3152 _log(DESTINY__WARNING,
"[%u] Cannot BubbleCast destiny update (u:%u, e:%u); entity (%u) is not in any bubble.", \
3154 if (
sConfig.debug.IsTestServer)
#define sConfig
A macro for easier access to the singleton.
void SetPosition(const GPoint &pos)
void SendNotification(const PyAddress &dest, EVENotificationStream ¬i, bool seq=true)
SystemEntity * GetSE(uint32 entityID) const
GaExpInl GaFloat dotProduct(const GaVec3 &oth) const
GaExpInl bool isNotZero() const
float m_currentSpeedFraction
void AddEntity(SystemEntity *pSE, bool addSignal=true)
bool IsAligned(GPoint &targetPoint)
GaExpInl GaFloat length() const
void WarpCruise(uint16 sec_into_warp)
void SendErrorMsg(const char *fmt,...)
void AddBallExclusive(SystemEntity *about_who)
#define _log(type, fmt,...)
void SendAnchorLift() const
SystemEntity * GetTargetSE()
float GetSecurityRating() const
static const uint32 minWarpDistance(130000)
void ClearAllTargets(bool notify=true)
void SetAutoPilot(bool set=false)
bool HasAttribute(const uint16 attrID) const
void SendGateActivity(uint32 gateID) const
const GPoint & position() const
void GotoDirection(const GPoint &direction)
void SendJettisonPacket() const
void MakeMissile(Missile *missile)
SystemBubble * SysBubble()
bool InBubble(const GPoint &pt, bool inWarp=false) const
static const float TURN_ALIGNMENT
virtual ShipSE * GetShipSE()
void SendCloakFx(bool apply=false, bool module=false) const
void SendJumpInEffect(std::string JumpEffect) const
void SendJumpOutEffect(std::string JumpEffect, uint32 locationID) const
ShipItemRef GetShipItemRef()
float m_prevSpeedFraction
double Rad2Deg(double rad)
bool m_hasSentShipUpdates
void QueueDestinyEvent(PyTuple **multiEvent)
GaExpInl bool isNaN() const
itemID[count] Create count or of the specified() x() entityID Translocate to the specified entity Immediately stops setting then Sends Bubble AddBalls and Destiny SetState(resets spaceview with current server data)" ) COMMAND( sendstate
virtual Client * GetPilot()
static CargoContainerRef SpawnTemp(ItemData &data)
Python floating point number.
int32 GetCharacterID() const
void SendDestinyUpdate(std::vector< PyTuple * > &updates, bool self_only=false) const
void SetMaxVelocity(float maxVelocity)
void GetClientList(std::vector< Client * > &cVec)
void AddMarker(SystemEntity *pSE, bool sendBall=false, bool addSignal=false)
this is a class that kinda mimics how python polymorph's numbers.
void SendNotifyMsg(const char *fmt,...)
TargetManager * TargetMgr()
CharacterRef GetChar() const
void SendSetState() const
const GPoint & GetPosition() const
float m_maxOrbitSpeedFraction
void SafeDelete(T *&p)
Deletes and nullifies a pointer.
void Bounce(GVector direction, float speed)
float m_activeSpeedFraction
void UpdateOldShip(ShipSE *pShipSE)
void WarpStop(double currentShipSpeed)
GaExpInl GaFloat normalize()
const ItemType & type() const
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
std::pair< uint32, SystemEntity * > m_targetEntity
void SendSpecialEffect(uint32 entityID, uint32 moduleID, uint32 moduleTypeID, uint32 targetID, uint32 chargeTypeID, std::string guid, bool isOffensive, bool start, bool isActive, int32 duration, uint32 repeat, int32 graphicInfo=0) const
void WarpDecel(uint16 sec_into_warp)
void SendAnchorDrop() const
void BubblecastDestiny(std::vector< PyTuple * > &updates, std::vector< PyTuple * > &events, const char *desc) const
DestinyManager * DestinyMgr()
SystemManager * SystemMgr()
InventoryItemRef GetSelf()
virtual bool IsStationSE()
double Deg2Rad(double deg)
#define codelog(type, fmt,...)
void SetItem(size_t index, PyRep *object)
Stores Python object.
virtual bool IsContainerSE()
void SendJumpOut(uint32 gateID) const
static const GPoint NULL_ORIGIN(0, 0, 0)
void AlignTo(SystemEntity *pSE)
virtual bool IsMissileSE()
void SetSpeedFraction(float fraction=1.0f, bool startMovement=false)
void SetUndocking(bool set=false)
void SetAttribute(uint16 attrID, int num, bool notify=true)
void EntityRemoved(SystemEntity *pSE)
ShipItemRef GetShip() const
const char * GetName() const
void SetStateSent(bool set=false)
const char * GetName() const
void WarpAccel(uint16 sec_into_warp)
void UpdateVelocity(bool isMoving=false)
void UpdateNewShip(const ShipItemRef newShipRef)
void QueueDestinyUpdate(PyTuple **update, bool DoPackage=false, bool IsSetState=false)
GaExpInl bool isInf() const
void Jump(bool showCloak=true)
Python object "ccp_exceptions.UserError".
static const GVector NULL_ORIGIN_V(0, 0, 0)
void RemoveExclusive(SystemEntity *pSE)
void SetPosition(const GPoint &pt, bool update=false)
uint32 GetDockStationID()
void SendSingleDestinyUpdate(PyTuple **up, bool self_only=false) const
void Bump(SystemEntity *who)
void GotoPoint(const GPoint &point)
void WarpTo(const GPoint &where, int32 distance=0, bool autoPilot=false, SystemEntity *pSE=nullptr)
void SendSpecialEffect10(uint32 entityID, uint32 targetID, std::string guid, bool isOffensive, bool start, bool isActive) const
PyServiceMgr & GetServices()
void MakeSetState(const SystemBubble *pBubble, SetState &into) const
uint32 GetCorporationID()
const std::string & itemName() const
void UpdateShipVariables()
void Remove(SystemEntity *pSE)
void SendTerminalExplosion(uint32 shipID, uint32 bubbleID, bool isGlobal=false) const
EvilNumber GetAttribute(const uint16 attrID) const
void SendSingleDestinyEvent(PyTuple **ev, bool self_only=false) const
GaExpInl bool isZero() const
#define IsFaction(itemID)
void SetStateTimer(int8 state, uint32 time=Player::Timer::Default)
void TractorBeamStart(SystemEntity *pShipSE, EvilNumber speed)
int8 GetSkillLevel(uint16 skillTypeID, bool zeroForNotInjected=true) const
double m_warpCapacitorNeed
void WarpUpdate(double currentShipSpeed)
virtual bool IsDynamicEntity()
GPoint ComputePosition(double curRad)
const GPoint & GetPosition() const
void SpeedBoost(bool deactivate=false)
DestinyManager(SystemEntity *self)
#define IsAlliance(itemID)
void SendBallInteractive(const ShipItemRef shipRef, bool set=false) const
GaExpInl GaFloat distance(const GaVec3 &oth) const
SystemBubble * m_targBubble
PyResult AttemptDockOperation()
static const uint16 BUMP_DISTANCE
static const float WARP_ALIGNMENT
void Add(SystemEntity *pSE)
float m_userSpeedFraction
PyList * ShipGetModuleList()
void WebbedMe(InventoryItemRef modRef, bool apply=false)
const char * itoa(int64 num)
Convers num to string.
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
static const int64 ONE_AU_IN_METERS
void GetPlayers(std::vector< Client * > &into) const
static const float BUBBLE_RADIUS_METERS