Phasor  01.00.10.059
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Player.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "../../Common/Types.h"
4 #include "../../Common/Streams.h"
5 #include "../../Common/noncopyable.h"
6 #include "Halo.h"
7 #include "Game/Objects.h"
8 #include "HaloStreams.h"
9 #include <string>
10 #include <memory>
11 
12 namespace halo
13 {
14  namespace afk_detection { class CAFKDetection; }
15  struct s_player;
16 
17  // ------------------------------------------------------------------
18 
19  #pragma pack(push, 1)
21  {
22  WORD playerJoinCount; // 0x0000
23  WORD localClient; // 0x0002 always FF FF on a dedi in Halo is 00 00 if its your player
24  wchar_t playerName[12]; //0x0004
25  UNKNOWN(4); // 0x001C only seen FF FF FF FF
26  BYTE team; // 0x0020
27  UNKNOWN(3); // padding?
28  ident m_interactionObject; // 0x0024 ie Press E to enter THIS vehicle
29  WORD interactionType; // 0x0028 8 for vehicle, 7 for weapon
30  WORD interactionSpecifier; // 0x002A which seat of car etc
31  DWORD respawnTimer; // 0x002c
32  UNKNOWN(4); // 0x0030 only seen empty
33  ident object_id; // 0x0034
34  ident old_object_id; // 0x0038
35  UNKNOWN(4);; // 0x003C sometimes changes as you move, fuck idk
36  UNKNOWN(4); // 0x0040 always FF FF FF FF, never accessed
37  UNKNOWN(4); // 0x0044 changes when the player shoots
38  wchar_t playerNameAgain[12]; // 0x0048
39  WORD playerNum_NotUsed; // 0x0060 seems to be the player number.. never seen it accessed tho
40  WORD empty1; // 0x0062 byte alignment
41  BYTE playerNum; // 0x0064 player number used for rcon etc (ofc this is 0 based tho)
42  BYTE unk_PlayerNumberHigh; // 0x0065 just a guess
43  BYTE team_Again; // 0x0066
44  UNKNOWN(5);
45  float speed; // 0x006C
46  UNKNOWN(0x2c);
47  WORD kills; // 0x009C
48  UNKNOWN(6);
49  WORD assists; // 0x00A4
50  UNKNOWN(6);
51  WORD betrayals; // 0x00AC
52  WORD deaths; // 0x00AE
53  WORD suicides; // 0x00B0
54  // cbf with the rest
55  UNKNOWN(0x14e);
56  };
57  static_assert(sizeof(s_player_structure) == 0x0200, "bad");
58  #pragma pack(pop)
59 
60  struct s_player : private noncopyable
61  {
62  std::string hash, ip;
63  WORD port;
64  int memory_id;
67  std::unique_ptr<afk_detection::CAFKDetection> afk;
68  std::unique_ptr<PlayerConsoleStream> console_stream;
69  std::unique_ptr<PlayerChatStream> chat_stream;
70 
71  // ----------------------------------------------------------------
72  explicit s_player(int memory_id);
73  ~s_player();
74 
76  void Kick() const;
77  void ChangeTeam(BYTE new_team, bool forcekill=true);
78  void Kill();
79  void ApplyCamo(float duration) const;
80  void SetSpeed(float speed) const;
81  void checkAndSetAdmin();
82  bool InVehicle() const;
83  ident getPlayerIdent() const;
84  };
85 
87 
88  // -----------------------------------------------------------------
89 
90 }