summaryrefslogtreecommitdiffstats
path: root/source/cClientHandle.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-10 23:27:24 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-03-10 23:27:24 +0100
commit219be8186c5b64df7f56cafe9e97322732c7a224 (patch)
tree73c72f03c4f1f2050a6e1ebf61e422052fb56312 /source/cClientHandle.cpp
parentCompletely integrated the new axis ordering. Will update worlds accordingly (diff)
downloadcuberite-219be8186c5b64df7f56cafe9e97322732c7a224.tar
cuberite-219be8186c5b64df7f56cafe9e97322732c7a224.tar.gz
cuberite-219be8186c5b64df7f56cafe9e97322732c7a224.tar.bz2
cuberite-219be8186c5b64df7f56cafe9e97322732c7a224.tar.lz
cuberite-219be8186c5b64df7f56cafe9e97322732c7a224.tar.xz
cuberite-219be8186c5b64df7f56cafe9e97322732c7a224.tar.zst
cuberite-219be8186c5b64df7f56cafe9e97322732c7a224.zip
Diffstat (limited to '')
-rw-r--r--source/cClientHandle.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp
index 58bfad7dc..c610f91a3 100644
--- a/source/cClientHandle.cpp
+++ b/source/cClientHandle.cpp
@@ -306,7 +306,7 @@ void cClientHandle::Authenticate(void)
LoginResponse.m_MapSeed = cRoot::Get()->GetWorld()->GetWorldSeed();
#endif
LoginResponse.m_Dimension = 0;
- LoginResponse.m_MaxPlayers = (unsigned char)cRoot::Get()->GetWorld()->GetMaxPlayers();
+ LoginResponse.m_MaxPlayers = (unsigned char)cRoot::Get()->GetDefaultWorld()->GetMaxPlayers();
LoginResponse.m_Difficulty = 2;
Send(LoginResponse);
@@ -627,11 +627,11 @@ void cClientHandle::HandlePing(void)
// Somebody tries to retrieve information about the server
AString Reply;
Printf(Reply, "%s%s%i%s%i",
- cRoot::Get()->GetWorld()->GetDescription().c_str(),
+ cRoot::Get()->GetDefaultWorld()->GetDescription().c_str(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetWorld()->GetNumPlayers(),
+ cRoot::Get()->GetDefaultWorld()->GetNumPlayers(),
cChatColor::Delimiter.c_str(),
- cRoot::Get()->GetWorld()->GetMaxPlayers()
+ cRoot::Get()->GetDefaultWorld()->GetMaxPlayers()
);
Kick(Reply.c_str());
}
@@ -656,7 +656,7 @@ void cClientHandle::HandleHandshake(cPacket_Handshake * a_Packet)
LOG("HANDSHAKE %s", m_Username.c_str());
- if (cRoot::Get()->GetWorld()->GetNumPlayers() >= cRoot::Get()->GetWorld()->GetMaxPlayers())
+ if (cRoot::Get()->GetDefaultWorld()->GetNumPlayers() >= cRoot::Get()->GetDefaultWorld()->GetMaxPlayers())
{
Kick("The server is currently full :(-- Try again later");
return;
@@ -1647,8 +1647,10 @@ void cClientHandle::HandleKeepAlive(cPacket_KeepAlive * a_Packet)
bool cClientHandle::CheckBlockInteractionsRate(void)
{
+ ASSERT(m_Player != NULL);
+ ASSERT(m_Player->GetWorld() != NULL);
int LastActionCnt = m_Player->GetLastBlockActionCnt();
- if ((cRoot::Get()->GetWorld()->GetTime() - m_Player->GetLastBlockActionTime()) < 0.1)
+ if ((m_Player->GetWorld()->GetTime() - m_Player->GetLastBlockActionTime()) < 0.1)
{
// Limit the number of block interactions per tick
m_Player->SetLastBlockActionTime(); //Player tried to interact with a block. Reset last block interation time.