summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-01-19 22:47:52 +0100
committerMattes D <github@xoft.cz>2014-01-19 22:47:52 +0100
commitfde8b0be60fb58796727d240ceab48a5e2aa0b88 (patch)
treec7c97ced908edb8d0a719032fb3b9eaff9d7ca7c /src/ClientHandle.cpp
parentRewritten SocketThreads for proper shutdown scenario. (diff)
parentRemoved unneeded paramters (diff)
downloadcuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.tar
cuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.tar.gz
cuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.tar.bz2
cuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.tar.lz
cuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.tar.xz
cuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.tar.zst
cuberite-fde8b0be60fb58796727d240ceab48a5e2aa0b88.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 1eec00bc3..74d192129 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -542,12 +542,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;
}
@@ -562,6 +568,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;
}
@@ -591,6 +598,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;
}
@@ -613,6 +621,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()));
}
@@ -2199,6 +2209,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,