1
0

Compile.sh namechange to cuberite

This commit is contained in:
Safwat Halaby 2015-09-25 13:49:18 +03:00
parent b6e28ad422
commit f1270cb7a1
22 changed files with 46 additions and 42 deletions

View File

@ -177,17 +177,21 @@ echo
# Echo: Compilation complete. # Echo: Compilation complete.
popd popd > /dev/null
pushd cuberite/MCServer pushd cuberite/Server > /dev/null
echo echo
echo "-----------------" echo "-----------------"
echo "Compilation done!" echo "Compilation done!"
echo echo
echo "Cuberite awaits you at:" echo "Cuberite awaits you at:"
echo "`pwd`/MCServer" if [[ $BUILDTYPE == "Debug" ]]; then
echo "`pwd`/Cuberite_debug"
else
echo "`pwd`/Cuberite"
fi
echo echo
echo "Enjoy :)" echo "Enjoy :)"
popd popd > /dev/null
exit 0 exit 0
:windows_detected :windows_detected

View File

@ -14,8 +14,8 @@
#include "LuaState.h" #include "LuaState.h"
// Names for the global variables through which the plugin is identified in its LuaState // Names for the global variables through which the plugin is identified in its LuaState
#define LUA_PLUGIN_NAME_VAR_NAME "_MCServerInternal_PluginName" #define LUA_PLUGIN_NAME_VAR_NAME "_CuberiteInternal_PluginName"
#define LUA_PLUGIN_INSTANCE_VAR_NAME "_MCServerInternal_PluginInstance" #define LUA_PLUGIN_INSTANCE_VAR_NAME "_CuberiteInternal_PluginInstance"

View File

@ -1761,7 +1761,7 @@ bool cPluginManager::BindConsoleCommand(const AString & a_Command, cPlugin * a_P
{ {
if (cmd->second.m_Plugin == nullptr) if (cmd->second.m_Plugin == nullptr)
{ {
LOGWARNING("Console command \"%s\" is already bound internally by MCServer, cannot bind in plugin \"%s\".", a_Command.c_str(), a_Plugin->GetName().c_str()); LOGWARNING("Console command \"%s\" is already bound internally by Cuberite, cannot bind in plugin \"%s\".", a_Command.c_str(), a_Plugin->GetName().c_str());
} }
else else
{ {

View File

@ -16,7 +16,7 @@
// tolua_begin // tolua_begin
/** Biome IDs /** Biome IDs
The first batch corresponds to the clientside biomes, used by MineCraft. The first batch corresponds to the clientside biomes, used by MineCraft.
BiomeIDs over 255 are used by MCServer internally and are translated to MC biomes before sending them to client BiomeIDs over 255 are used by Cuberite internally and are translated to MC biomes before sending them to client
*/ */
enum EMCSBiome enum EMCSBiome
{ {

View File

@ -68,8 +68,8 @@ public:
/** The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the highest non-air block in the column */ /** The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the highest non-air block in the column */
typedef HEIGHTTYPE HeightMap[Width * Width]; typedef HEIGHTTYPE HeightMap[Width * Width];
/** The type used for any biomemap operations and storage inside MCServer, /** The type used for any biomemap operations and storage inside Cuberite,
using MCServer biomes (need not correspond to client representation!) using Cuberite biomes (need not correspond to client representation!)
idx = x + Width * z */ idx = x + Width * z */
typedef EMCSBiome BiomeMap[Width * Width]; typedef EMCSBiome BiomeMap[Width * Width];

View File

@ -225,7 +225,7 @@ template class SizeChecker<UInt8, 1>;
#endif #endif
#if defined(ANDROID_NDK) #if defined(ANDROID_NDK)
#define FILE_IO_PREFIX "/sdcard/mcserver/" #define FILE_IO_PREFIX "/sdcard/Cuberite/"
#else #else
#define FILE_IO_PREFIX "" #define FILE_IO_PREFIX ""
#endif #endif

View File

@ -83,7 +83,7 @@ class cDebugCallbacks :
{ {
if (!a_Request.HasAuth() || (a_Request.GetAuthUsername() != "a") || (a_Request.GetAuthPassword() != "b")) if (!a_Request.HasAuth() || (a_Request.GetAuthUsername() != "a") || (a_Request.GetAuthPassword() != "b"))
{ {
a_Connection.SendNeedAuth("MCServer WebAdmin"); a_Connection.SendNeedAuth("Cuberite WebAdmin");
return; return;
} }
} }

View File

@ -190,7 +190,7 @@
break; break;
} }
} }
__android_log_print(AndroidLogLevel, "MCServer", "%s", a_Message.c_str()); __android_log_print(AndroidLogLevel, "Cuberite", "%s", a_Message.c_str());
} }
}; };

