Cavestory Mod API
CaveNet_ExportedTypes.h
Go to the documentation of this file.
1 /*
2  Cavestory Multiplayer API
3  Copyright (C) 2021 Johnny Ledger
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
26 #pragma once
27 
28 #include <CaveNet_Config.h>
29 #include <CaveNet_EnumData.h>
30 
31 #include <SortedBinList.h>
32 #include <List.h>
33 
34 #include <CSMAPI_begincode.h>
35 
36 class GameResource;
38 
39 #ifdef CAVESTORY_MOD_EXPORTS
40 #include <SDL_net.h>
41 #else
42 typedef struct
43 {
44  unsigned int host; /* 32-bit IPv4 host address */
45  unsigned short port; /* 16-bit protocol port */
46 } IPaddress;
47 #endif
48 
52 namespace CaveNet
53 {
54  namespace DataStructures
55  {
56  class NetScoreInstance;
57  class NetScoreType;
58  class PSSortableClient;
59  class NetClientVector;
60  class SortableClient;
61  class AI_ActionBase;
62  class NetDownload;
63  class NetPacket;
64  class NetSocket;
65  class NetClient;
66  class NetPlayer;
67  class AI_Brain;
68  class NetTeam;
69  };
70 };
71 
72 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
73 
78 (
79  int iTeamId,
80  bool bClientSide,
81  void* pOut
82 );
83 
88 (
89 );
90 
95 (
96 );
97 
102 (
103 );
104 
109 (
110 );
111 
118 (
119  int index
120 );
121 
128 (
129  int ghost_id
130 );
131 
136 (
137 );
138 
139 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
140 
145 (
146 );
147 
152 (
153 );
154 
159 (
160 );
161 
165 (
166 );
167 
179 (
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
186 );
187 
194 (
195  int index
196 );
197 
204 (
205  int ghost_id
206 );
207 
212 (
213 );
214 
220 (
221  const char* pFormat,
222  ...
223 );
224 
228 (
229 );
230 
231 //------------------------------------------------------------
232 
239 (
240 );
241 
246 (
247  int type = -1
248 );
249 
260 (
261  char* pBuffer = NULL,
262  unsigned int iBufferSize = 0,
263  CaveNet::NetDisconnectReason eDisconnectReason = CaveNet::NetDisconnectReason::NET_DISCONNECT_REASON_UNKNOWN,
264  const char* pCustomReason = NULL,
265  CaveNet::DataStructures::NetClient* pResponsibleClient = NULL
266 );
267 
268 //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
269 
270 namespace CaveNet
271 {
272  namespace DataStructures
273  {
274  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
276 
280  {
283 
286 
288  FLAG_CLEAR
289  };
290 
294  {
297 
300 
303 
306  };
307 
310  enum GUI_Type
311  {
313  GUI_NONE = 0,
314 
316  GUI_CAMP, // Arms, items aka inventory
317 
319  GUI_MAP, // The portable map system
320 
322  GUI_COUNT
323  };
324 
328  {
331 
334 
337 
340 
343 
346  };
347 
348  static const char* g_NetDownloadTypeNames[] =
349  {
350  "UNKNOWN",
351  "MAP",
352  "TILESET",
353  "CHARACTER",
354  "IMAGE",
355  };
356 
360  {
363 
366 
369 
372 
375 
378 
381 
384 
387 
390 
393 
396  };
397 
398  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
399 
403  {
404  public: // Variables
405 
409 
412  int m_Key;
413 
414  public: // Constructor
415 
418  SortableClient(int key)
419  {
420  m_Client = NULL;
421  m_Key = key;
422  }
423 
427  {
428  m_Key = 0;
429  m_Client = NULL;
430  }
431 
432  public: // Operators
433 
436  inline bool operator< (const SortableClient& other) const { return m_Key < other.m_Key; }
437 
440  inline bool operator<=(const SortableClient& other) const { return m_Key <= other.m_Key; }
441 
444  inline bool operator> (const SortableClient& other) const { return m_Key > other.m_Key; }
445 
448  inline bool operator>=(const SortableClient& other) const { return m_Key >= other.m_Key; }
449 
452  inline bool operator!=(const SortableClient& other) const { return m_Key != other.m_Key; }
453 
456  inline bool operator==(const SortableClient& other) const { return m_Key == other.m_Key; }
457  };
458 
459  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
460 
465  {
466  public: // Variables
467 
470  NetClientId m_GhostId;
471 
474  int m_Key;
475 
476  public: // Constructor
477 
482  {
483  m_GhostId = NULL;
484  m_Key = key;
485  }
486 
491  PSSortableClient(NetClientId ghostId, int key)
492  {
493  m_GhostId = ghostId;
494  m_Key = key;
495  }
496 
500  {
501  m_GhostId = NULL;
502  m_Key = 0;
503  }
504 
505  public: // Methods
506 
512  NetClient* GetClient(bool Server);
513 
519  NetClient* GetClient(bool Server) const;
520 
521  public: // Operators
524  inline bool operator< (const PSSortableClient& other) const { return m_Key < other.m_Key; }
525 
528  inline bool operator<=(const PSSortableClient& other) const { return m_Key <= other.m_Key; }
529 
532  inline bool operator> (const PSSortableClient& other) const { return m_Key > other.m_Key; }
533 
536  inline bool operator>=(const PSSortableClient& other) const { return m_Key >= other.m_Key; }
537 
540  inline bool operator!=(const PSSortableClient& other) const { return m_Key != other.m_Key; }
541 
544  inline bool operator==(const PSSortableClient& other) const { return m_Key == other.m_Key; }
545  };
546 
547  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
548 
553  {
554  public: // Interal variables
555 
559 
563 
567 
568  public: // Variables
569 
572  char* m_Name;
573 
577 
581 
584  unsigned int m_NameHash;
585 
589 
593  unsigned long long int m_MaskBits;
594 
598  unsigned long long int m_Flags;
599 
600  public: // C++ Stuff
601 
605 
609 
610  public: // Methods
611 
614  void Init();
615 
624  bool BuildUIString(CaveNet::DataStructures::NetClient* pClient, NetScoreInstance* pInstance, char* pOutBuffer, unsigned int iBufferSize, const char* pStatHexColor = NULL, const char* pDynamicFormatAdd = NULL);
625 
626  public: // Operators
627 
630  inline bool operator< (const NetScoreType& other) const
631  {
632  return m_NameHash < other.m_NameHash;
633  }
634 
637  inline bool operator<=(const NetScoreType& other) const
638  {
639  return m_NameHash <= other.m_NameHash;
640  }
641 
644  inline bool operator> (const NetScoreType& other) const
645  {
646  return m_NameHash > other.m_NameHash;
647  }
648 
651  inline bool operator>=(const NetScoreType& other) const
652  {
653  return m_NameHash >= other.m_NameHash;
654  }
655 
658  inline bool operator!=(const NetScoreType& other) const
659  {
660  return m_NameHash != other.m_NameHash;
661  }
662 
665  inline bool operator==(const NetScoreType& other) const
666  {
667  return m_NameHash == other.m_NameHash;
668  }
669  };
670 
671  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
672 
674  {
675  public: // Variables
676 
680 
683  unsigned int m_TotalPoints;
684 
687  unsigned int m_MostPointsEver;
688 
691  unsigned int m_CurrentLifePoints;
692 
695  long long m_TimerStartTime;
696 
700 
701  public: // C++ Stuff
702 
706  {
707  m_Info = pType;
708  m_TotalPoints = 0;
709  m_MostPointsEver = 0;
710  m_CurrentLifePoints = 0;
711  m_TimerStartTime = 0;
712  m_TimerStarted = false;
713  }
714 
718  {
719  m_Info = NULL;
720  m_TotalPoints = 0;
721  m_MostPointsEver = 0;
722  m_CurrentLifePoints = 0;
723  m_TimerStartTime = 0;
724  m_TimerStarted = false;
725  }
726 
727  public: // Operators
728 
731  inline bool operator< (const NetScoreInstance& other) const
732  {
733  return m_Info->m_NameHash < other.m_Info->m_NameHash;
734  }
735 
738  inline bool operator<=(const NetScoreInstance& other) const
739  {
740  return m_Info->m_NameHash <= other.m_Info->m_NameHash;
741  }
742 
745  inline bool operator> (const NetScoreInstance& other) const
746  {
747  return m_Info->m_NameHash > other.m_Info->m_NameHash;
748  }
749 
752  inline bool operator>=(const NetScoreInstance& other) const
753  {
754  return m_Info->m_NameHash >= other.m_Info->m_NameHash;
755  }
756 
759  inline bool operator!=(const NetScoreInstance& other) const
760  {
761  return m_Info->m_NameHash != other.m_Info->m_NameHash;
762  }
763 
766  inline bool operator==(const NetScoreInstance& other) const
767  {
768  return m_Info->m_NameHash == other.m_Info->m_NameHash;
769  }
770  };
771 
772  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
773 
775  {
776  public: // Variables
777 
780  unsigned short m_FlagID;
781 
785 
789 
790  public: // C++ Stuff
791 
794  NetFlagChangeData(unsigned short iFlagID, bool bNewValue)
795  {
796  m_FlagID = iFlagID;
797  m_NewValue = bNewValue;
798  m_Acknowledged = false;
799  }
800 
804  {
805  m_FlagID = 0;
806  m_NewValue = false;
807  m_Acknowledged = false;
808  }
809 
810  public: // Operators
811 
814  inline bool operator< (const NetFlagChangeData& other) const
815  {
816  return m_FlagID < other.m_FlagID;
817  }
818 
821  inline bool operator<=(const NetFlagChangeData& other) const
822  {
823  return m_FlagID <= other.m_FlagID;
824  }
825 
828  inline bool operator> (const NetFlagChangeData& other) const
829  {
830  return m_FlagID > other.m_FlagID;
831  }
832 
835  inline bool operator>=(const NetFlagChangeData& other) const
836  {
837  return m_FlagID >= other.m_FlagID;
838  }
839 
842  inline bool operator!=(const NetFlagChangeData& other) const
843  {
844  return m_FlagID != other.m_FlagID;
845  }
846 
849  inline bool operator==(const NetFlagChangeData& other) const
850  {
851  return m_FlagID == other.m_FlagID;
852  }
853  };
854 
855  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
856 
860  {
861  friend class NetClient;
862  friend class NetPlayer;
863 
864  public: // Enumeration
865 
866  enum TeamType
867  {
868  TEAM_YELLOW = 0,
869  TEAM_GREEN = 1,
870  TEAM_RED = 2,
871  TEAM_BLUE = 3
872  };
873 
874  public: // Structs
875 
879  {
883 
886  unsigned char level;
887 
890  int ammo;
891 
894  int max_ammo;
895  };
896 
900  {
904 
908 
912 
916 
920 
923  NetTeamSpawnWeapon spawn_weapons[ARMS_MAX];
924 
927  unsigned int equip_flags;
928 
931  unsigned int max_life;
932 
935  int score;
936 
940 
944  };
945 
946  public: // Linkage
947 
951 
955 
958  static unsigned int server_count;
959 
962  static unsigned int client_count;
963 
967 
971 
972  private: // Private variables
973 
976  static NetTeamId next_team_id;
977 
978  protected: // Variables
979 
982  NetTeamId mTeamId;
983 
986  char* mName;
987 
991 
994  char mHexColor[7];
995 
998  List<NetClient*> mClientList;
999 
1003 
1007 
1008  public: // NPCs
1009 
1012  TeamType mTeamType;
1013 
1016  List<NPCHAR*> mSpawnPoints;
1017 
1021 
1025 
1026  public: // Public configuration
1027 
1031 
1032  public: // C++ Stuff
1033 
1037 
1040  NetTeam(NetTeamId iTeamId, bool bClientSide = true);
1041 
1045 
1046  protected: // Link methods
1047 
1050  void Link();
1051 
1054  void Unlink();
1055 
1056  public: // Team info methods
1057 
1060  void ResetConfig();
1061 
1065  void SetName(const char* pNewName);
1066 
1070  void SetColor(GUI_COLOR pColor);
1071 
1075  void SetNpcSpawnIndex(int iIndex);
1076 
1077  public: // Inline team info methods
1078 
1082  inline const char* GetName() { return mName; }
1083 
1087  inline GUI_COLOR GetColor() { return mColor; }
1088 
1092  inline const char* GetHexColor() { return mHexColor; }
1093 
1097  inline NetTeamId GetTeamId() { return mTeamId; }
1098 
1102  inline bool IsClientSide() { return mIsClientSide; }
1103 
1107  inline int GetNpcSpawnIndex() { return mSpawnNpcIndex; }
1108 
1109  public: // Member management methods
1110 
1116  bool AddSpawnPoint(int iNpcIdx);
1117 
1122 
1126  void SpawnClient(NetClient* pClient);
1127 
1128  public: // Member management methods
1129 
1135  bool IsMember(NetClient* pClient);
1136 
1143  bool AddMember(NetClient* pClient, bool bAnnounce = true);
1144 
1151  bool RemoveMember(NetClient* pClient, bool bAnnounce = true);
1152 
1157 
1163  NetClient* GetMember(int iIndex);
1164 
1168 
1169  public: // Static methods
1170 
1173  static void ClearAllTeams();
1174 
1181  static NetTeam* FindTeamByName(const char* pName, bool bClientSide);
1182 
1189  static NetTeam* FindTeamById(NetTeamId iTeamId, bool bClientSide);
1190 
1197  static NetTeam* FindTeamByType(TeamType iTeamType, bool bClientSide);
1198 
1205  static NetTeam* GetTeamByIndex(int iTeamIndex, bool bClientSide);
1206 
1213  static bool AreTeamsUnbalanced(NetTeamId& iHighestTeam, NetTeamId& iLightestTeam);
1214 
1218  static void BalanceTeams(bool bOnlySwitchDeadPlayers = false);
1219 
1225  static NetTeamId GetNextFreeTeamId(bool bClientSide);
1226 
1227  public: // Networking
1228 
1232  void WritePacket(NetPacket* pPacket);
1233 
1237  unsigned int SizePacket();
1238 
1239 #ifdef _DEBUG
1243  void QueryPacket(NetPacket* pPacket, void* pAddArgFunc);
1244 #endif
1245 
1249  void ReadPacket(NetPacket* pPacket);
1250 
1253  void UpdateTeam();
1254 
1255  public: // Gui
1256 
1260  static int OpenTeamListMenu();
1261 
1267  static int OpenTeamEditMenu(NetTeam* pTeam = NULL);
1268  };
1269 
1270  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1271 
1275  {
1279 
1283 
1289  inline bool operator==(const NetClient_MapTileChange& other) const { return tile_index == other.tile_index; }
1290 
1296  inline bool operator!=(const NetClient_MapTileChange& other) const { return tile_index != other.tile_index; }
1297 
1303  inline bool operator< (const NetClient_MapTileChange& other) const { return tile_index < other.tile_index; }
1304 
1310  inline bool operator<=(const NetClient_MapTileChange& other) const { return tile_index <= other.tile_index; }
1311 
1317  inline bool operator> (const NetClient_MapTileChange& other) const { return tile_index > other.tile_index; }
1318 
1324  inline bool operator>=(const NetClient_MapTileChange& other) const { return tile_index >= other.tile_index; }
1325 
1329  {
1330  tile_index = 0;
1331  new_tile_id = 0;
1332  }
1333 
1337  {
1339  tile_index = index;
1340  }
1341  };
1342 
1343  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1344 
1348  {
1352 
1356 
1360 
1364 
1367  inline void Reset()
1368  {
1369  total_packets = 0;
1370  total_bytes = 0;
1371  step_packets = 0;
1372  step_bytes = 0;
1373  }
1374  };
1375 
1376  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1377 
1381  {
1382  public: // Variables
1386 
1390 
1394 
1398 
1402 
1406 
1409  int mAmount[CAVENET_CLIENT_PINGCACHE];
1410 
1413  int mCount;
1414 
1415  public: // Constructor
1416 
1420 
1421  public: // Manipulation methods
1422 
1425  void Reset();
1426 
1429  void DoPing();
1430 
1433  void MissPing();
1434 
1435  public: // Data query methods
1436 
1440  bool IsLagging();
1441 
1445  bool IsTimedOut();
1446 
1450  int GetAverage();
1451  };
1452 
1453  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1455 
1459  {
1460  public: // Variables
1461 
1464  short npc_idx;
1465 
1469 
1470  public: // Constructor
1471 
1474  GhostInfo(int iNpcIDX, float iDistance)
1475  {
1476  ticks_alive = 0;
1477  npc_idx = iNpcIDX;
1478  }
1479 
1483  {
1484  ticks_alive = 0;
1485  npc_idx = 0;
1486  }
1487 
1488  public: // Operators
1489 
1495  inline bool operator< (const GhostInfo& other) const { return ticks_alive < other.ticks_alive; }
1496 
1502  inline bool operator<=(const GhostInfo& other) const { return ticks_alive <= other.ticks_alive; }
1503 
1509  inline bool operator> (const GhostInfo& other) const { return ticks_alive > other.ticks_alive; }
1510 
1516  inline bool operator>=(const GhostInfo& other) const { return ticks_alive >= other.ticks_alive; }
1517 
1523  inline bool operator!=(const GhostInfo& other) const { return ticks_alive != other.ticks_alive; }
1524 
1530  inline bool operator==(const GhostInfo& other) const { return ticks_alive == other.ticks_alive; }
1531  };
1532 
1533  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1534 
1535  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1536 
1540  {
1543  bool bLeft;
1544 
1547  bool bRight;
1548 
1551  bool bUp;
1552 
1555  bool bDown;
1556 
1559  bool bJump;
1560 
1563  bool bShoot;
1564 
1568 
1572  };
1573 
1574  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1575 
1579  {
1580  public:
1581 
1585 
1586  public:
1587 
1591  {
1592  pBrain = NULL;
1593  }
1594 
1595  public:
1596 
1599  virtual bool OnBegin() = 0;
1600 
1603  virtual void OnFinish() = 0;
1604 
1607  virtual bool IsDone() = 0;
1608 
1611  virtual void Tick(AI_Controls* pControls) = 0;
1612  };
1613 
1614  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1615 
1619  {
1620  friend class NetPlayer;
1621 
1622  public: // Callbacks
1623 
1624  void(*m_OnCleanup)(AI_Brain* pBrain);
1625 
1626  public: // Variables
1627 
1631 
1635 
1639 
1643 
1647 
1651 
1655 
1659 
1662  void* ptr_1;
1663 
1666  void* ptr_2;
1667 
1670  void* ptr_3;
1671 
1674  void* ptr_4;
1675 
1678  int act_no;
1679 
1683 
1686  int count1;
1687 
1690  int count2;
1691 
1694  int count3;
1695 
1698  int count4;
1699 
1702  int count5;
1703 
1706  int count6;
1707 
1710  int count7;
1711 
1714  int count8;
1715 
1718  int count9;
1719 
1722  int count10;
1723 
1726  int count11;
1727 
1730  int count12;
1731 
1734  int count13;
1735 
1738  int count14;
1739 
1742  int count15;
1743 
1746  int timer_1;
1747 
1750  int timer_2;
1751 
1754  int tgt_x;
1755 
1758  int tgt_y;
1759 
1763 
1766  void* m_CustomVarList[32];
1767 
1768  public: // Actions
1769 
1772  List<AI_ActionBase*> m_ActionQueue;
1773 
1777 
1781 
1782  public:
1783 
1787 
1791 
1792  public: // Methods
1793 
1797 
1798  public: // Bot methods
1799 
1804 
1809 
1812  void Think();
1813 
1816  int Tick();
1817  };
1818 
1819  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1820 
1825  {
1826  public: // Friends
1827  friend class NetClientVector;
1828  friend class NetPlayer;
1829  friend class NetTeam;
1830 
1831  public: // Enumerations
1833  {
1835  CLIENT_DISCONNECTED = 0,
1836 
1839 
1841  CLIENT_GHOST
1842  };
1843 
1845  {
1848  char r;
1849 
1852  char g;
1853 
1856  char b;
1857  };
1858 
1859  public: // Client cache
1861  {
1865 
1869 
1872  char ghostlist_lookup_table[((NPC_MAX + BOSS_MAX) + 7) >> 3];
1873 
1876  List<NetClient_MapTileChange> tile_change_list;
1877 
1880  List<GhostInfo> ghostlist;
1881 
1884  bool bullet_ignore_list[BULLET_MAX];
1885 
1888  SortedBinList<int, CAVENET_CLIENT_MAX_ZONES> zonelist;
1889 
1892  PERMIT_STAGE permitStage[PERMIT_STAGE_COUNT];
1893 
1897 
1900  ARMS armsData[ARMS_MAX];
1901 
1904  ITEM itemData[ITEM_MAX];
1905 
1908  char character_name[256];
1909 
1913 
1917 
1921 
1925 
1928  NetClientId old_spectate_trg;
1929 
1933 
1937 
1941 
1946 
1951 
1954  int empty;
1955 
1959 
1963 
1966  WHIMSICAL_STAR star[MAX_WHIMSICAL_STARS];
1967 
1971 
1975 
1979 
1982  bool spur_max;
1983 
1987 
1990  long long int lastMoveTime;
1991 
1994  unsigned long long int lastInputChangeTime;
1995 
1998  unsigned int lastMovePacketCRC;
1999 
2002 
2006 
2010 
2014 
2018 
2022 
2025  NetClientId carried_by_ghost_id;
2026 
2029  NetClientId carrying_ghost_id;
2030 
2033  int frame_x;
2034 
2037  int frame_y;
2038 
2041  char net_name[127];
2042 
2045  bool is_ghost;
2046 
2050 
2054 
2058 
2062 
2066 
2069  int key_old;
2070 
2073  int keyTrg;
2074 
2077  int key;
2078 
2082 
2087 
2091  int gameKey;
2092 
2096 
2100 
2104 
2108 
2113 
2117 
2121 
2125 
2129 
2132  struct
2133  {
2136  int x;
2137 
2140  int y;
2141 
2144  int w;
2145 
2148  int h;
2149  } name_rect;
2150 
2153  unsigned char ssidx;
2154 
2158 
2162 
2166 
2170 
2174 
2178 
2182 
2186 
2189  unsigned int respawn_time;
2190 
2193  unsigned int last_supply_time;
2194 
2197  DynamicSortedBinList<NetFlagChangeData, 1, true> flag_change_list;
2198 
2201  bool notarget;
2202 
2206  } mCache;
2207 
2208  struct
2209  {
2213 
2216  unsigned int UserIdent[5];
2217  } mClientConfig;
2218 
2219  struct
2220  {
2223  NetDownload** list;
2224 
2227  int count;
2228 
2232 
2235  bool is_ready;
2236  } mDownloadQueue;
2237 
2238  struct
2239  {
2242  GameResource** list;
2243 
2246  int count;
2247 
2250  bool is_done;
2251 
2254  bool was_sent;
2255 
2259 
2262  char* clean_list;
2263 
2267  } mManifestQueue;
2268 
2270  struct
2271  {
2274  NetPacket** queue;
2275 
2279 
2283 
2286  unsigned long long int last_sent;
2287  } mPacketQueue;
2288 
2292 
2295  bool mIsLocal;
2296 
2299  bool mIsBot;
2300 
2303  bool mIsDev;
2304 
2308 
2309  public: // Score variables
2310 
2313  DynamicSortedPointerBinList<NetScoreInstance*, 1, true> m_ScoreTable;
2314 
2315  protected: // Variables
2316 
2320 
2324 
2327  NetSocket* mSocket;
2328 
2332 
2336 
2341  NetClientId mGhostId;
2342 
2346 
2350 
2354 
2355  public: // Gameplay related variables
2356 
2359  bool mIsReady;
2360 
2361  public: // Constructors
2362 
2366 
2370 
2371  protected: // Protected methods
2372 
2376  inline void SetState(ClientState state) { mState = state; }
2377 
2380  inline void SetVector(NetClientVector* ptr) { mVector = ptr; }
2381 
2384  inline void SetPlayer(NetPlayer* ptr) { mPlayer = ptr; }
2385 
2386  public: // Resource management
2387 
2393  bool QueueResource(GameResource* pResource);
2394 
2402  bool IsResourceDirty(GameResource* pResource, int iIndex = -1);
2403 
2410  bool SetResourceDirty(GameResource* pResource, bool bValue, int iIndex = -1);
2411 
2415 
2419 
2423 
2429  bool NextResource(bool deleteFirst = true);
2430 
2434 
2435  public: // Netdownloading
2436 
2442  bool QueueDownload(NetDownload* ptr);
2443 
2447 
2451  bool NextDownload(bool deleteFirst = true);
2452 
2456 
2461 
2466  void BuildDownloadString(char* out, int out_size);
2467 
2468  public: // Safe methods
2469 
2475 
2476  public: // Score methods
2477 
2486  float GetTotalGameScore(unsigned long long int iMaskBits, unsigned long long int iNegateMaskBits = 0);
2487 
2496  CaveNet::DataStructures::NetScoreInstance* GetGameScoreInstanceByHash(unsigned int iNameHash, bool bAdd = false);
2497 
2506  CaveNet::DataStructures::NetScoreInstance* GetGameScoreInstance(const char* pName, bool bAdd = false);
2507 
2515  bool AddGameScore(const char* pName, int iAmount);
2516 
2525  bool SetGameScore(unsigned int iNameHash, unsigned int iAmount, bool bCurrentLife = false);
2526 
2535  bool SetGameScore(const char* pName, unsigned int iAmount, bool bCurrentLife = false);
2536 
2542  bool RemoveGameScore(const char* pName);
2543 
2548  void RemoveAllGameScores(bool bReAddMandatory = true, bool bTransmit = true);
2549 
2553 
2554  public: // Team methods
2555 
2560 
2565 
2569  inline NetTeam* GetTeam() { return mTeam; }
2570 
2574  inline int GetTeamId() { return (!mTeam ? -1 : mTeam->GetTeamId()); }
2575 
2576  public: // Game methods
2577 
2581  bool IsMaxExp();
2582 
2585  void GetTrg();
2586 
2591  void Spawn(int x, int y);
2592 
2595  void SpawnAuto();
2596 
2600  void Respawn(int iTime);
2601 
2605 
2609 
2616  bool AddArmsData(long code, long max_num);
2617 
2626  bool AddArmsData2(long code, long num, long max_num, long level);
2627 
2633  bool HasArmsData(long code);
2634 
2640  int GetArmsSlot(long code);
2641 
2646 
2649  bool SetArmsDataExact(long index, long code, long max_num, long exp, long level);
2650 
2653  bool SetArmsInfo(long code, long exp, long level, long max_num);
2654 
2660  bool SubArmsData(long code);
2661 
2669  bool TradeArms(long code1, long code2, long max_num);
2670 
2676  bool AddItemData(long code);
2677 
2683  bool SubItemData(long code);
2684 
2690  bool CheckItem(long code);
2691 
2697  bool CheckArms(long code);
2698 
2702  void AddExp(int x, BOOL spur = false);
2703 
2708 
2713  void AddBullet(int no, int val);
2714 
2718  bool IsAmmoFull();
2719 
2723 
2727 
2732  void EquipItem(int flag, bool val);
2733 
2738  void ZeroEquip();
2739 
2747  void BackStep(int code_event);
2748 
2753  void SetPlayerPosition(int x, int y);
2754 
2760  void SetDirect(int direction);
2761 
2765 
2769 
2773  int ArmsNext();
2774 
2778  int ArmsPrev();
2779 
2786  bool AddPermitStage(int index, int event);
2787 
2793  bool SubPermitStage(int index);
2794 
2798 
2806  void SetColor(unsigned char r, unsigned char g, unsigned char b);
2807 
2812  {
2813  return (mCache.use_color ? GUI_COLOR(mCache.char_color.r, mCache.char_color.g, mCache.char_color.b) : GUI_COLOR(0, 0, 0));
2814  }
2815 
2819  void ChatEmote(int index);
2820 
2825  void DrawChatEmote(int fx, int fy);
2826 
2829  void CacheDeath();
2830 
2834 
2840  void SendTileChange(int x, int y, int new_tile);
2841 
2844  void OnMapLoad();
2845 
2850 
2854 
2860  void GetFaceInfo(GUI_RECT* face_src_rect, Surface_Ids* surf_id, Surface_Ids* mask_id);
2861 
2862  public: // Packet Queue
2863 
2867  void AddToPacketQueue(NetPacket* pPacket);
2868 
2874  bool SendPacketQueue(bool bForce = false);
2875 
2879 
2880  public: // Movement prediction
2881 
2889  int SimulateMovement(int iNumFrames, MYCHAR* pMC, unsigned int iKeyMask = gKeyMaxVal);
2890 
2897  void PredictMovement(int iNewInput, long long int iInputTime, int iClientX, int iClientY);
2898 
2899  public: // GUI management
2900 
2907  bool OpenGUI(CaveNet::DataStructures::GUI_Type gui_type, bool DisableControl = true);
2908 
2914  bool CloseGUI(bool EnableControl = true);
2915 
2922  void HandleGuiAction(int ActionIndex, int Arg1, int Arg2, int Arg3);
2923 
2927  bool IsInGUI();
2928 
2935 
2936  public: // Carrying
2937 
2943  bool CarryPlayer(NetClientId id);
2944 
2950  bool Dismount(bool deleteAnim = true);
2951 
2956 
2961 
2966 
2970  bool IsCarrying();
2971 
2978  bool IsCarryingPlayer(NetClientId id);
2979 
2986  bool IsBeingCarriedBy(NetClientId id);
2987 
2994 
3000  bool CanCarry(NetClient* other);
3001 
3002  public: // Whimsical star
3003 
3006  void InitStar();
3007 
3010  void ActStar();
3011 
3016  void PutStar(int fx, int fy);
3017 
3021 
3022  public: // Spectation
3026  void SpectatePlayer(NetClientId ghostId);
3027 
3031 
3035 
3039 
3043 
3050 
3054 
3061 
3062  public: // Frame management
3063 
3067 
3076  void GetScreenRect(int* x_out, int* y_out, int* w_out, int* h_out);
3077 
3078  protected: // Protected zone management
3079 
3085  inline int GetZoneIndex(int zone_id);
3086 
3087  public: // Zone management
3088 
3092  void AddToZone(int zone_idx);
3093 
3097  void RemoveFromZone(int zone_idx);
3098 
3102  bool IsInZone(int zone_idx);
3103 
3107  void ClearZones(bool do_remove = true);
3108 
3113  void CalculateZoneCandidates(int zones[CAVENET_CLIENT_MAX_ZONES], int* count);
3114 
3117  void OccupyZones();
3118 
3119  public: // Methods
3120 
3127  bool Assign(NetSocket* sock, IPaddress* addr, int channel = -2);
3128 
3134  void Disconnect(NetDisconnectReason eDisconnectReason = NetDisconnectReason::NET_DISCONNECT_REASON_UNKNOWN, const char* pCustomReason = NULL, NetClient* pResponsibleClient = NULL);
3135 
3141  bool CompareUserIdent(unsigned int* pUserIdent);
3142 
3143  public: // Packet communication
3144 
3151  bool Send(NetPacket* packet, bool bForceSend = false);
3152 
3158  bool Read(NetPacket* packet);
3159 
3160  public: // Server methods
3161 
3165  inline int GetPing() { if (mCache.is_ghost) return mCache.ClientSide_AveragePing; return mCache.ping.GetAverage(); }
3166 
3171 
3176  inline CSM_ClientRanks GetAdminRank() { return mAdminRank; }
3177 
3183  unsigned int GetMovePacketCRC();
3184 
3185  public: // Miscallaneous Methods
3186 
3190  inline bool IsGhost() { return mCache.is_ghost; }
3191 
3195  inline const ClientState GetState() { return mState; }
3196 
3200  inline NetPlayer* GetPlayer() { return mPlayer; }
3201 
3207  MYCHAR* GetMyChar(bool bRequired = false);
3208 
3212  CustomPlayer* GetCharacter();
3213 
3218 
3222  inline NetClientId GetGhostId() { return mGhostId; }
3223 
3227  inline int GetChannel() { return mChannelNum; }
3228 
3232  inline IPaddress* GetAddress() { return &mAddress; }
3233 
3237  inline const char* GetNetName() { return mCache.net_name; }
3238 
3242  inline NetSocket* GetSocket() { return mSocket; }
3243 
3250  char* GetStringIP(char* out, int out_size);
3251 
3252  public: // Flag management (Server-side methods)
3253 
3256  void SendFlags(bool bSendAll = true);
3257 
3262  void RecordFlag(unsigned short iFlagID, bool bFlagValue);
3263 
3264  public: // Server-side methods
3265 
3269  inline void SetGhostId(NetClientId id) { mGhostId = id; }
3270 
3274 
3278  void SendMap(int event_id = 90);
3279 
3283 
3287 
3291 
3295 
3300  void SendTeamData(NetTeam* pTeam = NULL);
3301 
3305 
3309 
3312  void PasteState();
3313 
3316  void InitClient();
3317 
3321 
3326 
3330 
3334 
3338 
3342 
3346 
3352  void TransmitInventory(unsigned int iTypeFlags);
3353 
3357 
3364 
3370  void ShowServerMessage(const char* pFormat, ...);
3371 
3375  void Say(const char* pMessage);
3376 
3377  public: // Server-side packet building methods
3378 
3384  bool BuildFullPacket_Join(NetPacket* out);
3385 
3391  bool BuildFullPacket_MovePacket(NetPacket* out);
3392 
3393  public: // Server-side packet building methods (for stems)
3394 
3400  bool BuildStemPacket_Join(NetPacket* out);
3401 
3407  bool BuildStemPacket_Ready(NetPacket* out);
3408 
3414  int BuildStemPacket_WhimsicalStar(NetPacket* out);
3415 
3421  int BuildStemPacket_PlayerUpdate(NetPacket* out);
3422 
3429 
3437 
3443  int BuildStemPacket_Update(NetPacket* out);
3444 
3450  int BuildStemPacket_UpdatePing(NetPacket* out);
3451 
3452  public: // Client-side methods
3453 
3460  void GetSignalStrengthRect(int* x, int* y, int* w, int* h, bool IncrementFrame = true);
3461 
3465  inline void SetGhostedClient(NetClientId id) { mGhostId = id; SetState(ClientState::CLIENT_GHOST); }
3466 
3470 
3477  void GetNamePlateRect(int* x, int* y, int* w, int* h);
3478 
3479  public: // Server-side ghosting methods
3480 
3484 
3488 
3492  void DirtyNPC(int index);
3493 
3497  void CleanNPC(int index);
3498 
3504  int GetNPCDirtyIndex(int index);
3505 
3506  public: // Processing Methods
3507 
3511  };
3512 
3513  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3514 
3520  {
3523  unsigned long long int time;
3524 
3527  unsigned long long int game_tick;
3528 
3531  bool dead;
3532 
3536 
3540 
3543  bool spur_max;
3544 
3548 
3552  };
3553 
3554  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3555 
3560  {
3561  friend class AI_Brain;
3562  friend class AI_ActionBase;
3563  friend class NetClient;
3564 
3565  protected: // Variables
3566 
3569  NetClient* mClient;
3570 
3571  public: // Movement prediction
3572 
3576 
3579  unsigned int mMoveHistoryCount;
3580 
3581  public:
3583  struct
3584  {
3588 
3591  bool enabled;
3592  } m_Ai;
3593 
3594  struct
3595  {
3599 
3602  bool dead;
3603  } m_Player;
3604 
3605  public: // Constructors & deconsctructors
3606 
3607  NetPlayer(NetClient* client);
3608  ~NetPlayer();
3609 
3610  public:
3611 
3615 
3619 
3627  bool ApplyClosestPredictionFrame(unsigned long long int iGlobalTime, int iClientX, int iClientY);
3628 
3636  NetPlayerFrameInfo* FindClosestPredictionFrame(unsigned long long int iGlobalTime, int iClientX, int iClientY);
3637 
3641 
3646 
3650  bool Tackle(int level);
3651 
3655  bool TeleportIn();
3656 
3660  bool TeleportOut();
3661 
3665  bool BecomeDead();
3666 
3671 
3675  inline bool IsAnimating() { return (m_Player.npc.netanim != -1); }
3676 
3677  public: // Params
3678 
3686  void Damage(int iDamage, bool bExactDamage = false, PlayerDeathType iDamageType = PlayerDeathType::DEATHTYPE_UNKNOWN, CaveNet::DataStructures::NetClient* pKillerClient = NULL, NPCHAR* pKillerNpc = NULL);
3687 
3688  public: // Acts
3689 
3693  void Act_Camera(bool bKey);
3694 
3697  void AirProcess();
3698 
3699  public: // Collision
3700 
3703  void PutlittleStar();
3704 
3707  int JudgeHitMyCharBlock(int x, int y);
3708 
3711  int JudgeHitMyCharTriangleA(int x, int y);
3712 
3715  int JudgeHitMyCharTriangleB(int x, int y);
3716 
3719  int JudgeHitMyCharTriangleC(int x, int y);
3720 
3723  int JudgeHitMyCharTriangleD(int x, int y);
3724 
3727  int JudgeHitMyCharTriangleE(int x, int y);
3728 
3731  int JudgeHitMyCharTriangleF(int x, int y);
3732 
3735  int JudgeHitMyCharTriangleG(int x, int y);
3736 
3739  int JudgeHitMyCharTriangleH(int x, int y);
3740 
3743  int JudgeHitMyCharWater(int x, int y);
3744 
3747  int JudgeHitMyCharDamage(int x, int y);
3748 
3751  int JudgeHitMyCharDamageW(int x, int y);
3752 
3755  int JudgeHitMyCharVectLeft(int x, int y);
3756 
3759  int JudgeHitMyCharVectUp(int x, int y);
3760 
3763  unsigned char JudgeHitMyCharNPC3(NPCHAR* npc);
3764 
3767  int JudgeHitMyCharVectRight(int x, int y);
3768 
3771  int JudgeHitMyCharVectDown(int x, int y);
3772 
3775  int JudgeHitMyCharNPC(NPCHAR* npc);
3776 
3779  int JudgeHitMyCharNPC4(NPCHAR* npc);
3780 
3783  int JudgeHitMyCharPlayer(MYCHAR* npc);
3784 
3785  public: // Public methods
3786 
3791 
3796  unsigned long long int GetPlayerStateFlags();
3797 
3802 
3808  inline bool IsPlayerState(int iStateType) { return m_Player.npc.netanim == iStateType; }
3809 
3814  unsigned long long int GetPlayerStateFlagsFromCarrier();
3815 
3816  public: // Public methods
3817 
3821  bool IsMaxExp();
3822 
3827 
3831  int CanShoot();
3832 
3835  void GetTrg();
3836 
3839  void Act(bool bKey);
3840 
3844  void AddExp(int x);
3845 
3849  void AddLife(int x);
3850 
3854  void SetLife(int x);
3855 
3859  void AddMaxLife(int x);
3860 
3864  void SetMaxLife(int x);
3865 
3870  void SetPosition(int x, int y);
3871 
3875  void ShowMyChar(bool val);
3876 
3880  void Animate(bool bKey);
3881 
3888  void Revive(bool restoreControl, int health = 1, NetClient * pSavior = NULL, bool bAnnounce = true);
3889 
3893  void Kill(bool bResetVelocity = true, PlayerDeathType iDeathType = PlayerDeathType::DEATHTYPE_UNKNOWN, NPCHAR* pKillerNpc = NULL, CaveNet::DataStructures::NetClient* pKillerClient = NULL);
3894 
3897  void ResetFlag();
3898 
3902 
3906 
3910 
3914 
3918 
3923  void Put(int fx, int fy);
3924 
3925  public:
3926 
3929  void StartAI();
3930 
3933  void EndAI();
3934 
3937  void ProcessAI();
3938 
3939  public: // Miscallaneous methods
3940 
3944  inline NetClient* GetClient() { return mClient; }
3945  };
3946 
3947  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3948 
3952  {
3953  private:
3956  int m_iIndex;
3957 
3960  NetClient*(*m_pGetClientFunc)(int);
3961 
3962  public:
3963 
3967  {
3968  m_iIndex = 0;
3969  m_pGetClientFunc = NULL;
3970  }
3971 
3972  public:
3973 
3979  inline NetClient* first(bool bUseServerClientGroup)
3980  {
3981  m_pGetClientFunc = (!bUseServerClientGroup ? CaveNet_Client_ClientGroup_GetClient : CaveNet_Server_ClientGroup_GetClient);
3982  m_iIndex = 0;
3983 
3984  return m_pGetClientFunc(0);
3985  }
3986 
3990  inline NetClient* next()
3991  {
3992  return m_pGetClientFunc(++m_iIndex);
3993  }
3994  };
3995 
3996  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3997 
4001  {
4002  public: // Friends
4005  friend class NetClient;
4006 
4007  public: // Typedefs
4008 
4011  typedef NetClient** iterator;
4012 
4013  protected: // Variables
4014 
4017  NetClient** mList;
4018 
4021  int mCount;
4022 
4025  int mSize;
4026 
4027  public: // Constructors & deconstructors
4028 
4032 
4036 
4037  protected: // Protected methods
4038 
4043  void Resize(int newSize);
4044 
4045  public: // Vector manipulation methods
4046 
4052  bool Add(NetClient* client);
4053 
4059  bool Remove(NetClient* client);
4060 
4066  bool Remove(NetClient** itr);
4067 
4070  void Clear();
4071 
4074  void FreeClients();
4075 
4078  void Shrink();
4079 
4080  public: // Miscallaneous methods
4081 
4085  int Count();
4086 
4090  int Size();
4091 
4092 #ifdef _DEBUG
4096  void Dump();
4097 #endif
4098 
4099  public: // Operator overloads
4100 
4104  NetClient* operator[](int index);
4105 
4109  NetClient* operator[](int index) const;
4110 
4111  public: // Iterating the array
4112 
4117 
4122 
4127 
4132  };
4133 
4134  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4135 
4136  inline MYCHAR* NetClient::GetMyChar(bool bRequired)
4137  {
4138  return (mCache.is_ghost && mCache.is_our_player ? &gMC : (mPlayer ? &mPlayer->m_Player.npc : (bRequired ? &gNOT_USED : NULL)));
4139  }
4140 
4141  //------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
4142  };
4143 
4144 
4145  using namespace DataStructures;
4146 
4147 };
4148 
4151 
4152 #include <CSMAPI_endcode.h>
Directions
Directions.
Definition: CSMAPI_enums.h:37
CSM_ClientRanks
All possible values for a client's mAdminRank.
Definition: CSMAPI_enums.h:1451
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
PlayerDeathType
A list of possible player death types.
Definition: CSMAPI_enums.h:1215
PlayerStateAnimator_OutputType
A list of output types for a player state's "ANIMATE" function.
Definition: CSMAPI_enums.h:1203
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:7384
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
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 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.
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 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
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
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
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:30
#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