summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-16 23:30:57 +0100
committerTiger Wang <ziwei.tiger@hotmail.co.uk>2014-01-16 23:30:57 +0100
commitd675173b80e08fba4a0aa2b06b9c33713581b922 (patch)
tree6049c49af5c0004677dd132f4df9061d738fd471
parentRemoved CustomCopy() (diff)
downloadcuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.tar
cuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.tar.gz
cuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.tar.bz2
cuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.tar.lz
cuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.tar.xz
cuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.tar.zst
cuberite-d675173b80e08fba4a0aa2b06b9c33713581b922.zip
-rw-r--r--src/Protocol/Protocol17x.cpp6
-rw-r--r--src/main.cpp11
2 files changed, 13 insertions, 4 deletions
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index e878cf725..274e59f63 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -1682,7 +1682,7 @@ void cProtocol172::ParseItemMetadata(cItem & a_Item, const AString & a_Metadata)
for (int loretag = NBT.GetFirstChild(displaytag); loretag >= 0; loretag = NBT.GetNextSibling(loretag)) // Loop through array of strings
{
- AppendPrintf(Lore, "%s\n", NBT.GetString(loretag).c_str()); // Append the lore with a newline, used internally by MCS to display a new line in the client; don't forget to c_str ;)
+ AppendPrintf(Lore, "%s`", NBT.GetString(loretag).c_str()); // Append the lore with a newline, used internally by MCS to display a new line in the client; don't forget to c_str ;)
}
a_Item.m_Lore = Lore;
@@ -1764,12 +1764,12 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item)
{
Writer.BeginList("Lore", TAG_String);
- AStringVector Decls = StringSplit(a_Item.m_Lore, "\n");
+ AStringVector Decls = StringSplit(a_Item.m_Lore, "`");
for (AStringVector::const_iterator itr = Decls.begin(), end = Decls.end(); itr != end; ++itr)
{
if (itr->empty())
{
- // The decl is empty (two \ns), ignore
+ // The decl is empty (two `s), ignore
continue;
}
Writer.AddString("", itr->c_str());
diff --git a/src/main.cpp b/src/main.cpp
index 0620e0f0e..94e2388d6 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -47,9 +47,18 @@ void NonCtrlHandler(int a_Signal)
case SIGSEGV:
{
std::signal(SIGSEGV, SIG_DFL);
- LOGWARN("Segmentation fault; MCServer has crashed :(");
+ LOGERROR(" D: | MCServer has encountered an error and needs to close");
+ LOGERROR("Details | SIGSEGV: Segmentation fault");
exit(EXIT_FAILURE);
}
+ case SIGABRT:
+ case SIGABRT_COMPAT:
+ {
+ std::signal(a_Signal, SIG_DFL);
+ LOGERROR(" D: | MCServer has encountered an error and needs to close");
+ LOGERROR("Details | SIGABRT: Server self-terminated due to an internal fault");
+ break;
+ }
case SIGTERM:
{
std::signal(SIGTERM, SIG_IGN); // Server is shutting down, wait for it...