2010-11-20 10:37:14 +00:00
|
|
|
/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
|
|
|
|
/* If you are missing that file, acquire a complete release at teeworlds.com. */
|
2010-05-29 07:25:38 +00:00
|
|
|
#ifndef GAME_SERVER_PLAYER_H
|
|
|
|
#define GAME_SERVER_PLAYER_H
|
|
|
|
|
|
|
|
// this include should perhaps be removed
|
|
|
|
#include "entities/character.h"
|
|
|
|
#include "gamecontext.h"
|
|
|
|
|
|
|
|
// player object
|
|
|
|
class CPlayer
|
|
|
|
{
|
|
|
|
MACRO_ALLOC_POOL_ID()
|
|
|
|
|
|
|
|
public:
|
|
|
|
CPlayer(CGameContext *pGameServer, int CID, int Team);
|
|
|
|
~CPlayer();
|
|
|
|
|
2010-09-17 06:05:27 +00:00
|
|
|
//void Init(int CID); idk what this does or where it is so i commented it. GreYFoXWas Here
|
2010-05-29 07:25:38 +00:00
|
|
|
|
|
|
|
void TryRespawn();
|
|
|
|
void Respawn();
|
|
|
|
void SetTeam(int Team);
|
|
|
|
int GetTeam() const { return m_Team; };
|
|
|
|
int GetCID() const { return m_ClientID; };
|
|
|
|
|
2010-08-26 17:55:04 +00:00
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
void Tick();
|
|
|
|
void Snap(int SnappingClient);
|
|
|
|
|
|
|
|
void OnDirectInput(CNetObj_PlayerInput *NewInput);
|
|
|
|
void OnPredictedInput(CNetObj_PlayerInput *NewInput);
|
|
|
|
void OnDisconnect();
|
|
|
|
|
|
|
|
void KillCharacter(int Weapon = WEAPON_GAME);
|
|
|
|
CCharacter *GetCharacter();
|
|
|
|
|
2010-08-22 13:17:57 +00:00
|
|
|
struct PauseInfo {
|
|
|
|
CCharacterCore m_Core;
|
|
|
|
int m_StartTime;
|
2010-10-29 21:28:15 +00:00
|
|
|
int m_DDRaceState;
|
2010-08-22 13:17:57 +00:00
|
|
|
//int m_RefreshTime;
|
2010-08-22 22:04:26 +00:00
|
|
|
int m_FreezeTime;
|
|
|
|
bool m_Doored;
|
|
|
|
vec2 m_OldPos;
|
|
|
|
vec2 m_OlderPos;
|
|
|
|
int m_LastAction;
|
|
|
|
int m_Jumped;
|
|
|
|
int m_Health;
|
|
|
|
int m_Armor;
|
|
|
|
int m_PlayerState;
|
|
|
|
int m_LastMove;
|
|
|
|
vec2 m_PrevPos;
|
|
|
|
int m_ActiveWeapon;
|
|
|
|
int m_LastWeapon;
|
2010-08-22 13:17:57 +00:00
|
|
|
bool m_Respawn;
|
|
|
|
bool m_aHasWeapon[NUM_WEAPONS];
|
2010-08-22 22:04:26 +00:00
|
|
|
int m_HammerType;
|
|
|
|
bool m_Super;
|
2010-08-22 23:59:54 +00:00
|
|
|
int m_PauseTime;
|
2010-11-22 07:21:02 +00:00
|
|
|
int m_Team;
|
2010-08-22 13:17:57 +00:00
|
|
|
} m_PauseInfo;
|
2010-09-17 06:05:27 +00:00
|
|
|
bool m_InfoSaved;
|
2010-08-22 13:17:57 +00:00
|
|
|
void LoadCharacter();
|
|
|
|
void SaveCharacter();
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//---------------------------------------------------------
|
|
|
|
// this is used for snapping so we know how we can clip the view for the player
|
|
|
|
vec2 m_ViewPos;
|
|
|
|
|
|
|
|
//
|
|
|
|
int m_Vote;
|
|
|
|
int m_VotePos;
|
|
|
|
//
|
2010-07-29 19:55:33 +00:00
|
|
|
int64 m_Last_KickVote;
|
|
|
|
|
|
|
|
int64 m_Last_VoteCall;
|
|
|
|
int64 m_Last_VoteTry;
|
|
|
|
int64 m_Last_Chat;
|
|
|
|
int64 m_Last_SetTeam;
|
|
|
|
int64 m_Last_ChangeInfo;
|
|
|
|
int64 m_Last_Emote;
|
|
|
|
int64 m_Last_Kill;
|
2010-12-13 22:16:53 +00:00
|
|
|
int64 m_Last_Pause;
|
2010-09-08 16:22:11 +00:00
|
|
|
|
2010-09-14 16:56:28 +00:00
|
|
|
bool m_Invisible;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2010-07-29 05:21:18 +00:00
|
|
|
int m_Muted;
|
|
|
|
//int hammer_ type;
|
|
|
|
|
|
|
|
// TODO: clean this up
|
2010-10-10 13:36:58 +00:00
|
|
|
int m_Authed;
|
2011-01-06 05:08:12 +00:00
|
|
|
|
2010-10-29 21:28:15 +00:00
|
|
|
bool m_IsUsingDDRaceClient;
|
2011-01-06 05:08:12 +00:00
|
|
|
bool m_ShowOthers;
|
2010-10-23 19:26:10 +00:00
|
|
|
|
2010-07-29 05:21:18 +00:00
|
|
|
int m_Starttime;
|
|
|
|
int m_Refreshtime;
|
2010-10-29 21:28:15 +00:00
|
|
|
int m_DDRaceState;
|
2010-07-29 05:21:18 +00:00
|
|
|
int m_Besttick;
|
|
|
|
int m_Lasttick;
|
|
|
|
float m_BestLap;
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
// TODO: clean this up
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
char m_SkinName[64];
|
|
|
|
int m_UseCustomColor;
|
|
|
|
int m_ColorBody;
|
|
|
|
int m_ColorFeet;
|
|
|
|
} m_TeeInfos;
|
|
|
|
|
|
|
|
int m_RespawnTick;
|
|
|
|
int m_DieTick;
|
|
|
|
int m_Score;
|
2010-05-31 20:35:47 +00:00
|
|
|
int m_ScoreStartTick;
|
2010-05-29 07:25:38 +00:00
|
|
|
bool m_ForceBalanced;
|
2010-10-09 17:14:42 +00:00
|
|
|
int m_LastActionTick;
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int m_TargetX;
|
|
|
|
int m_TargetY;
|
|
|
|
} m_LatestActivity;
|
2010-05-29 07:25:38 +00:00
|
|
|
|
2010-08-23 19:37:27 +00:00
|
|
|
float m_BestTime;
|
|
|
|
float m_aBestCpTime[25];
|
|
|
|
|
|
|
|
bool m_ResetPickups;
|
|
|
|
|
2010-08-23 21:40:23 +00:00
|
|
|
bool m_RconFreeze;
|
2010-05-29 07:25:38 +00:00
|
|
|
private:
|
|
|
|
CCharacter *Character;
|
|
|
|
CGameContext *m_pGameServer;
|
|
|
|
|
|
|
|
CGameContext *GameServer() const { return m_pGameServer; }
|
|
|
|
IServer *Server() const;
|
|
|
|
|
2010-07-29 19:55:33 +00:00
|
|
|
|
|
|
|
|
2010-05-29 07:25:38 +00:00
|
|
|
//
|
|
|
|
bool m_Spawning;
|
|
|
|
int m_ClientID;
|
|
|
|
int m_Team;
|
|
|
|
|
|
|
|
// network latency calculations
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
int m_Accum;
|
|
|
|
int m_AccumMin;
|
|
|
|
int m_AccumMax;
|
|
|
|
int m_Avg;
|
|
|
|
int m_Min;
|
|
|
|
int m_Max;
|
|
|
|
} m_Latency;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|