MCPcopy Create free account
hub / github.com/cuberite/cuberite / cPlayer

Method cPlayer

src/Entities/Player.cpp:27–115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

25
26
27cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
28 : super(etPlayer, 0.6, 1.8)
29 , m_bVisible(true)
30 , m_FoodLevel(MAX_FOOD_LEVEL)
31 , m_FoodSaturationLevel(5)
32 , m_FoodTickTimer(0)
33 , m_FoodExhaustionLevel(0)
34 , m_FoodPoisonedTicksRemaining(0)
35 , m_LastJumpHeight(0)
36 , m_LastGroundHeight(0)
37 , m_bTouchGround(false)
38 , m_Stance(0.0)
39 , m_Inventory(*this)
40 , m_CurrentWindow(NULL)
41 , m_InventoryWindow(NULL)
42 , m_Color('-')
43 , m_GameMode(eGameMode_NotSet)
44 , m_IP("")
45 , m_ClientHandle(a_Client)
46 , m_NormalMaxSpeed(1.0)
47 , m_SprintingMaxSpeed(1.3)
48 , m_FlyingMaxSpeed(1.0)
49 , m_IsCrouched(false)
50 , m_IsSprinting(false)
51 , m_IsFlying(false)
52 , m_IsSwimming(false)
53 , m_IsSubmerged(false)
54 , m_IsFishing(false)
55 , m_CanFly(false)
56 , m_EatingFinishTick(-1)
57 , m_LifetimeTotalXp(0)
58 , m_CurrentXp(0)
59 , m_bDirtyExperience(false)
60 , m_IsChargingBow(false)
61 , m_BowCharge(0)
62 , m_FloaterID(-1)
63 , m_Team(NULL)
64{
65 LOGD("Created a player object for \"%s\" @ \"%s\" at %p, ID %d",
66 a_PlayerName.c_str(), a_Client->GetIPString().c_str(),
67 this, GetUniqueID()
68 );
69
70 m_InventoryWindow = new cInventoryWindow(*this);
71 m_CurrentWindow = m_InventoryWindow;
72 m_InventoryWindow->OpenedByPlayer(*this);
73
74 SetMaxHealth(MAX_HEALTH);
75 m_Health = MAX_HEALTH;
76
77 cTimer t1;
78 m_LastPlayerListTime = t1.GetNowTime();
79
80 m_TimeLastTeleportPacket = 0;
81
82 m_PlayerName = a_PlayerName;
83 m_bDirtyPosition = true; // So chunks are streamed to player at spawn
84

Callers

nothing calls this directly

Calls 12

c_strMethod · 0.80
OpenedByPlayerMethod · 0.80
GetNowTimeMethod · 0.80
GetSpawnXMethod · 0.80
GetDefaultWorldMethod · 0.80
GetSpawnYMethod · 0.80
GetSpawnZMethod · 0.80
PlayerCreatedMethod · 0.80
GetServerMethod · 0.80
ClearMethod · 0.45
GetWorldMethod · 0.45
IsGameModeCreativeMethod · 0.45

Tested by

no test coverage detected