diff --git a/Minecraft.Server/Minecraft.Server.vcxproj b/Minecraft.Server/Minecraft.Server.vcxproj
index a32361380..c2f0c96dd 100644
--- a/Minecraft.Server/Minecraft.Server.vcxproj
+++ b/Minecraft.Server/Minecraft.Server.vcxproj
@@ -646,6 +646,9 @@
NotUsing
+
+
+
Create
Create
@@ -653,6 +656,11 @@
+
+
+
+
+
diff --git a/Minecraft.Server/Minecraft.Server.vcxproj.filters b/Minecraft.Server/Minecraft.Server.vcxproj.filters
index 544f1c502..930213ad9 100644
--- a/Minecraft.Server/Minecraft.Server.vcxproj.filters
+++ b/Minecraft.Server/Minecraft.Server.vcxproj.filters
@@ -6,8 +6,28 @@
+
+ Server
+
+
+ Server
+
+
+ Server
+
Server
+
+
+ Server
+
+
+ Server
+
+
+ Server
+
+
diff --git a/Minecraft.Server/ServerLogger.cpp b/Minecraft.Server/ServerLogger.cpp
new file mode 100644
index 000000000..2d2af3f38
--- /dev/null
+++ b/Minecraft.Server/ServerLogger.cpp
@@ -0,0 +1,74 @@
+#include "stdafx.h"
+
+#include "ServerLogger.h"
+
+#include
+
+namespace ServerRuntime
+{
+std::string WideToUtf8(const std::wstring &value)
+{
+ if (value.empty())
+ {
+ return std::string();
+ }
+
+ int charCount = WideCharToMultiByte(CP_UTF8, 0, value.c_str(), (int)value.length(), NULL, 0, NULL, NULL);
+ if (charCount <= 0)
+ {
+ return std::string();
+ }
+
+ std::string utf8;
+ utf8.resize(charCount);
+ WideCharToMultiByte(CP_UTF8, 0, value.c_str(), (int)value.length(), &utf8[0], charCount, NULL, NULL);
+ return utf8;
+}
+
+std::wstring Utf8ToWide(const char *value)
+{
+ if (value == NULL || value[0] == 0)
+ {
+ return std::wstring();
+ }
+
+ int wideCount = MultiByteToWideChar(CP_UTF8, 0, value, -1, NULL, 0);
+ if (wideCount <= 0)
+ {
+ wideCount = MultiByteToWideChar(CP_ACP, 0, value, -1, NULL, 0);
+ if (wideCount <= 0)
+ {
+ return std::wstring();
+ }
+
+ std::wstring wide;
+ wide.resize(wideCount - 1);
+ MultiByteToWideChar(CP_ACP, 0, value, -1, &wide[0], wideCount);
+ return wide;
+ }
+
+ std::wstring wide;
+ wide.resize(wideCount - 1);
+ MultiByteToWideChar(CP_UTF8, 0, value, -1, &wide[0], wideCount);
+ return wide;
+}
+
+void LogStartupStep(const char *message)
+{
+ printf("[startup] %s\n", message);
+ fflush(stdout);
+}
+
+void LogWorldIO(const char *message)
+{
+ printf("[world-io] %s\n", message);
+ fflush(stdout);
+}
+
+void LogWorldName(const char *prefix, const std::wstring &name)
+{
+ std::string utf8 = WideToUtf8(name);
+ printf("[world-io] %s: %s\n", prefix, utf8.c_str());
+ fflush(stdout);
+}
+}
diff --git a/Minecraft.Server/ServerLogger.h b/Minecraft.Server/ServerLogger.h
new file mode 100644
index 000000000..90dad6e11
--- /dev/null
+++ b/Minecraft.Server/ServerLogger.h
@@ -0,0 +1,13 @@
+#pragma once
+
+#include
+
+namespace ServerRuntime
+{
+ std::string WideToUtf8(const std::wstring &value);
+ std::wstring Utf8ToWide(const char *value);
+
+ void LogStartupStep(const char *message);
+ void LogWorldIO(const char *message);
+ void LogWorldName(const char *prefix, const std::wstring &name);
+}
diff --git a/Minecraft.Server/ServerProperties.cpp b/Minecraft.Server/ServerProperties.cpp
new file mode 100644
index 000000000..bd0d44cf6
--- /dev/null
+++ b/Minecraft.Server/ServerProperties.cpp
@@ -0,0 +1,376 @@
+#include "stdafx.h"
+
+#include "ServerProperties.h"
+
+#include "ServerLogger.h"
+
+#include
+#include
+#include