View File

@ -912,7 +912,7 @@ eMonsterType cMonster::StringToMobType(const AString & a_Name)
{ {
AString lcName = StrToLower(a_Name); AString lcName = StrToLower(a_Name);
// Search MCServer name: // Search Cuberite name:
for (size_t i = 0; i < ARRAYCOUNT(g_MobTypeNames); i++) for (size_t i = 0; i < ARRAYCOUNT(g_MobTypeNames); i++)
{ {
if (strcmp(g_MobTypeNames[i].m_lcName, lcName.c_str()) == 0) if (strcmp(g_MobTypeNames[i].m_lcName, lcName.c_str()) == 0)

View File

@ -10,7 +10,7 @@ class cPath;
#include "../FastRandom.h" #include "../FastRandom.h"
#ifdef COMPILING_PATHFIND_DEBUGGER #ifdef COMPILING_PATHFIND_DEBUGGER
/* Note: the COMPILING_PATHFIND_DEBUGGER flag is used by Native / WiseOldMan95 to debug /* Note: the COMPILING_PATHFIND_DEBUGGER flag is used by Native / WiseOldMan95 to debug
this class outside of MCServer. This preprocessor flag is never set when compiling MCServer. */ this class outside of Cuberite. This preprocessor flag is never set when compiling Cuberite. */
#include "PathFinderIrrlicht_Head.h" #include "PathFinderIrrlicht_Head.h"
#endif #endif

View File

@ -50,7 +50,7 @@ int cSslContext::Initialize(bool a_IsClient, const SharedPtr<cCtrDrbgContext> &
if (m_CtrDrbg.get() == nullptr) if (m_CtrDrbg.get() == nullptr)
{ {
m_CtrDrbg.reset(new cCtrDrbgContext); m_CtrDrbg.reset(new cCtrDrbgContext);
m_CtrDrbg->Initialize("MCServer", 8); m_CtrDrbg->Initialize("Cuberite", 8);
} }
// Initialize PolarSSL's structures: // Initialize PolarSSL's structures:

View File

@ -149,7 +149,7 @@ bool cAuthenticator::AuthWithYggdrasil(AString & a_UserName, const AString & a_S
AString Request; AString Request;
Request += "GET " + ActualAddress + " HTTP/1.0\r\n"; Request += "GET " + ActualAddress + " HTTP/1.0\r\n";
Request += "Host: " + m_Server + "\r\n"; Request += "Host: " + m_Server + "\r\n";
Request += "User-Agent: MCServer\r\n"; Request += "User-Agent: Cuberite\r\n";
Request += "Connection: close\r\n"; Request += "Connection: close\r\n";
Request += "\r\n"; Request += "\r\n";
@ -223,7 +223,7 @@ bool cAuthenticator::GetPlayerProperties(const AString & a_UUID, Json::Value & a
AString Request; AString Request;
Request += "GET " + ActualAddress + " HTTP/1.0\r\n"; Request += "GET " + ActualAddress + " HTTP/1.0\r\n";
Request += "Host: " + m_Server + "\r\n"; Request += "Host: " + m_Server + "\r\n";
Request += "User-Agent: MCServer\r\n"; Request += "User-Agent: Cuberite\r\n";
Request += "Connection: close\r\n"; Request += "Connection: close\r\n";
Request += "\r\n"; Request += "\r\n";

View File

@ -1,10 +1,10 @@
// cAuthenticator.h // cAuthenticator.h
// Interfaces to the cAuthenticator class representing the thread that authenticates users against the official MC server // Interfaces to the cAuthenticator class representing the thread that authenticates users against the official Mojang servers
// Authentication prevents "hackers" from joining with an arbitrary username (possibly impersonating the server admins) // Authentication prevents "hackers" from joining with an arbitrary username (possibly impersonating the server admins)
// For more info, see http://wiki.vg/Session#Server_operation // For more info, see http://wiki.vg/Session#Server_operation
// In MCS, authentication is implemented as a single thread that receives queued auth requests and dispatches them one by one. // In Cuberite, authentication is implemented as a single thread that receives queued auth requests and dispatches them one by one.

View File

@ -688,7 +688,7 @@ void cMojangAPI::QueryNamesToUUIDs(AStringVector & a_NamesToQuery)
AString Request; AString Request;
Request += "POST " + m_NameToUUIDAddress + " HTTP/1.0\r\n"; // We need to use HTTP 1.0 because we don't handle Chunked transfer encoding Request += "POST " + m_NameToUUIDAddress + " HTTP/1.0\r\n"; // We need to use HTTP 1.0 because we don't handle Chunked transfer encoding
Request += "Host: " + m_NameToUUIDServer + "\r\n"; Request += "Host: " + m_NameToUUIDServer + "\r\n";
Request += "User-Agent: MCServer\r\n"; Request += "User-Agent: Cuberite\r\n";
Request += "Connection: close\r\n"; Request += "Connection: close\r\n";
Request += "Content-Type: application/json\r\n"; Request += "Content-Type: application/json\r\n";
Request += Printf("Content-Length: %u\r\n", static_cast<unsigned>(RequestBody.length())); Request += Printf("Content-Length: %u\r\n", static_cast<unsigned>(RequestBody.length()));
@ -802,7 +802,7 @@ void cMojangAPI::QueryUUIDToProfile(const AString & a_UUID)
AString Request; AString Request;
Request += "GET " + Address + " HTTP/1.0\r\n"; // We need to use HTTP 1.0 because we don't handle Chunked transfer encoding Request += "GET " + Address + " HTTP/1.0\r\n"; // We need to use HTTP 1.0 because we don't handle Chunked transfer encoding
Request += "Host: " + m_UUIDToProfileServer + "\r\n"; Request += "Host: " + m_UUIDToProfileServer + "\r\n";
Request += "User-Agent: MCServer\r\n"; Request += "User-Agent: Cuberite\r\n";
Request += "Connection: close\r\n"; Request += "Connection: close\r\n";
Request += "Content-Length: 0\r\n"; Request += "Content-Length: 0\r\n";
Request += "\r\n"; Request += "\r\n";

View File

@ -1800,7 +1800,7 @@ void cProtocol172::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
// Version: // Version:
Json::Value Version; Json::Value Version;
Version["name"] = "MCServer 1.7.2"; Version["name"] = "Cuberite 1.7.2";
Version["protocol"] = 4; Version["protocol"] = 4;
// Players: // Players:
@ -2394,7 +2394,7 @@ void cProtocol172::HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, const
} }
// Send back our brand: // Send back our brand:
SendPluginMessage("MC|Brand", "MCServer"); SendPluginMessage("MC|Brand", "Cuberite");
return; return;
} }
else if (a_Channel == "MC|Beacon") else if (a_Channel == "MC|Beacon")
@ -3256,7 +3256,7 @@ void cProtocol176::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
// Version: // Version:
Json::Value Version; Json::Value Version;
Version["name"] = "MCServer 1.7.6"; Version["name"] = "Cuberite 1.7.6";
Version["protocol"] = 5; Version["protocol"] = 5;
// Players: // Players:

View File

@ -2066,7 +2066,7 @@ void cProtocol180::HandlePacketStatusRequest(cByteBuffer & a_ByteBuffer)
// Version: // Version:
Json::Value Version; Json::Value Version;
Version["name"] = "MCServer 1.8"; Version["name"] = "Cuberite 1.8";
Version["protocol"] = 47; Version["protocol"] = 47;
// Players: // Players:
@ -2671,7 +2671,7 @@ void cProtocol180::HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, const
HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Brand); HANDLE_READ(a_ByteBuffer, ReadVarUTF8String, AString, Brand);
m_Client->SetClientBrand(Brand); m_Client->SetClientBrand(Brand);
// Send back our brand, including the length: // Send back our brand, including the length:
SendPluginMessage("MC|Brand", "\x08MCServer"); SendPluginMessage("MC|Brand", "\x08Cuberite");
return; return;
} }
else if (a_Channel == "MC|Beacon") else if (a_Channel == "MC|Beacon")

