28 #include <CaveNet_Config.h>
31 #include <SortedBinList.h>
39 #ifdef CAVESTORY_MOD_EXPORTS
54 namespace DataStructures
56 class NetScoreInstance;
58 class PSSortableClient;
59 class NetClientVector;
180 const char* pBotName = NULL,
181 const char* pCharName = NULL,
182 unsigned char iColorR = 0,
183 unsigned char iColorG = 0,
184 unsigned char iColorB = 0,
185 bool bRandomColor =
false
261 char* pBuffer = NULL,
262 unsigned int iBufferSize = 0,
264 const char* pCustomReason = NULL,
272 namespace DataStructures
348 static const char* g_NetDownloadTypeNames[] =
651 inline bool operator>=(
const NetScoreType& other)
const
653 return m_NameHash >= other.m_NameHash;
658 inline bool operator!=(
const NetScoreType& other)
const
660 return m_NameHash != other.m_NameHash;
665 inline bool operator==(
const NetScoreType& other)
const
667 return m_NameHash == other.m_NameHash;
709 m_MostPointsEver = 0;
710 m_CurrentLifePoints = 0;
711 m_TimerStartTime = 0;
712 m_TimerStarted =
false;
721 m_MostPointsEver = 0;
722 m_CurrentLifePoints = 0;
723 m_TimerStartTime = 0;
724 m_TimerStarted =
false;
745 inline bool operator> (
const NetScoreInstance& other)
const
747 return m_Info->
m_NameHash > other.m_Info->m_NameHash;
752 inline bool operator>=(
const NetScoreInstance& other)
const
754 return m_Info->
m_NameHash >= other.m_Info->m_NameHash;
759 inline bool operator!=(
const NetScoreInstance& other)
const
761 return m_Info->
m_NameHash != other.m_Info->m_NameHash;
766 inline bool operator==(
const NetScoreInstance& other)
const
768 return m_Info->
m_NameHash == other.m_Info->m_NameHash;
797 m_NewValue = bNewValue;
798 m_Acknowledged =
false;
807 m_Acknowledged =
false;
828 inline bool operator> (
const NetFlagChangeData& other)
const
830 return m_FlagID > other.m_FlagID;
835 inline bool operator>=(
const NetFlagChangeData& other)
const
837 return m_FlagID >= other.m_FlagID;
842 inline bool operator!=(
const NetFlagChangeData& other)
const
844 return m_FlagID != other.m_FlagID;
849 inline bool operator==(
const NetFlagChangeData& other)
const
851 return m_FlagID == other.m_FlagID;
976 static NetTeamId next_team_id;
1040 NetTeam(NetTeamId iTeamId,
bool bClientSide =
true);
1243 void QueryPacket(NetPacket* pPacket,
void* pAddArgFunc);
1409 int mAmount[CAVENET_CLIENT_PINGCACHE];
1624 void(*m_OnCleanup)(
AI_Brain* pBrain);
1766 void* m_CustomVarList[32];
1835 CLIENT_DISCONNECTED = 0,
1908 char character_name[256];
2216 unsigned int UserIdent[5];
2486 float GetTotalGameScore(
unsigned long long int iMaskBits,
unsigned long long int iNegateMaskBits = 0);
2525 bool SetGameScore(
unsigned int iNameHash,
unsigned int iAmount,
bool bCurrentLife =
false);
2535 bool SetGameScore(
const char* pName,
unsigned int iAmount,
bool bCurrentLife =
false);
2806 void SetColor(
unsigned char r,
unsigned char g,
unsigned char b);
2813 return (mCache.use_color ?
GUI_COLOR(mCache.char_color.r, mCache.char_color.g, mCache.char_color.b) :
GUI_COLOR(0, 0, 0));
2897 void PredictMovement(
int iNewInput,
long long int iInputTime,
int iClientX,
int iClientY);
3151 bool Send(NetPacket* packet,
bool bForceSend =
false);
3165 inline int GetPing() {
if (mCache.is_ghost)
return mCache.ClientSide_AveragePing;
return mCache.ping.GetAverage(); }
3207 MYCHAR* GetMyChar(
bool bRequired =
false);
3375 void Say(
const char* pMessage);
3465 inline void SetGhostedClient(NetClientId
id) { mGhostId = id; SetState(ClientState::CLIENT_GHOST); }
3703 void PutlittleStar();
3707 int JudgeHitMyCharBlock(
int x,
int y);
3711 int JudgeHitMyCharTriangleA(
int x,
int y);
3715 int JudgeHitMyCharTriangleB(
int x,
int y);
3719 int JudgeHitMyCharTriangleC(
int x,
int y);
3723 int JudgeHitMyCharTriangleD(
int x,
int y);
3727 int JudgeHitMyCharTriangleE(
int x,
int y);
3731 int JudgeHitMyCharTriangleF(
int x,
int y);
3735 int JudgeHitMyCharTriangleG(
int x,
int y);
3739 int JudgeHitMyCharTriangleH(
int x,
int y);
3743 int JudgeHitMyCharWater(
int x,
int y);
3747 int JudgeHitMyCharDamage(
int x,
int y);
3751 int JudgeHitMyCharDamageW(
int x,
int y);
3755 int JudgeHitMyCharVectLeft(
int x,
int y);
3759 int JudgeHitMyCharVectUp(
int x,
int y);
3763 unsigned char JudgeHitMyCharNPC3(
NPCHAR* npc);
3767 int JudgeHitMyCharVectRight(
int x,
int y);
3771 int JudgeHitMyCharVectDown(
int x,
int y);
3775 int JudgeHitMyCharNPC(
NPCHAR* npc);
3779 int JudgeHitMyCharNPC4(
NPCHAR* npc);
3783 int JudgeHitMyCharPlayer(
MYCHAR* npc);
3808 inline bool IsPlayerState(
int iStateType) {
return m_Player.npc.netanim == iStateType; }
3888 void Revive(
bool restoreControl,
int health = 1,
NetClient * pSavior = NULL,
bool bAnnounce =
true);
3969 m_pGetClientFunc = NULL;
3984 return m_pGetClientFunc(0);
3992 return m_pGetClientFunc(++m_iIndex);
4145 using namespace DataStructures;
Directions
Directions.
Definition: CSMAPI_enums.h:37
CSM_ClientRanks
All possible values for a client's mAdminRank.
Definition: CSMAPI_enums.h:1465
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
PlayerDeathType
A list of possible player death types.
Definition: CSMAPI_enums.h:1229
PlayerStateAnimator_OutputType
A list of output types for a player state's "ANIMATE" function.
Definition: CSMAPI_enums.h:1217
float(* CSM_NetScore_GetScoreModifyAmount)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetScoreInstance *pInstance)
Determine the amount of score to be modified for a client.
Definition: CSMAPI_types.h:7388
NetDisconnectReason
Disconnect reasons for CaveNet clients.
Definition: CaveNet_EnumData.h:34
NetDownloadTypes
todo: NetDownloadTypes
Definition: CaveNet_ExportedTypes.h:328
@ NET_DOWNLOAD_MAX
Max download types.
Definition: CaveNet_ExportedTypes.h:345
@ NET_DOWNLOAD_MAP
Map download.
Definition: CaveNet_ExportedTypes.h:333
@ NET_DOWNLOAD_GENERIC
Generic file.
Definition: CaveNet_ExportedTypes.h:330
@ NET_DOWNLOAD_TILESET
Tileset download.
Definition: CaveNet_ExportedTypes.h:336
@ NET_DOWNLOAD_CHARACTER
Character download.
Definition: CaveNet_ExportedTypes.h:339
@ NET_DOWNLOAD_IMAGE
Image download.
Definition: CaveNet_ExportedTypes.h:342
FlagOperation
Enumerations.
Definition: CaveNet_ExportedTypes.h:280
@ FLAG_CLEAR
Clear flags.
Definition: CaveNet_ExportedTypes.h:288
@ FLAG_OVERWRITE
Overwrite all flags.
Definition: CaveNet_ExportedTypes.h:282
@ FLAG_SET
Set flags.
Definition: CaveNet_ExportedTypes.h:285
GUI_Type
todo: GUI_Type
Definition: CaveNet_ExportedTypes.h:311
@ GUI_MAP
Map system.
Definition: CaveNet_ExportedTypes.h:319
@ GUI_CAMP
Inventory.
Definition: CaveNet_ExportedTypes.h:316
@ GUI_COUNT
Max GUI types.
Definition: CaveNet_ExportedTypes.h:322
@ GUI_NONE
No GUI.
Definition: CaveNet_ExportedTypes.h:313
UserCommands
Commands that can be sent to the server.
Definition: CaveNet_ExportedTypes.h:360
@ USER_COMMAND_SPECTATE_PLAYER
Spectate a player.
Definition: CaveNet_ExportedTypes.h:371
@ USER_COMMAND_FIND_PLAYER
Teleport to a player.
Definition: CaveNet_ExportedTypes.h:368
@ USER_COMMAND_RESERVED_10
reserved
Definition: CaveNet_ExportedTypes.h:392
@ __USER_COMMAND__COUNT__
Number of user commands.
Definition: CaveNet_ExportedTypes.h:395
@ USER_COMMAND_RESERVED_9
reserved
Definition: CaveNet_ExportedTypes.h:389
@ USER_COMMAND_SPLITSCREEN_READY
Splitscreen ready.
Definition: CaveNet_ExportedTypes.h:377
@ USER_COMMAND_FETCH_PLAYER
Teleport a player to us.
Definition: CaveNet_ExportedTypes.h:365
@ USER_COMMAND_SET_CONFIG_VALUE
Set a configuration option's value.
Definition: CaveNet_ExportedTypes.h:380
@ USER_COMMAND_MOD_FROM_CLIENT
Receive / send mod-specific data over the network.
Definition: CaveNet_ExportedTypes.h:386
@ USER_COMMAND_MOD_FROM_SERVER
Receive / send mod-specific data over the network.
Definition: CaveNet_ExportedTypes.h:383
@ USER_COMMAND_RESPAWN_PLAYER
Respawn a player.
Definition: CaveNet_ExportedTypes.h:362
@ USER_COMMAND_KICK_PLAYER
Kick a player.
Definition: CaveNet_ExportedTypes.h:374
ClientState
todo: ClientState
Definition: CaveNet_ExportedTypes.h:294
@ CLIENT_CONNECTING
Connecting.
Definition: CaveNet_ExportedTypes.h:299
@ CLIENT_NOT_CONNECTED
Not connected.
Definition: CaveNet_ExportedTypes.h:296
@ CLIENT_DOWNLOADING
Downloading files.
Definition: CaveNet_ExportedTypes.h:302
@ CLIENT_CONNECTED
Connected.
Definition: CaveNet_ExportedTypes.h:305
AI Player's action base.
Definition: CaveNet_ExportedTypes.h:1579
AI_ActionBase()
Constructor.
Definition: CaveNet_ExportedTypes.h:1590
virtual void OnFinish()=0
Called when this action finishes.
virtual void Tick(AI_Controls *pControls)=0
Called every frame.
virtual bool OnBegin()=0
Called when this action is started.
AI_Brain * pBrain
The brain this action is performing for.
Definition: CaveNet_ExportedTypes.h:1584
virtual bool IsDone()=0
Whether this action is complete or not.
AI Player's brain.
Definition: CaveNet_ExportedTypes.h:1619
NPCHAR * target_3
...
Definition: CaveNet_ExportedTypes.h:1654
NPCHAR * target_4
...
Definition: CaveNet_ExportedTypes.h:1658
int count15
...
Definition: CaveNet_ExportedTypes.h:1742
int Tick()
Tick this bot for one frame.
int count9
...
Definition: CaveNet_ExportedTypes.h:1718
NetPlayer * m_Player
The player attached to this brain.
Definition: CaveNet_ExportedTypes.h:1776
int count4
...
Definition: CaveNet_ExportedTypes.h:1698
void * ptr_3
...
Definition: CaveNet_ExportedTypes.h:1670
int act_no
...
Definition: CaveNet_ExportedTypes.h:1678
int count7
...
Definition: CaveNet_ExportedTypes.h:1710
int count14
...
Definition: CaveNet_ExportedTypes.h:1738
int count1
...
Definition: CaveNet_ExportedTypes.h:1686
void * ptr_1
...
Definition: CaveNet_ExportedTypes.h:1662
void * ptr_4
...
Definition: CaveNet_ExportedTypes.h:1674
int timer_2
...
Definition: CaveNet_ExportedTypes.h:1750
int tgt_y
...
Definition: CaveNet_ExportedTypes.h:1758
CaveNet::DataStructures::NetPlayer * focus_1
...
Definition: CaveNet_ExportedTypes.h:1630
int act_wait
...
Definition: CaveNet_ExportedTypes.h:1682
int count2
...
Definition: CaveNet_ExportedTypes.h:1690
int count3
...
Definition: CaveNet_ExportedTypes.h:1694
int count5
...
Definition: CaveNet_ExportedTypes.h:1702
int count8
...
Definition: CaveNet_ExportedTypes.h:1714
int tgt_x
...
Definition: CaveNet_ExportedTypes.h:1754
int start_time
...
Definition: CaveNet_ExportedTypes.h:1762
NPCHAR * target_1
...
Definition: CaveNet_ExportedTypes.h:1646
NPCHAR * target_2
...
Definition: CaveNet_ExportedTypes.h:1650
~AI_Brain()
Deconstructor.
int timer_1
...
Definition: CaveNet_ExportedTypes.h:1746
int count10
...
Definition: CaveNet_ExportedTypes.h:1722
void NotifyOfClientDeletion(CaveNet::DataStructures::NetClient *pClient)
Notify this brain of pointer deletion.
CaveNet::DataStructures::NetPlayer * focus_3
...
Definition: CaveNet_ExportedTypes.h:1638
void * ptr_2
...
Definition: CaveNet_ExportedTypes.h:1666
void Think()
Think for this bot.
void NotifyOfPlayerDeletion(CaveNet::DataStructures::NetPlayer *pPlayer)
Notify this brain of pointer deletion.
int count13
...
Definition: CaveNet_ExportedTypes.h:1734
AI_ActionBase * AddAction(AI_ActionBase *pAction)
Add an action to the queue.
List< AI_ActionBase * > m_ActionQueue
The action queue for this brain.
Definition: CaveNet_ExportedTypes.h:1772
int count12
...
Definition: CaveNet_ExportedTypes.h:1730
CaveNet::DataStructures::NetPlayer * focus_4
...
Definition: CaveNet_ExportedTypes.h:1642
int count6
...
Definition: CaveNet_ExportedTypes.h:1706
int count11
...
Definition: CaveNet_ExportedTypes.h:1726
CaveNet::DataStructures::NetPlayer * focus_2
...
Definition: CaveNet_ExportedTypes.h:1634
int m_SelectedWeapon
Selected weapon.
Definition: CaveNet_ExportedTypes.h:1780
Stores ghosting information for a single NPC.
Definition: CaveNet_ExportedTypes.h:1459
bool operator!=(const GhostInfo &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1523
bool operator>=(const GhostInfo &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1516
GhostInfo(int iNpcIDX, float iDistance)
Constructor.
Definition: CaveNet_ExportedTypes.h:1474
bool operator==(const GhostInfo &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1530
bool operator<=(const GhostInfo &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1502
GhostInfo()
Constructor 2.
Definition: CaveNet_ExportedTypes.h:1482
short npc_idx
The NPC index in #gNPC.
Definition: CaveNet_ExportedTypes.h:1464
int ticks_alive
How many ticks have passed since this ghost info was created.
Definition: CaveNet_ExportedTypes.h:1468
Networking client.
Definition: CaveNet_ExportedTypes.h:1825
int BuildStemPacket_PlayerPhysicsUpdate(NetPacket *out)
Build a 'player physics' packet.
void ClearArmsData()
Clear all arms data.
char * GetStringIP(char *out, int out_size)
Get this client's IP into a string.
int SimulateMovement(int iNumFrames, MYCHAR *pMC, unsigned int iKeyMask=gKeyMaxVal)
Simulate character movement.
void SpawnAuto()
Find a suitable place to spawn & spawn there.
bool BuildStemPacket_Ready(NetPacket *out)
Build a 'ready' packet.
bool IsResourceDirty(GameResource *pResource, int iIndex=-1)
Check if a resource is dirty for this client.
int GetChannel()
Get the channel this client is communicating on.
Definition: CaveNet_ExportedTypes.h:3227
GameResource ** list
Resource scope queue.
Definition: CaveNet_ExportedTypes.h:2242
void SendMap(int event_id=90)
Send the current map.
void TransmitInventory(unsigned int iTypeFlags)
Transmit this player's inventory.
void ClearDeathCache()
Clear death cache.
TEXT_SCRIPT_PTR_DATA * GetScriptContext(TEXT_SCRIPT_PTR_DATA *ptr)
Build the event context for this client.
bool IsMaxExp()
Has max EXP for the current weapon?
void ZeroExpMyChar()
Reset experience for the currently selected weapon.
bool AddArmsData(long code, long max_num)
Add arms data.
void Respawn(int iTime)
Respawn this client in a fixed amount of time.
void EquipItem(int flag, bool val)
Set / clear equip flags.
bool is_done
Whether or not we're done scoping resources.
Definition: CaveNet_ExportedTypes.h:2250
NetSocket * GetSocket()
Get this client's NetSocket.
Definition: CaveNet_ExportedTypes.h:3242
int queue_count
The number of packets in this queue.
Definition: CaveNet_ExportedTypes.h:2278
void CacheDeath()
Cache our death NPC if we can.
void AutoAdminCheck()
Check for administrator privileges for this client.
void GetFaceInfo(GUI_RECT *face_src_rect, Surface_Ids *surf_id, Surface_Ids *mask_id)
Get the face info for this client.
MYCHAR * GetMyChar(bool bRequired=false)
Get this client's MYCHAR object.
Definition: CaveNet_ExportedTypes.h:4136
void CleanNPC(int index)
Mark an NPC at the given index as 'clean'.
NetTeam * GetTeam()
Get this client's team.
Definition: CaveNet_ExportedTypes.h:2569
void ProcessGhosting()
Process ghosting on this client.
int ArmsPrev()
Switch to the previous weapon in our inventory.
void ActStar()
Process the whimsical stars.
CSM_ClientRanks mAdminRank
This client's admin rank.
Definition: CaveNet_ExportedTypes.h:2307
bool NextDownload(bool deleteFirst=true)
Finish the current download & go to the next one.
bool AddPermitStage(int index, int event)
Add a stage permission.
NetPlayer * mPlayer
This client's player object.
Definition: CaveNet_ExportedTypes.h:2323
void SetManifestDirty()
Set all items in this client's manifest cache as 'dirty'.
bool Read(NetPacket *packet)
Read a packet from this client.
void InitializeDirtyList()
Build the initial dirty list; Don't include NPCs that don't exist.
void SendStartEvent()
Transmit the 'start event' packet.
void Say(const char *pMessage)
Have the client say something in chat.
CSM_ClientRanks GetAdminRank()
Get this client's admin rank.
Definition: CaveNet_ExportedTypes.h:3176
void BuildDownloadString(char *out, int out_size)
Get the progress of the current download in string form.
void PredictMovement(int iNewInput, long long int iInputTime, int iClientX, int iClientY)
Predict this client's movement.
int GetPing()
Get this client's ping average.
Definition: CaveNet_ExportedTypes.h:3165
void UpdateSpectator()
Update the spectation target, taking into account text script's focusing.
void TransmitName()
Transmit a name update packet to all clients.
bool SetGameScore(unsigned int iNameHash, unsigned int iAmount, bool bCurrentLife=false)
Set the points of a specific NetScoreType for this client by the NetScoreType's name hash.
void SendDirtyManifest()
Send this client all still-dirty manifest items.
void SendServerInfo()
Send server information to this client.
bool SubPermitStage(int index)
Remove a stage permission.
void FinalizeClient()
Finalize this client.
void ClearItemData()
Clear all item data.
NetClientId mGhostId
This client's Ghost ID.
Definition: CaveNet_ExportedTypes.h:2341
SafeClientInterface * GetInterface()
Get an interface for this client.
IPaddress * GetAddress()
Get the channel this client's address.
Definition: CaveNet_ExportedTypes.h:3232
bool Dismount(bool deleteAnim=true)
Dismount from the player we're mounted on.
bool BuildFullPacket_MovePacket(NetPacket *out)
Construct a full-on move packet.
void ClearDownloadQueue()
Clear the client's download queue.
void HandleGuiAction(int ActionIndex, int Arg1, int Arg2, int Arg3)
Handle any GUI interactions.
void SyncConfigVars()
Synchronize configuration variables.
void RestoreSpectate()
Restore the old spectator target.
bool IsDownloading()
Check to see if this client is downloading.
bool IsCarrying()
Check if we're carrying anybody.
GUI_COLOR GetColor()
Get client color.
Definition: CaveNet_ExportedTypes.h:2811
bool mIsDev
Whether this client is a developer.
Definition: CaveNet_ExportedTypes.h:2303
void DirtyNPC(int index)
Mark an NPC at the given index as 'dirty'.
void InitStar()
Re-initialize the whimsical stars.
bool BuildStemPacket_Join(NetPacket *out)
Build a 'join' packet.
void FreezeIfEventIsRunning()
Self-explanatory.
void SendFlags(bool bSendAll=true)
Send flags.
bool SetArmsDataExact(long index, long code, long max_num, long exp, long level)
Add arms data (exact)
void GetSignalStrengthRect(int *x, int *y, int *w, int *h, bool IncrementFrame=true)
Get the SURFACE_ID_GUI rect for the signal strength of this client.
void RecordFlag(unsigned short iFlagID, bool bFlagValue)
Record a flag change so it can be transmitted to the client.
NetClient()
Default constructor.
void GetScreenRect(int *x_out, int *y_out, int *w_out, int *h_out)
Get this client's screen rect.
bool SetGameScore(const char *pName, unsigned int iAmount, bool bCurrentLife=false)
Set the points of a specific NetScoreType for this client.
void RemoveAllGameScores(bool bReAddMandatory=true, bool bTransmit=true)
Remove all NetScoreInstance objects from this client.
bool mIsReady
I'm ready!
Definition: CaveNet_ExportedTypes.h:2359
bool OpenGUI(CaveNet::DataStructures::GUI_Type gui_type, bool DisableControl=true)
Open a GUI for this client.
bool IsInGUI()
Self-explanatory.
NetSocket * mSocket
The socket this client is using to communicate to us.
Definition: CaveNet_ExportedTypes.h:2327
int GetArmsCount()
Get the amount of valid weapon slots this client has.
void TransmitStars()
Transmit the whimsical stars.
bool AddItemData(long code)
Add an item to inventory.
bool CanCarry(NetClient *other)
Check if we can carry a client.
void ValidateFrame()
Validate this client's frame.
int GetNPCDirtyIndex(int index)
Get the index of a dirty NPC.
CustomPlayer * GetCharacter()
Get our custom player.
void SendPlayerList()
Send the player list to this client.
void ZeroCurrentLifeGameScore()
Zero-out the 'current-life' field of all NetScoreInstance objects tied to this client.
void BackStep(int code_event)
Backstep the player.
NetClient * GetCarryStackDown()
Get the previous carried client.
bool IsBeingCarried()
Check if we're being carried.
bool CanBeCarriedBy(NetClient *other)
Check if we can be carried by a client.
NetDownload ** list
Download queue.
Definition: CaveNet_ExportedTypes.h:2223
void ProcessSpectator()
Process spectation controls.
bool SendPacketQueue(bool bForce=false)
Send all queue'd packets, resetting the send time & clearing the queue.
void Disconnect(NetDisconnectReason eDisconnectReason=NetDisconnectReason::NET_DISCONNECT_REASON_UNKNOWN, const char *pCustomReason=NULL, NetClient *pResponsibleClient=NULL)
Disconnect this client from the server.
void ClearManifest()
Clear this client's manifest.
void GetNamePlateRect(int *x, int *y, int *w, int *h)
Get the rect for the name plate of this client.
bool AddArmsData2(long code, long num, long max_num, long level)
Add arms data.
void TickDownloadQueue()
Tick downloading.
void DrawChatEmote(int fx, int fy)
Draw the emote.
int BuildStemPacket_ScoreInstance(NetPacket *out, CaveNet::DataStructures::NetScoreInstance *pInst=NULL)
Build a 'score instance' packet.
bool CanBeAutoBalanced()
Determine whether this client can be auto balanced or not.
NetPlayer * GetPlayer()
Get this client's player object.
Definition: CaveNet_ExportedTypes.h:3200
bool mIsLocal
Whether this client is local (same-application) or not.
Definition: CaveNet_ExportedTypes.h:2295
bool QueueDownload(NetDownload *ptr)
Queue a download.
float GetTotalGameScore(unsigned long long int iMaskBits, unsigned long long int iNegateMaskBits=0)
Get this client's total score based on flags.
void SetPlayer(NetPlayer *ptr)
Set the player pointer.
Definition: CaveNet_ExportedTypes.h:2384
void SetState(ClientState state)
Set the state of the client.
Definition: CaveNet_ExportedTypes.h:2376
void ResetSpurCharge()
Reset spur charge.
void PutStar(int fx, int fy)
Draw the whimsical stars.
ClientState
Definition: CaveNet_ExportedTypes.h:1833
@ CLIENT_CONNECTED
This client is a client connected to us.
Definition: CaveNet_ExportedTypes.h:1838
bool RemoveGameScore(const char *pName)
Remove all NetScoreInstance objects from this client.
void GenerateNamePlate()
Generate a name on the name plate surface for this user.
bool IsBeingCarriedBy(NetClientId id)
Check to see if we're being carried by a specific client.
bool DownloadResources
Whether this client wants to download resources or not.
Definition: CaveNet_ExportedTypes.h:2212
void AddToPacketQueue(NetPacket *pPacket)
Queue a packet to be sent when the server is ready.
bool is_initialized
Whether the client has already started downloading or not.
Definition: CaveNet_ExportedTypes.h:2231
bool BuildFullPacket_Join(NetPacket *out)
Construct a full-on connection packet.
bool Send(NetPacket *packet, bool bForceSend=false)
Send a packet to this client.
void CalculateZoneCandidates(int zones[CAVENET_CLIENT_MAX_ZONES], int *count)
Calculate & build a list of zone candidates.
void Spawn(int x, int y)
Spawn this client at a set of coordinates.
void CancelPacketQueue()
Cancel & free all queue'd packets.
void ShowServerMessage(const char *pFormat,...)
Show this specific client a server message.
int mConn_Port
Our connection port.
Definition: CaveNet_ExportedTypes.h:2291
void GetTrg()
Update gamekey and gamekeytrg.
int BuildStemPacket_Update(NetPacket *out)
Build an 'update' packet.
int GetTeamBalanceScore()
Calculate a team balance score.
NetClient * GetNextSpectateTarget(Directions iDirect)
Get the next spectator target.
NetPacket ** queue
The queue.
Definition: CaveNet_ExportedTypes.h:2274
NetClientId GetGhostId()
Get this client's ghost ID.
Definition: CaveNet_ExportedTypes.h:3222
void InitClient()
Initialization.
int mChannelNum
The channel number to communicate on.
Definition: CaveNet_ExportedTypes.h:2349
bool IsGhost()
Check to see if this object is a ghost.
Definition: CaveNet_ExportedTypes.h:3190
void AddBullet(int no, int val)
Add ammo to the held weapon.
void TransmitScoreInstances(CaveNet::DataStructures::NetScoreInstance *pInstance=NULL)
Transmit the score instances for this client.
bool mIsBot
Whether this client is a bot or a real user.
Definition: CaveNet_ExportedTypes.h:2299
void TransmitPlayerPhysics()
Transmit the physics for this player.
bool NextResource(bool deleteFirst=true)
Download the next resource.
bool SubArmsData(long code)
Remove arms data.
void SetColor(unsigned char r, unsigned char g, unsigned char b)
Set client color.
void SetPlayerPosition(int x, int y)
Set the player's absolute position.
bool did_start
Whether we started already.
Definition: CaveNet_ExportedTypes.h:2258
int ArmsNext()
Switch to the next weapon in our inventory.
void OccupyZones()
Re-calculate what zones we're in.
bool IsInZone(int zone_idx)
Check to see if we're in a zone.
bool CheckArms(long code)
Check this client's inventory for a weapon.
void OnMapLoad()
Callback for when the map loads.
void SetDirect(int direction)
void FullArmsEnergy()
Set all weapons in this client's inventory to be at full ammo.
bool SetResourceDirty(GameResource *pResource, bool bValue, int iIndex=-1)
Set a resource as dirty.
void TickManifestQueue()
Send a chunk of the download manifest to the client.
void SendBossLife()
Send boss life.
bool CarryPlayer(NetClientId id)
Carry a player.
bool IsTargetSpectatable(NetClient *pTarget)
Determine whether or not the specified client is spectatable.
void ClearSpectate()
Takes this client out of spectator mode.
bool AddGameScore(const char *pName, int iAmount)
Add score to this client.
DynamicSortedPointerBinList< NetScoreInstance *, 1, true > m_ScoreTable
This client's score instances.
Definition: CaveNet_ExportedTypes.h:2313
SafeClientInterface mInterface
The safe client interface that belongs to this client.
Definition: CaveNet_ExportedTypes.h:2353
IPaddress mAddress
This client's IP address.
Definition: CaveNet_ExportedTypes.h:2331
void RemoveFromZone(int zone_idx)
Remove ourselves from a zone.
unsigned long long int last_sent
The last time we sent packets to this client.
Definition: CaveNet_ExportedTypes.h:2286
bool IsAmmoFull()
Check if the missile launcher is full.
void ClearPermitStage()
Clear stage permissions.
bool SetArmsInfo(long code, long exp, long level, long max_num)
Set arms level & experience.
void SetVector(NetClientVector *ptr)
Set the vector pointer.
Definition: CaveNet_ExportedTypes.h:2380
void AddToZone(int zone_idx)
Add ourselves to a zone.
bool HasArmsData(long code)
Check to see if this client has a weapon.
bool is_ready
Whether the client is ready for the next file chunk.
Definition: CaveNet_ExportedTypes.h:2235
void TransmitUpdate()
Transmit an update packet to all clients.
void TransmitPlayerUpdate()
Transmit a player update packet to all clients.
void SetGhostedClient(NetClientId id)
Set this client as a ghosted object.
Definition: CaveNet_ExportedTypes.h:3465
void ClearZones(bool do_remove=true)
Clear our occupied zones.
void SetGhostId(NetClientId id)
Set the ghost ID for this client.
Definition: CaveNet_ExportedTypes.h:3269
int GetTeamId()
Get this client's team id.
Definition: CaveNet_ExportedTypes.h:2574
bool CompareUserIdent(unsigned int *pUserIdent)
Compare this user's ident hash to the one given.
int count
How many files are in the queue.
Definition: CaveNet_ExportedTypes.h:2227
void ChatEmote(int index)
Play an emote.
bool TradeArms(long code1, long code2, long max_num)
Trade arms.
void AddExpToNextValidWeapon(int x)
Add experience to the next valid weapon.
bool Assign(NetSocket *sock, IPaddress *addr, int channel=-2)
Assign this client to a socket & address.
bool QueueResource(GameResource *pResource)
Queue a resource to be checked w/ this client.
const ClientState GetState()
Get the state of the client.
Definition: CaveNet_ExportedTypes.h:3195
bool CanOpenGUI(CaveNet::DataStructures::GUI_Type gui_type)
Check to see if this client can open a type of GUI.
void CacheSpectate()
Cache the current spectator target.
CaveNet::DataStructures::NetScoreInstance * GetGameScoreInstance(const char *pName, bool bAdd=false)
Get a NetScoreInstance by its name.
NetTeam * mTeam
The team we're apart of.
Definition: CaveNet_ExportedTypes.h:2319
int clean_list_size
Size of clean list.
Definition: CaveNet_ExportedTypes.h:2266
int GetZoneIndex(int zone_id)
Find the zone in our array.
void SendTileChange(int x, int y, int new_tile)
Transmit a tile change to a client.
bool was_sent
Whether we sent a resource.
Definition: CaveNet_ExportedTypes.h:2254
bool CloseGUI(bool EnableControl=true)
Close any open GUI for this client.
int BuildStemPacket_UpdatePing(NetPacket *out)
Build an 'update ping' packet.
void ChooseCharacter()
Choose this client's character.
void SendTeamData(NetTeam *pTeam=NULL)
Transmit the 'team update' packet.
int queue_size
The number of packets that this client's queue can hold.
Definition: CaveNet_ExportedTypes.h:2282
char * clean_list
Clean list.
Definition: CaveNet_ExportedTypes.h:2262
unsigned int GetMovePacketCRC()
Calculate a CRC checksum based on multiple values.
MYCHAR * GetDFocus()
Get display focus for mAnimNPCs.
bool SubItemData(long code)
Remove an item.
void ValidateName()
Enforce name uniqueness.
~NetClient()
Default deconstructor.
NetClientVector * mVector
A pointer to the clientgroup that this client is stored within.
Definition: CaveNet_ExportedTypes.h:2335
void ResetGhosting()
Reset ghosting for this client.
ClientState mState
The state of this client.
Definition: CaveNet_ExportedTypes.h:2345
int GetArmsSlot(long code)
Get the slot index of this arms id.
int BuildStemPacket_PlayerUpdate(NetPacket *out)
Build a 'player update' packet.
bool CheckItem(long code)
Check this client's inventory for an item.
bool IsCarryingPlayer(NetClientId id)
Check to see if we're carrying a specific client.
bool IsOurLocalClient()
Check to see whether this client is our local client or not.
void ZeroArmsEnergy_All()
Zero-exp and reset the levels of all weapons in this client's inventory.
const char * GetNetName()
Get this client's netname.
Definition: CaveNet_ExportedTypes.h:3237
void SpectatePlayer(NetClientId ghostId)
Spectate another client.
void PasteState()
Paste the current game state to this client.
int BuildStemPacket_WhimsicalStar(NetPacket *out)
Build a 'whimsical star update' packet.
void AddExp(int x, BOOL spur=false)
Add experience to the held weapon.
CaveNet::DataStructures::NetScoreInstance * GetGameScoreInstanceByHash(unsigned int iNameHash, bool bAdd=false)
Get a NetScoreInstance by its name hash.
void ZeroEquip()
Set / clear equip flags.
NetClient * GetCarryStackUp()
Get the next client in the carry stack.
void SendTextScriptState()
Send the current text script state.
void TransmitMapTileUpdate()
Transmit an update packet to all clients.
Clientgroup iterator.
Definition: CaveNet_ExportedTypes.h:3952
NetClient * next()
Get the first client in a clientgroup.
Definition: CaveNet_ExportedTypes.h:3990
NetClient * first(bool bUseServerClientGroup)
Get the first client in a clientgroup.
Definition: CaveNet_ExportedTypes.h:3979
NetClientIterator()
Default constructor.
Definition: CaveNet_ExportedTypes.h:3966
Stores multiple clients.
Definition: CaveNet_ExportedTypes.h:4001
bool Add(NetClient *client)
Add a client into this vector.
~NetClientVector()
Deconstructor.
NetClient * last()
Get the last entry.
NetClient ** end()
Get the last iterator entry.
void Shrink()
Shrink the vector down to fit the current amount of clients in it.
NetClient * first()
Get the first entry.
void FreeClients()
Clear the vector, whilst also freeing all clients.
NetClient ** iterator
The iterator for NetClientVector.
Definition: CaveNet_ExportedTypes.h:4011
NetClient * operator[](int index)
Array operator – Returns a net client at the given index.
NetClient ** begin()
Get the first iterator entry.
void Clear()
Clear the vector.
NetClientVector()
Constructor.
void Resize(int newSize)
Resize the vector.
int Size()
Get the size of the vector.
bool Remove(NetClient *client)
Remove a client from this vector.
NetClient * operator[](int index) const
Array operator – Returns a net client at the given index.
bool Remove(NetClient **itr)
Remove a client from this vector.
int Count()
Get the number of clients in the vector.
Definition: CaveNet_ExportedTypes.h:775
bool m_NewValue
The new value of the flag.
Definition: CaveNet_ExportedTypes.h:784
unsigned short m_FlagID
The flag ID.
Definition: CaveNet_ExportedTypes.h:780
NetFlagChangeData()
Constructor.
Definition: CaveNet_ExportedTypes.h:803
bool m_Acknowledged
Whether this was acknowledged or not.
Definition: CaveNet_ExportedTypes.h:788
NetFlagChangeData(unsigned short iFlagID, bool bNewValue)
Constructor for DynamicSortedPointerBinList's FindIndex.
Definition: CaveNet_ExportedTypes.h:794
Uniform ping calculation.
Definition: CaveNet_ExportedTypes.h:1381
int mAverage
The average ping.
Definition: CaveNet_ExportedTypes.h:1405
void DoPing()
Notify of ping.
void MissPing()
Notify of missed ping.
int GetAverage()
Get the average ping.
bool mExpectingPong
Expecting a pong?
Definition: CaveNet_ExportedTypes.h:1397
int mCurrent
The current index in mAmount.
Definition: CaveNet_ExportedTypes.h:1401
bool IsTimedOut()
Check if this object can be timed out.
int mLastTime
Last ping time.
Definition: CaveNet_ExportedTypes.h:1385
bool IsLagging()
Check if this object is considered 'lagging'.
int mLastPingTime
Last sent ping time.
Definition: CaveNet_ExportedTypes.h:1389
int mCount
Number of pings.
Definition: CaveNet_ExportedTypes.h:1413
int mLastReceiveTime
Last packet receive time.
Definition: CaveNet_ExportedTypes.h:1393
A networking player.
Definition: CaveNet_ExportedTypes.h:3560
void Kill(bool bResetVelocity=true, PlayerDeathType iDeathType=PlayerDeathType::DEATHTYPE_UNKNOWN, NPCHAR *pKillerNpc=NULL, CaveNet::DataStructures::NetClient *pKillerClient=NULL)
Kill this player.
bool IsMaxExp()
Check to see if this player has max EXP in their held weapon.
unsigned int mMoveHistoryCount
Stores how many movement frames are stored in mMoveHistory.
Definition: CaveNet_ExportedTypes.h:3579
void Damage(int iDamage, bool bExactDamage=false, PlayerDeathType iDamageType=PlayerDeathType::DEATHTYPE_UNKNOWN, CaveNet::DataStructures::NetClient *pKillerClient=NULL, NPCHAR *pKillerNpc=NULL)
Deal damage to this player.
void ShowMyChar(bool val)
Show/hide this player.
void ResetFlag()
Reset the collision flags for this player.
void EndAnimation()
End the current animation.
void Act_Camera(bool bKey)
Process the camera.
bool ApplyClosestPredictionFrame(unsigned long long int iGlobalTime, int iClientX, int iClientY)
Apply the closest frame to the given global timestamp.
bool BeginFishing()
Begin fishing.
bool Tackle(int level)
Begin tackling.
void HitMyCharBullet()
Player collision checking against bullets.
int GetPlayerState()
Get the playerstate for this player.
void Act(bool bKey)
Tick this player's movement logic.
bool TeleportIn()
Teleports the player in.
bool IsPlayerState(int iStateType)
Check to see if this player is in the specified state.
Definition: CaveNet_ExportedTypes.h:3808
unsigned long long int GetPlayerStateFlagsFromCarrier()
Get the playerstate flags from the player we're being carried by.
NetPlayerFrameInfo * mMoveHistory
Movement prediction information.
Definition: CaveNet_ExportedTypes.h:3575
void StartAI()
Start AI routine (if this is a bot).
void HitMyCharBoss()
Player collision checking against bosses.
void HitMyCharNpChar()
Player collision checking against NPCs.
bool BecomeCarried(CaveNet::DataStructures::NetClient *pClient)
Become a carried NPC.
PlayerStateAnimator_OutputType GetPlayerStateAnimatorType()
Returns the animator type for this player.
NetPlayerFrameInfo * FindClosestPredictionFrame(unsigned long long int iGlobalTime, int iClientX, int iClientY)
Get the closest movement frame to the given timestamp.
unsigned long long int GetPlayerStateFlags()
Get the playerstate flags for this player.
bool dead
Whether this client is dead or not.
Definition: CaveNet_ExportedTypes.h:3602
void Put(int fx, int fy)
Draw this player.
MYCHAR npc
This player's MYCHAR representation.
Definition: CaveNet_ExportedTypes.h:3598
int CanShoot()
Check to see if this player can shoot.
void AddPredictionFrame()
Remember the current playerstate for movement prediction.
void GetTrg()
Update this client's gameKey, gameKeyTrg, key and keyTrg.
NetClient * GetClient()
Get the client that owns this player.
Definition: CaveNet_ExportedTypes.h:3944
AI_Brain * brain
AI Brain.
Definition: CaveNet_ExportedTypes.h:3587
void SetPosition(int x, int y)
bool BecomeDead()
Death animation.
void ClearPredictionFrames()
Clear all prediction frames.
bool TeleportOut()
Teleports the player out.
bool enabled
AI enabled.
Definition: CaveNet_ExportedTypes.h:3591
void AirProcess()
Process underwater air.
void HitMyCharMap()
Player collision checking against map tiles.
bool CanBeRevived()
Check to see if this player can be revived right now.
void Revive(bool restoreControl, int health=1, NetClient *pSavior=NULL, bool bAnnounce=true)
Revive this player.
void HitMyCharMapNoclip()
Player collision checking against map tiles whilst in noclip mode.
bool IsAnimating()
Check to see if this player is currently being animated.
Definition: CaveNet_ExportedTypes.h:3675
void EndAI()
End AI routine (if this is a bot).
Definition: CaveNet_ExportedTypes.h:674
NetScoreInstance(CaveNet::DataStructures::NetScoreType *pType)
Constructor for DynamicSortedPointerBinList's FindIndex.
Definition: CaveNet_ExportedTypes.h:705
bool m_TimerStarted
The amount of points this player has this life.
Definition: CaveNet_ExportedTypes.h:699
unsigned int m_CurrentLifePoints
The amount of points this player has this life.
Definition: CaveNet_ExportedTypes.h:691
NetScoreInstance()
Constructor.
Definition: CaveNet_ExportedTypes.h:717
unsigned int m_TotalPoints
The amount of points this instance has.
Definition: CaveNet_ExportedTypes.h:683
unsigned int m_MostPointsEver
The most points this player ever had.
Definition: CaveNet_ExportedTypes.h:687
NetScoreType * m_Info
This instance's type.
Definition: CaveNet_ExportedTypes.h:679
long long m_TimerStartTime
The amount of points this player has this life.
Definition: CaveNet_ExportedTypes.h:695
Score type.
Definition: CaveNet_ExportedTypes.h:553
char * m_Name
The name of this score type.
Definition: CaveNet_ExportedTypes.h:572
~NetScoreType()
Deconstructor.
bool BuildUIString(CaveNet::DataStructures::NetClient *pClient, NetScoreInstance *pInstance, char *pOutBuffer, unsigned int iBufferSize, const char *pStatHexColor=NULL, const char *pDynamicFormatAdd=NULL)
Build the UI string.
static NetScoreType * gFirst
First object in the linkage.
Definition: CaveNet_ExportedTypes.h:558
CSM_NetScore_GetScoreModifyAmount m_GetScoreFunc
A pointer to the function that will calculate the amount of score to be modified.
Definition: CaveNet_ExportedTypes.h:588
NetScoreType * gPrev
Previous object in the linkage.
Definition: CaveNet_ExportedTypes.h:566
void Init()
Initialize this mode.
NetScoreType * gNext
Next object in the linkage.
Definition: CaveNet_ExportedTypes.h:562
unsigned long long int m_Flags
This type's flags.
Definition: CaveNet_ExportedTypes.h:598
char * m_DispFormatDynamic
The display format of this type.
Definition: CaveNet_ExportedTypes.h:580
char * m_DispFormatName
The display format of this type.
Definition: CaveNet_ExportedTypes.h:576
unsigned long long int m_MaskBits
This type's mask bits.
Definition: CaveNet_ExportedTypes.h:593
unsigned int m_NameHash
The hash of this type's name.
Definition: CaveNet_ExportedTypes.h:584
NetScoreType()
Constructor.
Player teams.
Definition: CaveNet_ExportedTypes.h:860
bool mIsClientSide
Stores whether this team is clientside or serverside.
Definition: CaveNet_ExportedTypes.h:1002
bool AddMember(NetClient *pClient, bool bAnnounce=true)
Add a client to this team.
NetTeam * next
Next team in the link.
Definition: CaveNet_ExportedTypes.h:966
static NetTeam * client_first
First team in the client-sided link.
Definition: CaveNet_ExportedTypes.h:950
int GetNpcSpawnIndex()
Get the spawn index.
Definition: CaveNet_ExportedTypes.h:1107
char * mName
The team name.
Definition: CaveNet_ExportedTypes.h:986
NetTeamConfig mConfig
This team's configuration.
Definition: CaveNet_ExportedTypes.h:1030
int GetMemberCount()
Get this team's member count.
static NetTeam * server_first
First team in the server-sided link.
Definition: CaveNet_ExportedTypes.h:954
bool IsClientSide()
Get whether this team is client-sided or not.
Definition: CaveNet_ExportedTypes.h:1102
static NetTeam * FindTeamByName(const char *pName, bool bClientSide)
Find a team by name.
void SetNpcSpawnIndex(int iIndex)
Set the NPC spawn index.
static NetTeam * GetTeamByIndex(int iTeamIndex, bool bClientSide)
Fetch a team by index.
void WritePacket(NetPacket *pPacket)
Write a team packet.
GUI_COLOR mColor
The team color.
Definition: CaveNet_ExportedTypes.h:990
void SpawnClient(NetClient *pClient)
Spawn a player.
void SetName(const char *pNewName)
Set the team's name.
void ClearMembers()
Clear all members from this team.
List< NetClient * > mClientList
The clients in this team.
Definition: CaveNet_ExportedTypes.h:998
static int OpenTeamEditMenu(NetTeam *pTeam=NULL)
Opens an easy-to-use dialog that will allow the host to add or edit a team.
void ResetConfig()
Reset this team's configuration.
NetTeamId GetTeamId()
Get this team's ID.
Definition: CaveNet_ExportedTypes.h:1097
NetClient * GetMember(int iIndex)
Get a member of this team.
GUI_COLOR GetColor()
Get this team's color.
Definition: CaveNet_ExportedTypes.h:1087
TeamType mTeamType
The team type.
Definition: CaveNet_ExportedTypes.h:1012
int mSpawnNpcIndex
The NPC index of the spawn object.
Definition: CaveNet_ExportedTypes.h:1006
static bool AreTeamsUnbalanced(NetTeamId &iHighestTeam, NetTeamId &iLightestTeam)
Check to see if teams are unbalanced.
GUI_POINT GetSpawnPosition()
Get the spawn position for this team.
bool IsMember(NetClient *pClient)
Check if a client is a member of this team.
void ReadPacket(NetPacket *pPacket)
Read a team packet.
unsigned int SizePacket()
Size up a team packet.
NetTeam * prev
Previous team in the link.
Definition: CaveNet_ExportedTypes.h:970
NetTeamId mTeamId
The team net ID.
Definition: CaveNet_ExportedTypes.h:982
static void BalanceTeams(bool bOnlySwitchDeadPlayers=false)
Autobalance teams.
static NetTeam * FindTeamByType(TeamType iTeamType, bool bClientSide)
Find a team by type.
void Link()
Link this team to the rest.
static void ClearAllTeams()
Delete all teams.
void SetColor(GUI_COLOR pColor)
Set the team's color.
static int OpenTeamListMenu()
Opens an easy-to-use dialog that will allow the host to go through teams.
void Unlink()
Unlink this team from the rest.
List< NPCHAR * > mSpawnPoints
A list of NPCs that represent spawn points.
Definition: CaveNet_ExportedTypes.h:1016
bool AddSpawnPoint(int iNpcIdx)
Add a spawn point to this team.
bool RemoveMember(NetClient *pClient, bool bAnnounce=true)
Remove a member for this team.
static NetTeam * FindTeamById(NetTeamId iTeamId, bool bClientSide)
Find a team by id.
const char * GetHexColor()
Get this team's color in hexidecimal.
Definition: CaveNet_ExportedTypes.h:1092
NPCHAR * mCaptureZoneNpc
This team's CTP capture zone.
Definition: CaveNet_ExportedTypes.h:1024
NPCHAR * mFlagNpc
This team's CTP flag.
Definition: CaveNet_ExportedTypes.h:1020
void UpdateTeam()
Send a team update to all clients.
const char * GetName()
Get this team's name.
Definition: CaveNet_ExportedTypes.h:1082
NetTeam(NetTeamId iTeamId, bool bClientSide=true)
Client-side constructor.
static unsigned int server_count
Total count of server-side teams.
Definition: CaveNet_ExportedTypes.h:958
static unsigned int client_count
Total count of client-side teams.
Definition: CaveNet_ExportedTypes.h:962
static NetTeamId GetNextFreeTeamId(bool bClientSide)
Get the next free team ID.
A pointer-safe sortable client.
Definition: CaveNet_ExportedTypes.h:465
NetClient * GetClient(bool Server)
Get the client associated with this.
PSSortableClient()
Default constructor.
Definition: CaveNet_ExportedTypes.h:499
NetClient * GetClient(bool Server) const
Get the client associated with this.
NetClientId m_GhostId
The client's ghost id.
Definition: CaveNet_ExportedTypes.h:470
PSSortableClient(int key)
Constructor used to find an entry.
Definition: CaveNet_ExportedTypes.h:481
PSSortableClient(NetClientId ghostId, int key)
Real constructor.
Definition: CaveNet_ExportedTypes.h:491
int m_Key
The key for this.
Definition: CaveNet_ExportedTypes.h:474
A sortable client class, to be used with SortedBinList.
Definition: CaveNet_ExportedTypes.h:403
SortableClient()
Deconstructor.
Definition: CaveNet_ExportedTypes.h:426
NetClient * m_Client
A pointer to the client.
Definition: CaveNet_ExportedTypes.h:408
int m_Key
The key.
Definition: CaveNet_ExportedTypes.h:412
SortableClient(int key)
Constructor.
Definition: CaveNet_ExportedTypes.h:418
CAVESTORY_MOD_API bool CaveNet_Server_IsHosting()
Check if we're hosting a server.
Definition: CavestoryModAPI.cpp:634
CAVESTORY_MOD_API int CaveNet_Server_ClientGroup_GetClientCount()
Get the amount of clients currently cached.
Definition: CavestoryModAPI.cpp:668
CAVESTORY_MOD_API CaveNet::DataStructures::NetClient * CaveNet_Client_ClientGroup_GetClientByGhostId(int ghost_id)
Get a client object by their ghost id.
Definition: CavestoryModAPI.cpp:617
CAVESTORY_MOD_API CaveNet::DataStructures::NetClient * CaveNet_Server_ClientGroup_AddBot(const char *pBotName=NULL, const char *pCharName=NULL, unsigned char iColorR=0, unsigned char iColorG=0, unsigned char iColorB=0, bool bRandomColor=false)
Create a bot.
Definition: CavestoryModAPI.cpp:650
CAVESTORY_MOD_API bool CaveNet_Client_IsInGui()
Check if we're in a GUI.
Definition: CavestoryModAPI.cpp:597
CAVESTORY_MOD_API unsigned int CaveNet_GetGlobalTimerOffset()
Get the best global timer.
CAVESTORY_MOD_API int CaveNet_Client_ClientGroup_GetClientCount()
Get the amount of clients currently cached.
Definition: CavestoryModAPI.cpp:622
CAVESTORY_MOD_API bool CaveNet_Server_InLobby()
Check if we're in the lobby.
Definition: CavestoryModAPI.cpp:639
CAVESTORY_MOD_API CaveNet::DataStructures::NetClient * CaveNet_Server_ClientGroup_GetClient(int index)
Get a client object.
Definition: CavestoryModAPI.cpp:658
CAVESTORY_MOD_API void CaveNet_ProcessNet(int type=-1)
Process networking.
CAVESTORY_MOD_API char * CaveNet_BuildDisconnectReasonString(char *pBuffer=NULL, unsigned int iBufferSize=0, CaveNet::NetDisconnectReason eDisconnectReason=CaveNet::NetDisconnectReason::NET_DISCONNECT_REASON_UNKNOWN, const char *pCustomReason=NULL, CaveNet::DataStructures::NetClient *pResponsibleClient=NULL)
Build a disconnect reason string.
CAVESTORY_MOD_API bool CaveNet_Client_IsConnected()
Check if we're connected to a server.
Definition: CavestoryModAPI.cpp:602
CAVESTORY_MOD_API CaveNet::DataStructures::NetClient * CaveNet_Server_ClientGroup_GetClientByGhostId(int ghost_id)
Get a client object by their ghost id.
Definition: CavestoryModAPI.cpp:663
CAVESTORY_MOD_API void CaveNet_CreateTeam(int iTeamId, bool bClientSide, void *pOut)
Create a team object.
Definition: CavestoryModAPI.cpp:587
CAVESTORY_MOD_API void CaveNet_Server_EnterLobby()
Enter the lobby.
Definition: CavestoryModAPI.cpp:644
CAVESTORY_MOD_API int CaveNet_Client_GetGhostId()
Get our ghost ID.
Definition: CavestoryModAPI.cpp:607
CAVESTORY_MOD_API CaveNet::DataStructures::NetClient * CaveNet_Client_ClientGroup_GetClient(int index)
Get a client object.
Definition: CavestoryModAPI.cpp:612
CAVESTORY_MOD_API unsigned int CaveNet_Server_GetGlobalTimerOffset()
Get the server-side global timer.
Definition: CavestoryModAPI.cpp:629
CAVESTORY_MOD_API unsigned int CaveNet_Client_GetGlobalTimerOffset()
Get the global timer.
Definition: CavestoryModAPI.cpp:592
CAVESTORY_MOD_API void CaveNet_Server_ClientGroup_ReviveAllDeadPlayers()
Revive all dead players.
Definition: CavestoryModAPI.cpp:686
CAVESTORY_MOD_API void CaveNet_Server_ClientGroup_TransmitSystemMessage(const char *pFormat,...)
Transmit a system message.
Definition: CavestoryModAPI.cpp:673
#define BULLET_MAX
How many bullets can be initialized at one time.
Definition: CSMAPI_defines.h:42
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:31
#define NPC_MAX
How many npcs can be initialized at one time.
Definition: CSMAPI_defines.h:49
#define ITEM_MAX
How many items can be initialized at one time for each client.
Definition: CSMAPI_defines.h:44
#define BOSS_MAX
How many bosses can be initialized at one time.
Definition: CSMAPI_defines.h:51
#define ARMS_MAX
How many weapons can be initialized at one time for each client.
Definition: CSMAPI_defines.h:43
Weapon object.
Definition: CSMAPI_types.h:1264
AI Controls.
Definition: CaveNet_ExportedTypes.h:1540
bool bUp
Look up.
Definition: CaveNet_ExportedTypes.h:1551
bool bRight
Go right.
Definition: CaveNet_ExportedTypes.h:1547
bool bDown
Look down / search.
Definition: CaveNet_ExportedTypes.h:1555
bool bJump
Jump.
Definition: CaveNet_ExportedTypes.h:1559
bool bLeft
Go left.
Definition: CaveNet_ExportedTypes.h:1543
bool bShoot
Shoot.
Definition: CaveNet_ExportedTypes.h:1563
bool bArmsNext
Next weapon.
Definition: CaveNet_ExportedTypes.h:1571
bool bArmsPrev
Previous weapon.
Definition: CaveNet_ExportedTypes.h:1567
Definition: CaveNet_ExportedTypes.h:1861
int star_cached
Cache star count.
Definition: CaveNet_ExportedTypes.h:1974
int bytes_lost
Total Bytes lost.
Definition: CaveNet_ExportedTypes.h:2065
DynamicSortedBinList< NetFlagChangeData, 1, true > flag_change_list
A list that holds all changed flag IDs.
Definition: CaveNet_ExportedTypes.h:2197
int chat_emote_spam_amount
Chat emote spam amount.
Definition: CaveNet_ExportedTypes.h:2013
bool is_initialized
Whether this client is initialized or not.
Definition: CaveNet_ExportedTypes.h:1912
int lastPingLagTime
Last ping lag time.
Definition: CaveNet_ExportedTypes.h:1936
int hp_bar_wait
HP bar timer before it dissapears.
Definition: CaveNet_ExportedTypes.h:2001
int net_name_hash
The hash of CaveNet::DataStructures::NetClient::CLIENT_CACHE::net_name.
Definition: CaveNet_ExportedTypes.h:2053
int oldGameFlags
Old game flags.
Definition: CaveNet_ExportedTypes.h:1950
bool ClientSide_Lagging
Whether this client is deemed as 'lagging' (for client-side clients only)
Definition: CaveNet_ExportedTypes.h:2120
NetClientId carrying_ghost_id
The client we're carrying.
Definition: CaveNet_ExportedTypes.h:2029
unsigned char ssidx
"Signal Strength Index".
Definition: CaveNet_ExportedTypes.h:2153
int x
X position.
Definition: CaveNet_ExportedTypes.h:2136
int h
Height.
Definition: CaveNet_ExportedTypes.h:2148
bool has_finalized
Whether this client has finalized initialization.
Definition: CaveNet_ExportedTypes.h:1986
char sendPingPacket
When to send a ping packet.
Definition: CaveNet_ExportedTypes.h:1962
NetPing ping
Ping object for this client.
Definition: CaveNet_ExportedTypes.h:2103
int create_time
Our creation time.
Definition: CaveNet_ExportedTypes.h:2165
PXDEMO_PLAYER_STRUCT * recorder_player
Our player that's being recorded.
Definition: CaveNet_ExportedTypes.h:2157
int gameKeyTrg
KeyTrg.
Definition: CaveNet_ExportedTypes.h:2086
bool collectables_shown
Collectables shown.
Definition: CaveNet_ExportedTypes.h:2177
int chat_emote_index
Chat emote index.
Definition: CaveNet_ExportedTypes.h:2005
int w
Width.
Definition: CaveNet_ExportedTypes.h:2144
unsigned int last_supply_time
Last time we interacted with a supply cabinet.
Definition: CaveNet_ExportedTypes.h:2193
List< NetClient_MapTileChange > tile_change_list
do not use
Definition: CaveNet_ExportedTypes.h:1876
bool is_ghost
Whether this is a client-side client or a server-side client.
Definition: CaveNet_ExportedTypes.h:2045
int puppy_spawn_time
...
Definition: CaveNet_ExportedTypes.h:2181
int currentWeapon
This client's currently selected weapon.
Definition: CaveNet_ExportedTypes.h:1932
int gameFlags
This client's game flags.
Definition: CaveNet_ExportedTypes.h:1945
List< GhostInfo > ghostlist
This client's ghosting queue.
Definition: CaveNet_ExportedTypes.h:1880
int star_update
Star update.
Definition: CaveNet_ExportedTypes.h:1970
bool is_old_spectator
Whether this client was spectating or not.
Definition: CaveNet_ExportedTypes.h:1920
bool invulnerable
Whether this client has godmode forced on or not.
Definition: CaveNet_ExportedTypes.h:2205
int chat_emote_yoffset
Chat emote Y offset.
Definition: CaveNet_ExportedTypes.h:2021
int basil_spawn_time
...
Definition: CaveNet_ExportedTypes.h:2185
bool spur_max
Whether this client's spur charge is at maximum.
Definition: CaveNet_ExportedTypes.h:1982
int key
Key inputs.
Definition: CaveNet_ExportedTypes.h:2077
int keyTrg
Key inputs (trg)
Definition: CaveNet_ExportedTypes.h:2073
long long int lastMoveTime
Last movement time (using SDL_GetTicks())
Definition: CaveNet_ExportedTypes.h:1990
int ClientSide_Download_FilesLeft
Download files left for this client (for client-side clients only)
Definition: CaveNet_ExportedTypes.h:2128
NetClientId current_spectate_trg
This client's spectate target.
Definition: CaveNet_ExportedTypes.h:1924
int bytes_received
Total bytes received.
Definition: CaveNet_ExportedTypes.h:2057
GUI_POINT death_position
Persistent death NPC.
Definition: CaveNet_ExportedTypes.h:2099
unsigned long long int lastInputChangeTime
Last time input changed (using CaveNet::Server::GetGlobalTimerOffset())
Definition: CaveNet_ExportedTypes.h:1994
int curr_map
Current map index.
Definition: CaveNet_ExportedTypes.h:1958
int ClientSide_AveragePing
This client's calculated ping (for client-side clients only)
Definition: CaveNet_ExportedTypes.h:2116
ClientColor char_color
This client's cached playercolor.
Definition: CaveNet_ExportedTypes.h:1864
int soft_rensha
Soft rensha; for weapons.
Definition: CaveNet_ExportedTypes.h:1940
int bytes_sent
Total bytes sent.
Definition: CaveNet_ExportedTypes.h:2061
int gameKeyOld
Old game keys.
Definition: CaveNet_ExportedTypes.h:2081
NetClientId old_spectate_trg
This client's old spectate target.
Definition: CaveNet_ExportedTypes.h:1928
bool use_color
Whether to use this client's cached playercolor.
Definition: CaveNet_ExportedTypes.h:1868
int OpenedGUI
Which GUI this client has opened.
Definition: CaveNet_ExportedTypes.h:2112
int chat_emote_timer
Chat emote timer.
Definition: CaveNet_ExportedTypes.h:2009
int frame_y
This client's predicted camera Y.
Definition: CaveNet_ExportedTypes.h:2037
NetClientId carried_by_ghost_id
The client being carried by us.
Definition: CaveNet_ExportedTypes.h:2025
bool notarget
Whether this client has notarget forced on or not.
Definition: CaveNet_ExportedTypes.h:2201
int collectable_count
Collectable count.
Definition: CaveNet_ExportedTypes.h:2173
int empty
Empty.
Definition: CaveNet_ExportedTypes.h:1954
SortedBinList< int, CAVENET_CLIENT_MAX_ZONES > zonelist
A list of zones this client's player is currently occupying.
Definition: CaveNet_ExportedTypes.h:1888
bool is_our_player
Whether this is our local player.
Definition: CaveNet_ExportedTypes.h:2049
int key_old
Old key.
Definition: CaveNet_ExportedTypes.h:2069
int frame_x
This client's predicted camera X.
Definition: CaveNet_ExportedTypes.h:2033
unsigned int lastMovePacketCRC
Last move input keys.
Definition: CaveNet_ExportedTypes.h:1998
int death_map
The index number of the map where this client died.
Definition: CaveNet_ExportedTypes.h:2095
bool got_packet
Got packet on this tick.
Definition: CaveNet_ExportedTypes.h:2107
bool is_spectating
Whether this client is spectating or not.
Definition: CaveNet_ExportedTypes.h:1916
unsigned int respawn_time
...
Definition: CaveNet_ExportedTypes.h:2189
int gameKey
Key.
Definition: CaveNet_ExportedTypes.h:2091
int y
Y position.
Definition: CaveNet_ExportedTypes.h:2140
int chat_emote_spam_cooldown
Chat emote spam cooldown.
Definition: CaveNet_ExportedTypes.h:2017
int spur_charge
This client's spur charge.
Definition: CaveNet_ExportedTypes.h:1978
bool ClientSide_Downloading
Whether this client is downloading files (for client-side clients only)
Definition: CaveNet_ExportedTypes.h:2124
int last_team_switch_time
The last time we switched teams.
Definition: CaveNet_ExportedTypes.h:2161
char allow_char_move
Allow char move.
Definition: CaveNet_ExportedTypes.h:2169
Definition: CaveNet_ExportedTypes.h:1845
char r
Red.
Definition: CaveNet_ExportedTypes.h:1848
char b
Blue.
Definition: CaveNet_ExportedTypes.h:1856
char g
Green.
Definition: CaveNet_ExportedTypes.h:1852
Stores changed map tile information.
Definition: CaveNet_ExportedTypes.h:1275
bool operator!=(const NetClient_MapTileChange &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1296
bool operator>=(const NetClient_MapTileChange &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1324
short new_tile_id
The new tile index to be set.
Definition: CaveNet_ExportedTypes.h:1282
int tile_index
The index in gMap.tiles of the tile.
Definition: CaveNet_ExportedTypes.h:1278
NetClient_MapTileChange()
Constructor.
Definition: CaveNet_ExportedTypes.h:1328
bool operator==(const NetClient_MapTileChange &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1289
bool operator<=(const NetClient_MapTileChange &other) const
For SortedBinList compatibility.
Definition: CaveNet_ExportedTypes.h:1310
NetClient_MapTileChange(int index)
Constructor.
Definition: CaveNet_ExportedTypes.h:1336
Movement prediction information.
Definition: CaveNet_ExportedTypes.h:3520
unsigned long long int time
The global time at which this frame was saved.
Definition: CaveNet_ExportedTypes.h:3523
bool dead
Whether the player is dead.
Definition: CaveNet_ExportedTypes.h:3531
bool spur_max
Whether this client's spur charge is at maximum.
Definition: CaveNet_ExportedTypes.h:3543
unsigned long long int game_tick
The game tick that we were at when this was recorded.
Definition: CaveNet_ExportedTypes.h:3527
int spur_charge
This client's spur charge.
Definition: CaveNet_ExportedTypes.h:3539
int current_weapon
The current select weapon.
Definition: CaveNet_ExportedTypes.h:3547
MYCHAR info
The information for this frame.
Definition: CaveNet_ExportedTypes.h:3535
int soft_rensha
Soft rensha; for weapons.
Definition: CaveNet_ExportedTypes.h:3551
Stores statistics of a connection.
Definition: CaveNet_ExportedTypes.h:1348
int step_bytes
Numbers of bytes received last read.
Definition: CaveNet_ExportedTypes.h:1363
void Reset()
Reset the statistics.
Definition: CaveNet_ExportedTypes.h:1367
int total_packets
Total number of packets received over the lifetime of a connection.
Definition: CaveNet_ExportedTypes.h:1351
int total_bytes
Total number of bytes received overall.
Definition: CaveNet_ExportedTypes.h:1355
int step_packets
Number of packets parsed last read.
Definition: CaveNet_ExportedTypes.h:1359
Controls NetTeam configuration.
Definition: CaveNet_ExportedTypes.h:900
float damage_out_mult
Damage multiplier for the amount of damage team members deal to other entities / players.
Definition: CaveNet_ExportedTypes.h:915
bool friendly_fire
Whether to allow friendly fire or not.
Definition: CaveNet_ExportedTypes.h:903
bool enable_leveling_weapons
Enable leveling up weapons.
Definition: CaveNet_ExportedTypes.h:911
bool allow_autobalance
Whether this team can be autobalanced to / from.
Definition: CaveNet_ExportedTypes.h:943
unsigned int max_life
The maximum life points that team members spawn with.
Definition: CaveNet_ExportedTypes.h:931
int max_members
Maximum amount of members for this team.
Definition: CaveNet_ExportedTypes.h:939
int score
The score for this team.
Definition: CaveNet_ExportedTypes.h:935
bool force_outfit_color
Force outfit color.
Definition: CaveNet_ExportedTypes.h:907
float damage_in_mult
Damage multiplier for the amount of damage team members take.
Definition: CaveNet_ExportedTypes.h:919
unsigned int equip_flags
Initial equip flags for team members.
Definition: CaveNet_ExportedTypes.h:927
Stores information for spawning weapons.
Definition: CaveNet_ExportedTypes.h:879
int max_ammo
The maximum ammo.
Definition: CaveNet_ExportedTypes.h:894
int weapon_id
The ID of the weapon.
Definition: CaveNet_ExportedTypes.h:882
int ammo
The starting ammo.
Definition: CaveNet_ExportedTypes.h:890
unsigned char level
The level of the weapon.
Definition: CaveNet_ExportedTypes.h:886
Manages colors.
Definition: CSMAPI_types.h:497
Manages points.
Definition: CSMAPI_types.h:546
Definition: CSMAPI_types.h:842
Definition: CaveNet_ExportedTypes.h:43
Item object.
Definition: CSMAPI_types.h:1289
Player character object.
Definition: CSMAPI_types.h:1470
NPC object.
Definition: CSMAPI_types.h:2021
Permit stage object.
Definition: CSMAPI_types.h:1253
Player info.
Definition: GameDemo.h:430
SafeClientInterface.
Definition: CSMAPI_types.h:1775
Text script pointer data.
Definition: CSMAPI_types.h:2528
Whimsical star object.
Definition: CSMAPI_types.h:2282