forked from cafeberry/cafeberry
LCEMP commit: prepare code for dedicated server support
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
|
||||
#include "stdafx.h"
|
||||
|
||||
#include <time.h>
|
||||
#include "..\..\Minecraft.World\net.minecraft.world.entity.item.h"
|
||||
#include "..\..\Minecraft.World\net.minecraft.world.entity.player.h"
|
||||
#include "..\..\Minecraft.World\net.minecraft.world.level.tile.entity.h"
|
||||
@@ -236,6 +238,26 @@ void CMinecraftApp::DebugPrintf(const char *szFormat, ...)
|
||||
vsnprintf(buf, sizeof(buf), szFormat, ap);
|
||||
va_end(ap);
|
||||
OutputDebugStringA(buf);
|
||||
#ifdef _DEDICATED_SERVER
|
||||
bool hasContent = false;
|
||||
for (const char *p = buf; *p; p++) {
|
||||
if (*p != ' ' && *p != '\t' && *p != '\n' && *p != '\r' && *p != '=') {
|
||||
hasContent = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (hasContent)
|
||||
{
|
||||
size_t len = strlen(buf);
|
||||
while (len > 0 && (buf[len-1] == '\n' || buf[len-1] == '\r'))
|
||||
buf[--len] = '\0';
|
||||
|
||||
time_t now = time(NULL);
|
||||
struct tm t;
|
||||
localtime_s(&t, &now);
|
||||
printf("[%02d:%02d:%02d] [Server thread/INFO]: %s\n", t.tm_hour, t.tm_min, t.tm_sec, buf);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -298,6 +320,9 @@ LPCWSTR CMinecraftApp::GetString(int iID)
|
||||
{
|
||||
//return L"Değişiklikler ve Yenilikler";
|
||||
//return L"ÕÕÕÕÖÖÖÖ";
|
||||
#ifdef _DEDICATED_SERVER
|
||||
if (!app.m_stringTable) return L"";
|
||||
#endif
|
||||
return app.m_stringTable->getString(iID);
|
||||
}
|
||||
|
||||
|
||||
@@ -873,12 +873,14 @@ int CGameNetworkManager::JoinFromInvite_SignInReturned(void *pParam,bool bContin
|
||||
|
||||
void CGameNetworkManager::UpdateAndSetGameSessionData(INetworkPlayer *pNetworkPlayerLeaving)
|
||||
{
|
||||
#ifndef _DEDICATED_SERVER
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
TexturePack *tPack = pMinecraft->skins->getSelected();
|
||||
s_pPlatformNetworkManager->SetSessionTexturePackParentId( tPack->getDLCParentPackId() );
|
||||
s_pPlatformNetworkManager->SetSessionSubTexturePackId( tPack->getDLCSubPackId() );
|
||||
|
||||
s_pPlatformNetworkManager->UpdateAndSetGameSessionData( pNetworkPlayerLeaving );
|
||||
#endif
|
||||
}
|
||||
|
||||
void CGameNetworkManager::SendInviteGUI(int quadrant)
|
||||
@@ -1540,6 +1542,7 @@ void CGameNetworkManager::CreateSocket( INetworkPlayer *pNetworkPlayer, bool loc
|
||||
// Add this user to the game server if the game is started already
|
||||
if( g_NetworkManager.IsHost() && g_NetworkManager.IsInGameplay() )
|
||||
{
|
||||
app.DebugPrintf("Adding incoming socket for smallId=%d\n", pNetworkPlayer->GetSmallId());
|
||||
Socket::addIncomingSocket(socket);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,6 +61,9 @@ std::vector<BYTE> NetworkSocketLayer::s_pendingJoinSmallIds;
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_freeSmallIdLock;
|
||||
std::vector<BYTE> NetworkSocketLayer::s_freeSmallIds;
|
||||
|
||||
CRITICAL_SECTION NetworkSocketLayer::s_earlyDataLock;
|
||||
std::vector<BYTE> NetworkSocketLayer::s_earlyDataBuffers[NETWORK_LAN_MAX_CLIENTS + 1];
|
||||
|
||||
// only goes true on a successful Initialize(), and a failed one gets retried
|
||||
static bool s_locksCreated = false;
|
||||
#if defined _WINDOWS64
|
||||
@@ -88,6 +91,7 @@ bool NetworkSocketLayer::Initialize()
|
||||
InitializeCriticalSection(&s_disconnectLock);
|
||||
InitializeCriticalSection(&s_pendingJoinLock);
|
||||
InitializeCriticalSection(&s_freeSmallIdLock);
|
||||
InitializeCriticalSection(&s_earlyDataLock);
|
||||
|
||||
for (int i = 0; i < NETWORK_LAN_MAX_CLIENTS + 1; i++)
|
||||
{
|
||||
@@ -801,6 +805,9 @@ bool NetworkSocketLayer::JoinGame(const char *ip, int port)
|
||||
}
|
||||
s_localSmallId = assignedSmallId;
|
||||
|
||||
DWORD noTimeout = 0;
|
||||
setsockopt(s_hostConnectionSocket, SOL_SOCKET, SO_RCVTIMEO, (const char *)&noTimeout, sizeof(noTimeout));
|
||||
|
||||
app.DebugPrintf("LAN: Connected to %s:%d, assigned smallId=%d\n", ip, port, s_localSmallId);
|
||||
|
||||
s_active = true;
|
||||
@@ -926,9 +933,13 @@ void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, un
|
||||
|
||||
if (pPlayerFrom == NULL || pPlayerTo == NULL)
|
||||
{
|
||||
// dropping here is silent and looks identical to the peer never sending
|
||||
app.DebugPrintf("LAN: DROPPED %u bytes - from smallId=%d(%s) to smallId=%d(%s)\n",
|
||||
dataSize, fromSmallId, pPlayerFrom ? "ok" : "NULL", toSmallId, pPlayerTo ? "ok" : "NULL");
|
||||
if (s_isHost && fromSmallId > 0 && fromSmallId < NETWORK_LAN_MAX_CLIENTS + 1)
|
||||
{
|
||||
EnterCriticalSection(&s_earlyDataLock);
|
||||
s_earlyDataBuffers[fromSmallId].insert(
|
||||
s_earlyDataBuffers[fromSmallId].end(), data, data + dataSize);
|
||||
LeaveCriticalSection(&s_earlyDataLock);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -937,6 +948,13 @@ void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, un
|
||||
::Socket *pSocket = pPlayerFrom->GetSocket();
|
||||
if (pSocket != NULL)
|
||||
pSocket->pushDataToQueue(data, dataSize, false);
|
||||
else
|
||||
{
|
||||
EnterCriticalSection(&s_earlyDataLock);
|
||||
s_earlyDataBuffers[fromSmallId].insert(
|
||||
s_earlyDataBuffers[fromSmallId].end(), data, data + dataSize);
|
||||
LeaveCriticalSection(&s_earlyDataLock);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -946,6 +964,26 @@ void NetworkSocketLayer::HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, un
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkSocketLayer::FlushPendingData()
|
||||
{
|
||||
EnterCriticalSection(&s_earlyDataLock);
|
||||
for (int i = 1; i < NETWORK_LAN_MAX_CLIENTS + 1; i++)
|
||||
{
|
||||
if (s_earlyDataBuffers[i].empty()) continue;
|
||||
|
||||
INetworkPlayer *pPlayer = g_NetworkManager.GetPlayerBySmallId((BYTE)i);
|
||||
if (pPlayer == NULL) continue;
|
||||
|
||||
::Socket *pSocket = pPlayer->GetSocket();
|
||||
if (pSocket == NULL) continue;
|
||||
|
||||
pSocket->pushDataToQueue(s_earlyDataBuffers[i].data(),
|
||||
(DWORD)s_earlyDataBuffers[i].size(), false);
|
||||
s_earlyDataBuffers[i].clear();
|
||||
}
|
||||
LeaveCriticalSection(&s_earlyDataLock);
|
||||
}
|
||||
|
||||
int NetworkSocketLayer::AcceptThreadProc(LPVOID param)
|
||||
{
|
||||
while (s_active)
|
||||
@@ -1172,6 +1210,11 @@ void NetworkSocketLayer::CloseConnectionBySmallId(BYTE smallId)
|
||||
app.DebugPrintf("Win64 LAN: Force-closed TCP connection for smallId=%d\n", smallId);
|
||||
}
|
||||
LeaveCriticalSection(&s_connectionsLock);
|
||||
|
||||
EnterCriticalSection(&s_earlyDataLock);
|
||||
if (smallId < NETWORK_LAN_MAX_CLIENTS + 1)
|
||||
s_earlyDataBuffers[smallId].clear();
|
||||
LeaveCriticalSection(&s_earlyDataLock);
|
||||
}
|
||||
|
||||
int NetworkSocketLayer::ClientRecvThreadProc(LPVOID param)
|
||||
|
||||
@@ -167,6 +167,7 @@ public:
|
||||
static SOCKET GetSocketForSmallId(BYTE smallId);
|
||||
|
||||
static void HandleDataReceived(BYTE fromSmallId, BYTE toSmallId, unsigned char *data, unsigned int dataSize);
|
||||
static void FlushPendingData();
|
||||
|
||||
static bool PopDisconnectedSmallId(BYTE *outSmallId);
|
||||
static void PushFreeSmallId(BYTE smallId);
|
||||
@@ -235,6 +236,9 @@ private:
|
||||
|
||||
static CRITICAL_SECTION s_freeSmallIdLock;
|
||||
static std::vector<BYTE> s_freeSmallIds;
|
||||
|
||||
static CRITICAL_SECTION s_earlyDataLock;
|
||||
static std::vector<BYTE> s_earlyDataBuffers[NETWORK_LAN_MAX_CLIENTS + 1];
|
||||
};
|
||||
|
||||
extern bool g_MultiplayerHost;
|
||||
|
||||
@@ -4963,11 +4963,18 @@ void Minecraft::handleClientTextureReceived(const wstring &textureName)
|
||||
|
||||
unsigned int Minecraft::getCurrentTexturePackId()
|
||||
{
|
||||
#ifdef _DEDICATED_SERVER
|
||||
return 0;
|
||||
#else
|
||||
return skins->getSelected()->getId();
|
||||
#endif
|
||||
}
|
||||
|
||||
ColourTable *Minecraft::getColourTable()
|
||||
{
|
||||
#ifdef _DEDICATED_SERVER
|
||||
return NULL;
|
||||
#else
|
||||
TexturePack *selected = skins->getSelected();
|
||||
|
||||
ColourTable *colours = selected->getColourTable();
|
||||
@@ -4978,6 +4985,7 @@ ColourTable *Minecraft::getColourTable()
|
||||
}
|
||||
|
||||
return colours;
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined __ORBIS__
|
||||
|
||||
@@ -35,7 +35,11 @@
|
||||
#include "..\Minecraft.World\net.minecraft.world.entity.h"
|
||||
#include "ProgressRenderer.h"
|
||||
#include "ServerPlayer.h"
|
||||
#include "PlayerConnection.h"
|
||||
#include "GameRenderer.h"
|
||||
#if defined(_WINDOWS64) || defined(DISABLE_PSN) || defined(_DISABLE_XBLIVE)
|
||||
#include "Common\Network\NetworkSocketLayer.h"
|
||||
#endif
|
||||
#include "..\Minecraft.World\ThreadName.h"
|
||||
#include "..\Minecraft.World\IntCache.h"
|
||||
#include "..\Minecraft.World\CompressedTileStorage.h"
|
||||
@@ -47,6 +51,11 @@
|
||||
#endif
|
||||
#include "PS3\PS3Extras\ShutdownManager.h"
|
||||
#include "ServerCommandDispatcher.h"
|
||||
|
||||
#ifdef _DEDICATED_SERVER
|
||||
#include "..\Minecraft.Server\ServerCommands.h"
|
||||
#endif
|
||||
|
||||
#include "..\Minecraft.World\BiomeSource.h"
|
||||
#include "PlayerChunkMap.h"
|
||||
#include "Common\Telemetry\TelemetryManager.h"
|
||||
@@ -150,13 +159,11 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
||||
#endif
|
||||
settings = new Settings(new File(L"server.properties"));
|
||||
|
||||
app.DebugPrintf("\n*** SERVER SETTINGS ***\n");
|
||||
app.DebugPrintf("ServerSettings: host-friends-only is %s\n",(app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0)?"on":"off");
|
||||
app.DebugPrintf("ServerSettings: game-type is %s\n",(app.GetGameHostOption(eGameHostOption_GameType)==0)?"Survival Mode":"Creative Mode");
|
||||
app.DebugPrintf("ServerSettings: pvp is %s\n",(app.GetGameHostOption(eGameHostOption_PvP)>0)?"on":"off");
|
||||
app.DebugPrintf("ServerSettings: fire spreads is %s\n",(app.GetGameHostOption(eGameHostOption_FireSpreads)>0)?"on":"off");
|
||||
app.DebugPrintf("ServerSettings: tnt explodes is %s\n",(app.GetGameHostOption(eGameHostOption_TNT)>0)?"on":"off");
|
||||
app.DebugPrintf("\n");
|
||||
app.DebugPrintf("host-friends-only is %s",(app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0)?"on":"off");
|
||||
app.DebugPrintf("game-type is %s",(app.GetGameHostOption(eGameHostOption_GameType)==0)?"Survival Mode":"Creative Mode");
|
||||
app.DebugPrintf("pvp is %s",(app.GetGameHostOption(eGameHostOption_PvP)>0)?"on":"off");
|
||||
app.DebugPrintf("fire-spreads is %s",(app.GetGameHostOption(eGameHostOption_FireSpreads)>0)?"on":"off");
|
||||
app.DebugPrintf("tnt-explodes is %s",(app.GetGameHostOption(eGameHostOption_TNT)>0)?"on":"off");
|
||||
|
||||
// TODO 4J Stu - Init a load of settings based on data passed as params
|
||||
//settings->setBooleanAndSave( L"host-friends-only", (app.GetGameHostOption(eGameHostOption_FriendsOfFriends)>0) );
|
||||
@@ -283,6 +290,14 @@ bool MinecraftServer::initServer(__int64 seed, NetworkGameInitData *initData, DW
|
||||
}
|
||||
|
||||
g_NetworkManager.ServerReady(); // 4J added
|
||||
|
||||
#ifdef _DEDICATED_SERVER
|
||||
{
|
||||
extern QNET_STATE _iQNetStubState;
|
||||
_iQNetStubState = QNET_STATE_GAME_PLAY;
|
||||
}
|
||||
#endif
|
||||
|
||||
return m_bLoaded;
|
||||
|
||||
}
|
||||
@@ -405,7 +420,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
|
||||
int gameTypeId = settings->getInt(L"gamemode", app.GetGameHostOption(eGameHostOption_GameType));//LevelSettings::GAMETYPE_SURVIVAL);
|
||||
GameType *gameType = LevelSettings::validateGameType(gameTypeId);
|
||||
app.DebugPrintf("Default game type: %d\n" , gameTypeId);
|
||||
app.DebugPrintf("Default game type: %d" , gameTypeId);
|
||||
|
||||
LevelSettings *levelSettings = new LevelSettings(levelSeed, gameType, app.GetGameHostOption(eGameHostOption_Structures)>0?true:false, isHardcore(), true, pLevelType, initData->xzSize, initData->hellScale);
|
||||
if( app.GetGameHostOption(eGameHostOption_BonusChest ) ) levelSettings->enableStartingBonusItems();
|
||||
@@ -497,7 +512,7 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
Minecraft *pMinecraft = Minecraft::GetInstance();
|
||||
// m_lastSentDifficulty = pMinecraft->options->difficulty;
|
||||
levels[i]->difficulty = app.GetGameHostOption(eGameHostOption_Difficulty); //pMinecraft->options->difficulty;
|
||||
app.DebugPrintf("MinecraftServer::loadLevel - Difficulty = %d\n",levels[i]->difficulty);
|
||||
app.DebugPrintf("MinecraftServer::loadLevel - Difficulty = %d",levels[i]->difficulty);
|
||||
|
||||
#if DEBUG_SERVER_DONT_SPAWN_MOBS
|
||||
levels[i]->setSpawnSettings(false, false);
|
||||
@@ -571,6 +586,13 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
csf->closeHandle(fe);
|
||||
}
|
||||
|
||||
#ifdef _DEDICATED_SERVER
|
||||
{
|
||||
__int64 doneTime = System::currentTimeMillis();
|
||||
app.DebugPrintf("Done! For help, type \"help\" or \"?\"");
|
||||
}
|
||||
#endif
|
||||
|
||||
__int64 lastTime = System::currentTimeMillis();
|
||||
#ifdef _LARGE_WORLDS
|
||||
if(app.GetGameNewWorldSize() > levels[0]->getLevelData()->getXZSizeOld())
|
||||
@@ -693,9 +715,6 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
// stronghold position?
|
||||
if(levels[0]->dimension->id==0)
|
||||
{
|
||||
|
||||
app.DebugPrintf("===================================\n");
|
||||
|
||||
if(!levels[0]->getLevelData()->getHasStronghold())
|
||||
{
|
||||
int x,z;
|
||||
@@ -705,20 +724,19 @@ bool MinecraftServer::loadLevel(LevelStorageSource *storageSource, const wstring
|
||||
levels[0]->getLevelData()->setZStronghold(z);
|
||||
levels[0]->getLevelData()->setHasStronghold();
|
||||
|
||||
app.DebugPrintf("=== FOUND stronghold in terrain features list\n");
|
||||
app.DebugPrintf("FOUND stronghold in terrain features list\n");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// can't find the stronghold position in the terrain feature list. Do we have to run a post-process?
|
||||
app.DebugPrintf("=== Can't find stronghold in terrain features list\n");
|
||||
app.DebugPrintf("Can't find stronghold in terrain features list\n");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
app.DebugPrintf("=== Leveldata has stronghold position\n");
|
||||
app.DebugPrintf("Leveldata has stronghold position\n");
|
||||
}
|
||||
app.DebugPrintf("===================================\n");
|
||||
}
|
||||
|
||||
// printf("Post processing complete at %dms\n",System::currentTimeMillis() - startTime);
|
||||
@@ -1683,6 +1701,10 @@ void MinecraftServer::tick()
|
||||
}
|
||||
}
|
||||
Entity::tickExtraWandering(); // 4J added
|
||||
#ifdef _DEDICATED_SERVER
|
||||
g_NetworkManager.DoWork();
|
||||
NetworkSocketLayer::FlushPendingData();
|
||||
#endif
|
||||
|
||||
PIXBeginNamedEvent(0,"Connection tick");
|
||||
connection->tick();
|
||||
@@ -1717,6 +1739,12 @@ void MinecraftServer::handleConsoleInputs()
|
||||
AUTO_VAR(it, consoleInput.begin());
|
||||
ConsoleInput *input = *it;
|
||||
consoleInput.erase(it);
|
||||
#ifdef _DEDICATED_SERVER
|
||||
HandleServerCommand(input->msg, input->source, this);
|
||||
delete input;
|
||||
#else
|
||||
delete input;
|
||||
#endif
|
||||
// commands->handleCommand(input); // 4J - removed - TODO - do we want equivalent of console commands?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,7 @@ void PendingConnection::handlePreLogin(shared_ptr<PreLoginPacket> packet)
|
||||
return;
|
||||
}
|
||||
// printf("Server: handlePreLogin\n");
|
||||
app.DebugPrintf("PreLogin received from \"%ls\"\n", packet->loginKey.c_str());
|
||||
name = packet->loginKey; // 4J Stu - Change from the login packet as we know better on client end during the pre-login packet
|
||||
sendPreLoginResponse();
|
||||
}
|
||||
@@ -139,6 +140,7 @@ void PendingConnection::sendPreLoginResponse()
|
||||
|
||||
void PendingConnection::handleLogin(shared_ptr<LoginPacket> packet)
|
||||
{
|
||||
app.DebugPrintf("Login received from \"%ls\" (protocol %d)\n", name.c_str(), packet->clientVersion);
|
||||
// printf("Server: handleLogin\n");
|
||||
//name = packet->userName;
|
||||
if (packet->clientVersion != SharedConstants::NETWORK_PROTOCOL_VERSION)
|
||||
|
||||
@@ -116,7 +116,7 @@ void PlayerConnection::disconnect(DisconnectPacket::eDisconnectReason reason)
|
||||
return;
|
||||
}
|
||||
|
||||
app.DebugPrintf("PlayerConnection disconect reason: %d\n", reason );
|
||||
app.DebugPrintf("PlayerConnection disconect reason: %d", reason );
|
||||
player->disconnect();
|
||||
|
||||
// 4J Stu - Need to remove the player from the receiving list before their socket is NULLed so that we can find another player on their system
|
||||
@@ -543,10 +543,16 @@ void PlayerConnection::onDisconnect(DisconnectPacket::eDisconnectReason reason,
|
||||
if(getWasKicked())
|
||||
{
|
||||
server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerKickedFromGame) ) );
|
||||
#ifdef _DEDICATED_SERVER
|
||||
app.DebugPrintf("%ls was kicked from the game", player->name.c_str());
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
server->getPlayers()->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerLeftGame) ) );
|
||||
#ifdef _DEDICATED_SERVER
|
||||
app.DebugPrintf("%ls left the game", player->name.c_str());
|
||||
#endif
|
||||
}
|
||||
server->getPlayers()->remove(player);
|
||||
done = true;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#include "ConsoleInputSource.h"
|
||||
#include "..\Minecraft.World\PacketListener.h"
|
||||
#include "..\Minecraft.World\JavaIntHash.h"
|
||||
|
||||
@@ -243,6 +243,10 @@ void PlayerList::placeNewPlayer(Connection *connection, shared_ptr<ServerPlayer>
|
||||
//server->players->broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(L"§e" + playerEntity->name + L" joined the game.") ) );
|
||||
broadcastAll( shared_ptr<ChatPacket>( new ChatPacket(player->name, ChatPacket::e_ChatPlayerJoinedGame) ) );
|
||||
|
||||
#ifdef _DEDICATED_SERVER
|
||||
app.DebugPrintf("%ls joined the game", player->name.c_str());
|
||||
#endif
|
||||
|
||||
MemSect(14);
|
||||
add(player);
|
||||
MemSect(0);
|
||||
|
||||
@@ -1026,6 +1026,7 @@ void ServerLevel::saveToDisc(ProgressListener *progressListener, bool autosave)
|
||||
// 4J-PB - check that saves are enabled
|
||||
if(StorageManager.GetSaveDisabled()) return;
|
||||
|
||||
#ifndef _DEDICATED_SERVER
|
||||
// Check if we are using a trial version of a texture pack (which will be the case for going into the mash-up pack world with a trial version)
|
||||
if(!Minecraft::GetInstance()->skins->isUsingDefaultSkin())
|
||||
{
|
||||
@@ -1039,6 +1040,7 @@ void ServerLevel::saveToDisc(ProgressListener *progressListener, bool autosave)
|
||||
return;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (progressListener != NULL) progressListener->progressStage(IDS_PROGRESS_SAVING_TO_DISC);
|
||||
levelStorage->flushSaveFile(autosave);
|
||||
|
||||
@@ -1951,7 +1951,8 @@ AABBList *Level::getCubes(shared_ptr<Entity> source, AABB *box, bool noEntities/
|
||||
// 4J - now add in collision for any blocks which have actually been removed, but haven't had their render data updated to reflect this yet. This is to stop the player
|
||||
// being able to move the view position inside a tile which is (visually) still there, and see out of the world. This is particularly a problem when moving upwards in
|
||||
// creative mode as the player can get very close to the edge of tiles whilst looking upwards and can therefore very quickly move inside one.
|
||||
Minecraft::GetInstance()->levelRenderer->destroyedTileManager->addAABBs( this, box, &boxes);
|
||||
if(Minecraft::GetInstance()->levelRenderer != NULL)
|
||||
Minecraft::GetInstance()->levelRenderer->destroyedTileManager->addAABBs( this, box, &boxes);
|
||||
|
||||
// 4J - added
|
||||
if( noEntities ) return &boxes;
|
||||
|
||||
@@ -222,7 +222,7 @@ StructurePiece *StrongholdPieces::generateAndAddPiece(StartPiece *startPiece, li
|
||||
if(piece->pieceClass != EPieceClass_PortalRoom) continue;
|
||||
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Portal room forcing attempt\n");
|
||||
app.DebugPrintf("Portal room forcing attempt\n");
|
||||
#endif
|
||||
StrongholdPiece *strongholdPiece = PortalRoom::createPiece(pieces, random, footX, footY, footZ, direction, depth);
|
||||
if (strongholdPiece != NULL)
|
||||
@@ -235,7 +235,7 @@ StructurePiece *StrongholdPieces::generateAndAddPiece(StartPiece *startPiece, li
|
||||
currentPieces.remove(piece);
|
||||
}
|
||||
#ifndef _CONTENT_PACKAGE
|
||||
printf("Success\n");
|
||||
app.DebugPrintf("Success\n");
|
||||
#endif
|
||||
return strongholdPiece;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user