View File

@ -121,7 +121,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo)
LOG("--- Started Log ---"); LOG("--- Started Log ---");
#ifdef BUILD_ID #ifdef BUILD_ID
LOG("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID); LOG("Cuberite " BUILD_SERIES_NAME " build id: " BUILD_ID);
LOG("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME); LOG("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME);
#endif #endif

View File

@ -187,7 +187,7 @@ void cServer::PlayerDestroying(const cPlayer * a_Player)
bool cServer::InitServer(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth) bool cServer::InitServer(cSettingsRepositoryInterface & a_Settings, bool a_ShouldAuth)
{ {
m_Description = a_Settings.GetValueSet("Server", "Description", "MCServer - in C++!"); m_Description = a_Settings.GetValueSet("Server", "Description", "Cuberite - in C++!");
m_MaxPlayers = a_Settings.GetValueSetI("Server", "MaxPlayers", 100); m_MaxPlayers = a_Settings.GetValueSetI("Server", "MaxPlayers", 100);
m_bIsHardcore = a_Settings.GetValueSetB("Server", "HardcoreEnabled", false); m_bIsHardcore = a_Settings.GetValueSetB("Server", "HardcoreEnabled", false);
m_bAllowMultiLogin = a_Settings.GetValueSetB("Server", "AllowMultiLogin", false); m_bAllowMultiLogin = a_Settings.GetValueSetB("Server", "AllowMultiLogin", false);

View File

@ -96,7 +96,7 @@ bool cWebAdmin::Init(void)
if (!m_IniFile.ReadFile("webadmin.ini")) if (!m_IniFile.ReadFile("webadmin.ini"))
{ {
LOGWARN("Regenerating webadmin.ini, all settings will be reset"); LOGWARN("Regenerating webadmin.ini, all settings will be reset");
m_IniFile.AddHeaderComment(" This file controls the webadmin feature of MCServer"); m_IniFile.AddHeaderComment(" This file controls the webadmin feature of Cuberite");
m_IniFile.AddHeaderComment(" Username format: [User:*username*]"); m_IniFile.AddHeaderComment(" Username format: [User:*username*]");
m_IniFile.AddHeaderComment(" Password format: Password=*password*; for example:"); m_IniFile.AddHeaderComment(" Password format: Password=*password*; for example:");
m_IniFile.AddHeaderComment(" [User:admin]"); m_IniFile.AddHeaderComment(" [User:admin]");
@ -131,7 +131,7 @@ bool cWebAdmin::Init(void)
// Sets the fallback template: // Sets the fallback template:
m_LoginTemplate = \ m_LoginTemplate = \
"<h1>MCServer WebAdmin</h1>" \ "<h1>Cuberite WebAdmin</h1>" \
"<center>" \ "<center>" \
"<form method='get' action='webadmin/'>" \ "<form method='get' action='webadmin/'>" \
"<input type='submit' value='Log in'>" \ "<input type='submit' value='Log in'>" \
@ -216,7 +216,7 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
{ {
if (!a_Request.HasAuth()) if (!a_Request.HasAuth())
{ {
a_Connection.SendNeedAuth("MCServer WebAdmin"); a_Connection.SendNeedAuth("Cuberite WebAdmin");
return; return;
} }
@ -224,7 +224,7 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
AString UserPassword = m_IniFile.GetValue("User:" + a_Request.GetAuthUsername(), "Password", ""); AString UserPassword = m_IniFile.GetValue("User:" + a_Request.GetAuthUsername(), "Password", "");
if ((UserPassword == "") || (a_Request.GetAuthPassword() != UserPassword)) if ((UserPassword == "") || (a_Request.GetAuthPassword() != UserPassword))
{ {
a_Connection.SendNeedAuth("MCServer WebAdmin - bad username or password"); a_Connection.SendNeedAuth("Cuberite WebAdmin - bad username or password");
return; return;
} }
@ -333,7 +333,7 @@ void cWebAdmin::HandleWebadminRequest(cHTTPConnection & a_Connection, cHTTPReque
ReplaceString(Template, "{MENU}", Menu); ReplaceString(Template, "{MENU}", Menu);
ReplaceString(Template, "{PLUGIN_NAME}", FoundPlugin); ReplaceString(Template, "{PLUGIN_NAME}", FoundPlugin);
ReplaceString(Template, "{CONTENT}", Content); ReplaceString(Template, "{CONTENT}", Content);
ReplaceString(Template, "{TITLE}", "MCServer"); ReplaceString(Template, "{TITLE}", "Cuberite");
AString NumChunks; AString NumChunks;
Printf(NumChunks, "%d", cRoot::Get()->GetTotalChunkCount()); Printf(NumChunks, "%d", cRoot::Get()->GetTotalChunkCount());

View File

@ -415,7 +415,7 @@ void cNBTChunkSerializer::AddFallingBlockEntity(cFallingBlock * a_FallingBlock)
AddBasicEntity(a_FallingBlock, "FallingSand"); AddBasicEntity(a_FallingBlock, "FallingSand");
m_Writer.AddInt("TileID", a_FallingBlock->GetBlockType()); m_Writer.AddInt("TileID", a_FallingBlock->GetBlockType());
m_Writer.AddByte("Data", a_FallingBlock->GetBlockMeta()); m_Writer.AddByte("Data", a_FallingBlock->GetBlockMeta());
m_Writer.AddByte("Time", 1); // Unused in MCServer, Vanilla said to need nonzero m_Writer.AddByte("Time", 1); // Unused in Cuberite, Vanilla said to need nonzero
m_Writer.AddByte("DropItem", 1); m_Writer.AddByte("DropItem", 1);
m_Writer.AddByte("HurtEntities", a_FallingBlock->GetBlockType() == E_BLOCK_ANVIL); m_Writer.AddByte("HurtEntities", a_FallingBlock->GetBlockType() == E_BLOCK_ANVIL);
m_Writer.EndCompound(); m_Writer.EndCompound();

View File

@ -1139,7 +1139,7 @@ cBlockEntity * cWSSAnvil::LoadMobSpawnerFromNBT(const cParsedNBT & a_NBT, int a_
std::unique_ptr<cMobSpawnerEntity> MobSpawner = cpp14::make_unique<cMobSpawnerEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World); std::unique_ptr<cMobSpawnerEntity> MobSpawner = cpp14::make_unique<cMobSpawnerEntity>(a_BlockX, a_BlockY, a_BlockZ, m_World);
// Load entity (MCServer worlds): // Load entity (Cuberite worlds):
int Type = a_NBT.FindChildByName(a_TagIdx, "Entity"); int Type = a_NBT.FindChildByName(a_TagIdx, "Entity");
if ((Type >= 0) && (a_NBT.GetType(Type) == TAG_Short)) if ((Type >= 0) && (a_NBT.GetType(Type) == TAG_Short))
{ {

View File

@ -39,7 +39,7 @@ bool cRoot::m_RunAsService = false;
#if defined(_WIN32) #if defined(_WIN32)
SERVICE_STATUS_HANDLE g_StatusHandle = nullptr; SERVICE_STATUS_HANDLE g_StatusHandle = nullptr;
HANDLE g_ServiceThread = INVALID_HANDLE_VALUE; HANDLE g_ServiceThread = INVALID_HANDLE_VALUE;
#define SERVICE_NAME "MCServerService" #define SERVICE_NAME "CuberiteService"
#endif #endif
@ -77,10 +77,10 @@ void NonCtrlHandler(int a_Signal)
case SIGSEGV: case SIGSEGV:
{ {
std::signal(SIGSEGV, SIG_DFL); std::signal(SIGSEGV, SIG_DFL);
LOGERROR(" D: | MCServer has encountered an error and needs to close"); LOGERROR(" D: | Cuberite has encountered an error and needs to close");
LOGERROR("Details | SIGSEGV: Segmentation fault"); LOGERROR("Details | SIGSEGV: Segmentation fault");
#ifdef BUILD_ID #ifdef BUILD_ID
LOGERROR("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID); LOGERROR("Cuberite " BUILD_SERIES_NAME " build id: " BUILD_ID);
LOGERROR("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME); LOGERROR("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME);
#endif #endif
PrintStackTrace(); PrintStackTrace();
@ -92,10 +92,10 @@ void NonCtrlHandler(int a_Signal)
#endif #endif
{ {
std::signal(a_Signal, SIG_DFL); std::signal(a_Signal, SIG_DFL);
LOGERROR(" D: | MCServer has encountered an error and needs to close"); LOGERROR(" D: | Cuberite has encountered an error and needs to close");
LOGERROR("Details | SIGABRT: Server self-terminated due to an internal fault"); LOGERROR("Details | SIGABRT: Server self-terminated due to an internal fault");
#ifdef BUILD_ID #ifdef BUILD_ID
LOGERROR("MCServer " BUILD_SERIES_NAME " build id: " BUILD_ID); LOGERROR("Cuberite " BUILD_SERIES_NAME " build id: " BUILD_ID);
LOGERROR("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME); LOGERROR("from commit id: " BUILD_COMMIT_ID " built at: " BUILD_DATETIME);
#endif #endif
PrintStackTrace(); PrintStackTrace();
@ -358,7 +358,7 @@ std::unique_ptr<cMemorySettingsRepository> ParseArguments(int argc, char **argv)
try try
{ {
// Parse the comand line args: // Parse the comand line args:
TCLAP::CmdLine cmd("MCServer"); TCLAP::CmdLine cmd("Cuberite");
TCLAP::ValueArg<int> slotsArg ("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd); TCLAP::ValueArg<int> slotsArg ("s", "max-players", "Maximum number of slots for the server to use, overrides setting in setting.ini", false, -1, "number", cmd);
TCLAP::MultiArg<int> portsArg ("p", "port", "The port number the server should listen to", false, "port", cmd); TCLAP::MultiArg<int> portsArg ("p", "port", "The port number the server should listen to", false, "port", cmd);
TCLAP::SwitchArg commLogArg ("", "log-comm", "Log server client communications to file", cmd); TCLAP::SwitchArg commLogArg ("", "log-comm", "Log server client communications to file", cmd);