mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCEMP-Server.git
synced 2026-06-14 21:41:52 +00:00
Initial commit
This commit is contained in:
18
.gitignore
vendored
Normal file
18
.gitignore
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
x64_Server_Debug/
|
||||
x64_Server_Release/
|
||||
ipch/
|
||||
*.user
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.tlog
|
||||
*.lastbuildstate
|
||||
*.log
|
||||
*.idb
|
||||
*.ilk
|
||||
*.exe
|
||||
*.sdf
|
||||
*.opensdf
|
||||
*.suo
|
||||
*.sln
|
||||
server.properties
|
||||
107
CMakeLists.txt
Normal file
107
CMakeLists.txt
Normal file
@@ -0,0 +1,107 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
project("MinecraftDedicatedServer")
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
|
||||
if(NOT UNIX)
|
||||
message(FATAL_ERROR "The dedicated server currently only builds on Linux, use Visual Studio to build the Windows server")
|
||||
endif()
|
||||
|
||||
set(CMAKE_C_FLAGS_RELEASE "-Os -DNDEBUG")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-Os -DNDEBUG")
|
||||
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
|
||||
|
||||
set(ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/..")
|
||||
|
||||
include("${ROOT_DIR}/cmake/Sources.cmake")
|
||||
include("${ROOT_DIR}/cmake/ServerSources.cmake")
|
||||
|
||||
list(TRANSFORM MINECRAFT_WORLD_SOURCES PREPEND "${ROOT_DIR}/Minecraft.World/")
|
||||
list(TRANSFORM MINECRAFT_SERVER_OWN_SOURCES PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/")
|
||||
list(TRANSFORM MINECRAFT_SERVER_SHARED_SOURCES PREPEND "${ROOT_DIR}/Minecraft.Client/")
|
||||
|
||||
set(BUNDLED_ZLIB_SOURCES
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/adler32.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/compress.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/crc32.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/deflate.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/inffast.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/inflate.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/inftrees.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/trees.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/uncompr.c"
|
||||
"${ROOT_DIR}/Minecraft.Client/Common/zlib/zutil.c"
|
||||
)
|
||||
|
||||
add_library(MinecraftWorld STATIC ${MINECRAFT_WORLD_SOURCES} ${BUNDLED_ZLIB_SOURCES})
|
||||
|
||||
target_include_directories(MinecraftWorld PUBLIC
|
||||
"${ROOT_DIR}/Minecraft.World"
|
||||
"${ROOT_DIR}/Minecraft.World/x64headers"
|
||||
)
|
||||
|
||||
target_include_directories(MinecraftWorld BEFORE PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Linux/stubs"
|
||||
)
|
||||
|
||||
target_include_directories(MinecraftWorld PRIVATE
|
||||
"${ROOT_DIR}/Minecraft.Client"
|
||||
"${ROOT_DIR}/Minecraft.Client/Windows64/Iggy/include"
|
||||
"${ROOT_DIR}/Minecraft.Client/Xbox/Sentient/Include"
|
||||
)
|
||||
|
||||
target_compile_options(MinecraftWorld PRIVATE
|
||||
-include "${CMAKE_CURRENT_SOURCE_DIR}/Linux/LinuxCompat.h"
|
||||
-Wno-write-strings -Wno-narrowing -Wno-deprecated
|
||||
-ffunction-sections -fdata-sections
|
||||
)
|
||||
|
||||
target_compile_definitions(MinecraftWorld PRIVATE
|
||||
_LARGE_WORLDS _LIB _WINDOWS64
|
||||
_CRT_NON_CONFORMING_SWPRINTFS _CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
|
||||
add_executable(MinecraftDedicatedServer
|
||||
${MINECRAFT_SERVER_OWN_SOURCES}
|
||||
${MINECRAFT_SERVER_SHARED_SOURCES}
|
||||
)
|
||||
|
||||
target_compile_definitions(MinecraftDedicatedServer PRIVATE
|
||||
_DEDICATED_SERVER
|
||||
_CONTENT_PACKAGE
|
||||
_LARGE_WORLDS
|
||||
_WINDOWS64
|
||||
WITH_SERVER_CODE
|
||||
_CRT_NON_CONFORMING_SWPRINTFS
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
)
|
||||
|
||||
target_include_directories(MinecraftDedicatedServer BEFORE PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Linux/stubs"
|
||||
)
|
||||
|
||||
target_include_directories(MinecraftDedicatedServer PRIVATE
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}/Linux"
|
||||
"${ROOT_DIR}/Minecraft.Client"
|
||||
"${ROOT_DIR}/Minecraft.Client/Windows64/4JLibs/inc"
|
||||
"${ROOT_DIR}/Minecraft.Client/Windows64/Iggy/include"
|
||||
"${ROOT_DIR}/Minecraft.Client/Xbox/Sentient/Include"
|
||||
"${ROOT_DIR}/Minecraft.World/x64headers"
|
||||
)
|
||||
|
||||
target_compile_options(MinecraftDedicatedServer PRIVATE
|
||||
-include "${CMAKE_CURRENT_SOURCE_DIR}/Linux/LinuxCompat.h"
|
||||
-Wno-write-strings -Wno-narrowing -Wno-deprecated
|
||||
-ffunction-sections -fdata-sections
|
||||
)
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
target_link_libraries(MinecraftDedicatedServer PRIVATE
|
||||
MinecraftWorld
|
||||
Threads::Threads
|
||||
)
|
||||
|
||||
target_link_options(MinecraftDedicatedServer PRIVATE
|
||||
-Wl,--gc-sections
|
||||
)
|
||||
31
Commands/BanCommand.cpp
Normal file
31
Commands/BanCommand.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "stdafx.h"
|
||||
#include "BanCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.Client/PlayerConnection.h"
|
||||
#include "../../Minecraft.World/DisconnectPacket.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void BanCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring playerName;
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"Usage: /ban <player>");
|
||||
return;
|
||||
}
|
||||
|
||||
ServerLists_GetBannedPlayers()->add(playerName);
|
||||
ServerCommand::notifyAdmins(src, server, L"Banned player " + playerName);
|
||||
|
||||
shared_ptr<ServerPlayer> player = server->getPlayers()->getPlayer(playerName);
|
||||
if (player)
|
||||
player->connection->disconnect(DisconnectPacket::eDisconnect_Banned);
|
||||
}
|
||||
10
Commands/BanCommand.h
Normal file
10
Commands/BanCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class BanCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"ban"; }
|
||||
wstring getUsage() { return L"/ban <player> - Bans a player from the server"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
97
Commands/BanIpCommand.cpp
Normal file
97
Commands/BanIpCommand.cpp
Normal file
@@ -0,0 +1,97 @@
|
||||
#include "stdafx.h"
|
||||
#include "BanIpCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.Client/PlayerConnection.h"
|
||||
#include "../../Minecraft.World/DisconnectPacket.h"
|
||||
#include "../../Minecraft.World/Connection.h"
|
||||
#include "../../Minecraft.World/Socket.h"
|
||||
#include "../../Minecraft.Client/Windows64/Network/WinsockNetLayer.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
static bool isValidIP(const wstring& str)
|
||||
{
|
||||
int dots = 0;
|
||||
for (size_t i = 0; i < str.size(); i++)
|
||||
{
|
||||
if (str[i] == L'.') dots++;
|
||||
else if (str[i] < L'0' || str[i] > L'9') return false;
|
||||
}
|
||||
return dots == 3 && str.size() >= 7;
|
||||
}
|
||||
|
||||
static wstring narrowToWide(const std::string& s)
|
||||
{
|
||||
return wstring(s.begin(), s.end());
|
||||
}
|
||||
|
||||
void BanIpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring arg;
|
||||
if (!(ss >> arg))
|
||||
{
|
||||
src->warn(L"Usage: " + getUsage());
|
||||
return;
|
||||
}
|
||||
|
||||
wstring ip;
|
||||
if (isValidIP(arg))
|
||||
{
|
||||
ip = arg;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!server || !server->getPlayers())
|
||||
{
|
||||
src->warn(L"Cannot resolve player name, no players online");
|
||||
return;
|
||||
}
|
||||
shared_ptr<ServerPlayer> target = server->getPlayers()->getPlayer(arg);
|
||||
if (!target || !target->connection)
|
||||
{
|
||||
src->warn(L"Cannot find player \"" + arg + L"\"");
|
||||
return;
|
||||
}
|
||||
Connection *conn = target->connection->connection;
|
||||
if (!conn || !conn->getSocket())
|
||||
{
|
||||
src->warn(L"Cannot determine IP for \"" + arg + L"\"");
|
||||
return;
|
||||
}
|
||||
BYTE smallId = conn->getSocket()->getSmallId();
|
||||
std::string ipStr = WinsockNetLayer::GetIPForSmallId(smallId);
|
||||
if (ipStr.empty())
|
||||
{
|
||||
src->warn(L"Cannot determine IP for \"" + arg + L"\"");
|
||||
return;
|
||||
}
|
||||
ip = narrowToWide(ipStr);
|
||||
}
|
||||
|
||||
ServerLists_GetBannedIPs()->add(ip);
|
||||
ServerCommand::notifyAdmins(src, server, L"Banned IP address " + ip);
|
||||
|
||||
if (server && server->getPlayers())
|
||||
{
|
||||
vector<shared_ptr<ServerPlayer>>& pl = server->getPlayers()->players;
|
||||
for (unsigned int i = 0; i < pl.size(); i++)
|
||||
{
|
||||
if (!pl[i] || !pl[i]->connection) continue;
|
||||
Connection *conn = pl[i]->connection->connection;
|
||||
if (!conn || !conn->getSocket()) continue;
|
||||
BYTE sid = conn->getSocket()->getSmallId();
|
||||
std::string pIp = WinsockNetLayer::GetIPForSmallId(sid);
|
||||
if (narrowToWide(pIp) == ip)
|
||||
{
|
||||
server->getPlayers()->kickPlayerByShortId(sid);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
10
Commands/BanIpCommand.h
Normal file
10
Commands/BanIpCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class BanIpCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"ban-ip"; }
|
||||
wstring getUsage() { return L"/ban-ip <address|name> - Bans an IP address"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
45
Commands/BanListCommand.cpp
Normal file
45
Commands/BanListCommand.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "stdafx.h"
|
||||
#include "BanListCommand.h"
|
||||
#include "ServerTextList.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void BanListCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring type;
|
||||
ss >> type;
|
||||
|
||||
if (type == L"ips")
|
||||
{
|
||||
const set<wstring>& entries = ServerLists_GetBannedIPs()->getEntries();
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"There are %d banned IP addresses:", (int)entries.size());
|
||||
src->info(wstring(buf));
|
||||
wstring list;
|
||||
for (set<wstring>::const_iterator it = entries.begin(); it != entries.end(); ++it)
|
||||
{
|
||||
if (!list.empty()) list += L", ";
|
||||
list += *it;
|
||||
}
|
||||
if (!list.empty()) src->info(list);
|
||||
}
|
||||
else
|
||||
{
|
||||
const set<wstring>& entries = ServerLists_GetBannedPlayers()->getEntries();
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"There are %d banned players:", (int)entries.size());
|
||||
src->info(wstring(buf));
|
||||
wstring list;
|
||||
for (set<wstring>::const_iterator it = entries.begin(); it != entries.end(); ++it)
|
||||
{
|
||||
if (!list.empty()) list += L", ";
|
||||
list += *it;
|
||||
}
|
||||
if (!list.empty()) src->info(list);
|
||||
}
|
||||
}
|
||||
10
Commands/BanListCommand.h
Normal file
10
Commands/BanListCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class BanListCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"banlist"; }
|
||||
wstring getUsage() { return L"/banlist [ips|players] - Shows the ban list"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
31
Commands/ConsoleCommandDispatcher.cpp
Normal file
31
Commands/ConsoleCommandDispatcher.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "stdafx.h"
|
||||
#include "ConsoleCommandDispatcher.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
|
||||
ConsoleCommandDispatcher::~ConsoleCommandDispatcher()
|
||||
{
|
||||
for (AUTO_VAR(it, commandsByName.begin()); it != commandsByName.end(); ++it)
|
||||
delete it->second;
|
||||
commandsByName.clear();
|
||||
}
|
||||
|
||||
void ConsoleCommandDispatcher::addCommand(ServerCommand *command)
|
||||
{
|
||||
commandsByName[command->getName()] = command;
|
||||
}
|
||||
|
||||
bool ConsoleCommandDispatcher::performCommand(const wstring& name, const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
AUTO_VAR(it, commandsByName.find(name));
|
||||
if (it != commandsByName.end())
|
||||
{
|
||||
it->second->execute(args, src, server);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
const map<wstring, ServerCommand *>& ConsoleCommandDispatcher::getCommands() const
|
||||
{
|
||||
return commandsByName;
|
||||
}
|
||||
17
Commands/ConsoleCommandDispatcher.h
Normal file
17
Commands/ConsoleCommandDispatcher.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
#include <map>
|
||||
|
||||
class ConsoleCommandDispatcher
|
||||
{
|
||||
private:
|
||||
map<wstring, ServerCommand *> commandsByName;
|
||||
|
||||
public:
|
||||
~ConsoleCommandDispatcher();
|
||||
|
||||
void addCommand(ServerCommand *command);
|
||||
bool performCommand(const wstring& name, const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
const map<wstring, ServerCommand *>& getCommands() const;
|
||||
};
|
||||
13
Commands/ConsoleCommandSender.cpp
Normal file
13
Commands/ConsoleCommandSender.cpp
Normal file
@@ -0,0 +1,13 @@
|
||||
#include "stdafx.h"
|
||||
#include "ConsoleCommandSender.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
|
||||
void ConsoleCommandSender::sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type, int customData, const wstring& additionalMessage)
|
||||
{
|
||||
src->info(message);
|
||||
}
|
||||
|
||||
bool ConsoleCommandSender::hasPermission(EGameCommand command)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
17
Commands/ConsoleCommandSender.h
Normal file
17
Commands/ConsoleCommandSender.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../Minecraft.World/CommandSender.h"
|
||||
|
||||
class ConsoleInputSource;
|
||||
|
||||
class ConsoleCommandSender : public CommandSender
|
||||
{
|
||||
private:
|
||||
ConsoleInputSource *src;
|
||||
|
||||
public:
|
||||
ConsoleCommandSender(ConsoleInputSource *src) : src(src) {}
|
||||
|
||||
void sendMessage(const wstring& message, ChatPacket::EChatPacketMessage type = ChatPacket::e_ChatCustom, int customData = -1, const wstring& additionalMessage = L"");
|
||||
bool hasPermission(EGameCommand command);
|
||||
};
|
||||
36
Commands/DeOpCommand.cpp
Normal file
36
Commands/DeOpCommand.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "stdafx.h"
|
||||
#include "DeOpCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.World/net.minecraft.network.packet.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
void DeOpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstring name = args;
|
||||
size_t start = name.find_first_not_of(L" \t");
|
||||
if (start == wstring::npos || name.empty())
|
||||
{
|
||||
src->warn(L"Usage: /deop <player>");
|
||||
return;
|
||||
}
|
||||
name = name.substr(start);
|
||||
size_t end = name.find_first_of(L" \t");
|
||||
if (end != wstring::npos)
|
||||
name = name.substr(0, end);
|
||||
|
||||
ServerLists_GetOps()->remove(name);
|
||||
|
||||
shared_ptr<ServerPlayer> player = server->getPlayers()->getPlayer(name);
|
||||
if (player != nullptr)
|
||||
{
|
||||
player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_Op, 0);
|
||||
server->getPlayers()->broadcastAll(shared_ptr<PlayerInfoPacket>(new PlayerInfoPacket(player)));
|
||||
}
|
||||
|
||||
ServerCommand::notifyAdmins(src, server, L"De-opped " + name);
|
||||
}
|
||||
10
Commands/DeOpCommand.h
Normal file
10
Commands/DeOpCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class DeOpCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"deop"; }
|
||||
wstring getUsage() { return L"/deop <player> - Removes operator status from a player"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
55
Commands/DebugCommand.cpp
Normal file
55
Commands/DebugCommand.cpp
Normal file
@@ -0,0 +1,55 @@
|
||||
#include "stdafx.h"
|
||||
#include "DebugCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <time.h>
|
||||
|
||||
static bool s_profiling = false;
|
||||
static time_t s_profilingStart = 0;
|
||||
static int s_profilingStartTick = 0;
|
||||
|
||||
void DebugCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring subCmd;
|
||||
if (!(ss >> subCmd))
|
||||
{
|
||||
src->warn(L"Usage: /debug <start|stop>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (subCmd == L"start")
|
||||
{
|
||||
if (s_profiling)
|
||||
{
|
||||
src->warn(L"Debug profiling is already started");
|
||||
return;
|
||||
}
|
||||
s_profiling = true;
|
||||
s_profilingStart = time(NULL);
|
||||
s_profilingStartTick = server->tickCount;
|
||||
ServerCommand::notifyAdmins(src, server, L"Starting debug profiling");
|
||||
}
|
||||
else if (subCmd == L"stop")
|
||||
{
|
||||
if (!s_profiling)
|
||||
{
|
||||
src->warn(L"Debug profiling is not started");
|
||||
return;
|
||||
}
|
||||
s_profiling = false;
|
||||
time_t elapsed = time(NULL) - s_profilingStart;
|
||||
int ticks = server->tickCount - s_profilingStartTick;
|
||||
float tps = elapsed > 0 ? (float)ticks / (float)elapsed : 0.0f;
|
||||
wchar_t buf[256];
|
||||
swprintf_s(buf, 256, L"Stopped debug profiling after %.2f seconds and %d ticks (%.2f ticks per second)", (float)elapsed, ticks, tps);
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
else
|
||||
{
|
||||
src->warn(L"Usage: /debug <start|stop>");
|
||||
}
|
||||
}
|
||||
10
Commands/DebugCommand.h
Normal file
10
Commands/DebugCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class DebugCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"debug"; }
|
||||
wstring getUsage() { return L"/debug <start|stop> - Starts or stops a debugging session"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
36
Commands/DefaultGameModeCommand.cpp
Normal file
36
Commands/DefaultGameModeCommand.cpp
Normal file
@@ -0,0 +1,36 @@
|
||||
#include "stdafx.h"
|
||||
#include "DefaultGameModeCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.World/LevelSettings.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void DefaultGameModeCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring modeStr;
|
||||
if (!(ss >> modeStr))
|
||||
{
|
||||
src->warn(L"Usage: /defaultgamemode <mode>");
|
||||
return;
|
||||
}
|
||||
|
||||
GameType *mode = NULL;
|
||||
if (modeStr == L"0" || modeStr == L"s" || modeStr == L"survival")
|
||||
mode = GameType::SURVIVAL;
|
||||
else if (modeStr == L"1" || modeStr == L"c" || modeStr == L"creative")
|
||||
mode = GameType::CREATIVE;
|
||||
else if (modeStr == L"2" || modeStr == L"a" || modeStr == L"adventure")
|
||||
mode = GameType::ADVENTURE;
|
||||
else
|
||||
{
|
||||
src->warn(L"Unknown game mode: " + modeStr);
|
||||
return;
|
||||
}
|
||||
|
||||
server->getPlayers()->setOverrideGameMode(mode);
|
||||
ServerCommand::notifyAdmins(src, server, L"The world's default game mode is now " + mode->getName());
|
||||
}
|
||||
10
Commands/DefaultGameModeCommand.h
Normal file
10
Commands/DefaultGameModeCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class DefaultGameModeCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"defaultgamemode"; }
|
||||
wstring getUsage() { return L"/defaultgamemode <mode> - Sets the default game mode"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
48
Commands/EnchantServerCommand.cpp
Normal file
48
Commands/EnchantServerCommand.cpp
Normal file
@@ -0,0 +1,48 @@
|
||||
#include "stdafx.h"
|
||||
#include "EnchantServerCommand.h"
|
||||
#include "ConsoleCommandSender.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.World/CommandDispatcher.h"
|
||||
#include "../../Minecraft.World/ByteArrayOutputStream.h"
|
||||
#include "../../Minecraft.World/DataOutputStream.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void EnchantServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring playerName;
|
||||
int enchantmentId = 0;
|
||||
int enchantmentLevel = 1;
|
||||
|
||||
if (!(ss >> playerName >> enchantmentId))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /enchant <player> <enchantment ID> [level]");
|
||||
return;
|
||||
}
|
||||
|
||||
ss >> enchantmentLevel;
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
shared_ptr<ServerPlayer> player = players->getPlayer(playerName);
|
||||
if (!player)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayOutputStream baos;
|
||||
DataOutputStream dos(&baos);
|
||||
|
||||
dos.writePlayerUID(player->getXuid());
|
||||
dos.writeInt(enchantmentId);
|
||||
dos.writeInt(enchantmentLevel);
|
||||
|
||||
shared_ptr<ConsoleCommandSender> sender(new ConsoleCommandSender(src));
|
||||
CommandDispatcher *dispatcher = server->getCommandDispatcher();
|
||||
dispatcher->performCommand(sender, eGameCommand_EnchantItem, baos.toByteArray());
|
||||
}
|
||||
11
Commands/EnchantServerCommand.h
Normal file
11
Commands/EnchantServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class EnchantServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"enchant"; }
|
||||
wstring getUsage() { return L"/enchant <player> <enchantment ID> [level]"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
56
Commands/GameModeServerCommand.cpp
Normal file
56
Commands/GameModeServerCommand.cpp
Normal file
@@ -0,0 +1,56 @@
|
||||
#include "stdafx.h"
|
||||
#include "GameModeServerCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "ConsoleCommandSender.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.World/LevelSettings.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void GameModeServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring modeStr;
|
||||
|
||||
if (!(ss >> modeStr))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /gamemode <mode> [player]");
|
||||
return;
|
||||
}
|
||||
|
||||
GameType *mode = NULL;
|
||||
if (modeStr == L"0" || modeStr == L"s" || modeStr == L"survival")
|
||||
mode = GameType::SURVIVAL;
|
||||
else if (modeStr == L"1" || modeStr == L"c" || modeStr == L"creative")
|
||||
mode = GameType::CREATIVE;
|
||||
else if (modeStr == L"2" || modeStr == L"a" || modeStr == L"adventure")
|
||||
mode = GameType::ADVENTURE;
|
||||
else
|
||||
{
|
||||
src->warn(L"\u00A7cUnknown game mode: " + modeStr);
|
||||
return;
|
||||
}
|
||||
|
||||
wstring playerName;
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"\u00A7cYou must specify which player you wish to perform this action on.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
shared_ptr<ServerPlayer> player = players->getPlayer(playerName);
|
||||
if (!player)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
player->setGameMode(mode);
|
||||
wchar_t buf[256];
|
||||
swprintf_s(buf, 256, L"Set %s's game mode to %s", player->name.c_str(), mode->getName().c_str());
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
11
Commands/GameModeServerCommand.h
Normal file
11
Commands/GameModeServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class GameModeServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"gamemode"; }
|
||||
wstring getUsage() { return L"/gamemode <mode> [player]"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
59
Commands/GiveServerCommand.cpp
Normal file
59
Commands/GiveServerCommand.cpp
Normal file
@@ -0,0 +1,59 @@
|
||||
#include "stdafx.h"
|
||||
#include "GiveServerCommand.h"
|
||||
#include "ConsoleCommandSender.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.World/CommandDispatcher.h"
|
||||
#include "../../Minecraft.World/ByteArrayOutputStream.h"
|
||||
#include "../../Minecraft.World/DataOutputStream.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void GiveServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring playerName;
|
||||
int item = 0;
|
||||
int amount = 1;
|
||||
int aux = 0;
|
||||
|
||||
if (!(ss >> playerName >> item))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /give <player> <item id> [amount] [data]");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ss >> amount)
|
||||
{
|
||||
if (amount < 1 || amount > 64)
|
||||
{
|
||||
src->warn(L"\u00A7cItem amount must be between 1 and 64");
|
||||
return;
|
||||
}
|
||||
}
|
||||
ss >> aux;
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
shared_ptr<ServerPlayer> player = players->getPlayer(playerName);
|
||||
if (!player)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
|
||||
ByteArrayOutputStream baos;
|
||||
DataOutputStream dos(&baos);
|
||||
|
||||
dos.writePlayerUID(player->getXuid());
|
||||
dos.writeInt(item);
|
||||
dos.writeInt(amount);
|
||||
dos.writeInt(aux);
|
||||
dos.writeUTF(L"");
|
||||
|
||||
shared_ptr<ConsoleCommandSender> sender(new ConsoleCommandSender(src));
|
||||
CommandDispatcher *dispatcher = server->getCommandDispatcher();
|
||||
dispatcher->performCommand(sender, eGameCommand_Give, baos.toByteArray());
|
||||
}
|
||||
11
Commands/GiveServerCommand.h
Normal file
11
Commands/GiveServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class GiveServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"give"; }
|
||||
wstring getUsage() { return L"/give <player> <item id> [amount] [data]"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
73
Commands/HelpCommand.cpp
Normal file
73
Commands/HelpCommand.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#include "stdafx.h"
|
||||
#include "HelpCommand.h"
|
||||
#include "ConsoleCommandDispatcher.h"
|
||||
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
HelpCommand::HelpCommand(ConsoleCommandDispatcher *dispatcher)
|
||||
: dispatcher(dispatcher)
|
||||
{
|
||||
}
|
||||
|
||||
void HelpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
const map<wstring, ServerCommand *>& commandMap = dispatcher->getCommands();
|
||||
|
||||
vector<ServerCommand *> list;
|
||||
for (AUTO_VAR(it, commandMap.begin()); it != commandMap.end(); ++it)
|
||||
list.push_back(it->second);
|
||||
|
||||
sort(list.begin(), list.end(), [](ServerCommand *a, ServerCommand *b) {
|
||||
return a->getName() < b->getName();
|
||||
});
|
||||
|
||||
int itemsPerPage = 7;
|
||||
int totalPages = (int)list.size() / itemsPerPage;
|
||||
int page = 0;
|
||||
|
||||
wstringstream ss(args);
|
||||
wstring arg;
|
||||
if (ss >> arg)
|
||||
{
|
||||
wstringstream numTest(arg);
|
||||
int num;
|
||||
if (numTest >> num && numTest.eof())
|
||||
{
|
||||
if (num < 1) num = 1;
|
||||
if (num > totalPages + 1) num = totalPages + 1;
|
||||
page = num - 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
for (size_t i = 0; i < arg.size(); i++)
|
||||
arg[i] = towlower(arg[i]);
|
||||
|
||||
AUTO_VAR(it, commandMap.find(arg));
|
||||
if (it != commandMap.end())
|
||||
{
|
||||
src->info(L"\u00A7cUsage: " + it->second->getUsage());
|
||||
return;
|
||||
}
|
||||
|
||||
src->warn(L"\u00A7cUnknown command. Try /help for a list of commands");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int endIndex = (int)list.size();
|
||||
if ((page + 1) * itemsPerPage < endIndex)
|
||||
endIndex = (page + 1) * itemsPerPage;
|
||||
|
||||
wchar_t buf[256];
|
||||
swprintf_s(buf, 256, L"\u00A72--- Showing help page %d of %d (/help <page>) ---", page + 1, totalPages + 1);
|
||||
src->info(wstring(buf));
|
||||
|
||||
for (int k = page * itemsPerPage; k < endIndex; k++)
|
||||
src->info(list[k]->getUsage());
|
||||
|
||||
if (page == 0)
|
||||
src->info(L"\u00A7aTip: Use the <tab> key while typing a command to auto-complete the command or its arguments");
|
||||
}
|
||||
18
Commands/HelpCommand.h
Normal file
18
Commands/HelpCommand.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class ConsoleCommandDispatcher;
|
||||
|
||||
class HelpCommand : public ServerCommand
|
||||
{
|
||||
private:
|
||||
ConsoleCommandDispatcher *dispatcher;
|
||||
|
||||
public:
|
||||
HelpCommand(ConsoleCommandDispatcher *dispatcher);
|
||||
|
||||
wstring getName() { return L"help"; }
|
||||
wstring getUsage() { return L"/help [page|command name]"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
45
Commands/KickServerCommand.cpp
Normal file
45
Commands/KickServerCommand.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include "stdafx.h"
|
||||
#include "KickServerCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.Client/PlayerConnection.h"
|
||||
#include "../../Minecraft.World/DisconnectPacket.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void KickServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring playerName;
|
||||
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /kick <player> [reason ...]");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
shared_ptr<ServerPlayer> player = players->getPlayer(playerName);
|
||||
if (!player)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
|
||||
wstring reason;
|
||||
getline(ss, reason);
|
||||
size_t rstart = reason.find_first_not_of(L" \t");
|
||||
if (rstart != wstring::npos) reason = reason.substr(rstart);
|
||||
else reason.clear();
|
||||
|
||||
player->connection->disconnect(DisconnectPacket::eDisconnect_Kicked);
|
||||
|
||||
if (!reason.empty())
|
||||
ServerCommand::notifyAdmins(src, server, L"Kicked player " + player->name + L": " + reason);
|
||||
else
|
||||
ServerCommand::notifyAdmins(src, server, L"Kicked player " + player->name);
|
||||
}
|
||||
11
Commands/KickServerCommand.h
Normal file
11
Commands/KickServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class KickServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"kick"; }
|
||||
wstring getUsage() { return L"/kick <player> [reason ...]"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
33
Commands/KillServerCommand.cpp
Normal file
33
Commands/KillServerCommand.cpp
Normal file
@@ -0,0 +1,33 @@
|
||||
#include "stdafx.h"
|
||||
#include "KillServerCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.World/DamageSource.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void KillServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring playerName;
|
||||
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"\u00A7cYou must specify which player you wish to perform this action on.");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
shared_ptr<ServerPlayer> player = players->getPlayer(playerName);
|
||||
if (!player)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
|
||||
player->hurt(DamageSource::outOfWorld, 1000);
|
||||
src->info(L"Ouch. That look like it hurt.");
|
||||
}
|
||||
11
Commands/KillServerCommand.h
Normal file
11
Commands/KillServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class KillServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"kill"; }
|
||||
wstring getUsage() { return L"/kill <player>"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
19
Commands/ListServerCommand.cpp
Normal file
19
Commands/ListServerCommand.cpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#include "stdafx.h"
|
||||
#include "ListServerCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
|
||||
void ListServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
PlayerList *playerList = server->getPlayers();
|
||||
int count = playerList->getPlayerCount();
|
||||
int max = playerList->getMaxPlayers();
|
||||
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"There are %d/%d players online:", count, max);
|
||||
src->info(wstring(buf));
|
||||
src->info(playerList->getPlayerNames());
|
||||
}
|
||||
11
Commands/ListServerCommand.h
Normal file
11
Commands/ListServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class ListServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"list"; }
|
||||
wstring getUsage() { return L"/list"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
18
Commands/MeCommand.cpp
Normal file
18
Commands/MeCommand.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "stdafx.h"
|
||||
#include "MeCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.World/ChatPacket.h"
|
||||
|
||||
void MeCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
if (args.empty())
|
||||
{
|
||||
src->warn(L"Usage: /me <action ...>");
|
||||
return;
|
||||
}
|
||||
wstring msg = L"* Server " + args;
|
||||
server->getPlayers()->broadcastAll(shared_ptr<Packet>(new ChatPacket(msg)));
|
||||
src->info(msg);
|
||||
}
|
||||
10
Commands/MeCommand.h
Normal file
10
Commands/MeCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class MeCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"me"; }
|
||||
wstring getUsage() { return L"/me <action ...> - Performs the specified action"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
41
Commands/OpCommand.cpp
Normal file
41
Commands/OpCommand.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "stdafx.h"
|
||||
#include "OpCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.World/net.minecraft.network.packet.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
void OpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstring name = args;
|
||||
size_t start = name.find_first_not_of(L" \t");
|
||||
if (start == wstring::npos || name.empty())
|
||||
{
|
||||
src->warn(L"Usage: /op <player>");
|
||||
return;
|
||||
}
|
||||
name = name.substr(start);
|
||||
size_t end = name.find_first_of(L" \t");
|
||||
if (end != wstring::npos)
|
||||
name = name.substr(0, end);
|
||||
|
||||
ServerLists_GetOps()->add(name);
|
||||
|
||||
shared_ptr<ServerPlayer> player = server->getPlayers()->getPlayer(name);
|
||||
if (player != nullptr)
|
||||
{
|
||||
player->setPlayerGamePrivilege(Player::ePlayerGamePrivilege_Op, 1); // idfk if this works
|
||||
server->getPlayers()->broadcastAll(shared_ptr<PlayerInfoPacket>(new PlayerInfoPacket(player)));
|
||||
}
|
||||
|
||||
ServerCommand::notifyAdmins(src, server, L"Opped " + name);
|
||||
}
|
||||
|
||||
bool IsPlayerOp(const wstring& name)
|
||||
{
|
||||
return ServerLists_IsPlayerOp(name);
|
||||
}
|
||||
10
Commands/OpCommand.h
Normal file
10
Commands/OpCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class OpCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"op"; }
|
||||
wstring getUsage() { return L"/op <player> - Grants operator status to a player"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
23
Commands/PardonCommand.cpp
Normal file
23
Commands/PardonCommand.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "stdafx.h"
|
||||
#include "PardonCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void PardonCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring playerName;
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"Usage: /pardon <player>");
|
||||
return;
|
||||
}
|
||||
|
||||
ServerLists_GetBannedPlayers()->remove(playerName);
|
||||
ServerCommand::notifyAdmins(src, server, L"Unbanned player " + playerName);
|
||||
}
|
||||
10
Commands/PardonCommand.h
Normal file
10
Commands/PardonCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class PardonCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"pardon"; }
|
||||
wstring getUsage() { return L"/pardon <player> - Unbans a player"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
23
Commands/PardonIpCommand.cpp
Normal file
23
Commands/PardonIpCommand.cpp
Normal file
@@ -0,0 +1,23 @@
|
||||
#include "stdafx.h"
|
||||
#include "PardonIpCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void PardonIpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring ip;
|
||||
if (!(ss >> ip))
|
||||
{
|
||||
src->warn(L"Usage: /pardon-ip <ip>");
|
||||
return;
|
||||
}
|
||||
|
||||
ServerLists_GetBannedIPs()->remove(ip);
|
||||
ServerCommand::notifyAdmins(src, server, L"Unbanned IP address " + ip);
|
||||
}
|
||||
10
Commands/PardonIpCommand.h
Normal file
10
Commands/PardonIpCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class PardonIpCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"pardon-ip"; }
|
||||
wstring getUsage() { return L"/pardon-ip <ip> - Unbans an IP address"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
22
Commands/SaveAllCommand.cpp
Normal file
22
Commands/SaveAllCommand.cpp
Normal file
@@ -0,0 +1,22 @@
|
||||
#include "stdafx.h"
|
||||
#include "SaveAllCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerLevel.h"
|
||||
|
||||
void SaveAllCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
ServerCommand::notifyAdmins(src, server, L"Forcing save..");
|
||||
PlayerList *players = server->getPlayers();
|
||||
if (players)
|
||||
players->saveAll(NULL);
|
||||
for (unsigned int i = 0; i < server->levels.length; i++)
|
||||
{
|
||||
ServerLevel *level = server->levels[i];
|
||||
if (level)
|
||||
level->save(true, NULL);
|
||||
}
|
||||
ServerCommand::notifyAdmins(src, server, L"Save complete.");
|
||||
}
|
||||
10
Commands/SaveAllCommand.h
Normal file
10
Commands/SaveAllCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class SaveAllCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"save-all"; }
|
||||
wstring getUsage() { return L"/save-all - Forces the server to save"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
17
Commands/SaveOffCommand.cpp
Normal file
17
Commands/SaveOffCommand.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "stdafx.h"
|
||||
#include "SaveOffCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/ServerLevel.h"
|
||||
|
||||
void SaveOffCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
for (unsigned int i = 0; i < server->levels.length; i++)
|
||||
{
|
||||
ServerLevel *level = server->levels[i];
|
||||
if (level)
|
||||
level->noSave = true;
|
||||
}
|
||||
ServerCommand::notifyAdmins(src, server, L"Turned off world auto-saving");
|
||||
}
|
||||
10
Commands/SaveOffCommand.h
Normal file
10
Commands/SaveOffCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class SaveOffCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"save-off"; }
|
||||
wstring getUsage() { return L"/save-off - Disables automatic server saves"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
17
Commands/SaveOnCommand.cpp
Normal file
17
Commands/SaveOnCommand.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "stdafx.h"
|
||||
#include "SaveOnCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/ServerLevel.h"
|
||||
|
||||
void SaveOnCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
for (unsigned int i = 0; i < server->levels.length; i++)
|
||||
{
|
||||
ServerLevel *level = server->levels[i];
|
||||
if (level)
|
||||
level->noSave = false;
|
||||
}
|
||||
ServerCommand::notifyAdmins(src, server, L"Turned on world auto-saving");
|
||||
}
|
||||
10
Commands/SaveOnCommand.h
Normal file
10
Commands/SaveOnCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class SaveOnCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"save-on"; }
|
||||
wstring getUsage() { return L"/save-on - Enables automatic server saves"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
18
Commands/SayCommand.cpp
Normal file
18
Commands/SayCommand.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "stdafx.h"
|
||||
#include "SayCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.World/ChatPacket.h"
|
||||
|
||||
void SayCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
if (args.empty())
|
||||
{
|
||||
src->warn(L"Usage: /say <message ...>");
|
||||
return;
|
||||
}
|
||||
wstring msg = L"[Server] " + args;
|
||||
server->getPlayers()->broadcastAll(shared_ptr<Packet>(new ChatPacket(msg)));
|
||||
src->info(L"\u00A7d[Server] " + args);
|
||||
}
|
||||
10
Commands/SayCommand.h
Normal file
10
Commands/SayCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class SayCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"say"; }
|
||||
wstring getUsage() { return L"/say <message ...> - Broadcasts a message to all players"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
14
Commands/SeedCommand.cpp
Normal file
14
Commands/SeedCommand.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include "stdafx.h"
|
||||
#include "SeedCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/ServerLevel.h"
|
||||
#include "../../Minecraft.World/Level.h"
|
||||
|
||||
void SeedCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
__int64 seed = server->getLevel(0)->getSeed();
|
||||
wchar_t buf[64];
|
||||
swprintf_s(buf, 64, L"Seed: %lld", seed);
|
||||
src->info(wstring(buf));
|
||||
}
|
||||
10
Commands/SeedCommand.h
Normal file
10
Commands/SeedCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class SeedCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"seed"; }
|
||||
wstring getUsage() { return L"/seed - Displays the world seed"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
15
Commands/ServerCommand.h
Normal file
15
Commands/ServerCommand.h
Normal file
@@ -0,0 +1,15 @@
|
||||
#pragma once
|
||||
|
||||
class MinecraftServer;
|
||||
class ConsoleInputSource;
|
||||
|
||||
class ServerCommand
|
||||
{
|
||||
public:
|
||||
virtual ~ServerCommand() {}
|
||||
virtual wstring getName() = 0;
|
||||
virtual wstring getUsage() = 0;
|
||||
virtual void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server) = 0;
|
||||
|
||||
static void notifyAdmins(ConsoleInputSource *src, MinecraftServer *server, const wstring& message);
|
||||
};
|
||||
186
Commands/ServerCommands.cpp
Normal file
186
Commands/ServerCommands.cpp
Normal file
@@ -0,0 +1,186 @@
|
||||
#include "stdafx.h"
|
||||
#include "ServerCommands.h"
|
||||
#include "ConsoleCommandDispatcher.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
|
||||
#include "StopCommand.h"
|
||||
#include "HelpCommand.h"
|
||||
#include "TpCommand.h"
|
||||
#include "TimeServerCommand.h"
|
||||
#include "ToggleDownfallServerCommand.h"
|
||||
#include "GiveServerCommand.h"
|
||||
#include "EnchantServerCommand.h"
|
||||
#include "KillServerCommand.h"
|
||||
#include "GameModeServerCommand.h"
|
||||
#include "ListServerCommand.h"
|
||||
#include "KickServerCommand.h"
|
||||
#include "SayCommand.h"
|
||||
#include "MeCommand.h"
|
||||
#include "SeedCommand.h"
|
||||
#include "XpCommand.h"
|
||||
#include "DefaultGameModeCommand.h"
|
||||
#include "SaveAllCommand.h"
|
||||
#include "SaveOffCommand.h"
|
||||
#include "SaveOnCommand.h"
|
||||
#include "DebugCommand.h"
|
||||
#include "OpCommand.h"
|
||||
#include "DeOpCommand.h"
|
||||
#include "BanCommand.h"
|
||||
#include "PardonCommand.h"
|
||||
#include "BanIpCommand.h"
|
||||
#include "PardonIpCommand.h"
|
||||
#include "BanListCommand.h"
|
||||
#include "WhitelistCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
|
||||
void ServerCommand::notifyAdmins(ConsoleInputSource *src, MinecraftServer *server, const wstring& message)
|
||||
{
|
||||
src->info(message);
|
||||
if (server && server->getPlayers())
|
||||
server->getPlayers()->broadcastToAllOps(L"\u00A77\u00A7o[" + src->getConsoleName() + L": " + message + L"]");
|
||||
}
|
||||
|
||||
static ConsoleCommandDispatcher *s_dispatcher = NULL;
|
||||
|
||||
ConsoleCommandDispatcher *CreateConsoleCommandDispatcher()
|
||||
{
|
||||
ConsoleCommandDispatcher *dispatcher = new ConsoleCommandDispatcher();
|
||||
|
||||
dispatcher->addCommand(new StopCommand());
|
||||
dispatcher->addCommand(new TpCommand());
|
||||
|
||||
dispatcher->addCommand(new TimeServerCommand());
|
||||
dispatcher->addCommand(new ToggleDownfallServerCommand());
|
||||
dispatcher->addCommand(new GiveServerCommand());
|
||||
dispatcher->addCommand(new EnchantServerCommand());
|
||||
dispatcher->addCommand(new KillServerCommand());
|
||||
dispatcher->addCommand(new GameModeServerCommand());
|
||||
dispatcher->addCommand(new ListServerCommand());
|
||||
dispatcher->addCommand(new KickServerCommand());
|
||||
dispatcher->addCommand(new SayCommand());
|
||||
dispatcher->addCommand(new MeCommand());
|
||||
dispatcher->addCommand(new SeedCommand());
|
||||
dispatcher->addCommand(new XpCommand());
|
||||
dispatcher->addCommand(new DefaultGameModeCommand());
|
||||
dispatcher->addCommand(new SaveAllCommand());
|
||||
dispatcher->addCommand(new SaveOffCommand());
|
||||
dispatcher->addCommand(new SaveOnCommand());
|
||||
dispatcher->addCommand(new DebugCommand());
|
||||
dispatcher->addCommand(new OpCommand());
|
||||
dispatcher->addCommand(new DeOpCommand());
|
||||
dispatcher->addCommand(new BanCommand());
|
||||
dispatcher->addCommand(new PardonCommand());
|
||||
dispatcher->addCommand(new BanIpCommand());
|
||||
dispatcher->addCommand(new PardonIpCommand());
|
||||
dispatcher->addCommand(new BanListCommand());
|
||||
dispatcher->addCommand(new WhitelistCommand());
|
||||
|
||||
dispatcher->addCommand(new HelpCommand(dispatcher));
|
||||
|
||||
return dispatcher;
|
||||
}
|
||||
|
||||
bool HandleServerCommand(const wstring& rawCmd, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstring cmd = rawCmd;
|
||||
|
||||
size_t start = cmd.find_first_not_of(L" \t");
|
||||
if (start == wstring::npos) return false;
|
||||
cmd = cmd.substr(start);
|
||||
size_t end = cmd.find_last_not_of(L" \t");
|
||||
if (end != wstring::npos) cmd = cmd.substr(0, end + 1);
|
||||
|
||||
if (!cmd.empty() && cmd[0] == L'/') cmd = cmd.substr(1);
|
||||
if (cmd.empty()) return false;
|
||||
|
||||
wstring cmdName;
|
||||
wstring cmdArgs;
|
||||
size_t spacePos = cmd.find(L' ');
|
||||
if (spacePos != wstring::npos)
|
||||
{
|
||||
cmdName = cmd.substr(0, spacePos);
|
||||
cmdArgs = cmd.substr(spacePos + 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
cmdName = cmd;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < cmdName.size(); i++)
|
||||
cmdName[i] = towlower(cmdName[i]);
|
||||
|
||||
if (!s_dispatcher)
|
||||
s_dispatcher = CreateConsoleCommandDispatcher();
|
||||
|
||||
if (cmdName == L"?")
|
||||
cmdName = L"help";
|
||||
|
||||
if (!s_dispatcher->performCommand(cmdName, cmdArgs, src, server))
|
||||
{
|
||||
src->warn(L"Unknown command: " + cmdName + L". Type \"help\" for help.");
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
vector<wstring> GetServerCommandCompletions(const wstring& input, MinecraftServer *server)
|
||||
{
|
||||
vector<wstring> results;
|
||||
|
||||
if (!s_dispatcher)
|
||||
s_dispatcher = CreateConsoleCommandDispatcher();
|
||||
|
||||
wstring trimmed = input;
|
||||
if (!trimmed.empty() && trimmed[0] == L'/')
|
||||
trimmed = trimmed.substr(1);
|
||||
|
||||
size_t spacePos = trimmed.find(L' ');
|
||||
|
||||
if (spacePos == wstring::npos)
|
||||
{
|
||||
wstring partial = trimmed;
|
||||
for (size_t i = 0; i < partial.size(); i++)
|
||||
partial[i] = towlower(partial[i]);
|
||||
|
||||
const map<wstring, ServerCommand *>& cmds = s_dispatcher->getCommands();
|
||||
for (map<wstring, ServerCommand *>::const_iterator it = cmds.begin(); it != cmds.end(); ++it)
|
||||
{
|
||||
if (it->first.find(partial) == 0)
|
||||
results.push_back(it->first);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
wstring lastWord;
|
||||
size_t lastSpacePos = trimmed.find_last_of(L' ');
|
||||
if (lastSpacePos != wstring::npos && lastSpacePos + 1 < trimmed.size())
|
||||
lastWord = trimmed.substr(lastSpacePos + 1);
|
||||
|
||||
wstring partialLower = lastWord;
|
||||
for (size_t i = 0; i < partialLower.size(); i++)
|
||||
partialLower[i] = towlower(partialLower[i]);
|
||||
|
||||
if (server)
|
||||
{
|
||||
PlayerList *playerList = server->getPlayers();
|
||||
if (playerList)
|
||||
{
|
||||
for (size_t i = 0; i < playerList->players.size(); i++)
|
||||
{
|
||||
wstring pname = playerList->players[i]->name;
|
||||
wstring pnameLower = pname;
|
||||
for (size_t j = 0; j < pnameLower.size(); j++)
|
||||
pnameLower[j] = towlower(pnameLower[j]);
|
||||
|
||||
if (pnameLower.find(partialLower) == 0)
|
||||
results.push_back(pname);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
}
|
||||
11
Commands/ServerCommands.h
Normal file
11
Commands/ServerCommands.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
class MinecraftServer;
|
||||
class ConsoleInputSource;
|
||||
class ConsoleCommandDispatcher;
|
||||
|
||||
ConsoleCommandDispatcher *CreateConsoleCommandDispatcher();
|
||||
bool HandleServerCommand(const wstring& cmd, ConsoleInputSource *src, MinecraftServer *server);
|
||||
vector<wstring> GetServerCommandCompletions(const wstring& input, MinecraftServer *server);
|
||||
67
Commands/ServerTextList.h
Normal file
67
Commands/ServerTextList.h
Normal file
@@ -0,0 +1,67 @@
|
||||
#pragma once
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
class ServerTextList
|
||||
{
|
||||
private:
|
||||
std::wstring filename;
|
||||
std::set<std::wstring> entries;
|
||||
|
||||
public:
|
||||
ServerTextList(const std::wstring& filename) : filename(filename) { load(); }
|
||||
|
||||
void load()
|
||||
{
|
||||
entries.clear();
|
||||
std::wifstream file(
|
||||
#ifdef __linux__
|
||||
std::string(filename.begin(), filename.end()).c_str()
|
||||
#else
|
||||
filename.c_str()
|
||||
#endif
|
||||
);
|
||||
if (!file.is_open()) return;
|
||||
std::wstring line;
|
||||
while (std::getline(file, line))
|
||||
{
|
||||
if (!line.empty())
|
||||
entries.insert(line);
|
||||
}
|
||||
}
|
||||
|
||||
void save()
|
||||
{
|
||||
std::wofstream file(
|
||||
#ifdef __linux__
|
||||
std::string(filename.begin(), filename.end()).c_str()
|
||||
#else
|
||||
filename.c_str()
|
||||
#endif
|
||||
);
|
||||
if (!file.is_open()) return;
|
||||
for (std::set<std::wstring>::const_iterator it = entries.begin(); it != entries.end(); ++it)
|
||||
file << *it << L"\n";
|
||||
}
|
||||
|
||||
bool contains(const std::wstring& entry) const
|
||||
{
|
||||
return entries.find(entry) != entries.end();
|
||||
}
|
||||
|
||||
void add(const std::wstring& entry)
|
||||
{
|
||||
entries.insert(entry);
|
||||
save();
|
||||
}
|
||||
|
||||
void remove(const std::wstring& entry)
|
||||
{
|
||||
entries.erase(entry);
|
||||
save();
|
||||
}
|
||||
|
||||
const std::set<std::wstring>& getEntries() const { return entries; }
|
||||
int size() const { return (int)entries.size(); }
|
||||
};
|
||||
12
Commands/StopCommand.cpp
Normal file
12
Commands/StopCommand.cpp
Normal file
@@ -0,0 +1,12 @@
|
||||
#include "stdafx.h"
|
||||
#include "StopCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
|
||||
void StopCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
ServerCommand::notifyAdmins(src, server, L"Stopping the server");
|
||||
MinecraftServer::HaltServer();
|
||||
}
|
||||
11
Commands/StopCommand.h
Normal file
11
Commands/StopCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class StopCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"stop"; }
|
||||
wstring getUsage() { return L"/stop"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
93
Commands/TimeServerCommand.cpp
Normal file
93
Commands/TimeServerCommand.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
#include "stdafx.h"
|
||||
#include "TimeServerCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "ConsoleCommandSender.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ServerLevel.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.World/GameCommandPacket.h"
|
||||
#include "../../Minecraft.World/TimeCommand.h"
|
||||
#include "../../Minecraft.World/ByteArrayOutputStream.h"
|
||||
#include "../../Minecraft.World/DataOutputStream.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void TimeServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring subCmd;
|
||||
if (!(ss >> subCmd))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /time <set|add> <value>");
|
||||
return;
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < subCmd.size(); i++)
|
||||
subCmd[i] = towlower(subCmd[i]);
|
||||
|
||||
if (subCmd == L"set")
|
||||
{
|
||||
wstring valueStr;
|
||||
if (!(ss >> valueStr))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /time <set|add> <value>");
|
||||
return;
|
||||
}
|
||||
|
||||
int value;
|
||||
if (valueStr == L"day")
|
||||
value = 0;
|
||||
else if (valueStr == L"night")
|
||||
value = 12500;
|
||||
else
|
||||
{
|
||||
value = _wtoi(valueStr.c_str());
|
||||
if (value < 0)
|
||||
{
|
||||
wchar_t errBuf[256];
|
||||
swprintf_s(errBuf, 256, L"\u00A7cThe number you have entered (%d) is too small, it must be at least 0", value);
|
||||
src->warn(wstring(errBuf));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)server->levels.length; i++)
|
||||
server->levels[i]->setTimeAndAdjustTileTicks(value);
|
||||
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"Set the time to %d", value);
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
else if (subCmd == L"add")
|
||||
{
|
||||
wstring valueStr;
|
||||
if (!(ss >> valueStr))
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /time <set|add> <value>");
|
||||
return;
|
||||
}
|
||||
int value = _wtoi(valueStr.c_str());
|
||||
if (value < 0)
|
||||
{
|
||||
wchar_t errBuf[256];
|
||||
swprintf_s(errBuf, 256, L"\u00A7cThe number you have entered (%d) is too small, it must be at least 0", value);
|
||||
src->warn(wstring(errBuf));
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < (int)server->levels.length; i++)
|
||||
{
|
||||
ServerLevel *level = server->levels[i];
|
||||
level->setTimeAndAdjustTileTicks(level->getTime() + value);
|
||||
}
|
||||
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"Added %d to the time", value);
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
else
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /time <set|add> <value>");
|
||||
}
|
||||
}
|
||||
11
Commands/TimeServerCommand.h
Normal file
11
Commands/TimeServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class TimeServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"time"; }
|
||||
wstring getUsage() { return L"/time <set|add> <value>"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
17
Commands/ToggleDownfallServerCommand.cpp
Normal file
17
Commands/ToggleDownfallServerCommand.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
#include "stdafx.h"
|
||||
#include "ToggleDownfallServerCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "ConsoleCommandSender.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.World/CommandDispatcher.h"
|
||||
#include "../../Minecraft.World/ByteArrayOutputStream.h"
|
||||
|
||||
void ToggleDownfallServerCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
shared_ptr<ConsoleCommandSender> sender(new ConsoleCommandSender(src));
|
||||
CommandDispatcher *dispatcher = server->getCommandDispatcher();
|
||||
dispatcher->performCommand(sender, eGameCommand_ToggleDownfall, byteArray());
|
||||
ServerCommand::notifyAdmins(src, server, L"Toggled downfall");
|
||||
}
|
||||
11
Commands/ToggleDownfallServerCommand.h
Normal file
11
Commands/ToggleDownfallServerCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class ToggleDownfallServerCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"toggledownfall"; }
|
||||
wstring getUsage() { return L"/toggledownfall"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
67
Commands/TpCommand.cpp
Normal file
67
Commands/TpCommand.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
#include "stdafx.h"
|
||||
#include "TpCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
#include "../../Minecraft.Client/PlayerConnection.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
|
||||
void TpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
vector<wstring> tokens;
|
||||
wstring token;
|
||||
while (ss >> token)
|
||||
tokens.push_back(token);
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
|
||||
if (tokens.size() == 2)
|
||||
{
|
||||
shared_ptr<ServerPlayer> subject = players->getPlayer(tokens[0]);
|
||||
if (!subject)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
shared_ptr<ServerPlayer> dest = players->getPlayer(tokens[1]);
|
||||
if (!dest)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
subject->moveTo(dest->x, dest->y, dest->z, dest->yRot, dest->xRot);
|
||||
if (subject->connection)
|
||||
subject->connection->teleport(dest->x, dest->y, dest->z, dest->yRot, dest->xRot);
|
||||
wchar_t buf[256];
|
||||
swprintf_s(buf, 256, L"Teleported %s to %s", subject->name.c_str(), dest->name.c_str());
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
else if (tokens.size() == 4)
|
||||
{
|
||||
shared_ptr<ServerPlayer> subject = players->getPlayer(tokens[0]);
|
||||
if (!subject)
|
||||
{
|
||||
src->warn(L"\u00A7cThat player cannot be found");
|
||||
return;
|
||||
}
|
||||
int x = _wtoi(tokens[1].c_str());
|
||||
int y = _wtoi(tokens[2].c_str());
|
||||
int z = _wtoi(tokens[3].c_str());
|
||||
subject->moveTo(x + 0.5, (double)y, z + 0.5, subject->yRot, subject->xRot);
|
||||
if (subject->connection)
|
||||
subject->connection->teleport(x + 0.5, (double)y, z + 0.5, subject->yRot, subject->xRot);
|
||||
wchar_t buf[256];
|
||||
swprintf_s(buf, 256, L"Teleported %s to %d, %d, %d", subject->name.c_str(), x, y, z);
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
else
|
||||
{
|
||||
src->warn(L"\u00A7cUsage: /tp [player] <x> <y> <z> OR /tp [player] <player>");
|
||||
}
|
||||
}
|
||||
11
Commands/TpCommand.h
Normal file
11
Commands/TpCommand.h
Normal file
@@ -0,0 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class TpCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"tp"; }
|
||||
wstring getUsage() { return L"/tp [player] <x> <y> <z> OR /tp [player] <player>"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
84
Commands/WhitelistCommand.cpp
Normal file
84
Commands/WhitelistCommand.cpp
Normal file
@@ -0,0 +1,84 @@
|
||||
#include "stdafx.h"
|
||||
#include "WhitelistCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "ServerTextList.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../Core/ServerLists.h"
|
||||
#include "ServerTextList.h"
|
||||
|
||||
#include <sstream>
|
||||
#include <cwctype>
|
||||
|
||||
void WhitelistCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring subCmd;
|
||||
if (!(ss >> subCmd))
|
||||
{
|
||||
src->warn(L"Usage: /whitelist <on|off|list|add|remove|reload>");
|
||||
return;
|
||||
}
|
||||
|
||||
if (subCmd == L"on")
|
||||
{
|
||||
ServerLists_SetWhitelistEnabled(true);
|
||||
ServerCommand::notifyAdmins(src, server, L"Turned on the whitelist");
|
||||
}
|
||||
else if (subCmd == L"off")
|
||||
{
|
||||
ServerLists_SetWhitelistEnabled(false);
|
||||
ServerCommand::notifyAdmins(src, server, L"Turned off the whitelist");
|
||||
}
|
||||
else if (subCmd == L"list")
|
||||
{
|
||||
const set<wstring>& entries = ServerLists_GetWhitelist()->getEntries();
|
||||
wchar_t buf[128];
|
||||
swprintf_s(buf, 128, L"There are %d whitelisted players:", (int)entries.size());
|
||||
src->info(wstring(buf));
|
||||
wstring list;
|
||||
for (set<wstring>::const_iterator it = entries.begin(); it != entries.end(); ++it)
|
||||
{
|
||||
if (!list.empty()) list += L", ";
|
||||
list += *it;
|
||||
}
|
||||
if (!list.empty()) src->info(list);
|
||||
}
|
||||
else if (subCmd == L"add")
|
||||
{
|
||||
wstring playerName;
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"Usage: /whitelist add <player>");
|
||||
return;
|
||||
}
|
||||
wstring lower = playerName;
|
||||
for (size_t i = 0; i < lower.size(); i++)
|
||||
lower[i] = towlower(lower[i]);
|
||||
ServerLists_GetWhitelist()->add(lower);
|
||||
ServerCommand::notifyAdmins(src, server, L"Added " + playerName + L" to the whitelist");
|
||||
}
|
||||
else if (subCmd == L"remove")
|
||||
{
|
||||
wstring playerName;
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"Usage: /whitelist remove <player>");
|
||||
return;
|
||||
}
|
||||
wstring lower = playerName;
|
||||
for (size_t i = 0; i < lower.size(); i++)
|
||||
lower[i] = towlower(lower[i]);
|
||||
ServerLists_GetWhitelist()->remove(lower);
|
||||
ServerCommand::notifyAdmins(src, server, L"Removed " + playerName + L" from the whitelist");
|
||||
}
|
||||
else if (subCmd == L"reload")
|
||||
{
|
||||
ServerLists_GetWhitelist()->load();
|
||||
ServerCommand::notifyAdmins(src, server, L"Reloaded the whitelist");
|
||||
}
|
||||
else
|
||||
{
|
||||
src->warn(L"Usage: /whitelist <on|off|list|add|remove|reload>");
|
||||
}
|
||||
}
|
||||
10
Commands/WhitelistCommand.h
Normal file
10
Commands/WhitelistCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class WhitelistCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"whitelist"; }
|
||||
wstring getUsage() { return L"/whitelist <on|off|list|add|remove|reload> [player] - Manages the whitelist"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
62
Commands/XpCommand.cpp
Normal file
62
Commands/XpCommand.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#include "stdafx.h"
|
||||
#include "XpCommand.h"
|
||||
#include "ServerCommand.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/PlayerList.h"
|
||||
#include "../../Minecraft.Client/ServerPlayer.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
void XpCommand::execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server)
|
||||
{
|
||||
wstringstream ss(args);
|
||||
wstring amountStr;
|
||||
if (!(ss >> amountStr))
|
||||
{
|
||||
src->warn(L"Usage: /xp <amount> [player] OR /xp <amount>L [player]");
|
||||
return;
|
||||
}
|
||||
|
||||
bool isLevels = false;
|
||||
if (!amountStr.empty() && (amountStr.back() == L'l' || amountStr.back() == L'L'))
|
||||
{
|
||||
isLevels = true;
|
||||
amountStr = amountStr.substr(0, amountStr.size() - 1);
|
||||
}
|
||||
|
||||
int amount = _wtoi(amountStr.c_str());
|
||||
|
||||
wstring playerName;
|
||||
if (!(ss >> playerName))
|
||||
{
|
||||
src->warn(L"Usage: /xp <amount> <player>");
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerList *players = server->getPlayers();
|
||||
shared_ptr<ServerPlayer> player = players->getPlayer(playerName);
|
||||
if (!player)
|
||||
{
|
||||
src->warn(L"Player not found: " + playerName);
|
||||
return;
|
||||
}
|
||||
|
||||
wchar_t buf[256];
|
||||
if (isLevels)
|
||||
{
|
||||
player->withdrawExperienceLevels(-amount);
|
||||
swprintf_s(buf, 256, L"Given %d experience levels to %s", amount, player->name.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
if (amount < 0)
|
||||
{
|
||||
src->warn(L"Cannot give negative experience points");
|
||||
return;
|
||||
}
|
||||
player->increaseXp(amount);
|
||||
swprintf_s(buf, 256, L"Given %d experience to %s", amount, player->name.c_str());
|
||||
}
|
||||
ServerCommand::notifyAdmins(src, server, wstring(buf));
|
||||
}
|
||||
10
Commands/XpCommand.h
Normal file
10
Commands/XpCommand.h
Normal file
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include "ServerCommand.h"
|
||||
|
||||
class XpCommand : public ServerCommand
|
||||
{
|
||||
public:
|
||||
wstring getName() { return L"xp"; }
|
||||
wstring getUsage() { return L"/xp <amount> [player] OR /xp <amount>L [player] - Gives experience"; }
|
||||
void execute(const wstring& args, ConsoleInputSource *src, MinecraftServer *server);
|
||||
};
|
||||
559
Core/DedicatedServer.cpp
Normal file
559
Core/DedicatedServer.cpp
Normal file
@@ -0,0 +1,559 @@
|
||||
#include "stdafx.h"
|
||||
#include "DedicatedServer.h"
|
||||
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "../../Minecraft.Client/Minecraft.h"
|
||||
#include "../../Minecraft.Client/ProgressRenderer.h"
|
||||
#include "../../Minecraft.Client/GameRenderer.h"
|
||||
#include "../../Minecraft.Client/Options.h"
|
||||
#include "../../Minecraft.Client/User.h"
|
||||
#include "../../Minecraft.Client/StatsCounter.h"
|
||||
#include "../../Minecraft.Client/Windows64/Network/WinsockNetLayer.h"
|
||||
#include "../../Minecraft.Client/Common/Network/PlatformNetworkManagerStub.h"
|
||||
#include "../../Minecraft.World/Minecraft.World.h"
|
||||
#include "../../Minecraft.World/System.h"
|
||||
#include "../../Minecraft.World/AABB.h"
|
||||
#include "../../Minecraft.World/Vec3.h"
|
||||
#include "../../Minecraft.World/IntCache.h"
|
||||
#include "../../Minecraft.World/compression.h"
|
||||
#include "../../Minecraft.World/OldChunkStorage.h"
|
||||
#include "../../Minecraft.World/Level.h"
|
||||
#include "../../Minecraft.World/Tile.h"
|
||||
#include "../../Minecraft.World/Entity.h"
|
||||
#include "../../Minecraft.World/SharedConstants.h"
|
||||
#include "../../Minecraft.World/ChunkSource.h"
|
||||
#include "ServerLogger.h"
|
||||
#include "ServerLists.h"
|
||||
#include "../Commands/ServerCommands.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <termios.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <conio.h>
|
||||
#endif
|
||||
|
||||
DedicatedServer::DedicatedServer()
|
||||
: m_running(false)
|
||||
{
|
||||
}
|
||||
|
||||
DedicatedServer::~DedicatedServer()
|
||||
{
|
||||
}
|
||||
|
||||
bool DedicatedServer::init()
|
||||
{
|
||||
if (!m_properties.load(L"server.properties"))
|
||||
{
|
||||
ServerLog(L"server.properties not found, generating defaults\n");
|
||||
m_properties.save(L"server.properties");
|
||||
}
|
||||
|
||||
ServerLog(L"Loading properties\n");
|
||||
ServerLog(L"Default game type: %s\n", m_properties.gamemode == 0 ? L"SURVIVAL" : L"CREATIVE");
|
||||
ServerLog(L"Max players: %d\n", m_properties.maxPlayers);
|
||||
ServerLog(L"Difficulty: %d\n", m_properties.difficulty);
|
||||
ServerLog(L"Level size: %s\n", m_properties.levelSize.c_str());
|
||||
|
||||
ServerLists_Init(m_properties.whiteList, &m_properties);
|
||||
|
||||
extern bool g_voiceChatEnabled;
|
||||
g_voiceChatEnabled = m_properties.voiceChat;
|
||||
|
||||
extern bool g_ServerAdvertiseLAN;
|
||||
g_ServerAdvertiseLAN = m_properties.advertiseLan;
|
||||
|
||||
extern char g_ServerBindAddress[256];
|
||||
if (!m_properties.serverIp.empty())
|
||||
{
|
||||
wcstombs(g_ServerBindAddress, m_properties.serverIp.c_str(), sizeof(g_ServerBindAddress) - 1);
|
||||
g_ServerBindAddress[sizeof(g_ServerBindAddress) - 1] = '\0';
|
||||
}
|
||||
else
|
||||
{
|
||||
g_ServerBindAddress[0] = '\0';
|
||||
}
|
||||
if (g_voiceChatEnabled && m_properties.maxPlayers > 8)
|
||||
{
|
||||
ServerLog(L"Voice chat has been disabled: max-players (%d) exceeds the maximum supported for voice chat (8)\n", m_properties.maxPlayers);
|
||||
g_voiceChatEnabled = false;
|
||||
}
|
||||
else if (g_voiceChatEnabled)
|
||||
{
|
||||
ServerLog(L"Voice chat is enabled\n");
|
||||
}
|
||||
|
||||
AABB::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
Compression::CreateNewThreadStorage();
|
||||
OldChunkStorage::CreateNewThreadStorage();
|
||||
Level::enableLightingCache();
|
||||
Tile::CreateNewThreadStorage();
|
||||
|
||||
MinecraftWorld_RunStaticCtors();
|
||||
|
||||
{
|
||||
wchar_t exePath[MAX_PATH];
|
||||
if (GetModuleFileNameW(NULL, exePath, MAX_PATH))
|
||||
{
|
||||
wstring exeDir(exePath);
|
||||
size_t lastSlash = exeDir.find_last_of(L"\\/");
|
||||
if (lastSlash != wstring::npos)
|
||||
exeDir = exeDir.substr(0, lastSlash);
|
||||
SetCurrentDirectoryW(exeDir.c_str());
|
||||
#ifdef __linux__
|
||||
wstring gameHDDPath = exeDir + L"/Linux/GameHDD";
|
||||
CreateDirectoryW((exeDir + L"/Linux").c_str(), NULL);
|
||||
#else
|
||||
wstring gameHDDPath = exeDir + L"\\Windows64\\GameHDD";
|
||||
CreateDirectoryW((exeDir + L"\\Windows64").c_str(), NULL);
|
||||
#endif
|
||||
CreateDirectoryW(gameHDDPath.c_str(), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
StorageManager.Init(1, app.GetString(IDS_DEFAULT_SAVENAME), "savegame.dat", FIFTY_ONE_MB, NULL, NULL, "MinecraftDedicatedServer");
|
||||
StorageManager.SetMaxSaves(99);
|
||||
StorageManager.StoreTMSPathName();
|
||||
|
||||
g_NetworkManager.Initialise();
|
||||
|
||||
for (int i = 0; i < MINECRAFT_NET_MAX_PLAYERS; i++)
|
||||
{
|
||||
IQNet::m_player[i].m_smallId = (BYTE)i;
|
||||
IQNet::m_player[i].m_isRemote = false;
|
||||
IQNet::m_player[i].m_isHostPlayer = (i == 0);
|
||||
swprintf_s(IQNet::m_player[i].m_gamertag, 32, L"Server%d", i);
|
||||
}
|
||||
wcscpy_s(IQNet::m_player[0].m_gamertag, 32, m_properties.motd.c_str());
|
||||
|
||||
WinsockNetLayer::Initialize();
|
||||
|
||||
app.SetGameHostOption(eGameHostOption_Difficulty, m_properties.difficulty);
|
||||
app.SetGameHostOption(eGameHostOption_GameType, m_properties.gamemode);
|
||||
app.SetGameHostOption(eGameHostOption_PvP, m_properties.pvp ? 1 : 0);
|
||||
app.SetGameHostOption(eGameHostOption_TrustPlayers, m_properties.trustPlayers ? 1 : 0);
|
||||
app.SetGameHostOption(eGameHostOption_FireSpreads, m_properties.fireSpreads ? 1 : 0);
|
||||
app.SetGameHostOption(eGameHostOption_TNT, m_properties.tntExplodes ? 1 : 0);
|
||||
app.SetGameHostOption(eGameHostOption_Structures, m_properties.structures ? 1 : 0);
|
||||
app.SetGameHostOption(eGameHostOption_Gamertags, m_properties.showGamertags ? 1 : 0);
|
||||
|
||||
Minecraft *pMinecraft = new Minecraft(NULL, NULL, NULL, 1, 1, false);
|
||||
pMinecraft->options = new Options(pMinecraft, File(L"."));
|
||||
pMinecraft->progressRenderer = new ProgressRenderer(pMinecraft);
|
||||
pMinecraft->gameRenderer = new GameRenderer(pMinecraft);
|
||||
for (int i = 0; i < 4; i++)
|
||||
pMinecraft->stats[i] = new StatsCounter();
|
||||
|
||||
{
|
||||
static DWORD dwProfileSettingsA[5] = {0, 0, 0, 0, 0};
|
||||
ProfileManager.Initialise(TITLEID_MINECRAFT,
|
||||
app.m_dwOfferID,
|
||||
PROFILE_VERSION_10,
|
||||
5,
|
||||
4,
|
||||
dwProfileSettingsA,
|
||||
app.GAME_DEFINED_PROFILE_DATA_BYTES * XUSER_MAX_COUNT,
|
||||
&app.uiGameDefinedDataChangedBitmask);
|
||||
}
|
||||
|
||||
app.InitGameSettings();
|
||||
|
||||
if (!m_properties.serverIp.empty())
|
||||
ServerLog(L"Starting Minecraft server on %s:%d\n", m_properties.serverIp.c_str(), m_properties.serverPort);
|
||||
else
|
||||
ServerLog(L"Starting Minecraft server on *:%d\n", m_properties.serverPort);
|
||||
m_running = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
int DedicatedServer::run()
|
||||
{
|
||||
if (!m_running)
|
||||
{
|
||||
ServerWarn(L"Server not initialized!\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
ServerLog(L"Preparing level \"%s\"\n", m_properties.levelName.c_str());
|
||||
|
||||
StorageManager.GetSavesInfo(0, NULL, NULL, NULL);
|
||||
PSAVE_DETAILS pSaveDetails = StorageManager.ReturnSavesInfo();
|
||||
if (pSaveDetails && pSaveDetails->iSaveC > 0)
|
||||
{
|
||||
int bestIdx = 0;
|
||||
time_t bestTime = pSaveDetails->SaveInfoA[0].metaData.modifiedTime;
|
||||
for (int i = 1; i < pSaveDetails->iSaveC; i++)
|
||||
{
|
||||
if (pSaveDetails->SaveInfoA[i].metaData.modifiedTime > bestTime)
|
||||
{
|
||||
bestTime = pSaveDetails->SaveInfoA[i].metaData.modifiedTime;
|
||||
bestIdx = i;
|
||||
}
|
||||
}
|
||||
ServerLog(L"Loading existing world from save \"%S\"\n", pSaveDetails->SaveInfoA[bestIdx].UTF8SaveFilename);
|
||||
StorageManager.LoadSaveData(&pSaveDetails->SaveInfoA[bestIdx], NULL, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
ServerLog(L"No existing save found, creating new world\n");
|
||||
wstring title = m_properties.levelName;
|
||||
StorageManager.SetSaveTitle(title.c_str());
|
||||
}
|
||||
|
||||
g_NetworkManager.HostGame(1, true, false, (unsigned char)m_properties.maxPlayers, 0);
|
||||
|
||||
extern CPlatformNetworkManagerStub *g_pPlatformNetworkManager;
|
||||
g_pPlatformNetworkManager->NotifyPlayerJoined(&IQNet::m_player[0]);
|
||||
|
||||
g_NetworkManager.ServerReadyCreate(true);
|
||||
g_NetworkManager.ServerStoppedCreate(true);
|
||||
|
||||
NetworkGameInitData initData;
|
||||
initData.seed = m_properties.levelSeed;
|
||||
initData.saveData = NULL;
|
||||
initData.settings = 0;
|
||||
initData.levelGen = NULL;
|
||||
initData.texturePackId = 0;
|
||||
initData.findSeed = (m_properties.levelSeed == 0);
|
||||
|
||||
if (m_properties.levelSize == L"classic")
|
||||
{
|
||||
initData.xzSize = 1 * 54;
|
||||
initData.hellScale = 3;
|
||||
}
|
||||
else if (m_properties.levelSize == L"small")
|
||||
{
|
||||
initData.xzSize = 1 * 64;
|
||||
initData.hellScale = 3;
|
||||
}
|
||||
else if (m_properties.levelSize == L"medium")
|
||||
{
|
||||
initData.xzSize = 3 * 64;
|
||||
initData.hellScale = 6;
|
||||
}
|
||||
else
|
||||
{
|
||||
initData.xzSize = LEVEL_MAX_WIDTH;
|
||||
initData.hellScale = HELL_LEVEL_MAX_SCALE;
|
||||
}
|
||||
|
||||
AABB::CreateNewThreadStorage();
|
||||
Vec3::CreateNewThreadStorage();
|
||||
IntCache::CreateNewThreadStorage();
|
||||
Compression::UseDefaultThreadStorage();
|
||||
Entity::useSmallIds();
|
||||
Level::enableLightingCache();
|
||||
Tile::CreateNewThreadStorage();
|
||||
|
||||
ServerLog(L"Preparing start region for level 0\n");
|
||||
MinecraftServer::main(m_properties.levelSeed, &initData);
|
||||
|
||||
g_NetworkManager.ServerReadyDestroy();
|
||||
g_NetworkManager.ServerStoppedDestroy();
|
||||
|
||||
ServerLog(L"Server stopped\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
void DedicatedServer::shutdown()
|
||||
{
|
||||
ServerLog(L"Stopping server\n");
|
||||
m_running = false;
|
||||
MinecraftServer::HaltServer();
|
||||
|
||||
Tile::ReleaseThreadStorage();
|
||||
IntCache::ReleaseThreadStorage();
|
||||
AABB::ReleaseThreadStorage();
|
||||
Vec3::ReleaseThreadStorage();
|
||||
Level::destroyLightingCache();
|
||||
|
||||
g_NetworkManager.Terminate();
|
||||
ServerLog(L"Shutdown complete\n");
|
||||
}
|
||||
|
||||
void DedicatedServer::info(const wstring& string)
|
||||
{
|
||||
ServerLog(L"%s\n", string.c_str());
|
||||
}
|
||||
|
||||
void DedicatedServer::warn(const wstring& string)
|
||||
{
|
||||
ServerWarn(L"%s\n", string.c_str());
|
||||
}
|
||||
|
||||
wstring DedicatedServer::getConsoleName()
|
||||
{
|
||||
return L"Server";
|
||||
}
|
||||
|
||||
int DedicatedServer::consoleInputThread(void *param)
|
||||
{
|
||||
DedicatedServer *server = (DedicatedServer *)param;
|
||||
|
||||
#ifdef __linux__
|
||||
struct termios origTermios;
|
||||
tcgetattr(STDIN_FILENO, &origTermios);
|
||||
{
|
||||
struct termios raw = origTermios;
|
||||
raw.c_lflag &= ~(ICANON | ECHO);
|
||||
raw.c_cc[VMIN] = 1;
|
||||
raw.c_cc[VTIME] = 0;
|
||||
tcsetattr(STDIN_FILENO, TCSAFLUSH, &raw);
|
||||
}
|
||||
#endif
|
||||
|
||||
wstring buffer;
|
||||
vector<wstring> history;
|
||||
int historyPos = -1;
|
||||
wstring savedBuffer;
|
||||
ServerLog_RegisterInput(&buffer);
|
||||
|
||||
auto clearLine = [&]() {
|
||||
if (buffer.empty()) return;
|
||||
#ifdef __linux__
|
||||
for (size_t i = 0; i < buffer.size(); i++)
|
||||
printf("\b \b");
|
||||
fflush(stdout);
|
||||
#else
|
||||
for (size_t i = 0; i < buffer.size(); i++)
|
||||
wprintf(L"\b \b");
|
||||
#endif
|
||||
};
|
||||
|
||||
auto redrawLine = [&]() {
|
||||
#ifdef __linux__
|
||||
printf("%ls", buffer.c_str());
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"%s", buffer.c_str());
|
||||
#endif
|
||||
};
|
||||
|
||||
while (server->m_running)
|
||||
{
|
||||
#ifdef __linux__
|
||||
char c;
|
||||
if (read(STDIN_FILENO, &c, 1) <= 0) break;
|
||||
wchar_t wc = (wchar_t)(unsigned char)c;
|
||||
#else
|
||||
wchar_t wc = _getwch();
|
||||
#endif
|
||||
|
||||
if (wc == L'\t')
|
||||
{
|
||||
ServerLog_LockOutput();
|
||||
MinecraftServer *mcServer = MinecraftServer::getInstance();
|
||||
vector<wstring> completions = GetServerCommandCompletions(buffer, mcServer);
|
||||
|
||||
if (completions.size() == 1)
|
||||
{
|
||||
size_t lastSpace = buffer.find_last_of(L' ');
|
||||
wstring currentWord = (lastSpace == wstring::npos) ? buffer : buffer.substr(lastSpace + 1);
|
||||
wstring toAppend = completions[0].substr(currentWord.size()) + L" ";
|
||||
buffer += toAppend;
|
||||
#ifdef __linux__
|
||||
printf("%ls", toAppend.c_str());
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"%s", toAppend.c_str());
|
||||
#endif
|
||||
}
|
||||
else if (completions.size() > 1)
|
||||
{
|
||||
wstring common = completions[0];
|
||||
for (size_t i = 1; i < completions.size(); i++)
|
||||
{
|
||||
size_t j = 0;
|
||||
while (j < common.size() && j < completions[i].size() &&
|
||||
towlower(common[j]) == towlower(completions[i][j]))
|
||||
j++;
|
||||
common = common.substr(0, j);
|
||||
}
|
||||
|
||||
size_t lastSpace = buffer.find_last_of(L' ');
|
||||
wstring currentWord = (lastSpace == wstring::npos) ? buffer : buffer.substr(lastSpace + 1);
|
||||
|
||||
if (common.size() > currentWord.size())
|
||||
{
|
||||
wstring toAppend = common.substr(currentWord.size());
|
||||
buffer += toAppend;
|
||||
#ifdef __linux__
|
||||
printf("%ls", toAppend.c_str());
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"%s", toAppend.c_str());
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef __linux__
|
||||
printf("\n");
|
||||
for (size_t i = 0; i < completions.size(); i++)
|
||||
printf("%ls ", completions[i].c_str());
|
||||
printf("\n%ls", buffer.c_str());
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"\n");
|
||||
for (size_t i = 0; i < completions.size(); i++)
|
||||
wprintf(L"%s ", completions[i].c_str());
|
||||
wprintf(L"\n%s", buffer.c_str());
|
||||
#endif
|
||||
}
|
||||
}
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
else if (wc == L'\r' || wc == L'\n')
|
||||
{
|
||||
ServerLog_LockOutput();
|
||||
#ifdef __linux__
|
||||
printf("\n");
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"\n");
|
||||
#endif
|
||||
wstring cmd = buffer;
|
||||
buffer.clear();
|
||||
ServerLog_UnlockOutput();
|
||||
if (!cmd.empty())
|
||||
{
|
||||
if (history.empty() || history.back() != cmd)
|
||||
history.push_back(cmd);
|
||||
historyPos = -1;
|
||||
|
||||
if (cmd == L"stop" || cmd == L"quit" || cmd == L"exit")
|
||||
{
|
||||
ServerLog(L"Stopping the server\n");
|
||||
MinecraftServer::HaltServer();
|
||||
server->m_running = false;
|
||||
break;
|
||||
}
|
||||
MinecraftServer *mcServer = MinecraftServer::getInstance();
|
||||
if (mcServer)
|
||||
mcServer->handleConsoleInput(cmd, server);
|
||||
}
|
||||
}
|
||||
else if (wc == 127 || wc == 8)
|
||||
{
|
||||
if (!buffer.empty())
|
||||
{
|
||||
ServerLog_LockOutput();
|
||||
buffer.pop_back();
|
||||
#ifdef __linux__
|
||||
printf("\b \b");
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"\b \b");
|
||||
#endif
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
}
|
||||
#ifdef __linux__
|
||||
else if (c == 27)
|
||||
{
|
||||
char seq[2];
|
||||
if (read(STDIN_FILENO, &seq[0], 1) != 1) continue;
|
||||
if (seq[0] != '[') continue;
|
||||
if (read(STDIN_FILENO, &seq[1], 1) != 1) continue;
|
||||
|
||||
if (seq[1] == 'A')
|
||||
{
|
||||
if (history.empty()) continue;
|
||||
if (historyPos == -1)
|
||||
{
|
||||
savedBuffer = buffer;
|
||||
historyPos = (int)history.size() - 1;
|
||||
}
|
||||
else if (historyPos > 0)
|
||||
{
|
||||
historyPos--;
|
||||
}
|
||||
ServerLog_LockOutput();
|
||||
clearLine();
|
||||
buffer = history[historyPos];
|
||||
redrawLine();
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
else if (seq[1] == 'B')
|
||||
{
|
||||
if (historyPos == -1) continue;
|
||||
ServerLog_LockOutput();
|
||||
clearLine();
|
||||
if (historyPos < (int)history.size() - 1)
|
||||
{
|
||||
historyPos++;
|
||||
buffer = history[historyPos];
|
||||
}
|
||||
else
|
||||
{
|
||||
historyPos = -1;
|
||||
buffer = savedBuffer;
|
||||
}
|
||||
redrawLine();
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
}
|
||||
#else
|
||||
else if (wc == 0 || wc == 0xE0)
|
||||
{
|
||||
wchar_t ext = _getwch();
|
||||
if (ext == 72)
|
||||
{
|
||||
if (history.empty()) continue;
|
||||
if (historyPos == -1)
|
||||
{
|
||||
savedBuffer = buffer;
|
||||
historyPos = (int)history.size() - 1;
|
||||
}
|
||||
else if (historyPos > 0)
|
||||
{
|
||||
historyPos--;
|
||||
}
|
||||
ServerLog_LockOutput();
|
||||
clearLine();
|
||||
buffer = history[historyPos];
|
||||
redrawLine();
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
else if (ext == 80)
|
||||
{
|
||||
if (historyPos == -1) continue;
|
||||
ServerLog_LockOutput();
|
||||
clearLine();
|
||||
if (historyPos < (int)history.size() - 1)
|
||||
{
|
||||
historyPos++;
|
||||
buffer = history[historyPos];
|
||||
}
|
||||
else
|
||||
{
|
||||
historyPos = -1;
|
||||
buffer = savedBuffer;
|
||||
}
|
||||
redrawLine();
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
else if (wc >= 32)
|
||||
{
|
||||
ServerLog_LockOutput();
|
||||
buffer += wc;
|
||||
#ifdef __linux__
|
||||
printf("%lc", wc);
|
||||
fflush(stdout);
|
||||
#else
|
||||
wprintf(L"%c", wc);
|
||||
#endif
|
||||
ServerLog_UnlockOutput();
|
||||
}
|
||||
}
|
||||
|
||||
ServerLog_UnregisterInput();
|
||||
#ifdef __linux__
|
||||
tcsetattr(STDIN_FILENO, TCSAFLUSH, &origTermios);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
30
Core/DedicatedServer.h
Normal file
30
Core/DedicatedServer.h
Normal file
@@ -0,0 +1,30 @@
|
||||
#pragma once
|
||||
|
||||
#include "../../Minecraft.Client/ConsoleInputSource.h"
|
||||
#include "../../Minecraft.Client/MinecraftServer.h"
|
||||
#include "ServerProperties.h"
|
||||
|
||||
class DedicatedServer : public ConsoleInputSource
|
||||
{
|
||||
public:
|
||||
DedicatedServer();
|
||||
~DedicatedServer();
|
||||
|
||||
bool init();
|
||||
|
||||
int run();
|
||||
|
||||
void shutdown();
|
||||
|
||||
virtual void info(const wstring& string);
|
||||
virtual void warn(const wstring& string);
|
||||
virtual wstring getConsoleName();
|
||||
|
||||
static int consoleInputThread(void *param);
|
||||
|
||||
private:
|
||||
void processConsoleInput();
|
||||
|
||||
bool m_running;
|
||||
ServerProperties m_properties;
|
||||
};
|
||||
140
Core/DedicatedServer_Main.cpp
Normal file
140
Core/DedicatedServer_Main.cpp
Normal file
@@ -0,0 +1,140 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "DedicatedServer.h"
|
||||
#include "ServerLogger.h"
|
||||
#include "../../Minecraft.World/C4JThread.h"
|
||||
#include "../../Minecraft.Client/Common/BuildVer.h"
|
||||
#include "../../Minecraft.World/SharedConstants.h"
|
||||
|
||||
#ifdef __linux__
|
||||
#include <signal.h>
|
||||
#include <cstdio>
|
||||
#include <ctime>
|
||||
#include <locale.h>
|
||||
#else
|
||||
#include <fcntl.h>
|
||||
#include <io.h>
|
||||
#include <time.h>
|
||||
#endif
|
||||
|
||||
static DedicatedServer g_dedicatedServer;
|
||||
static volatile bool g_shutdownRequested = false;
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
static void SignalHandler(int sig)
|
||||
{
|
||||
if (sig == SIGINT || sig == SIGTERM)
|
||||
{
|
||||
printf("\n");
|
||||
ServerLog(L"Received shutdown signal, saving and stopping...\n");
|
||||
g_shutdownRequested = true;
|
||||
MinecraftServer::HaltServer();
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
setlocale(LC_ALL, "");
|
||||
ServerLog_Init();
|
||||
|
||||
ServerLog(L"Starting Minecraft LCE server version %s (protocol %d)\n", VER_FILEVERSION_STR_W, SharedConstants::NETWORK_PROTOCOL_VERSION);
|
||||
|
||||
struct sigaction sa;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = SignalHandler;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sigaction(SIGINT, &sa, NULL);
|
||||
sigaction(SIGTERM, &sa, NULL);
|
||||
|
||||
signal(SIGPIPE, SIG_IGN);
|
||||
signal(SIGTTIN, SIG_IGN);
|
||||
|
||||
if (!g_dedicatedServer.init())
|
||||
{
|
||||
ServerLog(L"Failed to initialize. Exiting.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
C4JThread *inputThread = new C4JThread(DedicatedServer::consoleInputThread, &g_dedicatedServer, "ConsoleInput");
|
||||
inputThread->Run();
|
||||
|
||||
int result = g_dedicatedServer.run();
|
||||
|
||||
g_dedicatedServer.shutdown();
|
||||
delete inputThread;
|
||||
|
||||
ServerLog(L"Goodbye.\n");
|
||||
ServerLog_Close();
|
||||
return result;
|
||||
}
|
||||
|
||||
#else // Windows
|
||||
|
||||
static HANDLE g_shutdownCompleteEvent = NULL;
|
||||
|
||||
BOOL WINAPI ConsoleCtrlHandler(DWORD ctrlType)
|
||||
{
|
||||
switch (ctrlType)
|
||||
{
|
||||
case CTRL_C_EVENT:
|
||||
case CTRL_BREAK_EVENT:
|
||||
wprintf(L"\n");
|
||||
ServerLog(L"Received shutdown signal, saving and stopping...\n");
|
||||
g_shutdownRequested = true;
|
||||
MinecraftServer::HaltServer();
|
||||
if (g_shutdownCompleteEvent)
|
||||
WaitForSingleObject(g_shutdownCompleteEvent, 30000);
|
||||
return TRUE;
|
||||
case CTRL_CLOSE_EVENT:
|
||||
FreeConsole();
|
||||
g_shutdownRequested = true;
|
||||
MinecraftServer::HaltServer();
|
||||
if (g_shutdownCompleteEvent)
|
||||
WaitForSingleObject(g_shutdownCompleteEvent, 30000);
|
||||
ExitProcess(0);
|
||||
return TRUE;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
int wmain(int argc, wchar_t *argv[])
|
||||
{
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
SetConsoleCP(CP_UTF8);
|
||||
SetConsoleTitleW(L"LCEMP Server");
|
||||
ServerLog_Init();
|
||||
|
||||
ServerLog(L"Starting Minecraft LCE server version %s (protocol %d)\n", VER_FILEVERSION_STR_W, SharedConstants::NETWORK_PROTOCOL_VERSION);
|
||||
|
||||
SetConsoleCtrlHandler(ConsoleCtrlHandler, TRUE);
|
||||
|
||||
g_shutdownCompleteEvent = CreateEventW(NULL, TRUE, FALSE, NULL);
|
||||
|
||||
if (!g_dedicatedServer.init())
|
||||
{
|
||||
ServerLog(L"Failed to initialize. Exiting.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
C4JThread *inputThread = new C4JThread(DedicatedServer::consoleInputThread, &g_dedicatedServer, "ConsoleInput");
|
||||
inputThread->Run();
|
||||
|
||||
int result = g_dedicatedServer.run();
|
||||
|
||||
g_dedicatedServer.shutdown();
|
||||
if (g_shutdownCompleteEvent)
|
||||
{
|
||||
SetEvent(g_shutdownCompleteEvent);
|
||||
CloseHandle(g_shutdownCompleteEvent);
|
||||
}
|
||||
delete inputThread;
|
||||
|
||||
ServerLog(L"Goodbye.\n");
|
||||
ServerLog_Close();
|
||||
return result;
|
||||
}
|
||||
|
||||
#endif // __linux__
|
||||
73
Core/ServerLists.cpp
Normal file
73
Core/ServerLists.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
#include "stdafx.h"
|
||||
#include "ServerLists.h"
|
||||
#include "ServerProperties.h"
|
||||
#include "../Commands/ServerTextList.h"
|
||||
#include <cwctype>
|
||||
|
||||
static ServerTextList* s_bannedPlayers = NULL;
|
||||
static ServerTextList* s_bannedIPs = NULL;
|
||||
static ServerTextList* s_whitelist = NULL;
|
||||
static ServerTextList* s_ops = NULL;
|
||||
static bool s_whitelistEnabled = false;
|
||||
static ServerProperties* s_properties = NULL;
|
||||
|
||||
void ServerLists_Init(bool whitelistEnabled, ServerProperties* props)
|
||||
{
|
||||
static ServerTextList bannedPlayers(L"banned-players.txt");
|
||||
static ServerTextList bannedIPs(L"banned-ips.txt");
|
||||
static ServerTextList whitelist(L"white-list.txt");
|
||||
static ServerTextList ops(L"ops.txt");
|
||||
|
||||
s_bannedPlayers = &bannedPlayers;
|
||||
s_bannedIPs = &bannedIPs;
|
||||
s_whitelist = &whitelist;
|
||||
s_ops = &ops;
|
||||
s_whitelistEnabled = whitelistEnabled;
|
||||
s_properties = props;
|
||||
}
|
||||
|
||||
ServerTextList* ServerLists_GetBannedPlayers() { return s_bannedPlayers; }
|
||||
ServerTextList* ServerLists_GetBannedIPs() { return s_bannedIPs; }
|
||||
ServerTextList* ServerLists_GetWhitelist() { return s_whitelist; }
|
||||
ServerTextList* ServerLists_GetOps() { return s_ops; }
|
||||
|
||||
bool ServerLists_IsWhitelistEnabled() { return s_whitelistEnabled; }
|
||||
void ServerLists_SetWhitelistEnabled(bool enabled)
|
||||
{
|
||||
s_whitelistEnabled = enabled;
|
||||
if (s_properties)
|
||||
{
|
||||
s_properties->whiteList = enabled;
|
||||
s_properties->save(L"server.properties");
|
||||
}
|
||||
}
|
||||
|
||||
bool ServerLists_IsPlayerBanned(const std::wstring& name)
|
||||
{
|
||||
if (!s_bannedPlayers) return false;
|
||||
return s_bannedPlayers->contains(name);
|
||||
}
|
||||
|
||||
bool ServerLists_IsIPBanned(const std::wstring& ip)
|
||||
{
|
||||
if (!s_bannedIPs) return false;
|
||||
return s_bannedIPs->contains(ip);
|
||||
}
|
||||
|
||||
bool ServerLists_IsPlayerOp(const std::wstring& name)
|
||||
{
|
||||
if (!s_ops) return false;
|
||||
return s_ops->contains(name);
|
||||
}
|
||||
|
||||
bool ServerLists_IsPlayerWhitelisted(const std::wstring& name)
|
||||
{
|
||||
if (!s_whitelistEnabled) return true;
|
||||
if (ServerLists_IsPlayerOp(name)) return true;
|
||||
if (!s_whitelist) return true;
|
||||
|
||||
std::wstring lower = name;
|
||||
for (size_t i = 0; i < lower.size(); i++)
|
||||
lower[i] = towlower(lower[i]);
|
||||
return s_whitelist->contains(lower);
|
||||
}
|
||||
20
Core/ServerLists.h
Normal file
20
Core/ServerLists.h
Normal file
@@ -0,0 +1,20 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
|
||||
class ServerTextList;
|
||||
class ServerProperties;
|
||||
|
||||
void ServerLists_Init(bool whitelistEnabled, ServerProperties* props = 0);
|
||||
|
||||
ServerTextList* ServerLists_GetBannedPlayers();
|
||||
ServerTextList* ServerLists_GetBannedIPs();
|
||||
ServerTextList* ServerLists_GetWhitelist();
|
||||
ServerTextList* ServerLists_GetOps();
|
||||
|
||||
bool ServerLists_IsWhitelistEnabled();
|
||||
void ServerLists_SetWhitelistEnabled(bool enabled);
|
||||
|
||||
bool ServerLists_IsPlayerBanned(const std::wstring& name);
|
||||
bool ServerLists_IsPlayerWhitelisted(const std::wstring& name);
|
||||
bool ServerLists_IsPlayerOp(const std::wstring& name);
|
||||
bool ServerLists_IsIPBanned(const std::wstring& ip);
|
||||
312
Core/ServerLogger.cpp
Normal file
312
Core/ServerLogger.cpp
Normal file
@@ -0,0 +1,312 @@
|
||||
#include "stdafx.h"
|
||||
#include "ServerLogger.h"
|
||||
|
||||
#include <cstdio>
|
||||
#include <cstdarg>
|
||||
#include <ctime>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
|
||||
using std::string;
|
||||
using std::wstring;
|
||||
|
||||
#ifdef __linux__
|
||||
#include <pthread.h>
|
||||
static pthread_mutex_t g_logMutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
#else
|
||||
static CRITICAL_SECTION g_logCS;
|
||||
#endif
|
||||
|
||||
static FILE* g_logFile = NULL;
|
||||
static bool g_initialized = false;
|
||||
static wstring* g_inputBuffer = nullptr;
|
||||
|
||||
void ServerLog_Init()
|
||||
{
|
||||
if (g_initialized) return;
|
||||
|
||||
#ifndef __linux__
|
||||
InitializeCriticalSection(&g_logCS);
|
||||
#endif
|
||||
|
||||
#ifdef __linux__
|
||||
g_logFile = fopen("server.log", "a");
|
||||
#else
|
||||
g_logFile = _wfopen(L"server.log", L"a");
|
||||
#endif
|
||||
|
||||
if (!g_logFile)
|
||||
{
|
||||
fprintf(stderr, "WARNING: Failed to log to server.log\n");
|
||||
}
|
||||
|
||||
g_initialized = true;
|
||||
}
|
||||
|
||||
void ServerLog_Close()
|
||||
{
|
||||
if (!g_initialized) return;
|
||||
|
||||
if (g_logFile)
|
||||
{
|
||||
fclose(g_logFile);
|
||||
g_logFile = NULL;
|
||||
}
|
||||
|
||||
#ifndef __linux__
|
||||
DeleteCriticalSection(&g_logCS);
|
||||
#endif
|
||||
|
||||
g_initialized = false;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
static string processNarrowFormattingCodes(const char* input)
|
||||
{
|
||||
string result;
|
||||
bool hasColor = false;
|
||||
for (size_t i = 0; input[i]; i++)
|
||||
{
|
||||
if ((unsigned char)input[i] == 0xC2 && (unsigned char)input[i + 1] == 0xA7 && input[i + 2])
|
||||
{
|
||||
char code = tolower((unsigned char)input[i + 2]);
|
||||
i += 2;
|
||||
hasColor = true;
|
||||
switch (code)
|
||||
{
|
||||
case '0': result += "\x1b[30m"; break;
|
||||
case '1': result += "\x1b[34m"; break;
|
||||
case '2': result += "\x1b[32m"; break;
|
||||
case '3': result += "\x1b[36m"; break;
|
||||
case '4': result += "\x1b[31m"; break;
|
||||
case '5': result += "\x1b[35m"; break;
|
||||
case '6': result += "\x1b[33m"; break;
|
||||
case '7': result += "\x1b[37m"; break;
|
||||
case '8': result += "\x1b[90m"; break;
|
||||
case '9': result += "\x1b[94m"; break;
|
||||
case 'a': result += "\x1b[92m"; break;
|
||||
case 'b': result += "\x1b[96m"; break;
|
||||
case 'c': result += "\x1b[91m"; break;
|
||||
case 'd': result += "\x1b[95m"; break;
|
||||
case 'e': result += "\x1b[93m"; break;
|
||||
case 'f': result += "\x1b[97m"; break;
|
||||
case 'l': result += "\x1b[1m"; break;
|
||||
case 'm': result += "\x1b[9m"; break;
|
||||
case 'n': result += "\x1b[4m"; break;
|
||||
case 'o': result += "\x1b[3m"; break;
|
||||
case 'r': result += "\x1b[0m"; break;
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += input[i];
|
||||
}
|
||||
}
|
||||
if (hasColor) result += "\x1b[0m";
|
||||
return result;
|
||||
}
|
||||
|
||||
static string stripNarrowFormattingCodes(const char* input)
|
||||
{
|
||||
string result;
|
||||
for (size_t i = 0; input[i]; i++)
|
||||
{
|
||||
if ((unsigned char)input[i] == 0xC2 && (unsigned char)input[i + 1] == 0xA7 && input[i + 2])
|
||||
i += 2;
|
||||
else
|
||||
result += input[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
static void logImpl(const char* level, const wchar_t* fmt, va_list ap)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
struct tm t;
|
||||
localtime_r(&now, &t);
|
||||
|
||||
char narrowFmt[2048];
|
||||
_wfmtToNarrow(fmt, narrowFmt, sizeof(narrowFmt));
|
||||
|
||||
char narrowMsg[4096];
|
||||
vsnprintf(narrowMsg, sizeof(narrowMsg), narrowFmt, ap);
|
||||
|
||||
string consoleMsg = processNarrowFormattingCodes(narrowMsg);
|
||||
|
||||
pthread_mutex_lock(&g_logMutex);
|
||||
|
||||
if (g_inputBuffer && !g_inputBuffer->empty())
|
||||
printf("\r\033[K");
|
||||
|
||||
printf("%04d-%02d-%02d %02d:%02d:%02d [%s] %s",
|
||||
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, level, consoleMsg.c_str());
|
||||
fflush(stdout);
|
||||
|
||||
if (g_logFile)
|
||||
{
|
||||
string fileMsg = stripNarrowFormattingCodes(narrowMsg);
|
||||
fprintf(g_logFile, "%04d-%02d-%02d %02d:%02d:%02d [%s] %s",
|
||||
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, level, fileMsg.c_str());
|
||||
fflush(g_logFile);
|
||||
}
|
||||
|
||||
if (g_inputBuffer && !g_inputBuffer->empty())
|
||||
{
|
||||
printf("%ls", g_inputBuffer->c_str());
|
||||
fflush(stdout);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&g_logMutex);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
static wstring stripWideFormattingCodes(const wchar_t* input)
|
||||
{
|
||||
wstring result;
|
||||
for (size_t i = 0; input[i]; i++)
|
||||
{
|
||||
if (input[i] == L'\u00A7' && input[i + 1])
|
||||
i++;
|
||||
else
|
||||
result += input[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
struct ColorSpan {
|
||||
size_t start;
|
||||
size_t end;
|
||||
WORD attr;
|
||||
};
|
||||
|
||||
static void printColored(const wchar_t* text)
|
||||
{
|
||||
HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
CONSOLE_SCREEN_BUFFER_INFO csbi;
|
||||
GetConsoleScreenBufferInfo(hConsole, &csbi);
|
||||
WORD defaultAttr = csbi.wAttributes;
|
||||
WORD currentAttr = defaultAttr;
|
||||
|
||||
const wchar_t* p = text;
|
||||
while (*p)
|
||||
{
|
||||
if (*p == L'\u00A7' && *(p + 1))
|
||||
{
|
||||
wchar_t code = towlower(*(p + 1));
|
||||
p += 2;
|
||||
switch (code)
|
||||
{
|
||||
case L'0': currentAttr = 0; break;
|
||||
case L'1': currentAttr = FOREGROUND_BLUE; break;
|
||||
case L'2': currentAttr = FOREGROUND_GREEN; break;
|
||||
case L'3': currentAttr = FOREGROUND_GREEN | FOREGROUND_BLUE; break;
|
||||
case L'4': currentAttr = FOREGROUND_RED; break;
|
||||
case L'5': currentAttr = FOREGROUND_RED | FOREGROUND_BLUE; break;
|
||||
case L'6': currentAttr = FOREGROUND_RED | FOREGROUND_GREEN; break;
|
||||
case L'7': currentAttr = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; break;
|
||||
case L'8': currentAttr = FOREGROUND_INTENSITY; break;
|
||||
case L'9': currentAttr = FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
|
||||
case L'a': currentAttr = FOREGROUND_GREEN | FOREGROUND_INTENSITY; break;
|
||||
case L'b': currentAttr = FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
|
||||
case L'c': currentAttr = FOREGROUND_RED | FOREGROUND_INTENSITY; break;
|
||||
case L'd': currentAttr = FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
|
||||
case L'e': currentAttr = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY; break;
|
||||
case L'f': currentAttr = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | FOREGROUND_INTENSITY; break;
|
||||
case L'l': currentAttr |= FOREGROUND_INTENSITY; break;
|
||||
case L'r': currentAttr = defaultAttr; break;
|
||||
default: break;
|
||||
}
|
||||
SetConsoleTextAttribute(hConsole, currentAttr);
|
||||
}
|
||||
else
|
||||
{
|
||||
wchar_t ch[2] = { *p, 0 };
|
||||
wprintf(L"%ls", ch);
|
||||
p++;
|
||||
}
|
||||
}
|
||||
SetConsoleTextAttribute(hConsole, defaultAttr);
|
||||
}
|
||||
|
||||
static void logImpl(const char* level, const wchar_t* fmt, va_list ap)
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
struct tm t;
|
||||
localtime_s(&t, &now);
|
||||
|
||||
wchar_t wbuf[4096];
|
||||
vswprintf_s(wbuf, 4096, fmt, ap);
|
||||
|
||||
wstring stripped = stripWideFormattingCodes(wbuf);
|
||||
|
||||
EnterCriticalSection(&g_logCS);
|
||||
|
||||
if (g_inputBuffer && !g_inputBuffer->empty())
|
||||
{
|
||||
wstring spaces(g_inputBuffer->size(), L' ');
|
||||
wprintf(L"\r%ls\r", spaces.c_str());
|
||||
}
|
||||
|
||||
wprintf(L"%04d-%02d-%02d %02d:%02d:%02d [%S] ",
|
||||
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, level);
|
||||
printColored(wbuf);
|
||||
|
||||
if (g_logFile)
|
||||
{
|
||||
char narrowMsg[4096];
|
||||
size_t converted;
|
||||
wcstombs_s(&converted, narrowMsg, sizeof(narrowMsg), stripped.c_str(), _TRUNCATE);
|
||||
|
||||
fprintf(g_logFile, "%04d-%02d-%02d %02d:%02d:%02d [%s] %s",
|
||||
t.tm_year + 1900, t.tm_mon + 1, t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, level, narrowMsg);
|
||||
fflush(g_logFile);
|
||||
}
|
||||
|
||||
if (g_inputBuffer && !g_inputBuffer->empty())
|
||||
wprintf(L"%ls", g_inputBuffer->c_str());
|
||||
|
||||
LeaveCriticalSection(&g_logCS);
|
||||
}
|
||||
|
||||
#endif // __linux__
|
||||
|
||||
void ServerLog(const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
logImpl("INFO", fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void ServerWarn(const wchar_t* fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
logImpl("WARNING", fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
|
||||
void ServerLog_RegisterInput(wstring* buffer)
|
||||
{
|
||||
g_inputBuffer = buffer;
|
||||
}
|
||||
|
||||
void ServerLog_UnregisterInput()
|
||||
{
|
||||
g_inputBuffer = nullptr;
|
||||
}
|
||||
|
||||
#ifdef __linux__
|
||||
void ServerLog_LockOutput() { pthread_mutex_lock(&g_logMutex); }
|
||||
void ServerLog_UnlockOutput() { pthread_mutex_unlock(&g_logMutex); }
|
||||
#else
|
||||
void ServerLog_LockOutput() { EnterCriticalSection(&g_logCS); }
|
||||
void ServerLog_UnlockOutput() { LeaveCriticalSection(&g_logCS); }
|
||||
#endif
|
||||
12
Core/ServerLogger.h
Normal file
12
Core/ServerLogger.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
void ServerLog_Init();
|
||||
void ServerLog_Close();
|
||||
void ServerLog(const wchar_t* fmt, ...);
|
||||
void ServerWarn(const wchar_t* fmt, ...);
|
||||
void ServerLog_RegisterInput(std::wstring* buffer);
|
||||
void ServerLog_UnregisterInput();
|
||||
void ServerLog_LockOutput();
|
||||
void ServerLog_UnlockOutput();
|
||||
184
Core/ServerProperties.cpp
Normal file
184
Core/ServerProperties.cpp
Normal file
@@ -0,0 +1,184 @@
|
||||
#include "stdafx.h"
|
||||
#include "ServerProperties.h"
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <ctime>
|
||||
|
||||
ServerProperties::ServerProperties()
|
||||
{
|
||||
loadDefaults();
|
||||
}
|
||||
|
||||
void ServerProperties::loadDefaults()
|
||||
{
|
||||
serverPort = 25565;
|
||||
levelName = L"world";
|
||||
levelSeed = 0;
|
||||
gamemode = 0;
|
||||
difficulty = 2;
|
||||
maxPlayers = 8;
|
||||
pvp = true;
|
||||
trustPlayers = true;
|
||||
fireSpreads = true;
|
||||
tntExplodes = true;
|
||||
structures = true;
|
||||
spawnAnimals = true;
|
||||
spawnNpcs = true;
|
||||
onlineMode = false;
|
||||
showGamertags = true;
|
||||
motd = L"A Minecraft LCE Server";
|
||||
whiteList = false;
|
||||
voiceChat = false;
|
||||
levelSize = L"large";
|
||||
advertiseLan = true;
|
||||
serverIp = L"";
|
||||
}
|
||||
|
||||
static wstring trimWs(const wstring& s)
|
||||
{
|
||||
size_t start = s.find_first_not_of(L" \t\r\n");
|
||||
if (start == wstring::npos) return L"";
|
||||
size_t end = s.find_last_not_of(L" \t\r\n");
|
||||
return s.substr(start, end - start + 1);
|
||||
}
|
||||
|
||||
bool ServerProperties::load(const wstring& path)
|
||||
{
|
||||
FILE *f = NULL;
|
||||
_wfopen_s(&f, path.c_str(), L"r, ccs=UTF-8");
|
||||
if (!f)
|
||||
return false;
|
||||
|
||||
wchar_t line[1024];
|
||||
while (fgetws(line, 1024, f))
|
||||
{
|
||||
wstring ws(line);
|
||||
size_t nl = ws.find_last_not_of(L"\r\n");
|
||||
if (nl != wstring::npos)
|
||||
ws = ws.substr(0, nl + 1);
|
||||
else
|
||||
ws.clear();
|
||||
|
||||
if (ws.empty()) continue;
|
||||
if (ws[0] == L'#') continue;
|
||||
|
||||
size_t eq = ws.find(L'=');
|
||||
if (eq == wstring::npos) continue;
|
||||
|
||||
wstring key = trimWs(ws.substr(0, eq));
|
||||
wstring val = trimWs(ws.substr(eq + 1));
|
||||
m_properties[key] = val;
|
||||
}
|
||||
fclose(f);
|
||||
|
||||
serverPort = getInt(L"server-port", 25565);
|
||||
if (serverPort <= 0 || serverPort > 65535) serverPort = 25565;
|
||||
levelName = getString(L"level-name", L"world");
|
||||
levelSeed = getInt64(L"level-seed", 0);
|
||||
gamemode = getInt(L"gamemode", 0);
|
||||
difficulty = getInt(L"difficulty", 2);
|
||||
maxPlayers = getInt(L"max-players", 8);
|
||||
if (maxPlayers < 1) maxPlayers = 1;
|
||||
if (maxPlayers > 8) maxPlayers = 8;
|
||||
pvp = getBool(L"pvp", true);
|
||||
trustPlayers = getBool(L"trust-players", true);
|
||||
fireSpreads = getBool(L"fire-spreads", true);
|
||||
tntExplodes = getBool(L"tnt-explodes", true);
|
||||
structures = getBool(L"structures", true);
|
||||
spawnAnimals = getBool(L"spawn-animals", true);
|
||||
spawnNpcs = getBool(L"spawn-npcs", true);
|
||||
onlineMode = getBool(L"online-mode", false);
|
||||
showGamertags = getBool(L"show-gamertags", true);
|
||||
motd = getString(L"motd", L"A Minecraft LCE Server");
|
||||
whiteList = getBool(L"white-list", false);
|
||||
voiceChat = getBool(L"voice-chat", false);
|
||||
levelSize = getString(L"level-size", L"large");
|
||||
advertiseLan = getBool(L"advertise-lan", true);
|
||||
serverIp = getString(L"server-ip", L"");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ServerProperties::save(const wstring& path)
|
||||
{
|
||||
FILE *f = NULL;
|
||||
_wfopen_s(&f, path.c_str(), L"w, ccs=UTF-8");
|
||||
if (!f) return;
|
||||
|
||||
fwprintf(f, L"#Minecraft server properties\n");
|
||||
{
|
||||
time_t now = time(NULL);
|
||||
struct tm t;
|
||||
localtime_s(&t, &now);
|
||||
static const wchar_t* dayNames[] = { L"Sun", L"Mon", L"Tue", L"Wed", L"Thu", L"Fri", L"Sat" };
|
||||
static const wchar_t* monNames[] = { L"Jan", L"Feb", L"Mar", L"Apr", L"May", L"Jun", L"Jul", L"Aug", L"Sep", L"Oct", L"Nov", L"Dec" };
|
||||
fwprintf(f, L"#%ls %ls %02d %02d:%02d:%02d %04d\n",
|
||||
dayNames[t.tm_wday], monNames[t.tm_mon], t.tm_mday,
|
||||
t.tm_hour, t.tm_min, t.tm_sec, t.tm_year + 1900);
|
||||
}
|
||||
fwprintf(f, L"server-port=%d\n", serverPort);
|
||||
fwprintf(f, L"level-name=%ls\n", levelName.c_str());
|
||||
if (levelSeed != 0)
|
||||
fwprintf(f, L"level-seed=%lld\n", levelSeed);
|
||||
else
|
||||
fwprintf(f, L"level-seed=\n");
|
||||
fwprintf(f, L"gamemode=%d\n", gamemode);
|
||||
fwprintf(f, L"difficulty=%d\n", difficulty);
|
||||
fwprintf(f, L"max-players=%d\n", maxPlayers);
|
||||
fwprintf(f, L"pvp=%ls\n", pvp ? L"true" : L"false");
|
||||
fwprintf(f, L"trust-players=%ls\n", trustPlayers ? L"true" : L"false");
|
||||
fwprintf(f, L"fire-spreads=%ls\n", fireSpreads ? L"true" : L"false");
|
||||
fwprintf(f, L"tnt-explodes=%ls\n", tntExplodes ? L"true" : L"false");
|
||||
fwprintf(f, L"structures=%ls\n", structures ? L"true" : L"false");
|
||||
fwprintf(f, L"spawn-animals=%ls\n", spawnAnimals ? L"true" : L"false");
|
||||
fwprintf(f, L"spawn-npcs=%ls\n", spawnNpcs ? L"true" : L"false");
|
||||
fwprintf(f, L"online-mode=%ls\n", onlineMode ? L"true" : L"false");
|
||||
fwprintf(f, L"show-gamertags=%ls\n", showGamertags ? L"true" : L"false");
|
||||
fwprintf(f, L"motd=%ls\n", motd.c_str());
|
||||
fwprintf(f, L"white-list=%ls\n", whiteList ? L"true" : L"false");
|
||||
fwprintf(f, L"voice-chat=%ls\n", voiceChat ? L"true" : L"false");
|
||||
fwprintf(f, L"level-size=%ls\n", levelSize.c_str());
|
||||
fwprintf(f, L"advertise-lan=%ls\n", advertiseLan ? L"true" : L"false");
|
||||
if (!serverIp.empty())
|
||||
fwprintf(f, L"server-ip=%ls\n", serverIp.c_str());
|
||||
else
|
||||
fwprintf(f, L"server-ip=\n");
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
wstring ServerProperties::getString(const wstring& key, const wstring& defaultVal)
|
||||
{
|
||||
map<wstring, wstring>::iterator it = m_properties.find(key);
|
||||
if (it != m_properties.end())
|
||||
return it->second;
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
int ServerProperties::getInt(const wstring& key, int defaultVal)
|
||||
{
|
||||
map<wstring, wstring>::iterator it = m_properties.find(key);
|
||||
if (it != m_properties.end() && !it->second.empty())
|
||||
return _wtoi(it->second.c_str());
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
__int64 ServerProperties::getInt64(const wstring& key, __int64 defaultVal)
|
||||
{
|
||||
map<wstring, wstring>::iterator it = m_properties.find(key);
|
||||
if (it != m_properties.end() && !it->second.empty())
|
||||
return _wtoi64(it->second.c_str());
|
||||
return defaultVal;
|
||||
}
|
||||
|
||||
bool ServerProperties::getBool(const wstring& key, bool defaultVal)
|
||||
{
|
||||
map<wstring, wstring>::iterator it = m_properties.find(key);
|
||||
if (it != m_properties.end())
|
||||
{
|
||||
wstring val = it->second;
|
||||
if (val == L"true" || val == L"1") return true;
|
||||
if (val == L"false" || val == L"0") return false;
|
||||
}
|
||||
return defaultVal;
|
||||
}
|
||||
46
Core/ServerProperties.h
Normal file
46
Core/ServerProperties.h
Normal file
@@ -0,0 +1,46 @@
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
using namespace std;
|
||||
|
||||
class ServerProperties
|
||||
{
|
||||
public:
|
||||
ServerProperties();
|
||||
|
||||
bool load(const wstring& path);
|
||||
void save(const wstring& path);
|
||||
|
||||
wstring getString(const wstring& key, const wstring& defaultVal);
|
||||
int getInt(const wstring& key, int defaultVal);
|
||||
__int64 getInt64(const wstring& key, __int64 defaultVal);
|
||||
bool getBool(const wstring& key, bool defaultVal);
|
||||
|
||||
int serverPort;
|
||||
wstring levelName;
|
||||
__int64 levelSeed;
|
||||
int gamemode;
|
||||
int difficulty;
|
||||
int maxPlayers;
|
||||
bool pvp;
|
||||
bool trustPlayers;
|
||||
bool fireSpreads;
|
||||
bool tntExplodes;
|
||||
bool structures;
|
||||
bool spawnAnimals;
|
||||
bool spawnNpcs;
|
||||
bool onlineMode;
|
||||
bool showGamertags;
|
||||
wstring motd;
|
||||
bool whiteList;
|
||||
bool voiceChat;
|
||||
wstring levelSize;
|
||||
bool advertiseLan;
|
||||
wstring serverIp;
|
||||
|
||||
private:
|
||||
map<wstring, wstring> m_properties;
|
||||
void loadDefaults();
|
||||
};
|
||||
23
LICENSE.md
Normal file
23
LICENSE.md
Normal file
@@ -0,0 +1,23 @@
|
||||
Fork-Only Source License
|
||||
Copyright © 2026 LCEMP
|
||||
|
||||
You have permission to:
|
||||
|
||||
- fork this repository
|
||||
- make changes in your own fork
|
||||
- build new projects that are clearly derived from this one
|
||||
|
||||
You may share / distribute your fork, but you must:
|
||||
|
||||
- keep this copyright notice and license text
|
||||
- clearly show that your work came from this repository (include a link to the original repo and mention it visibly, e.g. in README, about box, credits, etc.)
|
||||
|
||||
What you may NOT do:
|
||||
|
||||
- copy & paste parts of this code (files, classes, functions, big chunks, small clever snippets, etc.) into a different project that is not a fork/derivative of this repository
|
||||
- use this code as a starting point for something that isn’t presented as being based on this project
|
||||
- incorporate this code into any closed-source, proprietary, or unrelated open-source project
|
||||
|
||||
if you're not keeping the fork relationship alive and giving clear credit back to this repo, you need to ask me for permission first.
|
||||
|
||||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
1309
Linux/LinuxCompat.h
Normal file
1309
Linux/LinuxCompat.h
Normal file
File diff suppressed because it is too large
Load Diff
1076
Linux/PosixNetLayer.cpp
Normal file
1076
Linux/PosixNetLayer.cpp
Normal file
File diff suppressed because it is too large
Load Diff
188
Linux/PosixNetLayer.h
Normal file
188
Linux/PosixNetLayer.h
Normal file
@@ -0,0 +1,188 @@
|
||||
#pragma once
|
||||
|
||||
|
||||
#ifdef __linux__
|
||||
|
||||
#include <sys/socket.h>
|
||||
#include <sys/types.h>
|
||||
#include <netinet/in.h>
|
||||
#include <netinet/tcp.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netdb.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <vector>
|
||||
#include <pthread.h>
|
||||
#include <cstring>
|
||||
|
||||
#include "../../Minecraft.Client/Common/Network/NetworkPlayerInterface.h"
|
||||
|
||||
typedef int SOCKET;
|
||||
#define INVALID_SOCKET (-1)
|
||||
#define SOCKET_ERROR (-1)
|
||||
|
||||
inline int closesocket(SOCKET s) { return close(s); }
|
||||
|
||||
#define WIN64_NET_DEFAULT_PORT 25565
|
||||
#define WIN64_NET_MAX_CLIENTS 7
|
||||
#define WIN64_NET_RECV_BUFFER_SIZE 65536
|
||||
#define WIN64_NET_MAX_PACKET_SIZE (3 * 1024 * 1024)
|
||||
#define WIN64_LAN_DISCOVERY_PORT 25566
|
||||
#define WIN64_LAN_BROADCAST_MAGIC 0x4D434C4E
|
||||
#define WIN64_LAN_BROADCAST_PLAYERS 8
|
||||
|
||||
class Socket;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct Win64LANBroadcast
|
||||
{
|
||||
DWORD magic;
|
||||
uint16_t netVersion;
|
||||
uint16_t gamePort;
|
||||
uint16_t hostName[32];
|
||||
uint8_t playerCount;
|
||||
uint8_t maxPlayers;
|
||||
DWORD gameHostSettings;
|
||||
DWORD texturePackParentId;
|
||||
uint8_t subTexturePackId;
|
||||
uint8_t isJoinable;
|
||||
uint8_t isDedicatedServer;
|
||||
char playerNames[WIN64_LAN_BROADCAST_PLAYERS][32]; // XUSER_NAME_SIZE
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct Win64LANSession
|
||||
{
|
||||
char hostIP[64];
|
||||
int hostPort;
|
||||
wchar_t hostName[32];
|
||||
unsigned short netVersion;
|
||||
unsigned char playerCount;
|
||||
unsigned char maxPlayers;
|
||||
unsigned int gameHostSettings;
|
||||
unsigned int texturePackParentId;
|
||||
unsigned char subTexturePackId;
|
||||
bool isJoinable;
|
||||
bool isDedicatedServer;
|
||||
DWORD lastSeenTick;
|
||||
char playerNames[WIN64_LAN_BROADCAST_PLAYERS][32];
|
||||
};
|
||||
|
||||
struct Win64RemoteConnection
|
||||
{
|
||||
SOCKET tcpSocket;
|
||||
uint8_t smallId;
|
||||
pthread_t recvThread;
|
||||
bool recvThreadActive;
|
||||
volatile bool active;
|
||||
pthread_mutex_t sendLock;
|
||||
};
|
||||
|
||||
class WinsockNetLayer
|
||||
{
|
||||
public:
|
||||
static bool Initialize();
|
||||
static void Shutdown();
|
||||
|
||||
static bool HostGame(int port);
|
||||
static bool JoinGame(const char *ip, int port);
|
||||
|
||||
static bool SendToSmallId(uint8_t targetSmallId, const void *data, int dataSize);
|
||||
static bool SendOnSocket(SOCKET sock, const void *data, int dataSize);
|
||||
|
||||
static bool IsHosting() { return s_isHost; }
|
||||
static bool IsConnected() { return s_connected; }
|
||||
static bool IsActive() { return s_active; }
|
||||
|
||||
static uint8_t GetLocalSmallId() { return s_localSmallId; }
|
||||
static uint8_t GetHostSmallId() { return s_hostSmallId; }
|
||||
|
||||
static SOCKET GetSocketForSmallId(uint8_t smallId);
|
||||
static std::string GetIPForSmallId(uint8_t smallId);
|
||||
|
||||
static void HandleDataReceived(uint8_t fromSmallId, uint8_t toSmallId, unsigned char *data, unsigned int dataSize);
|
||||
static void FlushPendingData();
|
||||
|
||||
static bool PopDisconnectedSmallId(uint8_t *outSmallId);
|
||||
static void PushFreeSmallId(uint8_t smallId);
|
||||
static void CloseConnectionBySmallId(uint8_t smallId);
|
||||
|
||||
static bool PopPendingJoinSmallId(uint8_t *outSmallId);
|
||||
|
||||
static bool IsSmallIdConnected(uint8_t smallId);
|
||||
|
||||
static bool StartAdvertising(int gamePort, const wchar_t *hostName, unsigned int gameSettings, unsigned int texPackId, unsigned char subTexId, unsigned short netVer);
|
||||
static void StopAdvertising();
|
||||
static void UpdateAdvertisePlayerCount(uint8_t count);
|
||||
static void UpdateAdvertiseJoinable(bool joinable);
|
||||
static void UpdateAdvertisePlayerNames(uint8_t count, const char playerNames[][32]);
|
||||
|
||||
static bool StartDiscovery();
|
||||
static void StopDiscovery();
|
||||
static std::vector<Win64LANSession> GetDiscoveredSessions();
|
||||
|
||||
static int GetHostPort() { return s_hostGamePort; }
|
||||
|
||||
private:
|
||||
static void* AcceptThreadProc(void* param);
|
||||
static void* RecvThreadProc(void* param);
|
||||
static void* ClientRecvThreadProc(void* param);
|
||||
static void* AdvertiseThreadProc(void* param);
|
||||
static void* DiscoveryThreadProc(void* param);
|
||||
|
||||
static SOCKET s_listenSocket;
|
||||
static SOCKET s_hostConnectionSocket;
|
||||
static pthread_t s_acceptThread;
|
||||
static bool s_acceptThreadActive;
|
||||
static pthread_t s_clientRecvThread;
|
||||
static bool s_clientRecvThreadActive;
|
||||
|
||||
static bool s_isHost;
|
||||
static bool s_connected;
|
||||
static bool s_active;
|
||||
static bool s_initialized;
|
||||
|
||||
static uint8_t s_localSmallId;
|
||||
static uint8_t s_hostSmallId;
|
||||
static uint8_t s_nextSmallId;
|
||||
|
||||
static pthread_mutex_t s_sendLock;
|
||||
static pthread_mutex_t s_connectionsLock;
|
||||
|
||||
static Win64RemoteConnection s_connections[WIN64_NET_MAX_CLIENTS + 1];
|
||||
|
||||
static SOCKET s_advertiseSock;
|
||||
static pthread_t s_advertiseThread;
|
||||
static bool s_advertiseThreadActive;
|
||||
static volatile bool s_advertising;
|
||||
static Win64LANBroadcast s_advertiseData;
|
||||
static pthread_mutex_t s_advertiseLock;
|
||||
static int s_hostGamePort;
|
||||
|
||||
static SOCKET s_discoverySock;
|
||||
static pthread_t s_discoveryThread;
|
||||
static bool s_discoveryThreadActive;
|
||||
static volatile bool s_discovering;
|
||||
static pthread_mutex_t s_discoveryLock;
|
||||
static std::vector<Win64LANSession> s_discoveredSessions;
|
||||
|
||||
static pthread_mutex_t s_disconnectLock;
|
||||
static std::vector<uint8_t> s_disconnectedSmallIds;
|
||||
|
||||
static pthread_mutex_t s_pendingJoinLock;
|
||||
static std::vector<uint8_t> s_pendingJoinSmallIds;
|
||||
|
||||
static pthread_mutex_t s_freeSmallIdLock;
|
||||
static std::vector<uint8_t> s_freeSmallIds;
|
||||
|
||||
static pthread_mutex_t s_earlyDataLock;
|
||||
static std::vector<uint8_t> s_earlyDataBuffers[WIN64_NET_MAX_CLIENTS + 1];
|
||||
};
|
||||
|
||||
extern bool g_Win64MultiplayerHost;
|
||||
extern bool g_Win64MultiplayerJoin;
|
||||
extern int g_Win64MultiplayerPort;
|
||||
extern char g_Win64MultiplayerIP[256];
|
||||
|
||||
#endif // __linux__
|
||||
7
Linux/WinsockNetLayer.h
Normal file
7
Linux/WinsockNetLayer.h
Normal file
@@ -0,0 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#ifdef __linux__
|
||||
#include "../../Minecraft.Server/Linux/PosixNetLayer.h"
|
||||
#else
|
||||
#error "This redirect header should only be used on Linux builds"
|
||||
#endif
|
||||
8
Linux/build.bat
Normal file
8
Linux/build.bat
Normal file
@@ -0,0 +1,8 @@
|
||||
@echo off
|
||||
set "ACTION=%~1"
|
||||
if "%ACTION%"=="" set "ACTION=Release"
|
||||
set "SCRIPT_DIR=%~dp0"
|
||||
set "SCRIPT_DIR=%SCRIPT_DIR:~0,-1%"
|
||||
for /f "usebackq delims=" %%P in (`wsl wslpath "%SCRIPT_DIR%"`) do set "WSL_DIR=%%P"
|
||||
wsl bash "%WSL_DIR%/build.sh" "%ACTION%"
|
||||
exit /b %ERRORLEVEL%
|
||||
41
Linux/build.sh
Normal file
41
Linux/build.sh
Normal file
@@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
ROOT_DIR="$(cd "$SCRIPT_DIR/../.." && pwd)"
|
||||
SRC="$HOME/lcemp-src"
|
||||
BUILD="$HOME/lcemp-build"
|
||||
ACTION="${1:-Release}"
|
||||
|
||||
case "$ACTION" in
|
||||
Clean)
|
||||
rm -rf "$BUILD" "$SRC"
|
||||
echo "Cleaned."
|
||||
exit 0
|
||||
;;
|
||||
Sync)
|
||||
rm -rf "$SRC"
|
||||
;&
|
||||
esac
|
||||
|
||||
if [ ! -d "$SRC/Minecraft.World" ]; then
|
||||
echo "copying source files to $SRC..."
|
||||
mkdir -p "$SRC"
|
||||
cp -a "$ROOT_DIR/." "$SRC/"
|
||||
rm -rf "$SRC/build_linux" "$SRC/build_dedicated" "$SRC/x64" "$SRC/x64_Server_Release" "$SRC/ipch" "$SRC/.vs"
|
||||
else
|
||||
rsync -a "$ROOT_DIR/CMakeLists.txt" "$SRC/"
|
||||
rsync -a "$ROOT_DIR/cmake/" "$SRC/cmake/"
|
||||
rsync -a "$ROOT_DIR/Minecraft.Server/" "$SRC/Minecraft.Server/" --exclude='*.obj' --exclude='*.pdb' --exclude='*.sdf' --exclude='*.tlog'
|
||||
rsync -a "$ROOT_DIR/Minecraft.World/" "$SRC/Minecraft.World/" --exclude='*.obj' --exclude='*.pdb'
|
||||
rsync -a "$ROOT_DIR/Minecraft.Client/" "$SRC/Minecraft.Client/" --exclude='*.obj' --exclude='*.pdb'
|
||||
fi
|
||||
|
||||
mkdir -p "$BUILD"
|
||||
cd "$BUILD"
|
||||
cmake "$SRC/Minecraft.Server" -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . --target MinecraftDedicatedServer -- -j$(nproc)
|
||||
strip MinecraftDedicatedServer
|
||||
|
||||
echo ""
|
||||
ls -lh MinecraftDedicatedServer
|
||||
3
Linux/stubs/DirectXMath.h
Normal file
3
Linux/stubs/DirectXMath.h
Normal file
@@ -0,0 +1,3 @@
|
||||
#pragma once
|
||||
namespace DirectX {
|
||||
}
|
||||
1
Linux/stubs/WS2tcpip.h
Normal file
1
Linux/stubs/WS2tcpip.h
Normal file
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
1
Linux/stubs/WinSock2.h
Normal file
1
Linux/stubs/WinSock2.h
Normal file
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
37
Linux/stubs/d3d11.h
Normal file
37
Linux/stubs/d3d11.h
Normal file
@@ -0,0 +1,37 @@
|
||||
#pragma once
|
||||
|
||||
struct ID3D11Device;
|
||||
struct ID3D11DeviceContext;
|
||||
struct ID3D11RenderTargetView;
|
||||
struct ID3D11DepthStencilView;
|
||||
struct ID3D11ShaderResourceView;
|
||||
struct ID3D11Buffer;
|
||||
struct ID3D11Texture2D;
|
||||
struct IDXGISwapChain;
|
||||
|
||||
typedef struct D3D11_RECT {
|
||||
long left;
|
||||
long top;
|
||||
long right;
|
||||
long bottom;
|
||||
} D3D11_RECT;
|
||||
|
||||
enum {
|
||||
D3D11_BLEND_ZERO = 1,
|
||||
D3D11_BLEND_ONE = 2,
|
||||
D3D11_BLEND_SRC_ALPHA = 3,
|
||||
D3D11_BLEND_INV_SRC_ALPHA = 4,
|
||||
D3D11_BLEND_DEST_ALPHA = 5,
|
||||
D3D11_BLEND_SRC_COLOR = 6,
|
||||
D3D11_BLEND_DEST_COLOR = 7,
|
||||
D3D11_BLEND_INV_DEST_COLOR = 8,
|
||||
D3D11_BLEND_INV_SRC_COLOR = 9,
|
||||
D3D11_BLEND_BLEND_FACTOR = 10,
|
||||
D3D11_BLEND_INV_BLEND_FACTOR = 11,
|
||||
|
||||
D3D11_COMPARISON_LESS_EQUAL = 20,
|
||||
D3D11_COMPARISON_EQUAL = 21,
|
||||
D3D11_COMPARISON_GREATER = 22,
|
||||
D3D11_COMPARISON_GREATER_EQUAL = 23,
|
||||
D3D11_COMPARISON_ALWAYS = 24
|
||||
};
|
||||
2
Linux/stubs/malloc.h
Normal file
2
Linux/stubs/malloc.h
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
#include <cstdlib>
|
||||
28
Linux/stubs/sal.h
Normal file
28
Linux/stubs/sal.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#pragma once
|
||||
#ifndef _In_
|
||||
#define _In_
|
||||
#endif
|
||||
#ifndef _Out_
|
||||
#define _Out_
|
||||
#endif
|
||||
#ifndef _Inout_
|
||||
#define _Inout_
|
||||
#endif
|
||||
#ifndef _In_opt_
|
||||
#define _In_opt_
|
||||
#endif
|
||||
#ifndef _Out_opt_
|
||||
#define _Out_opt_
|
||||
#endif
|
||||
#ifndef _Inout_opt_
|
||||
#define _Inout_opt_
|
||||
#endif
|
||||
#ifndef _In_z_
|
||||
#define _In_z_
|
||||
#endif
|
||||
#ifndef _Printf_format_string_
|
||||
#define _Printf_format_string_
|
||||
#endif
|
||||
#ifndef _Analysis_assume_
|
||||
#define _Analysis_assume_(x)
|
||||
#endif
|
||||
19
Linux/stubs/tchar.h
Normal file
19
Linux/stubs/tchar.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <cwchar>
|
||||
|
||||
#ifndef _T
|
||||
#define _T(x) L##x
|
||||
#endif
|
||||
#ifndef _TCHAR_DEFINED
|
||||
typedef wchar_t TCHAR;
|
||||
#define _TCHAR_DEFINED
|
||||
#endif
|
||||
#ifndef _tcslen
|
||||
#define _tcslen wcslen
|
||||
#endif
|
||||
#ifndef _tcscpy
|
||||
#define _tcscpy wcscpy
|
||||
#endif
|
||||
#ifndef _tcsncpy
|
||||
#define _tcsncpy wcsncpy
|
||||
#endif
|
||||
1
Linux/stubs/windows.h
Normal file
1
Linux/stubs/windows.h
Normal file
@@ -0,0 +1 @@
|
||||
#pragma once
|
||||
2
Linux/stubs/xhash
Normal file
2
Linux/stubs/xhash
Normal file
@@ -0,0 +1,2 @@
|
||||
#pragma once
|
||||
#include <functional>
|
||||
8
Linux/stubs/xsocialpost.h
Normal file
8
Linux/stubs/xsocialpost.h
Normal file
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#define XSOCIAL_CAPABILITY_POSTIMAGE 0x01
|
||||
#define XSOCIAL_CAPABILITY_POSTLINK 0x02
|
||||
|
||||
typedef struct _XSOCIAL_POST {
|
||||
unsigned int dwFlags;
|
||||
} XSOCIAL_POST;
|
||||
567
Minecraft.Server.vcxproj
Normal file
567
Minecraft.Server.vcxproj
Normal file
@@ -0,0 +1,567 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Debug-Linux|x64">
|
||||
<Configuration>Debug-Linux</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release-Linux|x64">
|
||||
<Configuration>Release-Linux</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<DefaultLanguage>en-US</DefaultLanguage>
|
||||
<ProjectGuid>{12A22166-696D-402E-A1B8-806F46567BF2}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>MinecraftServer</RootNamespace>
|
||||
<ProjectName>Minecraft.Server</ProjectName>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'" Label="Configuration">
|
||||
<ConfigurationType>Makefile</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Label="ExtensionSettings">
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'" Label="PropertySheets">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)x64_Server_Debug\</OutDir>
|
||||
<IntDir>x64_Server_Debug\</IntDir>
|
||||
<IncludePath>$(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)x64_Server_Release\</OutDir>
|
||||
<IntDir>x64_Server_Release\</IntDir>
|
||||
<IncludePath>$(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\Xbox\Sentient\Include;$(IncludePath)</IncludePath>
|
||||
</PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'">
|
||||
<OutDir>$(SolutionDir)Linux_Server_Debug\</OutDir>
|
||||
<IntDir>Linux_Server_Debug\</IntDir>
|
||||
<NMakeBuildCommandLine>"$(ProjectDir)Linux\build.bat" Debug</NMakeBuildCommandLine>
|
||||
<NMakeCleanCommandLine>"$(ProjectDir)Linux\build.bat" Clean</NMakeCleanCommandLine>
|
||||
<NMakeReBuildCommandLine>"$(ProjectDir)Linux\build.bat" Rebuild-Debug</NMakeReBuildCommandLine>
|
||||
<NMakeOutput>$(SolutionDir)build_linux\MinecraftDedicatedServer</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>__linux__;_DEDICATED_SERVER;_CONTENT_PACKAGE;_LARGE_WORLDS;_WINDOWS64;WITH_SERVER_CODE;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath>$(ProjectDir)Linux;$(ProjectDir)Linux\stubs;$(ProjectDir);$(ProjectDir)\..\Minecraft.Client;$(ProjectDir)\..\Minecraft.World;$(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\Windows64\Iggy\include;$(ProjectDir)\..\Minecraft.Client\Xbox\Sentient\Include</NMakeIncludeSearchPath>
|
||||
<AdditionalOptions>-std=c++11</AdditionalOptions>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'">
|
||||
<OutDir>$(SolutionDir)Linux_Server_Release\</OutDir>
|
||||
<IntDir>Linux_Server_Release\</IntDir>
|
||||
<NMakeBuildCommandLine>"$(ProjectDir)Linux\build.bat" Release</NMakeBuildCommandLine>
|
||||
<NMakeCleanCommandLine>"$(ProjectDir)Linux\build.bat" Clean</NMakeCleanCommandLine>
|
||||
<NMakeReBuildCommandLine>"$(ProjectDir)Linux\build.bat" Rebuild-Release</NMakeReBuildCommandLine>
|
||||
<NMakeOutput>$(SolutionDir)build_linux\MinecraftDedicatedServer</NMakeOutput>
|
||||
<NMakePreprocessorDefinitions>__linux__;_DEDICATED_SERVER;_CONTENT_PACKAGE;_LARGE_WORLDS;_WINDOWS64;WITH_SERVER_CODE;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath>$(ProjectDir)Linux;$(ProjectDir)Linux\stubs;$(ProjectDir);$(ProjectDir)\..\Minecraft.Client;$(ProjectDir)\..\Minecraft.World;$(ProjectDir)\..\Minecraft.World\x64headers;$(ProjectDir)\..\Minecraft.Client\Windows64\Iggy\include;$(ProjectDir)\..\Minecraft.Client\Xbox\Sentient\Include</NMakeIncludeSearchPath>
|
||||
<AdditionalOptions>-std=c++11</AdditionalOptions>
|
||||
</PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_DEDICATED_SERVER;_CONTENT_PACKAGE;WITH_SERVER_CODE;_LARGE_WORLDS;_DEBUG_MENUS_ENABLED;_DEBUG;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)\..\Minecraft.Client;$(ProjectDir)\..\Minecraft.Client\Windows64\Iggy\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<ProgramDatabaseFile>$(OutDir)$(ProjectName).pdb</ProgramDatabaseFile>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalDependencies>ws2_32.lib;..\Minecraft.World\x64_Debug\Minecraft.World.lib;..\Minecraft.Client\Windows64\4JLibs\libs\4J_Storage_d.lib;..\Minecraft.Client\Windows64\4JLibs\libs\4J_Profile_d.lib;..\Minecraft.Client\Windows64\4JLibs\libs\4J_Render_PC_d.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<SuppressStartupBanner>false</SuppressStartupBanner>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<Optimization>Full</Optimization>
|
||||
<ExceptionHandling>Sync</ExceptionHandling>
|
||||
<BufferSecurityCheck>false</BufferSecurityCheck>
|
||||
<PrecompiledHeaderOutputFile>$(IntDir)$(ProjectName).pch</PrecompiledHeaderOutputFile>
|
||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||
<PreprocessorDefinitions>_DEDICATED_SERVER;_CONTENT_PACKAGE;WITH_SERVER_CODE;_LARGE_WORLDS;_CRT_NON_CONFORMING_SWPRINTFS;_CRT_SECURE_NO_WARNINGS;_WINDOWS64;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)\..\Minecraft.Client;$(ProjectDir)\..\Minecraft.Client\Windows64\Iggy\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<RuntimeTypeInfo>true</RuntimeTypeInfo>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<BasicRuntimeChecks>Default</BasicRuntimeChecks>
|
||||
<ShowIncludes>false</ShowIncludes>
|
||||
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
<SubSystem>Console</SubSystem>
|
||||
<AdditionalDependencies>ws2_32.lib;..\Minecraft.World\x64_Release\Minecraft.World.lib;..\Minecraft.Client\Windows64\4JLibs\libs\4J_Storage.lib;..\Minecraft.Client\Windows64\4JLibs\libs\4J_Profile_r.lib;..\Minecraft.Client\Windows64\4JLibs\libs\4J_Render_PC.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<ShowProgress>NotSet</ShowProgress>
|
||||
<SuppressStartupBanner>false</SuppressStartupBanner>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h" />
|
||||
<ClInclude Include="Core\DedicatedServer.h" />
|
||||
<ClInclude Include="Core\ServerProperties.h" />
|
||||
<ClInclude Include="Commands\ServerCommands.h" />
|
||||
<ClInclude Include="Commands\ServerCommand.h" />
|
||||
<ClInclude Include="Commands\ConsoleCommandDispatcher.h" />
|
||||
<ClInclude Include="Commands\StopCommand.h" />
|
||||
<ClInclude Include="Commands\HelpCommand.h" />
|
||||
<ClInclude Include="Commands\TpCommand.h" />
|
||||
<ClInclude Include="Commands\ConsoleCommandSender.h" />
|
||||
<ClInclude Include="Commands\TimeServerCommand.h" />
|
||||
<ClInclude Include="Commands\ToggleDownfallServerCommand.h" />
|
||||
<ClInclude Include="Commands\GiveServerCommand.h" />
|
||||
<ClInclude Include="Commands\EnchantServerCommand.h" />
|
||||
<ClInclude Include="Commands\KillServerCommand.h" />
|
||||
<ClInclude Include="Commands\GameModeServerCommand.h" />
|
||||
<ClInclude Include="Commands\ListServerCommand.h" />
|
||||
<ClInclude Include="Commands\KickServerCommand.h" />
|
||||
<ClInclude Include="Linux\LinuxCompat.h" />
|
||||
<ClInclude Include="Linux\LinuxStdafx.h" />
|
||||
<ClInclude Include="Linux\PosixNetLayer.h" />
|
||||
<ClInclude Include="Linux\WinsockNetLayer.h" />
|
||||
<ClInclude Include="Commands\BanCommand.h" />
|
||||
<ClInclude Include="Commands\BanIpCommand.h" />
|
||||
<ClInclude Include="Commands\BanListCommand.h" />
|
||||
<ClInclude Include="Commands\DebugCommand.h" />
|
||||
<ClInclude Include="Commands\DefaultGameModeCommand.h" />
|
||||
<ClInclude Include="Commands\DeOpCommand.h" />
|
||||
<ClInclude Include="Commands\MeCommand.h" />
|
||||
<ClInclude Include="Commands\OpCommand.h" />
|
||||
<ClInclude Include="Commands\PardonCommand.h" />
|
||||
<ClInclude Include="Commands\PardonIpCommand.h" />
|
||||
<ClInclude Include="Commands\SaveAllCommand.h" />
|
||||
<ClInclude Include="Commands\SaveOffCommand.h" />
|
||||
<ClInclude Include="Commands\SaveOnCommand.h" />
|
||||
<ClInclude Include="Commands\SayCommand.h" />
|
||||
<ClInclude Include="Commands\SeedCommand.h" />
|
||||
<ClInclude Include="Commands\ServerTextList.h" />
|
||||
<ClInclude Include="Commands\WhitelistCommand.h" />
|
||||
<ClInclude Include="Commands\XpCommand.h" />
|
||||
<ClInclude Include="Core\ServerLists.h" />
|
||||
<ClInclude Include="Core\ServerLogger.h" />
|
||||
<ClInclude Include="Linux\stubs\d3d11.h" />
|
||||
<ClInclude Include="Linux\stubs\DirectXMath.h" />
|
||||
<ClInclude Include="Linux\stubs\malloc.h" />
|
||||
<ClInclude Include="Linux\stubs\sal.h" />
|
||||
<ClInclude Include="Linux\stubs\tchar.h" />
|
||||
<ClInclude Include="Linux\stubs\windows.h" />
|
||||
<ClInclude Include="Linux\stubs\WinSock2.h" />
|
||||
<ClInclude Include="Linux\stubs\WS2tcpip.h" />
|
||||
<ClInclude Include="Linux\stubs\xhash" />
|
||||
<ClInclude Include="Linux\stubs\xsocialpost.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\DedicatedServer_Main.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\DedicatedServer.cpp" />
|
||||
<ClCompile Include="Core\ServerProperties.cpp" />
|
||||
<ClCompile Include="Stubs\ServerStubs.cpp" />
|
||||
<ClCompile Include="Stubs\ServerStubs2.cpp" />
|
||||
<ClCompile Include="Commands\ServerCommands.cpp" />
|
||||
<ClCompile Include="Commands\ConsoleCommandDispatcher.cpp" />
|
||||
<ClCompile Include="Commands\StopCommand.cpp" />
|
||||
<ClCompile Include="Commands\HelpCommand.cpp" />
|
||||
<ClCompile Include="Commands\TpCommand.cpp" />
|
||||
<ClCompile Include="Commands\ConsoleCommandSender.cpp" />
|
||||
<ClCompile Include="Commands\TimeServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\ToggleDownfallServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\GiveServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\EnchantServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\KillServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\GameModeServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\ListServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\KickServerCommand.cpp" />
|
||||
<ClCompile Include="Commands\BanCommand.cpp" />
|
||||
<ClCompile Include="Commands\BanIpCommand.cpp" />
|
||||
<ClCompile Include="Commands\BanListCommand.cpp" />
|
||||
<ClCompile Include="Commands\DebugCommand.cpp" />
|
||||
<ClCompile Include="Commands\DefaultGameModeCommand.cpp" />
|
||||
<ClCompile Include="Commands\DeOpCommand.cpp" />
|
||||
<ClCompile Include="Commands\MeCommand.cpp" />
|
||||
<ClCompile Include="Commands\OpCommand.cpp" />
|
||||
<ClCompile Include="Commands\PardonCommand.cpp" />
|
||||
<ClCompile Include="Commands\PardonIpCommand.cpp" />
|
||||
<ClCompile Include="Commands\SaveAllCommand.cpp" />
|
||||
<ClCompile Include="Commands\SaveOffCommand.cpp" />
|
||||
<ClCompile Include="Commands\SaveOnCommand.cpp" />
|
||||
<ClCompile Include="Commands\SayCommand.cpp" />
|
||||
<ClCompile Include="Commands\SeedCommand.cpp" />
|
||||
<ClCompile Include="Commands\WhitelistCommand.cpp" />
|
||||
<ClCompile Include="Commands\XpCommand.cpp" />
|
||||
<ClCompile Include="Core\ServerLists.cpp" />
|
||||
<ClCompile Include="Core\ServerLogger.cpp" />
|
||||
<ClCompile Include="Stubs\ServerStubs3.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Minecraft.Client\MinecraftServer.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerConnection.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerLevel.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerLevelListener.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerPlayer.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerPlayerGameMode.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerChunkCache.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ServerCommandDispatcher.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\DerivedServerLevel.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\PlayerList.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\PlayerConnection.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\PendingConnection.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\PlayerChunkMap.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\EntityTracker.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\TrackedEntity.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ConsoleInput.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Settings.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Options.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\User.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\StatsCounter.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\StatsSyncher.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Minecraft.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerLevel.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerLocalPlayer.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerChunkCache.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerGameMode.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\LocalPlayer.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\RemotePlayer.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ClientConnection.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\ClientConstants.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\TeleportCommand.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\StringTable.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\WstringLookup.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Minimap.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MemoryTracker.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\crt_compat.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Consoles_App.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\ConsoleGameMode.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Console_Utils.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Network\GameNetworkManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Network\PlatformNetworkManagerStub.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Telemetry\TelemetryManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Trial\TrialMode.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Leaderboards\LeaderboardManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCPack.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCTextureFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCLocalisationFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCGameRulesFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCGameRulesHeader.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCAudioFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCCapeFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCSkinFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCColourTableFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCUIDataFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Audio\SoundEngine.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Audio\Consoles_SoundEngine.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Audio\SoundNames.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Colours\ColourTable.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\GameRule.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\GameRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\GameRuleManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelGenerationOptions.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelGenerators.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelRules.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelRuleset.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\BiomeOverride.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\StartFeature.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\ConsoleGenerateStructure.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\ConsoleSchematicFile.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\AddEnchantmentRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\AddItemRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\ApplySchematicRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\CollectItemRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\CompleteAllRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\CompoundGameRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\NamedAreaRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\UpdatePlayerRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\UseTileRuleDefinition.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionGenerateBox.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionPlaceBlock.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionPlaceContainer.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionPlaceSpawner.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\Tutorial.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialMode.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\FullTutorial.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\FullTutorialActiveTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\FullTutorialMode.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialHint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialMessage.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\AreaConstraint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\AreaHint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\AreaTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ChangeStateConstraint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ChoiceTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\CompleteUsingItemTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ControllerTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\CraftTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\DiggerItemHint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\EffectChangedTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\InfoTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\InputConstraint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\LookAtEntityHint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\LookAtTileHint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\PickupTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ProcedureCompoundTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ProgressFlagTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\StatTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TakeItemHint.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\UseItemTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\UseTileTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\XuiCraftingTask.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIController.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIScene.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIScene_PauseMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UILayer.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIGroup.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIControl.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIControl_Base.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIFontData.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIBitmapFont.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UITTFFont.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_StartGame.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_PauseMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_AbstractContainerMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_ContainerMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_CraftingMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_CreativeMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_FurnaceMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_InventoryMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_BrewingMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_DispenserMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_EnchantingMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_AnvilMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_TradingMenu.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\adler32.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\compress.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\crc32.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\deflate.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzclose.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzlib.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzread.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzwrite.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\infback.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\inffast.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\inflate.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\inftrees.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\trees.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\uncompr.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\zutil.c">
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">NotUsing</PrecompiledHeader>
|
||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">NotUsing</PrecompiledHeader>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Windows64_App.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Network\WinsockNetLayer.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug-Linux|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release-Linux|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Leaderboards\WindowsLeaderboardManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Windows64_UIController.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Xbox\Network\NetworkPlayerXbox.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\Extrax64Stubs.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\KeyboardMouseInput.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\PS3\PS3Extras\ShutdownManager.cpp" />
|
||||
<ClCompile Include="..\Minecraft.Client\CreativeMode.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Linux\LinuxMain.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Linux\PosixNetLayer.cpp">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
833
Minecraft.Server.vcxproj.filters
Normal file
833
Minecraft.Server.vcxproj.filters
Normal file
@@ -0,0 +1,833 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Server">
|
||||
<UniqueIdentifier>{F4549051-0176-4AC3-91C4-626AC6AE3E45}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Common">
|
||||
<UniqueIdentifier>{7DDBBB6C-E16F-4CF0-A8C4-588ED0B6DC71}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\GameRules">
|
||||
<UniqueIdentifier>{5823EB64-6F69-48EA-8D46-81FFA7F276FC}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Tutorial">
|
||||
<UniqueIdentifier>{9270DB82-A155-43C0-9D54-455417E97748}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\UI">
|
||||
<UniqueIdentifier>{EC39CF82-06DB-4BC5-9C80-F39B60E048ED}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\DLC">
|
||||
<UniqueIdentifier>{02CFBE7F-6A35-4620-B804-3D612385ACD0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\zlib">
|
||||
<UniqueIdentifier>{4D352E32-7D20-4EB2-9BDA-89E7AD5E9772}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Platform">
|
||||
<UniqueIdentifier>{F595EFE2-4D31-425B-B58D-C0E06402A8EB}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Core">
|
||||
<UniqueIdentifier>{916A333F-37B9-4310-9F8D-9AB833A0C913}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Commands">
|
||||
<UniqueIdentifier>{6ABCD7BC-D2D7-40D8-905F-72F86DCD1FD3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Stubs">
|
||||
<UniqueIdentifier>{58EC24F6-30EF-425A-87AF-CFF8CAFA7037}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Core">
|
||||
<UniqueIdentifier>{897BAA49-1C89-435F-A2C5-970920F9CC4F}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Commands">
|
||||
<UniqueIdentifier>{D2A911EF-1245-48F7-BD3E-3B336558008F}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Linux">
|
||||
<UniqueIdentifier>{F20822ED-AC55-413F-95E8-BCD9DCE43455}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Header Files\Linux\stubs">
|
||||
<UniqueIdentifier>{1126E4C0-31CF-4D9C-B5EF-A953541C9A7F}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\Linux">
|
||||
<UniqueIdentifier>{12B0324F-F606-40EF-9806-4CD453D2BFF3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="stdafx.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Core\DedicatedServer.h">
|
||||
<Filter>Header Files\Core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Core\ServerProperties.h">
|
||||
<Filter>Header Files\Core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ServerCommands.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ConsoleCommandDispatcher.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ConsoleCommandSender.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\StopCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\HelpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\TpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\TimeServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ToggleDownfallServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\GiveServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\EnchantServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\KillServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\GameModeServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ListServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\KickServerCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\BanCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\BanIpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\BanListCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\DebugCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\DefaultGameModeCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\DeOpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\MeCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\OpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\PardonCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\PardonIpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\SaveAllCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\SaveOffCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\SaveOnCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\SayCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\SeedCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\ServerTextList.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\WhitelistCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Commands\XpCommand.h">
|
||||
<Filter>Header Files\Commands</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Core\ServerLists.h">
|
||||
<Filter>Header Files\Core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Core\ServerLogger.h">
|
||||
<Filter>Header Files\Core</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\LinuxCompat.h">
|
||||
<Filter>Header Files\Linux</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\LinuxStdafx.h">
|
||||
<Filter>Header Files\Linux</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\PosixNetLayer.h">
|
||||
<Filter>Header Files\Linux</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\WinsockNetLayer.h">
|
||||
<Filter>Header Files\Linux</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\d3d11.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\DirectXMath.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\malloc.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\sal.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\tchar.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\windows.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\WinSock2.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\WS2tcpip.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\xhash">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Linux\stubs\xsocialpost.h">
|
||||
<Filter>Header Files\Linux\stubs</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="stdafx.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\DedicatedServer_Main.cpp">
|
||||
<Filter>Source Files\Core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\DedicatedServer.cpp">
|
||||
<Filter>Source Files\Core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\ServerProperties.cpp">
|
||||
<Filter>Source Files\Core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Stubs\ServerStubs.cpp">
|
||||
<Filter>Source Files\Stubs</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Stubs\ServerStubs2.cpp">
|
||||
<Filter>Source Files\Stubs</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\ServerCommands.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\ConsoleCommandDispatcher.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\ConsoleCommandSender.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\StopCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\HelpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\TpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\TimeServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\ToggleDownfallServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\GiveServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\EnchantServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\KillServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\GameModeServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\ListServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\KickServerCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\BanCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\BanIpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\BanListCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\DebugCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\DefaultGameModeCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\DeOpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\MeCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\OpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\PardonCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\PardonIpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\SaveAllCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\SaveOffCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\SaveOnCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\SayCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\SeedCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\WhitelistCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Commands\XpCommand.cpp">
|
||||
<Filter>Source Files\Commands</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\ServerLists.cpp">
|
||||
<Filter>Source Files\Core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Core\ServerLogger.cpp">
|
||||
<Filter>Source Files\Core</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Stubs\ServerStubs3.cpp">
|
||||
<Filter>Source Files\Stubs</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MinecraftServer.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerConnection.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerLevel.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerLevelListener.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerPlayer.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerPlayerGameMode.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerChunkCache.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ServerCommandDispatcher.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\DerivedServerLevel.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\PlayerList.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\PlayerConnection.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\PendingConnection.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\PlayerChunkMap.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\EntityTracker.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\TrackedEntity.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ConsoleInput.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Settings.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Options.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\User.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\StatsCounter.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\StatsSyncher.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Minecraft.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerLevel.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerLocalPlayer.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerChunkCache.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MultiPlayerGameMode.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\LocalPlayer.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\RemotePlayer.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ClientConnection.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\ClientConstants.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\TeleportCommand.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\StringTable.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\WstringLookup.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Minimap.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\MemoryTracker.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\crt_compat.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\CreativeMode.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Consoles_App.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\ConsoleGameMode.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Console_Utils.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Network\GameNetworkManager.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Network\PlatformNetworkManagerStub.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Telemetry\TelemetryManager.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Trial\TrialMode.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Leaderboards\LeaderboardManager.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Audio\SoundEngine.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Audio\Consoles_SoundEngine.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Audio\SoundNames.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Colours\ColourTable.cpp">
|
||||
<Filter>Source Files\Common</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCManager.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCPack.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCTextureFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCLocalisationFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCGameRulesFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCGameRulesHeader.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCAudioFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCCapeFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCSkinFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCColourTableFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\DLC\DLCUIDataFile.cpp">
|
||||
<Filter>Source Files\DLC</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\GameRule.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\GameRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\GameRuleManager.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelGenerationOptions.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelGenerators.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelRules.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\LevelRuleset.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\BiomeOverride.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\StartFeature.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\ConsoleGenerateStructure.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\ConsoleSchematicFile.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\AddEnchantmentRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\AddItemRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\ApplySchematicRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\CollectItemRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\CompleteAllRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\CompoundGameRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\NamedAreaRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\UpdatePlayerRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\UseTileRuleDefinition.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionGenerateBox.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionPlaceBlock.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionPlaceContainer.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\GameRules\XboxStructureActionPlaceSpawner.cpp">
|
||||
<Filter>Source Files\GameRules</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\Tutorial.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialMode.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\FullTutorial.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\FullTutorialActiveTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\FullTutorialMode.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialHint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialMessage.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TutorialTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\AreaConstraint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\AreaHint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\AreaTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ChangeStateConstraint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ChoiceTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\CompleteUsingItemTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ControllerTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\CraftTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\DiggerItemHint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\EffectChangedTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\InfoTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\InputConstraint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\LookAtEntityHint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\LookAtTileHint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\PickupTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ProcedureCompoundTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\ProgressFlagTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\StatTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\TakeItemHint.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\UseItemTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\UseTileTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\Tutorial\XuiCraftingTask.cpp">
|
||||
<Filter>Source Files\Tutorial</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIController.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIScene.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIScene_PauseMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UILayer.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIGroup.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIControl.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIControl_Base.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIFontData.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UIBitmapFont.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\UITTFFont.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_StartGame.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_PauseMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_AbstractContainerMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_ContainerMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_CraftingMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_CreativeMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_FurnaceMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_InventoryMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_BrewingMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_DispenserMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_EnchantingMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_AnvilMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\UI\IUIScene_TradingMenu.cpp">
|
||||
<Filter>Source Files\UI</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\adler32.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\compress.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\crc32.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\deflate.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzclose.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzlib.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzread.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\gzwrite.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\infback.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\inffast.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\inflate.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\inftrees.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\trees.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\uncompr.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Common\zlib\zutil.c">
|
||||
<Filter>Source Files\zlib</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Windows64_App.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Network\WinsockNetLayer.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Leaderboards\WindowsLeaderboardManager.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Windows64\Windows64_UIController.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Xbox\Network\NetworkPlayerXbox.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\Extrax64Stubs.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\KeyboardMouseInput.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\PS3\PS3Extras\ShutdownManager.cpp">
|
||||
<Filter>Source Files\Platform</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Minecraft.Client\CreativeMode.cpp">
|
||||
<Filter>Source Files\Server</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Linux\LinuxMain.cpp">
|
||||
<Filter>Source Files\Linux</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Linux\PosixNetLayer.cpp">
|
||||
<Filter>Source Files\Linux</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
124
README.md
Normal file
124
README.md
Normal file
@@ -0,0 +1,124 @@
|
||||
# LCEMP Dedicated Server
|
||||
|
||||
A dedicated server for Legacy Console Edition. This allows you to host a standalone server for LCE.
|
||||
|
||||
## Building
|
||||
|
||||
You need the main LCEMP repository to build the dedicated server, as it depends on the shared Minecraft.World and Minecraft.Client sources.
|
||||
|
||||
### Linux
|
||||
|
||||
Requires CMake 3.10+ and a C++ compiler with C++11 support (GCC or Clang).
|
||||
|
||||
```bash
|
||||
mkdir build && cd build
|
||||
cmake ../Minecraft.Server -DCMAKE_BUILD_TYPE=Release
|
||||
cmake --build . --target MinecraftDedicatedServer
|
||||
```
|
||||
|
||||
The binary will be at `build/MinecraftDedicatedServer`.
|
||||
|
||||
### Windows
|
||||
|
||||
Open `Minecraft.Server.vcxproj` in Visual Studio (2012 or later with the v110 toolset, or 2022 with v143) and build.
|
||||
|
||||
## Running
|
||||
|
||||
On Linux, run the binary directly:
|
||||
|
||||
```bash
|
||||
./MinecraftDedicatedServer
|
||||
```
|
||||
|
||||
On Windows, run `MinecraftDedicatedServer.exe` from a command prompt or by double-clicking it.
|
||||
|
||||
On first launch the server generates a default `server.properties` file, which you can edit to configure the server.
|
||||
|
||||
## server.properties
|
||||
|
||||
| Property | Type | Default | Description |
|
||||
|---|---|---|---|
|
||||
| `server-port` | integer | `25565` | Port the server listens on. |
|
||||
| `server-ip` | string | *(empty)* | IP address to bind to. Leave empty to bind on all interfaces. |
|
||||
| `level-name` | string | `world` | Name of the world. |
|
||||
| `level-seed` | integer | *(empty)* | World seed. Leave empty for a random seed. |
|
||||
| `level-size` | string | `large` | World size for newly created worlds. Options: `classic`, `small`, `medium`, `large`. |
|
||||
| `gamemode` | integer | `0` | Default game mode. `0` = Survival, `1` = Creative. |
|
||||
| `difficulty` | integer | `2` | Difficulty level. `0` = Peaceful, `1` = Easy, `2` = Normal, `3` = Hard. |
|
||||
| `max-players` | integer | `8` | Maximum number of players (1-8). |
|
||||
| `pvp` | boolean | `true` | Whether players can damage each other. |
|
||||
| `trust-players` | boolean | `true` | Whether to trust player positions sent by the client. |
|
||||
| `fire-spreads` | boolean | `true` | Whether fire spreads to nearby blocks. |
|
||||
| `tnt-explodes` | boolean | `true` | Whether TNT explosions are enabled. |
|
||||
| `structures` | boolean | `true` | Whether structures generate in new worlds. |
|
||||
| `spawn-animals` | boolean | `true` | Whether animals spawn naturally. |
|
||||
| `spawn-npcs` | boolean | `true` | Whether villagers spawn naturally. |
|
||||
| `online-mode` | boolean | `false` | Reserved for future use. |
|
||||
| `show-gamertags` | boolean | `true` | Whether player name tags are visible in-game. |
|
||||
| `motd` | string | `A Minecraft LCE Server` | Server name shown in the LAN browser. |
|
||||
| `white-list` | boolean | `false` | Whether to use a whitelist. Only players listed in `whitelist.txt` can join. |
|
||||
| `voice-chat` | boolean | `false` | Whether voice chat is enabled. Only works with 8 or fewer max players. |
|
||||
| `advertise-lan` | boolean | `true` | Whether the server broadcasts itself on the local network so clients can find it automatically. |
|
||||
|
||||
### World sizes
|
||||
|
||||
| Size | Overworld | Nether scale |
|
||||
|---|---|---|
|
||||
| `classic` | 864x864 blocks | 3x |
|
||||
| `small` | 1024x1024 blocks | 3x |
|
||||
| `medium` | 3072x3072 blocks | 6x |
|
||||
| `large` | 5120x5120 blocks | 8x |
|
||||
|
||||
The `level-size` property only takes effect when the server creates a new world. Existing saves keep their original size.
|
||||
|
||||
## Commands
|
||||
|
||||
Commands can be typed directly into the server console. Use `/help` to see a paginated list or `/help <command>` for details on a specific command (these commands are the same as vanilla java minecraft).
|
||||
|
||||
### Player Management
|
||||
|
||||
| Command | Usage | Description |
|
||||
|---|---|---|
|
||||
| `op` | `/op <player>` | Grants operator status to a player. |
|
||||
| `deop` | `/deop <player>` | Removes operator status from a player. |
|
||||
| `kick` | `/kick <player> [reason]` | Kicks a player from the server. |
|
||||
| `ban` | `/ban <player>` | Bans a player by name. |
|
||||
| `ban-ip` | `/ban-ip <address or player>` | Bans an IP address, or resolves a player name to their IP and bans it. |
|
||||
| `pardon` | `/pardon <player>` | Unbans a player. |
|
||||
| `pardon-ip` | `/pardon-ip <address>` | Unbans an IP address. |
|
||||
| `banlist` | `/banlist [ips\|players]` | Shows the ban list. Defaults to players. |
|
||||
| `whitelist` | `/whitelist <on\|off\|list\|add\|remove\|reload> [player]` | Manages the whitelist. |
|
||||
| `list` | `/list` | Shows online players. |
|
||||
|
||||
### Gameplay
|
||||
|
||||
| Command | Usage | Description |
|
||||
|---|---|---|
|
||||
| `gamemode` | `/gamemode <mode> [player]` | Changes a player's game mode. Accepts `0`/`s`/`survival`, `1`/`c`/`creative`, `2`/`a`/`adventure`. |
|
||||
| `defaultgamemode` | `/defaultgamemode <mode>` | Sets the default game mode for new players joining. |
|
||||
| `give` | `/give <player> <item id> [amount] [data]` | Gives an item to a player. |
|
||||
| `enchant` | `/enchant <player> <enchantment id> [level]` | Enchants the item a player is holding. |
|
||||
| `tp` | `/tp [player] <target player>` or `/tp [player] <x> <y> <z>` | Teleports a player to another player or to coordinates. |
|
||||
| `kill` | `/kill <player>` | Kills a player. |
|
||||
| `xp` | `/xp <amount> [player]` or `/xp <amount>L [player]` | Gives experience. Append `L` to give levels instead of points. |
|
||||
|
||||
### World
|
||||
|
||||
| Command | Usage | Description |
|
||||
|---|---|---|
|
||||
| `time` | `/time <set\|add> <value>` | Sets or adds to the world time. Accepts `day`, `night`, or a number. |
|
||||
| `toggledownfall` | `/toggledownfall` | Toggles rain/snow on or off. |
|
||||
| `seed` | `/seed` | Displays the world seed. |
|
||||
| `save-all` | `/save-all` | Forces an immediate save of the world. |
|
||||
| `save-off` | `/save-off` | Disables automatic saving. |
|
||||
| `save-on` | `/save-on` | Re-enables automatic saving. |
|
||||
|
||||
### Other
|
||||
|
||||
| Command | Usage | Description |
|
||||
|---|---|---|
|
||||
| `say` | `/say <message>` | Broadcasts a message to all players as `[Server]`. |
|
||||
| `me` | `/me <action>` | Broadcasts an action message as `* Server <action>`. |
|
||||
| `help` | `/help [page or command]` | Shows the command list or usage for a specific command. |
|
||||
| `stop` | `/stop` | Saves and shuts down the server. |
|
||||
| `debug` | `/debug <start\|stop>` | Starts or stops a debug profiling session. |
|
||||
196
Stubs/ServerStubs.cpp
Normal file
196
Stubs/ServerStubs.cpp
Normal file
@@ -0,0 +1,196 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "../../Minecraft.Client/Minecraft.h"
|
||||
#include "../../Minecraft.Client/ProgressRenderer.h"
|
||||
#include "../../Minecraft.Client/GameRenderer.h"
|
||||
#include "../../Minecraft.Client/Textures.h"
|
||||
#include "../../Minecraft.Client/Font.h"
|
||||
#include "../../Minecraft.Client/Gui.h"
|
||||
#include "../../Minecraft.Client/Options.h"
|
||||
#include "../../Minecraft.Client/User.h"
|
||||
#include "../../Minecraft.Client/StatsCounter.h"
|
||||
#include "../../Minecraft.Client/LevelRenderer.h"
|
||||
#include "../../Minecraft.Client/AchievementPopup.h"
|
||||
#include "../../Minecraft.Client/KeyboardMouseInput.h"
|
||||
#include "../../Minecraft.Client/Windows64/Sentient/SentientManager.h"
|
||||
#include "../../Minecraft.Client/Windows64/Social/SocialManager.h"
|
||||
#include "../../Minecraft.Client/StringTable.h"
|
||||
#include "../../Minecraft.Client/MemoryTracker.h"
|
||||
|
||||
#include "../../Minecraft.Client/Windows64Media/strings.h"
|
||||
#include <time.h>
|
||||
#include "../Core/ServerLogger.h"
|
||||
|
||||
CRITICAL_SECTION ProgressRenderer::s_progress;
|
||||
|
||||
static const wchar_t* GetProgressTitleName(int id)
|
||||
{
|
||||
switch(id)
|
||||
{
|
||||
case IDS_PROGRESS_INITIALISING_SERVER: return L"Starting integrated server";
|
||||
case IDS_PROGRESS_GENERATING_LEVEL: return L"Generating level";
|
||||
case IDS_PROGRESS_GENERATING_SPAWN_AREA: return L"Preparing spawn area";
|
||||
case IDS_PROGRESS_LOADING_LEVEL: return L"Loading level";
|
||||
case IDS_PROGRESS_LOADING_SPAWN_AREA: return L"Loading spawn area";
|
||||
case IDS_PROGRESS_BUILDING_TERRAIN: return L"Building terrain";
|
||||
case IDS_PROGRESS_SAVING_LEVEL: return L"Saving level";
|
||||
case IDS_PROGRESS_SAVING_CHUNKS: return L"Saving chunks";
|
||||
case IDS_PROGRESS_SAVING_PLAYERS: return L"Saving players";
|
||||
case IDS_PROGRESS_SAVING_TO_DISC: return L"Saving to disc";
|
||||
case IDS_PROGRESS_AUTOSAVING_LEVEL: return L"Autosaving level";
|
||||
case IDS_PROGRESS_HOST_SAVING: return L"Saving";
|
||||
case IDS_PROGRESS_RESPAWNING: return L"Respawning";
|
||||
case IDS_PROGRESS_ENTERING_NETHER: return L"Entering the Nether";
|
||||
case IDS_PROGRESS_LEAVING_NETHER: return L"Leaving the Nether";
|
||||
case IDS_PROGRESS_ENTERING_END: return L"Entering the End";
|
||||
case IDS_PROGRESS_LEAVING_END: return L"Leaving the End";
|
||||
default: return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
ProgressRenderer::ProgressRenderer(Minecraft *minecraft) : minecraft(minecraft)
|
||||
{
|
||||
lastPercent = 0;
|
||||
status = 0;
|
||||
title = 0;
|
||||
lastTime = 0;
|
||||
noAbort = false;
|
||||
m_eType = eProgressStringType_ID;
|
||||
}
|
||||
|
||||
void ProgressRenderer::progressStart(int title)
|
||||
{
|
||||
_progressStart(title);
|
||||
}
|
||||
|
||||
void ProgressRenderer::progressStartNoAbort(int string)
|
||||
{
|
||||
noAbort = true;
|
||||
_progressStart(string);
|
||||
}
|
||||
|
||||
void ProgressRenderer::_progressStart(int t)
|
||||
{
|
||||
this->title = t;
|
||||
this->lastPercent = -1;
|
||||
this->lastTime = 0;
|
||||
|
||||
const wchar_t *name = GetProgressTitleName(t);
|
||||
if (name)
|
||||
ServerLog(L"%ls\n", name);
|
||||
}
|
||||
|
||||
void ProgressRenderer::progressStage(int s)
|
||||
{
|
||||
this->status = s;
|
||||
}
|
||||
|
||||
void ProgressRenderer::progressStage(wstring &wstrText)
|
||||
{
|
||||
m_wstrText = wstrText;
|
||||
m_eType = eProgressStringType_String;
|
||||
}
|
||||
|
||||
void ProgressRenderer::progressStagePercentage(int i)
|
||||
{
|
||||
if (i != lastPercent)
|
||||
{
|
||||
lastPercent = i;
|
||||
if (title == IDS_PROGRESS_GENERATING_SPAWN_AREA || title == IDS_PROGRESS_LOADING_SPAWN_AREA)
|
||||
{
|
||||
if (i % 10 == 0 && i > 0)
|
||||
{
|
||||
const wchar_t *name = GetProgressTitleName(title);
|
||||
if (name)
|
||||
ServerLog(L"Preparing spawn area: %d%%%%\n", i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int ProgressRenderer::getCurrentPercent() { return lastPercent; }
|
||||
int ProgressRenderer::getCurrentTitle() { return title; }
|
||||
int ProgressRenderer::getCurrentStatus() { return status; }
|
||||
wstring& ProgressRenderer::getProgressString(void) { return m_wstrText; }
|
||||
ProgressRenderer::eProgressStringType ProgressRenderer::getType() { return m_eType; }
|
||||
void ProgressRenderer::setType(eProgressStringType eType) { m_eType = eType; }
|
||||
|
||||
bool GameRenderer::anaglyph3d = false;
|
||||
int GameRenderer::anaglyphPass = 0;
|
||||
|
||||
GameRenderer::GameRenderer(Minecraft *mc)
|
||||
{
|
||||
// should be good enough
|
||||
this->mc = mc;
|
||||
renderDistance = 0;
|
||||
_tick = 0;
|
||||
hovered = nullptr;
|
||||
thirdDistance = 4;
|
||||
thirdDistanceO = 4;
|
||||
thirdRotation = 0;
|
||||
thirdRotationO = 0;
|
||||
thirdTilt = 0;
|
||||
thirdTiltO = 0;
|
||||
accumulatedSmoothXO = 0;
|
||||
accumulatedSmoothYO = 0;
|
||||
tickSmoothXO = 0;
|
||||
tickSmoothYO = 0;
|
||||
lastTickA = 0;
|
||||
cameraPos = NULL;
|
||||
fovOffset = 0;
|
||||
fovOffsetO = 0;
|
||||
cameraRoll = 0;
|
||||
cameraRollO = 0;
|
||||
isInClouds = false;
|
||||
zoom = 1;
|
||||
zoom_x = 0;
|
||||
zoom_y = 0;
|
||||
rainXa = NULL;
|
||||
rainZa = NULL;
|
||||
lastActiveTime = 0;
|
||||
lastNsTime = 0;
|
||||
random = NULL;
|
||||
rainSoundTime = 0;
|
||||
xMod = 0;
|
||||
yMod = 0;
|
||||
lb = NULL;
|
||||
fr = 0; fg = 0; fb = 0;
|
||||
fogBrO = 0; fogBr = 0;
|
||||
cameraFlip = 0;
|
||||
_updateLightTexture = false;
|
||||
blr = 0; blrt = 0; blg = 0;
|
||||
itemInHandRenderer = NULL;
|
||||
for (int i = 0; i < 4; i++) { fov[i] = 0; oFov[i] = 0; tFov[i] = 0; }
|
||||
}
|
||||
|
||||
void GameRenderer::DisableUpdateThread()
|
||||
{
|
||||
}
|
||||
|
||||
void GameRenderer::EnableUpdateThread()
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef MULTITHREAD_ENABLE
|
||||
C4JThread* GameRenderer::m_updateThread = NULL;
|
||||
C4JThread::EventArray* GameRenderer::m_updateEvents = NULL;
|
||||
bool GameRenderer::nearThingsToDo = false;
|
||||
bool GameRenderer::updateRunning = false;
|
||||
#endif
|
||||
|
||||
vector<byte *> GameRenderer::m_deleteStackByte;
|
||||
vector<SparseLightStorage *> GameRenderer::m_deleteStackSparseLightStorage;
|
||||
vector<CompressedTileStorage *> GameRenderer::m_deleteStackCompressedTileStorage;
|
||||
vector<SparseDataStorage *> GameRenderer::m_deleteStackSparseDataStorage;
|
||||
|
||||
void MemSect(int sect) {}
|
||||
|
||||
void glFlush() {}
|
||||
void glTexGeni(int, int, int) {}
|
||||
void glTexGen(int, int, FloatBuffer *) {}
|
||||
void glReadPixels(int, int, int, int, int, int, ByteBuffer *) {}
|
||||
void glClearDepth(double) {}
|
||||
void glCullFace(int) {}
|
||||
void glDeleteLists(int, int) {}
|
||||
|
||||
void PlayerRenderer_InitNametagColors() {}
|
||||
779
Stubs/ServerStubs2.cpp
Normal file
779
Stubs/ServerStubs2.cpp
Normal file
@@ -0,0 +1,779 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "../../Minecraft.World/Dimension.h"
|
||||
#include "../../Minecraft.Client/Windows64/4JLibs/inc/4J_Input.h"
|
||||
#include "../../Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h"
|
||||
#include "../../Minecraft.Client/TexturePackRepository.h"
|
||||
#include "../../Minecraft.Client/LevelRenderer.h"
|
||||
#include "../../Minecraft.Client/Textures.h"
|
||||
#include "../../Minecraft.Client/Font.h"
|
||||
#include "../../Minecraft.Client/Gui.h"
|
||||
#include "../../Minecraft.Client/ScreenSizeCalculator.h"
|
||||
#include "../../Minecraft.Client/Timer.h"
|
||||
#include "../../Minecraft.Client/HumanoidModel.h"
|
||||
#include "../../Minecraft.Client/ParticleEngine.h"
|
||||
#include "../../Minecraft.Client/Tesselator.h"
|
||||
#include "../../Minecraft.Client/ItemInHandRenderer.h"
|
||||
#include "../../Minecraft.Client/EntityRenderDispatcher.h"
|
||||
#include "../../Minecraft.Client/TileEntityRenderDispatcher.h"
|
||||
#include "../../Minecraft.Client/GuiParticles.h"
|
||||
#include "../../Minecraft.Client/TitleScreen.h"
|
||||
#include "../../Minecraft.Client/AchievementPopup.h"
|
||||
#include "../../Minecraft.Client/Input.h"
|
||||
#include "../../Minecraft.Client/TextureManager.h"
|
||||
#include "../../Minecraft.Client/TileRenderer.h"
|
||||
#include "../../Minecraft.Client/Chunk.h"
|
||||
class EnderDragon;
|
||||
#include "../../Minecraft.Client/EnderDragonRenderer.h"
|
||||
#include "../../Minecraft.Client/GameRenderer.h"
|
||||
#include "../../Minecraft.Client/GameMode.h"
|
||||
#include "../../Minecraft.Client/KeyMapping.h"
|
||||
#include "../../Minecraft.Client/ArchiveFile.h"
|
||||
#include "../../Minecraft.Client/BufferedImage.h"
|
||||
#include "../../Minecraft.Client/Lighting.h"
|
||||
#include "../../Minecraft.Client/Model.h"
|
||||
#include "../../Minecraft.Client/OffsettedRenderList.h"
|
||||
#include "../../Minecraft.Client/Common/Audio/SoundEngine.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIController.h"
|
||||
#include "../../Minecraft.Client/Windows64/Windows64_UIController.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIControl_Progress.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIControl_Label.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIControl_Button.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIScene_FullscreenProgress.h"
|
||||
#include "../../Minecraft.Client/Common/UI/IUIScene_PauseMenu.h"
|
||||
#include "../../Minecraft.Client/Common/UI/IUIScene_CreativeMenu.h"
|
||||
#include "../../Minecraft.Client/Common/UI/IUIScene_TradingMenu.h"
|
||||
#include "../../Minecraft.Client/Common/UI/IUIScene_CraftingMenu.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIFontData.h"
|
||||
#include "../../Minecraft.Client/Particle.h"
|
||||
#include "../../Minecraft.Client/CritParticle.h"
|
||||
#include "../../Minecraft.Client/TakeAnimationParticle.h"
|
||||
#include "../../Minecraft.Client/Screen.h"
|
||||
#include "../../Minecraft.Client/GuiComponent.h"
|
||||
|
||||
C_4JInput InputManager;
|
||||
wchar_t g_Win64UsernameW[17] = L"Server";
|
||||
char g_Win64Username[17] = "Server";
|
||||
HWND g_hWnd = NULL;
|
||||
|
||||
bool TileRenderer::fancy = false;
|
||||
EntityRenderDispatcher *EntityRenderDispatcher::instance = NULL;
|
||||
TileEntityRenderDispatcher *TileEntityRenderDispatcher::instance = NULL;
|
||||
int Chunk::updates = 0;
|
||||
LevelRenderer *Chunk::levelRenderer = NULL;
|
||||
shared_ptr<EnderDragon> EnderDragonRenderer::bossInstance;
|
||||
int EnderDragonRenderer::currentModel = 0;
|
||||
|
||||
double EntityRenderDispatcher::xOff = 0;
|
||||
double EntityRenderDispatcher::yOff = 0;
|
||||
double EntityRenderDispatcher::zOff = 0;
|
||||
|
||||
double TileEntityRenderDispatcher::xOff = 0;
|
||||
double TileEntityRenderDispatcher::yOff = 0;
|
||||
double TileEntityRenderDispatcher::zOff = 0;
|
||||
|
||||
bool Textures::MIPMAP = false;
|
||||
C4JRender::eTextureFormat Textures::TEXTURE_FORMAT = C4JRender::TEXTURE_FORMAT_RxGyBzAw;
|
||||
|
||||
float Gui::currentGuiBlendFactor = 1.0f;
|
||||
float Gui::currentGuiScaleFactor = 1.0f;
|
||||
|
||||
const int LevelRenderer::MAX_LEVEL_RENDER_SIZE[3] = { 356, 42, 18 };
|
||||
const int LevelRenderer::DIMENSION_OFFSETS[3] = { 0, (356 * 356 * 16), (356 * 356 * 16) + (42 * 42 * 16) };
|
||||
|
||||
int ItemInHandRenderer::list = 0;
|
||||
int ItemInHandRenderer::listGlint = 0;
|
||||
|
||||
TexturePack *TexturePackRepository::DEFAULT_TEXTURE_PACK = NULL;
|
||||
|
||||
FloatBuffer *Lighting::lb = NULL;
|
||||
|
||||
void C_4JInput::Tick() {}
|
||||
unsigned int C_4JInput::GetGameJoypadMaps(unsigned char, unsigned char) { return 0; }
|
||||
unsigned char C_4JInput::GetJoypadMapVal(int) { return 0; }
|
||||
void C_4JInput::SetJoypadMapVal(int, unsigned char) {}
|
||||
unsigned int C_4JInput::GetValue(int, unsigned char, bool) { return 0; }
|
||||
bool C_4JInput::ButtonPressed(int, unsigned char) { return false; }
|
||||
bool C_4JInput::ButtonReleased(int, unsigned char) { return false; }
|
||||
bool C_4JInput::ButtonDown(int, unsigned char) { return false; }
|
||||
bool C_4JInput::IsPadConnected(int) { return false; }
|
||||
float C_4JInput::GetJoypadStick_LX(int, bool) { return 0.0f; }
|
||||
float C_4JInput::GetJoypadStick_LY(int, bool) { return 0.0f; }
|
||||
float C_4JInput::GetJoypadStick_RX(int, bool) { return 0.0f; }
|
||||
float C_4JInput::GetJoypadStick_RY(int, bool) { return 0.0f; }
|
||||
float C_4JInput::GetIdleSeconds(int) { return 0.0f; }
|
||||
void C_4JInput::SetJoypadStickAxisMap(int, unsigned int, unsigned int) {}
|
||||
void C_4JInput::SetJoypadStickTriggerMap(int, unsigned int, unsigned int) {}
|
||||
void C_4JInput::SetDebugSequence(const char *, int (*)(LPVOID), LPVOID) {}
|
||||
void C_4JInput::SetMenuDisplayed(int, bool) {}
|
||||
|
||||
void glTranslatef(float, float, float) {}
|
||||
void glRotatef(float, float, float, float) {}
|
||||
void glScalef(float, float, float) {}
|
||||
void glPushMatrix() {}
|
||||
void glPopMatrix() {}
|
||||
void glEnable(int) {}
|
||||
void glDisable(int) {}
|
||||
void glDepthFunc(int) {}
|
||||
void glMatrixMode(int) {}
|
||||
void glLoadIdentity() {}
|
||||
void glBindTexture(int, int) {}
|
||||
void glShadeModel(int) {}
|
||||
void glLineWidth(float) {}
|
||||
void glClear(int) {}
|
||||
void glViewport(int, int, int, int) {}
|
||||
void glAlphaFunc(int, float) {}
|
||||
void glOrtho(float, float, float, float, float, float) {}
|
||||
void glClearColor(float, float, float, float) {}
|
||||
void glBlendFunc(int, int) {}
|
||||
void glDeleteTextures(int) {}
|
||||
void glDeleteTextures(IntBuffer *) {}
|
||||
void glDepthMask(bool) {}
|
||||
void glColor4f(float, float, float, float) {}
|
||||
void glColor3f(float, float, float) {}
|
||||
void glNormal3f(float, float, float) {}
|
||||
void glNewList(int, int) {}
|
||||
void glEndList(int) {}
|
||||
void glCallList(int) {}
|
||||
void glCallLists(IntBuffer *) {}
|
||||
void glDrawArrays(int, int, int) {}
|
||||
void glTexCoordPointer(int, int, int, int) {}
|
||||
void glTexCoordPointer(int, int, FloatBuffer *) {}
|
||||
void glNormalPointer(int, int, int) {}
|
||||
void glNormalPointer(int, ByteBuffer *) {}
|
||||
void glEnableClientState(int) {}
|
||||
void glDisableClientState(int) {}
|
||||
void glColorPointer(int, bool, int, ByteBuffer *) {}
|
||||
void glColorPointer(int, int, int, int) {}
|
||||
void glVertexPointer(int, int, int, int) {}
|
||||
void glVertexPointer(int, int, FloatBuffer *) {}
|
||||
void glMultMatrixf(float *) {}
|
||||
void glTexParameteri(int, int, int) {}
|
||||
int glGenTextures() { return 0; }
|
||||
int glGenLists(int) { return 0; }
|
||||
void glTexImage2D(int, int, int, int, int, int, int, int, ByteBuffer *) {}
|
||||
void glColorMask(bool, bool, bool, bool) {}
|
||||
void glGenQueriesARB(IntBuffer *) {}
|
||||
void glBeginQueryARB(int, int) {}
|
||||
void glEndQueryARB(int) {}
|
||||
void glGetQueryObjectuARB(int, int, IntBuffer *) {}
|
||||
void glPolygonOffset(float, float) {}
|
||||
void glScaled(double, double, double) {}
|
||||
void gluPerspective(float, float, float, float) {}
|
||||
void glFogi(int, int) {}
|
||||
void glFogf(int, float) {}
|
||||
void glFog(int, FloatBuffer *) {}
|
||||
void glColorMaterial(int, int) {}
|
||||
void glMultiTexCoord2f(int, float, float) {}
|
||||
void glClientActiveTexture(int) {}
|
||||
void glActiveTexture(int) {}
|
||||
|
||||
void Display::update() {}
|
||||
void Display::swapBuffers() {}
|
||||
|
||||
Textures::Textures(TexturePackRepository *, Options *) {}
|
||||
int Textures::loadTexture(int) { return 0; }
|
||||
void Textures::tick(bool, bool) {}
|
||||
void Textures::reloadAll() {}
|
||||
void Textures::stitch() {}
|
||||
void Textures::bind(int) {}
|
||||
int Textures::getTexture(BufferedImage *, C4JRender::eTextureFormat, bool) { return 0; }
|
||||
void Textures::replaceTextureDirect(intArray, int, int, int) {}
|
||||
void Textures::releaseTexture(int) {}
|
||||
intArray Textures::loadTexturePixels(TEXTURE_NAME, const wstring &) { return intArray(); }
|
||||
void Textures::bindTexture(const wstring &) {}
|
||||
void Textures::bindTexture(int) {}
|
||||
void Textures::clearLastBoundId() {}
|
||||
void Textures::loadTexture(BufferedImage *, int) {}
|
||||
void Textures::loadTexture(BufferedImage *, int, bool, bool) {}
|
||||
void Textures::replaceTexture(intArray, int, int, int) {}
|
||||
void Textures::replaceTextureDirect(shortArray, int, int, int) {}
|
||||
int Textures::loadHttpTexture(const wstring &, const wstring &) { return 0; }
|
||||
int Textures::loadHttpTexture(const wstring &, int) { return 0; }
|
||||
bool Textures::hasHttpTexture(const wstring &) { return false; }
|
||||
HttpTexture *Textures::addHttpTexture(const wstring &, HttpTextureProcessor *) { return NULL; }
|
||||
void Textures::removeHttpTexture(const wstring &) {}
|
||||
int Textures::loadMemTexture(const wstring &, const wstring &) { return 0; }
|
||||
int Textures::loadMemTexture(const wstring &, int) { return 0; }
|
||||
MemTexture *Textures::addMemTexture(const wstring &, MemTextureProcessor *) { return NULL; }
|
||||
void Textures::removeMemTexture(const wstring &) {}
|
||||
Icon *Textures::getMissingIcon(int) { return NULL; }
|
||||
BufferedImage *Textures::readImage(TEXTURE_NAME, const wstring &) { return NULL; }
|
||||
bool Textures::IsTUImage(TEXTURE_NAME, const wstring &) { return false; }
|
||||
bool Textures::IsOriginalImage(TEXTURE_NAME, const wstring &) { return false; }
|
||||
|
||||
Font::Font(Options *, const wstring &, Textures *, bool, TEXTURE_NAME, int, int, int, int, unsigned short *) {}
|
||||
#ifndef _XBOX
|
||||
Font::~Font() {}
|
||||
#endif
|
||||
void Font::drawShadow(const wstring &, int, int, int) {}
|
||||
void Font::drawShadowWordWrap(const wstring &, int, int, int, int, int) {}
|
||||
void Font::draw(const wstring &, int, int, int) {}
|
||||
void Font::renderFakeCB(IntBuffer *) {}
|
||||
|
||||
Gui::Gui(Minecraft *) {}
|
||||
void Gui::render(float, bool, int, int) {}
|
||||
void Gui::tick() {}
|
||||
void Gui::clearMessages(int) {}
|
||||
void Gui::addMessage(const wstring &, int, bool) {}
|
||||
void Gui::setNowPlaying(const wstring &) {}
|
||||
void Gui::displayClientMessage(int, int) {}
|
||||
float Gui::getOpacity(int, DWORD) { return 0.0f; }
|
||||
|
||||
ScreenSizeCalculator::ScreenSizeCalculator(Options *, int, int, int) {}
|
||||
int ScreenSizeCalculator::getWidth() { return 800; }
|
||||
int ScreenSizeCalculator::getHeight() { return 600; }
|
||||
|
||||
Timer::Timer(float) {}
|
||||
void Timer::advanceTime() {}
|
||||
void Timer::advanceTimeQuickly() {}
|
||||
void Timer::skipTime() {}
|
||||
|
||||
LevelRenderer::LevelRenderer(Minecraft *, Textures *) {}
|
||||
void LevelRenderer::setLevel(int, MultiPlayerLevel *) {}
|
||||
void LevelRenderer::allChanged() {}
|
||||
void LevelRenderer::allChanged(int) {}
|
||||
void LevelRenderer::tick() {}
|
||||
void LevelRenderer::clear() {}
|
||||
int LevelRenderer::render(shared_ptr<Mob>, int, double, bool) { return 0; }
|
||||
void LevelRenderer::renderEntities(Vec3 *, Culler *, float) {}
|
||||
void LevelRenderer::renderSky(float) {}
|
||||
void LevelRenderer::renderClouds(float) {}
|
||||
bool LevelRenderer::updateDirtyChunks() { return false; }
|
||||
void LevelRenderer::renderHit(shared_ptr<Player>, HitResult *, int, shared_ptr<ItemInstance>, float) {}
|
||||
void LevelRenderer::renderDestroyAnimation(Tesselator *, shared_ptr<Player>, float) {}
|
||||
void LevelRenderer::renderHitOutline(shared_ptr<Player>, HitResult *, int, shared_ptr<ItemInstance>, float) {}
|
||||
wstring LevelRenderer::gatherStats1() { return L""; }
|
||||
wstring LevelRenderer::gatherStats2() { return L""; }
|
||||
void LevelRenderer::setDirty(int, int, int, int, int, int, Level *) {}
|
||||
void LevelRenderer::tileChanged(int, int, int) {}
|
||||
void LevelRenderer::tileLightChanged(int, int, int) {}
|
||||
void LevelRenderer::setTilesDirty(int, int, int, int, int, int, Level *) {}
|
||||
void LevelRenderer::cull(Culler *, float) {}
|
||||
void LevelRenderer::playStreamingMusic(const wstring &, int, int, int) {}
|
||||
void LevelRenderer::playSound(int, double, double, double, float, float, float) {}
|
||||
void LevelRenderer::playSound(shared_ptr<Entity>, int, double, double, double, float, float, float) {}
|
||||
void LevelRenderer::addParticle(ePARTICLE_TYPE, double, double, double, double, double, double) {}
|
||||
shared_ptr<Particle> LevelRenderer::addParticleInternal(ePARTICLE_TYPE, double, double, double, double, double, double) { return nullptr; }
|
||||
void LevelRenderer::entityAdded(shared_ptr<Entity>) {}
|
||||
void LevelRenderer::entityRemoved(shared_ptr<Entity>) {}
|
||||
void LevelRenderer::skyColorChanged() {}
|
||||
void LevelRenderer::levelEvent(shared_ptr<Player>, int, int, int, int, int) {}
|
||||
void LevelRenderer::destroyTileProgress(int, int, int, int, int) {}
|
||||
void LevelRenderer::registerTextures(IconRegister *) {}
|
||||
void LevelRenderer::render(AABB *) {}
|
||||
int LevelRenderer::activePlayers() { return 0; }
|
||||
void LevelRenderer::renderSameAsLast(int, double) {}
|
||||
void LevelRenderer::renderHaloRing(float) {}
|
||||
bool LevelRenderer::isInCloud(double, double, double, float) { return false; }
|
||||
void LevelRenderer::renderAdvancedClouds(float) {}
|
||||
void LevelRenderer::AddDLCSkinsToMemTextures() {}
|
||||
void LevelRenderer::fullyFlagRenderableTileEntitiesToBeRemoved() {}
|
||||
|
||||
int LevelRenderer::getDimensionIndexFromId(int id) { return (3 - id) % 3; }
|
||||
|
||||
int LevelRenderer::getGlobalIndexForChunk(int x, int y, int z, Level *level) {
|
||||
return getGlobalIndexForChunk(x, y, z, level->dimension->id);
|
||||
}
|
||||
int LevelRenderer::getGlobalIndexForChunk(int x, int y, int z, int dimensionId) {
|
||||
int dimIdx = getDimensionIndexFromId(dimensionId);
|
||||
int xx = (x / CHUNK_XZSIZE) + (MAX_LEVEL_RENDER_SIZE[dimIdx] / 2);
|
||||
int yy = y / CHUNK_SIZE;
|
||||
int zz = (z / CHUNK_XZSIZE) + (MAX_LEVEL_RENDER_SIZE[dimIdx] / 2);
|
||||
if ((xx < 0) || (xx >= MAX_LEVEL_RENDER_SIZE[dimIdx])) return -1;
|
||||
if ((zz < 0) || (zz >= MAX_LEVEL_RENDER_SIZE[dimIdx])) return -1;
|
||||
if ((yy < 0) || (yy >= CHUNK_Y_COUNT)) return -1;
|
||||
int offset = DIMENSION_OFFSETS[dimIdx];
|
||||
offset += (zz * MAX_LEVEL_RENDER_SIZE[dimIdx] + xx) * CHUNK_Y_COUNT;
|
||||
offset += yy;
|
||||
return offset;
|
||||
}
|
||||
bool LevelRenderer::isGlobalIndexInSameDimension(int idx, Level *level) {
|
||||
int dim = getDimensionIndexFromId(level->dimension->id);
|
||||
int idxDim = 0;
|
||||
if (idx >= DIMENSION_OFFSETS[2]) idxDim = 2;
|
||||
else if (idx >= DIMENSION_OFFSETS[1]) idxDim = 1;
|
||||
return (dim == idxDim);
|
||||
}
|
||||
int LevelRenderer::getGlobalChunkCount() {
|
||||
return (MAX_LEVEL_RENDER_SIZE[0] * MAX_LEVEL_RENDER_SIZE[0] * CHUNK_Y_COUNT) +
|
||||
(MAX_LEVEL_RENDER_SIZE[1] * MAX_LEVEL_RENDER_SIZE[1] * CHUNK_Y_COUNT) +
|
||||
(MAX_LEVEL_RENDER_SIZE[2] * MAX_LEVEL_RENDER_SIZE[2] * CHUNK_Y_COUNT);
|
||||
}
|
||||
int LevelRenderer::getGlobalChunkCountForOverworld() {
|
||||
return (MAX_LEVEL_RENDER_SIZE[0] * MAX_LEVEL_RENDER_SIZE[0] * CHUNK_Y_COUNT);
|
||||
}
|
||||
bool LevelRenderer::getGlobalChunkFlag(int, int, int, Level *, unsigned char, unsigned char) { return false; }
|
||||
void LevelRenderer::setGlobalChunkFlag(int, int, int, Level *, unsigned char, unsigned char) {}
|
||||
void LevelRenderer::setGlobalChunkFlag(int, unsigned char, unsigned char) {}
|
||||
void LevelRenderer::clearGlobalChunkFlag(int, int, int, Level *, unsigned char, unsigned char) {}
|
||||
|
||||
LevelRenderer::DestroyedTileManager::DestroyedTileManager() {}
|
||||
LevelRenderer::DestroyedTileManager::~DestroyedTileManager() {}
|
||||
void LevelRenderer::DestroyedTileManager::destroyingTileAt(Level *, int, int, int) {}
|
||||
void LevelRenderer::DestroyedTileManager::updatedChunkAt(Level *, int, int, int, int) {}
|
||||
void LevelRenderer::DestroyedTileManager::addAABBs(Level *, AABB *, AABBList *) {}
|
||||
void LevelRenderer::DestroyedTileManager::tick() {}
|
||||
|
||||
ParticleEngine::ParticleEngine(Level *, Textures *) {}
|
||||
ParticleEngine::~ParticleEngine() {}
|
||||
void ParticleEngine::add(shared_ptr<Particle>) {}
|
||||
void ParticleEngine::tick() {}
|
||||
void ParticleEngine::render(shared_ptr<Entity>, float) {}
|
||||
void ParticleEngine::renderLit(shared_ptr<Entity>, float) {}
|
||||
void ParticleEngine::setLevel(Level *) {}
|
||||
void ParticleEngine::destroy(int, int, int, int, int) {}
|
||||
void ParticleEngine::crack(int, int, int, int) {}
|
||||
wstring ParticleEngine::countParticles() { return L"0"; }
|
||||
|
||||
void GameRenderer::tick(bool) {}
|
||||
void GameRenderer::pick(float) {}
|
||||
void GameRenderer::render(float, bool) {}
|
||||
void GameRenderer::AddForDelete(SparseLightStorage *) {}
|
||||
void GameRenderer::AddForDelete(CompressedTileStorage *) {}
|
||||
void GameRenderer::AddForDelete(SparseDataStorage *) {}
|
||||
void GameRenderer::FinishedReassigning() {}
|
||||
|
||||
Tesselator *Tesselator::getInstance()
|
||||
{
|
||||
static char buffer[4096] = {};
|
||||
return reinterpret_cast<Tesselator *>(buffer);
|
||||
}
|
||||
void Tesselator::CreateNewThreadStorage(int) {}
|
||||
void Tesselator::end() {}
|
||||
void Tesselator::begin() {}
|
||||
void Tesselator::begin(int) {}
|
||||
void Tesselator::useCompactVertices(bool) {}
|
||||
bool Tesselator::getCompactVertices() { return false; }
|
||||
void Tesselator::useProjectedTexture(bool) {}
|
||||
void Tesselator::tex(float, float) {}
|
||||
void Tesselator::tex2(int) {}
|
||||
void Tesselator::color(float, float, float) {}
|
||||
void Tesselator::color(float, float, float, float) {}
|
||||
void Tesselator::color(int, int, int) {}
|
||||
void Tesselator::color(int, int, int, int) {}
|
||||
void Tesselator::color(byte, byte, byte) {}
|
||||
void Tesselator::vertexUV(float, float, float, float, float) {}
|
||||
void Tesselator::vertex(float, float, float) {}
|
||||
void Tesselator::color(int) {}
|
||||
void Tesselator::color(int, int) {}
|
||||
void Tesselator::noColor() {}
|
||||
void Tesselator::normal(float, float, float) {}
|
||||
void Tesselator::offset(float, float, float) {}
|
||||
void Tesselator::addOffset(float, float, float) {}
|
||||
bool Tesselator::setMipmapEnable(bool) { return false; }
|
||||
bool Tesselator::hasMaxVertices() { return false; }
|
||||
|
||||
HumanoidModel::HumanoidModel() {}
|
||||
HumanoidModel::HumanoidModel(float) {}
|
||||
HumanoidModel::HumanoidModel(float, float, int, int) {}
|
||||
|
||||
ItemInHandRenderer::ItemInHandRenderer(Minecraft *, bool) {}
|
||||
void ItemInHandRenderer::itemPlaced() {}
|
||||
void ItemInHandRenderer::itemUsed() {}
|
||||
void ItemInHandRenderer::render(float) {}
|
||||
void ItemInHandRenderer::tick() {}
|
||||
|
||||
void EntityRenderDispatcher::staticCtor() {}
|
||||
EntityRenderer *EntityRenderDispatcher::getRenderer(eINSTANCEOF) { return NULL; }
|
||||
EntityRenderer *EntityRenderDispatcher::getRenderer(shared_ptr<Entity>) { return NULL; }
|
||||
void EntityRenderDispatcher::prepare(Level *, Textures *, Font *, shared_ptr<Mob>, Options *, float) {}
|
||||
void EntityRenderDispatcher::render(shared_ptr<Entity>, float) {}
|
||||
void EntityRenderDispatcher::render(shared_ptr<Entity>, double, double, double, float, float, bool, bool) {}
|
||||
void EntityRenderDispatcher::setLevel(Level *) {}
|
||||
double EntityRenderDispatcher::distanceToSqr(double, double, double) { return 0; }
|
||||
Font *EntityRenderDispatcher::getFont() { return NULL; }
|
||||
void EntityRenderDispatcher::registerTerrainTextures(IconRegister *) {}
|
||||
|
||||
void TileEntityRenderDispatcher::staticCtor() {}
|
||||
TileEntityRenderer *TileEntityRenderDispatcher::getRenderer(eINSTANCEOF) { return NULL; }
|
||||
bool TileEntityRenderDispatcher::hasRenderer(shared_ptr<TileEntity>) { return false; }
|
||||
TileEntityRenderer *TileEntityRenderDispatcher::getRenderer(shared_ptr<TileEntity>) { return NULL; }
|
||||
void TileEntityRenderDispatcher::prepare(Level *, Textures *, Font *, shared_ptr<Mob>, float) {}
|
||||
void TileEntityRenderDispatcher::render(shared_ptr<TileEntity>, float, bool) {}
|
||||
void TileEntityRenderDispatcher::render(shared_ptr<TileEntity>, double, double, double, float, bool, float, bool) {}
|
||||
void TileEntityRenderDispatcher::setLevel(Level *) {}
|
||||
double TileEntityRenderDispatcher::distanceToSqr(double, double, double) { return 0; }
|
||||
Font *TileEntityRenderDispatcher::getFont() { return NULL; }
|
||||
|
||||
GuiParticles::GuiParticles(Minecraft *) {}
|
||||
void GuiParticles::tick() {}
|
||||
void GuiParticles::render(float) {}
|
||||
|
||||
TitleScreen::TitleScreen() {}
|
||||
|
||||
AchievementPopup::AchievementPopup(Minecraft *) {}
|
||||
void AchievementPopup::render() {}
|
||||
|
||||
Input::Input() : xa(0), ya(0), wasJumping(false), jumping(false), sneaking(false), sprinting(false) {}
|
||||
void Input::tick(LocalPlayer *) {}
|
||||
|
||||
void TextureManager::createInstance() {}
|
||||
TextureManager *TextureManager::getInstance() { return NULL; }
|
||||
|
||||
void Lighting::turnOff() {}
|
||||
void Lighting::turnOn() {}
|
||||
void Lighting::turnOnGui() {}
|
||||
|
||||
TexturePackRepository::TexturePackRepository(File, Minecraft *) {}
|
||||
void TexturePackRepository::addDebugPacks() {}
|
||||
TexturePack *TexturePackRepository::getSelected() { return NULL; }
|
||||
bool TexturePackRepository::selectTexturePackById(DWORD) { return false; }
|
||||
TexturePack *TexturePackRepository::addTexturePackFromDLC(DLCPack *, DWORD) { return NULL; }
|
||||
void TexturePackRepository::updateUI() {}
|
||||
bool TexturePackRepository::needsUIUpdate() { return false; }
|
||||
unsigned int TexturePackRepository::getTexturePackCount() { return 0; }
|
||||
TexturePack *TexturePackRepository::getTexturePackByIndex(unsigned int) { return NULL; }
|
||||
unsigned int TexturePackRepository::getTexturePackIndex(unsigned int) { return 0; }
|
||||
TexturePack *TexturePackRepository::getTexturePackById(DWORD) { return NULL; }
|
||||
void TexturePackRepository::clearInvalidTexturePacks() {}
|
||||
void TexturePackRepository::updateList() {}
|
||||
vector<TexturePack *> *TexturePackRepository::getAll() { return NULL; }
|
||||
bool TexturePackRepository::selectSkin(TexturePack *) { return false; }
|
||||
|
||||
ArchiveFile::ArchiveFile(File) {}
|
||||
ArchiveFile::~ArchiveFile() {}
|
||||
bool ArchiveFile::hasFile(const wstring &) { return false; }
|
||||
int ArchiveFile::getFileSize(const wstring &) { return 0; }
|
||||
byteArray ArchiveFile::getFile(const wstring &) { return byteArray(); }
|
||||
vector<wstring> *ArchiveFile::getFileList() { return NULL; }
|
||||
|
||||
KeyMapping::KeyMapping(const wstring &, int) {}
|
||||
|
||||
GameMode::GameMode(Minecraft *mc) : minecraft(mc), instaBuild(false) {}
|
||||
void GameMode::initLevel(Level *) {}
|
||||
bool GameMode::destroyBlock(int, int, int, int) { return false; }
|
||||
void GameMode::render(float) {}
|
||||
void GameMode::initPlayer(shared_ptr<Player>) {}
|
||||
void GameMode::tick() {}
|
||||
void GameMode::adjustPlayer(shared_ptr<Player>) {}
|
||||
bool GameMode::useItem(shared_ptr<Player>, Level *, shared_ptr<ItemInstance>, bool) { return false; }
|
||||
shared_ptr<Player> GameMode::createPlayer(Level *) { return nullptr; }
|
||||
bool GameMode::interact(shared_ptr<Player>, shared_ptr<Entity>) { return false; }
|
||||
void GameMode::attack(shared_ptr<Player>, shared_ptr<Entity>) {}
|
||||
shared_ptr<ItemInstance> GameMode::handleInventoryMouseClick(int, int, int, bool, shared_ptr<Player>) { return nullptr; }
|
||||
void GameMode::handleCloseInventory(int, shared_ptr<Player>) {}
|
||||
void GameMode::handleInventoryButtonClick(int, int) {}
|
||||
bool GameMode::isCutScene() { return false; }
|
||||
void GameMode::releaseUsingItem(shared_ptr<Player>) {}
|
||||
bool GameMode::hasExperience() { return false; }
|
||||
bool GameMode::hasMissTime() { return false; }
|
||||
bool GameMode::hasInfiniteItems() { return false; }
|
||||
bool GameMode::hasFarPickRange() { return false; }
|
||||
void GameMode::handleCreativeModeItemAdd(shared_ptr<ItemInstance>, int) {}
|
||||
void GameMode::handleCreativeModeItemDrop(shared_ptr<ItemInstance>) {}
|
||||
bool GameMode::handleCraftItem(int, shared_ptr<Player>) { return false; }
|
||||
void GameMode::handleDebugOptions(unsigned int, shared_ptr<Player>) {}
|
||||
|
||||
BufferedImage::BufferedImage(int, int, int) { memset(data, 0, sizeof(data)); width = 0; height = 0; }
|
||||
BufferedImage::BufferedImage(const wstring &, bool, bool, const wstring &) { memset(data, 0, sizeof(data)); width = 0; height = 0; }
|
||||
BufferedImage::BufferedImage(DLCPack *, const wstring &, bool) { memset(data, 0, sizeof(data)); width = 0; height = 0; }
|
||||
BufferedImage::BufferedImage(BYTE *, DWORD) { memset(data, 0, sizeof(data)); width = 0; height = 0; }
|
||||
BufferedImage::~BufferedImage() {}
|
||||
int BufferedImage::getWidth() { return width; }
|
||||
int BufferedImage::getHeight() { return height; }
|
||||
void BufferedImage::getRGB(int, int, int, int, intArray, int, int, int) {}
|
||||
int *BufferedImage::getData() { return NULL; }
|
||||
int *BufferedImage::getData(int) { return NULL; }
|
||||
Graphics *BufferedImage::getGraphics() { return NULL; }
|
||||
int BufferedImage::getTransparency() { return 0; }
|
||||
BufferedImage *BufferedImage::getSubimage(int, int, int, int) { return NULL; }
|
||||
void BufferedImage::preMultiplyAlpha() {}
|
||||
|
||||
void Windows64_UpdateGamma(unsigned short) {}
|
||||
|
||||
__int64 UIController::iggyAllocCount = 0;
|
||||
CRITICAL_SECTION UIController::ms_reloadSkinCS;
|
||||
bool UIController::ms_bReloadSkinCSInitialised = false;
|
||||
DWORD UIController::m_dwTrialTimerLimitSecs = 0;
|
||||
|
||||
UIController::UIController()
|
||||
{
|
||||
m_uiDebugConsole = NULL;
|
||||
m_uiDebugMarketingGuide = NULL;
|
||||
memset(&m_navigationLock, 0, sizeof(m_navigationLock));
|
||||
memset(m_actionRepeatTimer, 0, sizeof(m_actionRepeatTimer));
|
||||
m_fScreenWidth = 0;
|
||||
m_fScreenHeight = 0;
|
||||
m_bScreenWidthSetup = false;
|
||||
m_tileOriginX = 0;
|
||||
m_tileOriginY = 0;
|
||||
m_mcBitmapFont = NULL;
|
||||
m_mcTTFFont = NULL;
|
||||
m_moj7 = NULL;
|
||||
m_moj11 = NULL;
|
||||
gdraw_funcs = NULL;
|
||||
iggy_explorer = NULL;
|
||||
iggy_perfmon = NULL;
|
||||
m_iggyPerfmonEnabled = false;
|
||||
memset(m_bMenuDisplayed, 0, sizeof(m_bMenuDisplayed));
|
||||
memset(m_bMenuToBeClosed, 0, sizeof(m_bMenuToBeClosed));
|
||||
memset(m_iCountDown, 0, sizeof(m_iCountDown));
|
||||
memset(m_bCloseAllScenes, 0, sizeof(m_bCloseAllScenes));
|
||||
m_iPressStartQuadrantsMask = 0;
|
||||
m_bCustomRenderPosition = false;
|
||||
m_winUserIndex = 0;
|
||||
m_bSystemUIShowing = false;
|
||||
m_reloadSkinThread = NULL;
|
||||
m_navigateToHomeOnReload = false;
|
||||
m_accumulatedTicks = 0;
|
||||
memset(&m_customRenderingClearRect, 0, sizeof(m_customRenderingClearRect));
|
||||
memset(&m_registeredCallbackScenesCS, 0, sizeof(m_registeredCallbackScenesCS));
|
||||
for (int i = 0; i < eUIGroup_COUNT; i++) m_groups[i] = NULL;
|
||||
memset(&m_Allocatorlock, 0, sizeof(m_Allocatorlock));
|
||||
m_defaultBuffer = NULL;
|
||||
m_tempBuffer = NULL;
|
||||
}
|
||||
|
||||
void UIController::tick() {}
|
||||
void UIController::StartReloadSkinThread() {}
|
||||
bool UIController::IsReloadingSkin() { return false; }
|
||||
bool UIController::IsExpectingOrReloadingSkin() { return false; }
|
||||
void UIController::CleanUpSkinReload() {}
|
||||
bool UIController::NavigateToScene(int, EUIScene, void *, EUILayer, EUIGroup) { return false; }
|
||||
bool UIController::NavigateBack(int, bool, EUIScene, EUILayer) { return false; }
|
||||
void UIController::NavigateToHomeMenu() {}
|
||||
UIScene *UIController::GetTopScene(int, EUILayer, EUIGroup) { return NULL; }
|
||||
void UIController::CloseUIScenes(int, bool) {}
|
||||
void UIController::CloseAllPlayersScenes() {}
|
||||
bool UIController::IsPauseMenuDisplayed(int) { return false; }
|
||||
bool UIController::IsContainerMenuDisplayed(int) { return false; }
|
||||
bool UIController::IsIgnorePlayerJoinMenuDisplayed(int) { return false; }
|
||||
bool UIController::IsIgnoreAutosaveMenuDisplayed(int) { return false; }
|
||||
void UIController::SetIgnoreAutosaveMenuDisplayed(int, bool) {}
|
||||
bool UIController::IsSceneInStack(int, EUIScene) { return false; }
|
||||
void UIController::CheckMenuDisplayed() {}
|
||||
void UIController::AnimateKeyPress(int, int, bool, bool, bool) {}
|
||||
void UIController::OverrideSFX(int, int, bool) {}
|
||||
void UIController::SetTooltipText(unsigned int, unsigned int, int) {}
|
||||
void UIController::SetEnableTooltips(unsigned int, BOOL) {}
|
||||
void UIController::ShowTooltip(unsigned int, unsigned int, bool) {}
|
||||
void UIController::SetTooltips(unsigned int, int, int, int, int, int, int, int, int, int, bool) {}
|
||||
void UIController::EnableTooltip(unsigned int, unsigned int, bool) {}
|
||||
void UIController::RefreshTooltips(unsigned int) {}
|
||||
void UIController::PlayUISFX(ESoundEffect) {}
|
||||
void UIController::DisplayGamertag(unsigned int, bool) {}
|
||||
void UIController::SetSelectedItem(unsigned int, const wstring &) {}
|
||||
void UIController::UpdateSelectedItemPos(unsigned int) {}
|
||||
void UIController::HandleDLCMountingComplete() {}
|
||||
void UIController::HandleDLCInstalled(int) {}
|
||||
void UIController::HandleTMSDLCFileRetrieved(int) {}
|
||||
void UIController::HandleTMSBanFileRetrieved(int) {}
|
||||
void UIController::HandleInventoryUpdated(int) {}
|
||||
void UIController::HandleGameTick() {}
|
||||
void UIController::SetTutorial(int, Tutorial *) {}
|
||||
void UIController::SetTutorialDescription(int, TutorialPopupInfo *) {}
|
||||
void UIController::RemoveInteractSceneReference(int, UIScene *) {}
|
||||
void UIController::SetTutorialVisible(int, bool) {}
|
||||
bool UIController::IsTutorialVisible(int) { return false; }
|
||||
void UIController::UpdatePlayerBasePositions() {}
|
||||
void UIController::SetEmptyQuadrantLogo(int) {}
|
||||
void UIController::HideAllGameUIElements() {}
|
||||
void UIController::ShowOtherPlayersBaseScene(unsigned int, bool) {}
|
||||
void UIController::ShowTrialTimer(bool) {}
|
||||
void UIController::SetTrialTimerLimitSecs(unsigned int) {}
|
||||
void UIController::UpdateTrialTimer(unsigned int) {}
|
||||
void UIController::ReduceTrialTimerValue() {}
|
||||
void UIController::ShowAutosaveCountdownTimer(bool) {}
|
||||
void UIController::UpdateAutosaveCountdownTimer(unsigned int) {}
|
||||
void UIController::ShowSavingMessage(unsigned int, C4JStorage::ESavingMessage) {}
|
||||
void UIController::ShowPlayerDisplayname(bool) {}
|
||||
bool UIController::PressStartPlaying(unsigned int) { return false; }
|
||||
void UIController::ShowPressStart(unsigned int) {}
|
||||
void UIController::HidePressStart() {}
|
||||
void UIController::ClearPressStart() {}
|
||||
void UIController::SetWinUserIndex(unsigned int) {}
|
||||
unsigned int UIController::GetWinUserIndex() { return 0; }
|
||||
bool UIController::GetMenuDisplayed(int) { return false; }
|
||||
void UIController::SetMenuDisplayed(int, bool) {}
|
||||
void UIController::SetupFont() {}
|
||||
void UIController::ReloadSkin() {}
|
||||
byteArray UIController::getMovieData(const wstring &) { return byteArray(); }
|
||||
void UIController::getRenderDimensions(C4JRender::eViewportType, S32 &, S32 &) {}
|
||||
void UIController::setupRenderPosition(C4JRender::eViewportType) {}
|
||||
void UIController::setupRenderPosition(S32, S32) {}
|
||||
void UIController::SetSysUIShowing(bool) {}
|
||||
void UIController::SetSystemUIShowing(LPVOID, bool) {}
|
||||
void UIController::setupCustomDrawGameState() {}
|
||||
void UIController::endCustomDrawGameState() {}
|
||||
void UIController::setupCustomDrawMatrices(UIScene *, CustomDrawData *) {}
|
||||
void UIController::setupCustomDrawGameStateAndMatrices(UIScene *, CustomDrawData *) {}
|
||||
void UIController::endCustomDrawMatrices() {}
|
||||
void UIController::endCustomDrawGameStateAndMatrices() {}
|
||||
void UIController::registerSubstitutionTexture(const wstring &, PBYTE, DWORD) {}
|
||||
void UIController::unregisterSubstitutionTexture(const wstring &, bool) {}
|
||||
size_t UIController::RegisterForCallbackId(UIScene *) { return 0; }
|
||||
void UIController::UnregisterCallbackId(size_t) {}
|
||||
UIScene *UIController::GetSceneFromCallbackId(size_t) { return NULL; }
|
||||
void UIController::EnterCallbackIdCriticalSection() {}
|
||||
void UIController::LeaveCallbackIdCriticalSection() {}
|
||||
#ifndef __PS3__
|
||||
C4JStorage::EMessageResult UIController::RequestMessageBox(UINT, UINT, UINT *, UINT, DWORD, int (*)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID, C4JStringTable *, WCHAR *, DWORD, bool) { return (C4JStorage::EMessageResult)0; }
|
||||
#endif
|
||||
C4JStorage::EMessageResult UIController::RequestUGCMessageBox(UINT, UINT, int, int (*)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID) { return (C4JStorage::EMessageResult)0; }
|
||||
C4JStorage::EMessageResult UIController::RequestContentRestrictedMessageBox(UINT, UINT, int, int (*)(LPVOID, int, const C4JStorage::EMessageResult), LPVOID) { return (C4JStorage::EMessageResult)0; }
|
||||
void UIController::ShowUIDebugConsole(bool) {}
|
||||
void UIController::ShowUIDebugMarketingGuide(bool) {}
|
||||
void UIController::logDebugString(const string &) {}
|
||||
UIScene *UIController::FindScene(EUIScene) { return NULL; }
|
||||
void UIController::setFontCachingCalculationBuffer(int) {}
|
||||
|
||||
void UIController::preInit(S32, S32) {}
|
||||
void UIController::postInit() {}
|
||||
void UIController::renderScenes() {}
|
||||
|
||||
void ConsoleUIController::init(ID3D11Device *, ID3D11DeviceContext *, ID3D11RenderTargetView *, ID3D11DepthStencilView *, S32, S32) {}
|
||||
void ConsoleUIController::render() {}
|
||||
void ConsoleUIController::beginIggyCustomDraw4J(IggyCustomDrawCallbackRegion *, CustomDrawData *) {}
|
||||
CustomDrawData *ConsoleUIController::setupCustomDraw(UIScene *, IggyCustomDrawCallbackRegion *) { return NULL; }
|
||||
CustomDrawData *ConsoleUIController::calculateCustomDraw(IggyCustomDrawCallbackRegion *) { return NULL; }
|
||||
void ConsoleUIController::endCustomDraw(IggyCustomDrawCallbackRegion *) {}
|
||||
void ConsoleUIController::setTileOrigin(S32, S32) {}
|
||||
GDrawTexture *ConsoleUIController::getSubstitutionTexture(int) { return NULL; }
|
||||
void ConsoleUIController::destroySubstitutionTexture(void *, GDrawTexture *) {}
|
||||
void ConsoleUIController::shutdown() {}
|
||||
|
||||
ConsoleUIController ui;
|
||||
|
||||
TileRenderer::TileRenderer() : setColor(true) {}
|
||||
TileRenderer::TileRenderer(LevelSource *) : setColor(true) {}
|
||||
TileRenderer::~TileRenderer() {}
|
||||
|
||||
Chunk::Chunk() {}
|
||||
Chunk::~Chunk() {}
|
||||
|
||||
GuiComponent::GuiComponent() : blitOffset(0) {}
|
||||
void GuiComponent::hLine(int, int, int, int) {}
|
||||
void GuiComponent::vLine(int, int, int, int) {}
|
||||
void GuiComponent::fill(int, int, int, int, int) {}
|
||||
void GuiComponent::fillGradient(int, int, int, int, int, int) {}
|
||||
void GuiComponent::drawCenteredString(Font *, const wstring &, int, int, int) {}
|
||||
void GuiComponent::drawString(Font *, const wstring &, int, int, int) {}
|
||||
void GuiComponent::blit(int, int, int, int, int, int) {}
|
||||
|
||||
Screen::Screen() {}
|
||||
void Screen::render(int, int, float) {}
|
||||
void Screen::keyPressed(wchar_t, int) {}
|
||||
void Screen::mouseClicked(int, int, int) {}
|
||||
void Screen::mouseReleased(int, int, int) {}
|
||||
void Screen::buttonClicked(Button *) {}
|
||||
void Screen::init(Minecraft *, int, int) {}
|
||||
void Screen::setSize(int, int) {}
|
||||
void Screen::init() {}
|
||||
void Screen::updateEvents() {}
|
||||
void Screen::mouseEvent() {}
|
||||
void Screen::keyboardEvent() {}
|
||||
void Screen::tick() {}
|
||||
void Screen::removed() {}
|
||||
void Screen::renderBackground() {}
|
||||
void Screen::renderBackground(int) {}
|
||||
void Screen::renderDirtBackground(int) {}
|
||||
bool Screen::isPauseScreen() { return false; }
|
||||
void Screen::confirmResult(bool, int) {}
|
||||
void Screen::tabPressed() {}
|
||||
wstring Screen::getClipboard() { return L""; }
|
||||
void Screen::setClipboard(const wstring &) {}
|
||||
|
||||
Model::Model() : attackTime(0), riding(false), young(false), texWidth(64), texHeight(32), yHeadOffs(0), zHeadOffs(0) {}
|
||||
OffsettedRenderList::OffsettedRenderList() : x(0), y(0), z(0), xOff(0), yOff(0), zOff(0), lists(NULL), inited(false), rendered(false) {}
|
||||
|
||||
void HumanoidModel::render(shared_ptr<Entity>, float, float, float, float, float, float, bool) {}
|
||||
void HumanoidModel::setupAnim(float, float, float, float, float, float, unsigned int) {}
|
||||
ModelPart *HumanoidModel::AddOrRetrievePart(SKIN_BOX *) { return NULL; }
|
||||
|
||||
void TitleScreen::tick() {}
|
||||
void TitleScreen::keyPressed(wchar_t, int) {}
|
||||
void TitleScreen::init() {}
|
||||
void TitleScreen::buttonClicked(Button *) {}
|
||||
void TitleScreen::render(int, int, float) {}
|
||||
|
||||
SoundEngine::SoundEngine() {}
|
||||
void SoundEngine::SetStreamingSounds(int, int, int, int, int, int, int) {}
|
||||
void SoundEngine::destroy() {}
|
||||
void SoundEngine::play(int, float, float, float, float, float) {}
|
||||
void SoundEngine::playStreaming(const wstring &, float, float, float, float, float, bool) {}
|
||||
void SoundEngine::playUI(int, float, float) {}
|
||||
void SoundEngine::playMusicTick() {}
|
||||
void SoundEngine::updateMusicVolume(float) {}
|
||||
void SoundEngine::updateSystemMusicPlaying(bool) {}
|
||||
void SoundEngine::updateSoundEffectVolume(float) {}
|
||||
void SoundEngine::init(Options *) {}
|
||||
void SoundEngine::tick(shared_ptr<Mob> *, float) {}
|
||||
void SoundEngine::add(const wstring &, File *) {}
|
||||
void SoundEngine::addMusic(const wstring &, File *) {}
|
||||
void SoundEngine::addStreaming(const wstring &, File *) {}
|
||||
char *SoundEngine::ConvertSoundPathToName(const wstring &, bool) { return NULL; }
|
||||
|
||||
bool ConsoleSoundEngine::GetIsPlayingStreamingCDMusic() { return false; }
|
||||
bool ConsoleSoundEngine::GetIsPlayingStreamingGameMusic() { return false; }
|
||||
void ConsoleSoundEngine::SetIsPlayingStreamingCDMusic(bool) {}
|
||||
void ConsoleSoundEngine::SetIsPlayingStreamingGameMusic(bool) {}
|
||||
bool ConsoleSoundEngine::GetIsPlayingEndMusic() { return false; }
|
||||
bool ConsoleSoundEngine::GetIsPlayingNetherMusic() { return false; }
|
||||
void ConsoleSoundEngine::SetIsPlayingEndMusic(bool) {}
|
||||
void ConsoleSoundEngine::SetIsPlayingNetherMusic(bool) {}
|
||||
|
||||
void LevelRenderer::staticCtor() {}
|
||||
void IUIScene_CreativeMenu::staticCtor() {}
|
||||
vector< shared_ptr<ItemInstance> > IUIScene_CreativeMenu::categoryGroups[IUIScene_CreativeMenu::eCreativeInventoryGroupsCount];
|
||||
IUIScene_CreativeMenu::TabSpec **IUIScene_CreativeMenu::specs = NULL;
|
||||
|
||||
unsigned short SFontData::Codepoints[SFontData::FONTSIZE] = {};
|
||||
SFontData SFontData::Mojangles_7 = {};
|
||||
SFontData SFontData::Mojangles_11 = {};
|
||||
|
||||
int IUIScene_PauseMenu::SaveWorldThreadProc(void *) { return 0; }
|
||||
int IUIScene_PauseMenu::ExitWorldThreadProc(void *) { return 0; }
|
||||
void IUIScene_PauseMenu::_ExitWorld(LPVOID) {}
|
||||
shared_ptr<Merchant> IUIScene_TradingMenu::getMerchant() { return shared_ptr<Merchant>(); }
|
||||
bool IUIScene_CraftingMenu::isItemSelected(int) { return false; }
|
||||
|
||||
void UIScene_FullscreenProgress::SetWasCancelled(bool) {}
|
||||
|
||||
double Particle::xOff = 0;
|
||||
double Particle::yOff = 0;
|
||||
double Particle::zOff = 0;
|
||||
|
||||
void Particle::_init(Level *level, double x, double y, double z) {}
|
||||
Particle::Particle(Level *level, double x, double y, double z) : Entity(level) {}
|
||||
Particle::Particle(Level *level, double x, double y, double z, double xa, double ya, double za) : Entity(level) {}
|
||||
shared_ptr<Particle> Particle::setPower(float) { return shared_ptr<Particle>(); }
|
||||
shared_ptr<Particle> Particle::scale(float) { return shared_ptr<Particle>(); }
|
||||
void Particle::setColor(float, float, float) {}
|
||||
void Particle::setAlpha(float) {}
|
||||
float Particle::getRedCol() { return 0; }
|
||||
float Particle::getGreenCol() { return 0; }
|
||||
float Particle::getBlueCol() { return 0; }
|
||||
float Particle::getAlpha() { return 0; }
|
||||
bool Particle::makeStepSound() { return false; }
|
||||
void Particle::defineSynchedData() {}
|
||||
void Particle::tick() {}
|
||||
void Particle::render(Tesselator *, float, float, float, float, float, float) {}
|
||||
int Particle::getParticleTexture() { return 0; }
|
||||
void Particle::addAdditonalSaveData(CompoundTag *) {}
|
||||
void Particle::readAdditionalSaveData(CompoundTag *) {}
|
||||
void Particle::setTex(Textures *, Icon *) {}
|
||||
void Particle::setMiscTex(int) {}
|
||||
void Particle::setNextMiscAnimTex() {}
|
||||
bool Particle::isAttackable() { return false; }
|
||||
wstring Particle::toString() { return L""; }
|
||||
|
||||
void CritParticle::_init(Level *, shared_ptr<Entity>, ePARTICLE_TYPE) {}
|
||||
CritParticle::CritParticle(Level *level, shared_ptr<Entity> entity) : Particle(level, 0, 0, 0, 0, 0, 0), life(0), lifeTime(0), particleName(eParticleType_crit) {}
|
||||
CritParticle::CritParticle(Level *level, shared_ptr<Entity> entity, ePARTICLE_TYPE type) : Particle(level, 0, 0, 0, 0, 0, 0), life(0), lifeTime(0), particleName(type) {}
|
||||
void CritParticle::CritParticlePostConstructor() {}
|
||||
void CritParticle::render(Tesselator *, float, float, float, float, float, float) {}
|
||||
void CritParticle::tick() {}
|
||||
int CritParticle::getParticleTexture() { return 0; }
|
||||
|
||||
TakeAnimationParticle::TakeAnimationParticle(Level *level, shared_ptr<Entity> item, shared_ptr<Entity> target, float yOffs) : Particle(level, 0, 0, 0, 0, 0, 0), life(0), lifeTime(0), yOffs(yOffs) {}
|
||||
TakeAnimationParticle::~TakeAnimationParticle() {}
|
||||
void TakeAnimationParticle::render(Tesselator *, float, float, float, float, float, float) {}
|
||||
void TakeAnimationParticle::tick() {}
|
||||
int TakeAnimationParticle::getParticleTexture() { return 0; }
|
||||
|
||||
#ifdef _WIN32
|
||||
void C4JStorage::SetMaxSaves(int) {}
|
||||
C4JStorage::ESaveGameState C4JStorage::GetSaveState() { return C4JStorage::ESaveGame_Idle; }
|
||||
#endif
|
||||
202
Stubs/ServerStubs3.cpp
Normal file
202
Stubs/ServerStubs3.cpp
Normal file
@@ -0,0 +1,202 @@
|
||||
#include "stdafx.h"
|
||||
|
||||
#include "../../Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h"
|
||||
#include "../../Minecraft.Client/Windows64/4JLibs/inc/4J_Storage.h"
|
||||
#include "../../Minecraft.Client/Windows64/Windows64_App.h"
|
||||
#include "../../Minecraft.World/Item.h"
|
||||
#include "../../Minecraft.World/Tile.h"
|
||||
#include "../../Minecraft.Client/DeathScreen.h"
|
||||
#include "../../Minecraft.Client/ErrorScreen.h"
|
||||
#include "../../Minecraft.Client/ChatScreen.h"
|
||||
#include "../../Minecraft.Client/InBedChatScreen.h"
|
||||
#include "../../Minecraft.Client/Common/UI/UIScene.h"
|
||||
|
||||
CConsoleMinecraftApp app;
|
||||
C4JRender RenderManager;
|
||||
|
||||
CConsoleMinecraftApp::CConsoleMinecraftApp() : CMinecraftApp() {}
|
||||
void CConsoleMinecraftApp::SetRichPresenceContext(int, int) {}
|
||||
void CConsoleMinecraftApp::CaptureSaveThumbnail() {}
|
||||
void CConsoleMinecraftApp::GetSaveThumbnail(PBYTE*, DWORD*) {}
|
||||
void CConsoleMinecraftApp::FatalLoadError() {}
|
||||
void CConsoleMinecraftApp::StoreLaunchData() {}
|
||||
void CConsoleMinecraftApp::ExitGame() {}
|
||||
void CConsoleMinecraftApp::ReleaseSaveThumbnail() {}
|
||||
void CConsoleMinecraftApp::GetScreenshot(int, PBYTE*, DWORD*) {}
|
||||
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR*) { return 0; }
|
||||
int CConsoleMinecraftApp::LoadLocalTMSFile(WCHAR*, eFileExtensionType) { return 0; }
|
||||
void CConsoleMinecraftApp::FreeLocalTMSFiles(eTMSFileType) {}
|
||||
int CConsoleMinecraftApp::GetLocalTMSFileIndex(WCHAR*, bool, eFileExtensionType) { return -1; }
|
||||
void CConsoleMinecraftApp::TemporaryCreateGameStart() {}
|
||||
|
||||
void C4JRender::Tick() {}
|
||||
void C4JRender::UpdateGamma(unsigned short) {}
|
||||
void C4JRender::StartFrame() {}
|
||||
bool C4JRender::IsWidescreen() { return false; }
|
||||
bool C4JRender::IsHiDef() { return false; }
|
||||
void C4JRender::Present() {}
|
||||
void C4JRender::CBuffLockStaticCreations() {}
|
||||
void C4JRender::StateSetViewport(eViewportType) {}
|
||||
|
||||
const int Item::apple_Id;
|
||||
const int Item::arrow_Id;
|
||||
const int Item::beef_cooked_Id;
|
||||
const int Item::beef_raw_Id;
|
||||
const int Item::book_Id;
|
||||
const int Item::boots_chain_Id;
|
||||
const int Item::boots_cloth_Id;
|
||||
const int Item::boots_diamond_Id;
|
||||
const int Item::boots_iron_Id;
|
||||
const int Item::bread_Id;
|
||||
const int Item::chestplate_chain_Id;
|
||||
const int Item::chestplate_cloth_Id;
|
||||
const int Item::chestplate_diamond_Id;
|
||||
const int Item::chestplate_iron_Id;
|
||||
const int Item::chicken_cooked_Id;
|
||||
const int Item::chicken_raw_Id;
|
||||
const int Item::clock_Id;
|
||||
const int Item::coal_Id;
|
||||
const int Item::compass_Id;
|
||||
const int Item::cookie_Id;
|
||||
const int Item::diamond_Id;
|
||||
const int Item::enderPearl_Id;
|
||||
const int Item::expBottle_Id;
|
||||
const int Item::eyeOfEnder_Id;
|
||||
const int Item::fish_cooked_Id;
|
||||
const int Item::flintAndSteel_Id;
|
||||
const int Item::goldIngot_Id;
|
||||
const int Item::hatchet_diamond_Id;
|
||||
const int Item::hatchet_iron_Id;
|
||||
const int Item::helmet_chain_Id;
|
||||
const int Item::helmet_cloth_Id;
|
||||
const int Item::helmet_diamond_Id;
|
||||
const int Item::helmet_iron_Id;
|
||||
const int Item::hoe_diamond_Id;
|
||||
const int Item::hoe_iron_Id;
|
||||
const int Item::ironIngot_Id;
|
||||
const int Item::leggings_chain_Id;
|
||||
const int Item::leggings_cloth_Id;
|
||||
const int Item::leggings_diamond_Id;
|
||||
const int Item::leggings_iron_Id;
|
||||
const int Item::melon_Id;
|
||||
const int Item::paper_Id;
|
||||
const int Item::pickAxe_diamond_Id;
|
||||
const int Item::pickAxe_iron_Id;
|
||||
const int Item::porkChop_cooked_Id;
|
||||
const int Item::porkChop_raw_Id;
|
||||
const int Item::redStone_Id;
|
||||
const int Item::rotten_flesh_Id;
|
||||
const int Item::saddle_Id;
|
||||
const int Item::seeds_melon_Id;
|
||||
const int Item::seeds_pumpkin_Id;
|
||||
const int Item::seeds_wheat_Id;
|
||||
const int Item::shears_Id;
|
||||
const int Item::shovel_diamond_Id;
|
||||
const int Item::shovel_iron_Id;
|
||||
const int Item::sword_diamond_Id;
|
||||
const int Item::sword_iron_Id;
|
||||
const int Item::wheat_Id;
|
||||
|
||||
const int Tile::bookshelf_Id;
|
||||
const int Tile::cloth_Id;
|
||||
const int Tile::glass_Id;
|
||||
const int Tile::lightGem_Id;
|
||||
|
||||
|
||||
void DeathScreen::init() {}
|
||||
void DeathScreen::keyPressed(char, int) {}
|
||||
void DeathScreen::buttonClicked(Button*) {}
|
||||
void DeathScreen::render(int, int, float) {}
|
||||
bool DeathScreen::isPauseScreen() { return false; }
|
||||
|
||||
ErrorScreen::ErrorScreen(const wstring&, const wstring&) {}
|
||||
void ErrorScreen::init() {}
|
||||
void ErrorScreen::render(int, int, float) {}
|
||||
void ErrorScreen::keyPressed(wchar_t, int) {}
|
||||
|
||||
void InBedChatScreen::init() {}
|
||||
void InBedChatScreen::removed() {}
|
||||
void InBedChatScreen::keyPressed(wchar_t, int) {}
|
||||
void InBedChatScreen::render(int, int, float) {}
|
||||
void InBedChatScreen::buttonClicked(Button*) {}
|
||||
|
||||
UIScene::UIScene(int iPad, UILayer* parentLayer) : m_iPad(iPad), m_parentLayer(parentLayer), swf(nullptr), m_rootPath(nullptr), m_pItemRenderer(nullptr), m_iFocusControl(0), m_iFocusChild(0), m_lastOpacity(1.0f), m_bUpdateOpacity(false), m_bVisible(false), m_bCanHandleInput(false), m_backScene(nullptr), m_callbackUniqueId(0), m_loadedResolution((ESceneResolution)0), m_bIsReloading(false), m_bFocussedOnce(false), m_movieWidth(0), m_movieHeight(0), m_renderWidth(0), m_renderHeight(0), bHasFocus(false), m_hasTickedOnce(false), m_cacheSlotRenders(false), m_needsCacheRendered(false), m_expectedCachedSlotCount(0) {}
|
||||
UIScene::~UIScene() {}
|
||||
void UIScene::reloadMovie(bool) {}
|
||||
bool UIScene::needsReloaded() { return false; }
|
||||
bool UIScene::hasMovie() { return false; }
|
||||
void UIScene::updateSafeZone() {}
|
||||
F64 UIScene::getSafeZoneHalfHeight() { return 0; }
|
||||
F64 UIScene::getSafeZoneHalfWidth() { return 0; }
|
||||
bool UIScene::mapElementsAndNames() { return false; }
|
||||
void UIScene::tick() {}
|
||||
void UIScene::updateTooltips() {}
|
||||
void UIScene::handleGainFocus(bool) {}
|
||||
UIControl* UIScene::GetMainPanel() { return nullptr; }
|
||||
void UIScene::render(S32, S32, C4JRender::eViewportType) {}
|
||||
void UIScene::customDraw(IggyCustomDrawCallbackRegion*) {}
|
||||
bool UIScene::allowRepeat(int) { return false; }
|
||||
bool UIScene::isReadyToDelete() { return true; }
|
||||
IggyName UIScene::registerFastName(const wstring&) { return 0; }
|
||||
|
||||
#include "../../Minecraft.Client/Common/UI/UIControl_Base.h"
|
||||
UIControl_Base::UIControl_Base() {}
|
||||
bool UIControl_Base::setupControl(UIScene*, IggyValuePath*, const string&) { return false; }
|
||||
void UIControl_Base::tick() {}
|
||||
void UIControl_Base::setLabel(const wstring&, bool, bool) {}
|
||||
void UIControl_Base::setLabel(const string&) {}
|
||||
void UIControl_Base::setAllPossibleLabels(int, wchar_t[][256]) {}
|
||||
bool UIControl_Base::hasFocus() { return false; }
|
||||
|
||||
UIControl::UIControl() {}
|
||||
bool UIControl::setupControl(UIScene*, IggyValuePath*, const string&) { return false; }
|
||||
void UIControl::ReInit() {}
|
||||
IggyValuePath* UIControl::getIggyValuePath() { return nullptr; }
|
||||
|
||||
#include "../../Minecraft.Client/Common/UI/UIControl_Label.h"
|
||||
UIControl_Label::UIControl_Label() {}
|
||||
bool UIControl_Label::setupControl(UIScene*, IggyValuePath*, const string&) { return false; }
|
||||
void UIControl_Label::ReInit() {}
|
||||
|
||||
#include "../../Minecraft.Client/Common/UI/UIControl_SlotList.h"
|
||||
UIControl_SlotList::UIControl_SlotList() {}
|
||||
bool UIControl_SlotList::setupControl(UIScene*, IggyValuePath*, const string&) { return false; }
|
||||
void UIControl_SlotList::setFocus(bool) {}
|
||||
|
||||
ChatScreen::ChatScreen() {}
|
||||
void ChatScreen::init() {}
|
||||
void ChatScreen::removed() {}
|
||||
void ChatScreen::tick() {}
|
||||
void ChatScreen::render(int, int, float) {}
|
||||
void ChatScreen::keyPressed(wchar_t, int) {}
|
||||
void ChatScreen::mouseClicked(int, int, int) {}
|
||||
|
||||
extern "C" {
|
||||
IggyValuePath* IggyPlayerRootPath(Iggy*) { return nullptr; }
|
||||
}
|
||||
|
||||
#include "../../Minecraft.Client/Common/UI/UIScene_TradingMenu.h"
|
||||
|
||||
UIScene_TradingMenu::UIScene_TradingMenu(int iPad, void* initData, UILayer* parentLayer) : UIScene(iPad, parentLayer), IUIScene_TradingMenu(), m_showingRightArrow(false), m_showingLeftArrow(false) {}
|
||||
wstring UIScene_TradingMenu::getMoviePath() { return wstring(); }
|
||||
void UIScene_TradingMenu::updateTooltips() {}
|
||||
void UIScene_TradingMenu::handleDestroy() {}
|
||||
void UIScene_TradingMenu::handleReload() {}
|
||||
void UIScene_TradingMenu::tick() {}
|
||||
void UIScene_TradingMenu::handleInput(int, int, bool, bool, bool, bool&) {}
|
||||
void UIScene_TradingMenu::customDraw(IggyCustomDrawCallbackRegion*) {}
|
||||
void UIScene_TradingMenu::showScrollRightArrow(bool) {}
|
||||
void UIScene_TradingMenu::showScrollLeftArrow(bool) {}
|
||||
void UIScene_TradingMenu::moveSelector(bool) {}
|
||||
void UIScene_TradingMenu::setTitle(const wstring&) {}
|
||||
void UIScene_TradingMenu::setRequest1Name(const wstring&) {}
|
||||
void UIScene_TradingMenu::setRequest2Name(const wstring&) {}
|
||||
void UIScene_TradingMenu::setRequest1RedBox(bool) {}
|
||||
void UIScene_TradingMenu::setRequest2RedBox(bool) {}
|
||||
void UIScene_TradingMenu::setTradeRedBox(int, bool) {}
|
||||
void UIScene_TradingMenu::setOfferDescription(const wstring&, vector<wstring>&) {}
|
||||
|
||||
IUIScene_TradingMenu::IUIScene_TradingMenu() : m_menu(nullptr), m_validOffersCount(0), m_selectedSlot(0), m_offersStartIndex(0), m_bHasUpdatedOnce(false) {}
|
||||
void IUIScene_TradingMenu::setRequest1Item(shared_ptr<ItemInstance>) {}
|
||||
void IUIScene_TradingMenu::setRequest2Item(shared_ptr<ItemInstance>) {}
|
||||
void IUIScene_TradingMenu::setTradeItem(int, shared_ptr<ItemInstance>) {}
|
||||
1
stdafx.cpp
Normal file
1
stdafx.cpp
Normal file
@@ -0,0 +1 @@
|
||||
#include "stdafx.h"
|
||||
Reference in New Issue
Block a user