2018-07-06 14:11:38 +00:00
|
|
|
#ifndef GAME_SERVER_SAVE_H
|
|
|
|
#define GAME_SERVER_SAVE_H
|
2014-07-26 12:46:31 +00:00
|
|
|
|
2020-05-28 11:29:42 +00:00
|
|
|
#include "entities/character.h"
|
|
|
|
class IGameController;
|
|
|
|
class CGameContext;
|
2014-07-26 12:46:31 +00:00
|
|
|
|
|
|
|
class CSaveTee
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSaveTee();
|
|
|
|
~CSaveTee();
|
2017-05-14 20:36:44 +00:00
|
|
|
void save(CCharacter* pchr);
|
|
|
|
void load(CCharacter* pchr, int Team);
|
2014-07-26 12:46:31 +00:00
|
|
|
char* GetString();
|
|
|
|
int LoadString(char* String);
|
|
|
|
vec2 GetPos() { return m_Pos; }
|
2020-05-22 11:58:37 +00:00
|
|
|
char* GetName() { return m_aName; }
|
2014-07-26 12:46:31 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
2020-05-22 11:58:37 +00:00
|
|
|
char m_aString [2048];
|
|
|
|
char m_aName [16];
|
2014-07-26 12:46:31 +00:00
|
|
|
|
|
|
|
int m_Alive;
|
|
|
|
int m_Paused;
|
|
|
|
int m_NeededFaketuning;
|
|
|
|
|
|
|
|
// Teamstuff
|
|
|
|
int m_TeeFinished;
|
|
|
|
int m_IsSolo;
|
|
|
|
|
|
|
|
struct WeaponStat
|
|
|
|
{
|
|
|
|
int m_AmmoRegenStart;
|
|
|
|
int m_Ammo;
|
|
|
|
int m_Ammocost;
|
|
|
|
int m_Got;
|
|
|
|
|
|
|
|
} m_aWeapons[NUM_WEAPONS];
|
|
|
|
|
|
|
|
int m_LastWeapon;
|
|
|
|
int m_QueuedWeapon;
|
|
|
|
|
|
|
|
int m_SuperJump;
|
|
|
|
int m_Jetpack;
|
|
|
|
int m_NinjaJetpack;
|
|
|
|
int m_FreezeTime;
|
|
|
|
int m_FreezeTick;
|
|
|
|
int m_DeepFreeze;
|
|
|
|
int m_EndlessHook;
|
|
|
|
int m_DDRaceState;
|
|
|
|
|
|
|
|
int m_Hit;
|
|
|
|
int m_Collision;
|
|
|
|
int m_TuneZone;
|
|
|
|
int m_TuneZoneOld;
|
|
|
|
int m_Hook;
|
|
|
|
int m_Time;
|
|
|
|
vec2 m_Pos;
|
|
|
|
vec2 m_PrevPos;
|
|
|
|
int m_TeleCheckpoint;
|
|
|
|
int m_LastPenalty;
|
|
|
|
|
|
|
|
int m_CpTime;
|
|
|
|
int m_CpActive;
|
|
|
|
int m_CpLastBroadcast;
|
2020-05-22 11:58:37 +00:00
|
|
|
float m_aCpCurrent[25];
|
2014-07-26 12:46:31 +00:00
|
|
|
|
2018-12-17 13:55:58 +00:00
|
|
|
int m_NotEligibleForFinish;
|
|
|
|
|
2019-08-19 08:09:53 +00:00
|
|
|
int m_HasTelegunGun;
|
|
|
|
int m_HasTelegunGrenade;
|
|
|
|
int m_HasTelegunLaser;
|
2019-04-06 16:13:11 +00:00
|
|
|
|
2014-07-26 12:46:31 +00:00
|
|
|
// Core
|
|
|
|
vec2 m_CorePos;
|
|
|
|
vec2 m_Vel;
|
|
|
|
int m_ActiveWeapon;
|
|
|
|
int m_Jumped;
|
|
|
|
int m_JumpedTotal;
|
|
|
|
int m_Jumps;
|
|
|
|
vec2 m_HookPos;
|
|
|
|
vec2 m_HookDir;
|
|
|
|
vec2 m_HookTeleBase;
|
|
|
|
int m_HookTick;
|
|
|
|
int m_HookState;
|
2019-04-06 16:37:25 +00:00
|
|
|
|
2020-05-20 20:01:47 +00:00
|
|
|
char m_aGameUuid[UUID_MAXSTRSIZE];
|
2014-07-26 12:46:31 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class CSaveTeam
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CSaveTeam(IGameController* Controller);
|
|
|
|
~CSaveTeam();
|
|
|
|
char* GetString();
|
2019-09-08 17:22:12 +00:00
|
|
|
int GetMembersCount() { return m_MembersCount; }
|
2014-07-26 12:46:31 +00:00
|
|
|
int LoadString(const char* String);
|
2017-05-14 20:36:44 +00:00
|
|
|
int save(int Team);
|
|
|
|
int load(int Team);
|
2020-05-22 11:58:37 +00:00
|
|
|
CSaveTee* m_pSavedTees;
|
2014-07-26 12:46:31 +00:00
|
|
|
|
2020-05-27 18:09:12 +00:00
|
|
|
// returns true if an error occured
|
2020-02-13 16:04:58 +00:00
|
|
|
static bool HandleSaveError(int Result, int ClientID, CGameContext *pGameContext);
|
2014-07-26 12:46:31 +00:00
|
|
|
private:
|
2017-05-14 20:36:44 +00:00
|
|
|
int MatchPlayer(char name[16]);
|
2014-07-26 12:46:31 +00:00
|
|
|
CCharacter* MatchCharacter(char name[16], int SaveID);
|
|
|
|
|
|
|
|
IGameController* m_pController;
|
|
|
|
|
2020-05-22 11:58:37 +00:00
|
|
|
char m_aString[65536];
|
2014-07-26 12:46:31 +00:00
|
|
|
|
|
|
|
struct SSimpleSwitchers
|
|
|
|
{
|
|
|
|
int m_Status;
|
|
|
|
int m_EndTime;
|
|
|
|
int m_Type;
|
|
|
|
};
|
2020-05-22 11:58:37 +00:00
|
|
|
SSimpleSwitchers* m_pSwitchers;
|
2014-07-26 12:46:31 +00:00
|
|
|
|
|
|
|
int m_TeamState;
|
|
|
|
int m_MembersCount;
|
|
|
|
int m_NumSwitchers;
|
|
|
|
int m_TeamLocked;
|
2020-05-22 21:59:47 +00:00
|
|
|
int m_Practice;
|
2014-07-26 12:46:31 +00:00
|
|
|
};
|
|
|
|
|
2018-07-06 14:11:38 +00:00
|
|
|
#endif // GAME_SERVER_SAVE_H
|