summaryrefslogtreecommitdiffstats
path: root/source/cPlayer.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-01 23:38:03 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-01 23:38:03 +0100
commit48d30d6ab4657e00c0c861d67285256daeff1142 (patch)
treeb9dc6b6e59f09224fe3e2b80c5c247b44331e469 /source/cPlayer.cpp
parentAdded all current hooks to the new plugin structure. (diff)
downloadcuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.gz
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.bz2
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.lz
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.xz
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.tar.zst
cuberite-48d30d6ab4657e00c0c861d67285256daeff1142.zip
Diffstat (limited to 'source/cPlayer.cpp')
-rw-r--r--source/cPlayer.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/source/cPlayer.cpp b/source/cPlayer.cpp
index 982427a86..44b27e14a 100644
--- a/source/cPlayer.cpp
+++ b/source/cPlayer.cpp
@@ -64,7 +64,7 @@ struct cPlayer::sPlayerState
std::string LoadedWorldName;
};
-cPlayer::cPlayer(cClientHandle* a_Client, const char* a_PlayerName)
+cPlayer::cPlayer(cClientHandle* a_Client, const AString & a_PlayerName)
: m_GameMode( 0 )
, m_IP("")
, m_LastBlockActionTime( 0 )
@@ -134,7 +134,7 @@ cPlayer::~cPlayer(void)
void cPlayer::SpawnOn( cClientHandle* a_Target )
{
if( a_Target == m_ClientHandle || !m_bVisible ) return;
- LOG("cPlayer::SpawnOn -> Sending %s to %s", m_pState->PlayerName.c_str(), (a_Target)?a_Target->GetUsername():"Everybody" );
+ LOG("cPlayer::SpawnOn -> Sending %s to %s", m_pState->PlayerName.c_str(), (a_Target) ? a_Target->GetUsername().c_str() : "Everybody" );
cPacket_NamedEntitySpawn SpawnPacket;
SpawnPacket.m_UniqueID = m_UniqueID;
SpawnPacket.m_PlayerName = m_pState->PlayerName;
@@ -897,16 +897,24 @@ bool cPlayer::SaveToDisk()
-const char* cPlayer::GetName()
+const AString & cPlayer::GetName(void) const
{
- return m_pState->PlayerName.c_str();
+ return m_pState->PlayerName;
}
-void cPlayer::SetName( const char* a_Name )
+
+
+
+
+void cPlayer::SetName(const AString & a_Name )
{
m_pState->PlayerName = a_Name;
}
+
+
+
+
const cPlayer::GroupList & cPlayer::GetGroups()
{
return m_pState->Groups;
@@ -935,7 +943,7 @@ void cPlayer::UseEquippedItem()
if(GetGameMode() != 1) //No damage in creative
if (GetInventory().GetEquippedItem().DamageItem())
{
- LOG("Player %s Broke ID: %i", GetClientHandle()->GetUsername(), GetInventory().GetEquippedItem().m_ItemID);
+ LOG("Player %s Broke ID: %i", GetClientHandle()->GetUsername().c_str(), GetInventory().GetEquippedItem().m_ItemID);
GetInventory().RemoveItem( GetInventory().GetEquippedItem());
}
} \ No newline at end of file