summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index b06dbc84a..0a2d3c1be 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -120,9 +120,6 @@ cClientHandle::~cClientHandle()
LOGD("Deleting client \"%s\" at %p", GetUsername().c_str(), this);
- // Remove from cSocketThreads, we're not to be called anymore:
- cRoot::Get()->GetServer()->ClientDestroying(this);
-
{
cCSLock Lock(m_CSChunkLists);
m_LoadedChunks.clear();
@@ -160,8 +157,7 @@ cClientHandle::~cClientHandle()
cRoot::Get()->GetServer()->WriteToClient(this, Data);
}
- // Queue the socket to close as soon as it sends all outgoing data:
- cRoot::Get()->GetServer()->QueueClientClose(this);
+ // Close the socket as soon as it sends all outgoing data:
cRoot::Get()->GetServer()->RemoveClient(this);
delete m_Protocol;
@@ -552,12 +548,18 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ,
void cClientHandle::HandlePluginMessage(const AString & a_Channel, const AString & a_Message)
{
- if (a_Channel == "MC|AdvCdm") // Command block
+ if (a_Channel == "MC|AdvCdm") // Command block, set text, Client -> Server
{
const char* Data = a_Message.c_str();
-
HandleCommandBlockMessage(Data, a_Message.size());
-
+ return;
+ }
+ else if (a_Channel == "MC|Brand") // Client <-> Server branding exchange
+ {
+ // We are custom,
+ // We are awesome,
+ // We are MCServer.
+ SendPluginMessage("MC|Brand", "MCServer");
return;
}
@@ -572,6 +574,7 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
{
if (a_Length < 14)
{
+ SendChat(Printf("%s[INFO]%s Failure setting command block command; bad request", cChatColor::Red.c_str(), cChatColor::White.c_str()));
LOGD("Malformed MC|AdvCdm packet.");
return;
}
@@ -601,6 +604,7 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
default:
{
+ SendChat(Printf("%s[INFO]%s Failure setting command block command; unhandled mode", cChatColor::Red.c_str(), cChatColor::White.c_str()));
LOGD("Unhandled MC|AdvCdm packet mode.");
return;
}
@@ -623,6 +627,8 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
cWorld * World = m_Player->GetWorld();
World->DoWithCommandBlockAt(BlockX, BlockY, BlockZ, CmdBlockCB);
+
+ SendChat(Printf("%s[INFO]%s Successfully set command block command", cChatColor::Green.c_str(), cChatColor::White.c_str()));
}
@@ -2236,6 +2242,14 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
+void cClientHandle::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
+{
+ m_Protocol->SendUpdateBlockEntity(a_BlockEntity);
+}
+
+
+
+
void cClientHandle::SendUpdateSign(
int a_BlockX, int a_BlockY, int a_BlockZ,