FIX: i fucking wrote profiler just to find that sleep function takes SECONDS arg :sob::sob::sob::sob::sob::sob::sob::sob::sob:😭
This commit is contained in:
@@ -18,19 +18,14 @@
|
||||
#include "../network/ServerSideNetworkHandler.h"
|
||||
//#include "../network/Packet.h"
|
||||
#include "../world/entity/player/Inventory.h"
|
||||
#include "../world/level/chunk/ChunkCache.h"
|
||||
#include "../world/level/tile/Tile.h"
|
||||
#include "../world/level/storage/LevelStorageSource.h"
|
||||
#include "../world/level/storage/LevelStorage.h"
|
||||
#include "player/input/KeyboardInput.h"
|
||||
#include "world/level/chunk/ChunkSource.h"
|
||||
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "player/input/touchscreen/TouchInputHolder.h"
|
||||
#endif
|
||||
#include "player/LocalPlayer.h"
|
||||
#include "gamemode/CreativeMode.h"
|
||||
#include "gamemode/SurvivalMode.h"
|
||||
#include "player/LocalPlayer.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "particle/ParticleEngine.h"
|
||||
#include "gui/Screen.h"
|
||||
#include "gui/Font.h"
|
||||
@@ -38,65 +33,14 @@
|
||||
#include "gui/screens/ConsoleScreen.h"
|
||||
#include "gui/screens/ChatScreen.h"
|
||||
#include "sound/SoundEngine.h"
|
||||
#endif
|
||||
#include "../platform/CThread.h"
|
||||
#include "../platform/input/Mouse.h"
|
||||
#include "../AppPlatform.h"
|
||||
#include "../Performance.h"
|
||||
#include "../LicenseCodes.h"
|
||||
#include "../util/PerfTimer.h"
|
||||
#include "../util/PerfRenderer.h"
|
||||
#include "player/input/MouseBuildInput.h"
|
||||
|
||||
#include "../world/Facing.h"
|
||||
|
||||
#include "../network/packet/PlaceBlockPacket.h"
|
||||
|
||||
#include "player/input/IInputHolder.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "player/input/touchscreen/TouchscreenInput.h"
|
||||
|
||||
#include "player/input/ControllerTurnInput.h"
|
||||
#include "player/input/XperiaPlayInput.h"
|
||||
|
||||
#endif
|
||||
|
||||
#include "renderer/Chunk.h"
|
||||
#include "player/input/MouseTurnInput.h"
|
||||
#include "../world/entity/MobFactory.h"
|
||||
#include "../world/level/MobSpawner.h"
|
||||
#include "../util/Mth.h"
|
||||
#include "../network/packet/InteractPacket.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "gui/screens/PrerenderTilesScreen.h"
|
||||
#include "renderer/Textures.h"
|
||||
#include "gui/screens/DeathScreen.h"
|
||||
#endif
|
||||
|
||||
#include "../network/packet/RespawnPacket.h"
|
||||
#include "IConfigListener.h"
|
||||
#include "../world/entity/MobCategory.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "gui/screens/FurnaceScreen.h"
|
||||
#endif
|
||||
#include "../world/Difficulty.h"
|
||||
#include "../server/ServerLevel.h"
|
||||
#ifdef CREATORMODE
|
||||
#include "../server/CreatorLevel.h"
|
||||
#endif
|
||||
#include "../network/packet/AdventureSettingsPacket.h"
|
||||
#include "../network/packet/SetSpawnPositionPacket.h"
|
||||
#include "../network/command/CommandServer.h"
|
||||
#include "gamemode/CreatorMode.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "gui/screens/ArmorScreen.h"
|
||||
#endif
|
||||
#include "../world/level/levelgen/synth/ImprovedNoise.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "renderer/tileentity/TileEntityRenderDispatcher.h"
|
||||
#endif
|
||||
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "renderer/ptexture/DynamicTexture.h"
|
||||
#include "renderer/GameRenderer.h"
|
||||
#include "renderer/ItemInHandRenderer.h"
|
||||
@@ -106,8 +50,40 @@
|
||||
#include "gui/Font.h"
|
||||
#include "gui/screens/RenameMPLevelScreen.h"
|
||||
#include "sound/SoundEngine.h"
|
||||
#endif // STANDALONE_SERVER
|
||||
|
||||
#include "player/LocalPlayer.h"
|
||||
#include "gamemode/CreativeMode.h"
|
||||
#include "gamemode/SurvivalMode.h"
|
||||
#include "player/LocalPlayer.h"
|
||||
#include "../platform/CThread.h"
|
||||
#include "../platform/input/Mouse.h"
|
||||
#include "../AppPlatform.h"
|
||||
#include "../LicenseCodes.h"
|
||||
#include "../util/PerfTimer.h"
|
||||
#include "../util/PerfRenderer.h"
|
||||
#include "player/input/MouseBuildInput.h"
|
||||
|
||||
#include "player/input/IInputHolder.h"
|
||||
|
||||
#include "player/input/MouseTurnInput.h"
|
||||
#include "../world/entity/MobFactory.h"
|
||||
#include "../world/level/MobSpawner.h"
|
||||
#include "../util/Mth.h"
|
||||
#include "../network/packet/InteractPacket.h"
|
||||
#include "../network/packet/RespawnPacket.h"
|
||||
#include "IConfigListener.h"
|
||||
#include "../world/entity/MobCategory.h"
|
||||
#include "../world/Difficulty.h"
|
||||
#include "../server/ServerLevel.h"
|
||||
|
||||
#ifdef CREATORMODE
|
||||
#include "../server/CreatorLevel.h"
|
||||
#endif
|
||||
|
||||
#include "../network/command/CommandServer.h"
|
||||
#include "gamemode/CreatorMode.h"
|
||||
|
||||
static void checkGlError(const char* tag) {
|
||||
#ifdef GLDEBUG
|
||||
while (1) {
|
||||
@@ -118,7 +94,7 @@ static void checkGlError(const char* tag) {
|
||||
}
|
||||
#endif /*GLDEBUG*/
|
||||
}
|
||||
#include <fstream>
|
||||
|
||||
/*static*/
|
||||
const char* Minecraft::progressMessages[] = {
|
||||
"Locating server",
|
||||
|
||||
@@ -4,13 +4,12 @@
|
||||
#include "Options.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "MouseHandler.h"
|
||||
#endif
|
||||
#include "Timer.h"
|
||||
#include "player/input/ITurnInput.h"
|
||||
#ifndef STANDALONE_SERVER
|
||||
#include "gui/Gui.h"
|
||||
#include "gui/screens/ScreenChooser.h"
|
||||
#endif
|
||||
|
||||
#include "Timer.h"
|
||||
|
||||
//#include "../network/RakNetInstance.h"
|
||||
#include "../world/phys/HitResult.h"
|
||||
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#include "../../network/packet/PlayerArmorEquipmentPacket.h"
|
||||
|
||||
namespace {
|
||||
#ifndef STANDALONE_SERVER
|
||||
|
||||
static bool isBase64(unsigned char c) {
|
||||
return (std::isalnum(c) || (c == '+') || (c == '/'));
|
||||
@@ -177,6 +178,8 @@ static std::string getCapeUrlForUsername(const std::string& username) {
|
||||
return getTextureUrlForUsername(username, "CAPE");
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
static bool ensureDirectoryExists(const std::string& path) {
|
||||
#if defined(_WIN32)
|
||||
return _mkdir(path.c_str()) == 0 || errno == EEXIST;
|
||||
@@ -200,6 +203,8 @@ static bool fileExists(const std::string& path) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef STANDALONE_SERVER
|
||||
|
||||
static void* fetchSkinForPlayer(void* param) {
|
||||
LocalPlayer* player = (LocalPlayer*)param;
|
||||
if (!player) return NULL;
|
||||
@@ -290,6 +295,8 @@ static void* fetchCapeForPlayer(void* param) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
//@note: doesn't work completely, since it doesn't care about stairs rotation
|
||||
static bool isJumpable(int tileId) {
|
||||
return tileId != Tile::fence->id
|
||||
@@ -318,12 +325,14 @@ LocalPlayer::LocalPlayer(Minecraft* minecraft, Level* level, User* user, int dim
|
||||
this->dimension = dimension;
|
||||
_init();
|
||||
|
||||
#ifndef STANDALONE_SERVER
|
||||
if (user != NULL && !user->name.empty()) {
|
||||
this->name = user->name;
|
||||
// Fetch user skin and cape from Mojang servers in the background (avoids blocking the main thread)
|
||||
new CThread(fetchSkinForPlayer, this);
|
||||
new CThread(fetchCapeForPlayer, this);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
LocalPlayer::~LocalPlayer() {
|
||||
|
||||
Reference in New Issue
Block a user