mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
Merge remote-tracking branch 'origin/main' into feat/minigames
This commit is contained in:
commit
be0114511b
|
|
@ -1,4 +1,4 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include "../../Minecraft.World/net.minecraft.world.entity.item.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.entity.player.h"
|
||||||
#include "../../Minecraft.World/net.minecraft.world.level.tile.entity.h"
|
#include "../../Minecraft.World/net.minecraft.world.level.tile.entity.h"
|
||||||
|
|
@ -453,7 +453,7 @@ void CMinecraftApp::SetAction(int iPad, eXuiAction action, LPVOID param)
|
||||||
|
|
||||||
bool CMinecraftApp::IsAppPaused()
|
bool CMinecraftApp::IsAppPaused()
|
||||||
{
|
{
|
||||||
#if defined(_XBOX_ONE) || defined(__ORBIS__)
|
#if defined(_XBOX_ONE) || defined(__ORBIS__) || defined(_WINDOWS64)
|
||||||
bool paused = m_bIsAppPaused;
|
bool paused = m_bIsAppPaused;
|
||||||
EnterCriticalSection(&m_saveNotificationCriticalSection);
|
EnterCriticalSection(&m_saveNotificationCriticalSection);
|
||||||
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
|
if( g_NetworkManager.IsLocalGame() && g_NetworkManager.GetPlayerCount() == 1 )
|
||||||
|
|
|
||||||
|
|
@ -1268,6 +1268,8 @@ void Minecraft::applyFrameMouseLook()
|
||||||
|
|
||||||
void Minecraft::run_middle()
|
void Minecraft::run_middle()
|
||||||
{
|
{
|
||||||
|
pause = app.IsAppPaused();
|
||||||
|
|
||||||
static int64_t lastTime = 0;
|
static int64_t lastTime = 0;
|
||||||
static bool bFirstTimeIntoGame = true;
|
static bool bFirstTimeIntoGame = true;
|
||||||
static bool bAutosaveTimerSet=false;
|
static bool bAutosaveTimerSet=false;
|
||||||
|
|
|
||||||
|
|
@ -1848,7 +1848,7 @@ void MinecraftServer::run(int64_t seed, void *lpParameter)
|
||||||
lastTime = now;
|
lastTime = now;
|
||||||
|
|
||||||
// 4J Added ability to pause the server
|
// 4J Added ability to pause the server
|
||||||
if( !m_isServerPaused )
|
if( !m_isServerPaused && !app.IsAppPaused() )
|
||||||
{
|
{
|
||||||
bool didTick = false;
|
bool didTick = false;
|
||||||
if (levels[0]->allPlayersAreSleeping())
|
if (levels[0]->allPlayersAreSleeping())
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,7 @@ private:
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
bool IsServerPaused() { return m_isServerPaused; }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// 4J Added
|
// 4J Added
|
||||||
|
|
@ -291,6 +291,7 @@ public:
|
||||||
const wstring& getSaveFolderName() const { return m_saveFolderName; }
|
const wstring& getSaveFolderName() const { return m_saveFolderName; }
|
||||||
void Suspend();
|
void Suspend();
|
||||||
bool IsSuspending();
|
bool IsSuspending();
|
||||||
|
bool IsServerPaused() { return m_isServerPaused; }
|
||||||
|
|
||||||
// 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them
|
// 4J Stu - A load of functions were all added in 1.0.1 in the ServerInterface, but I don't think we need any of them
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -183,7 +183,7 @@ void PlayerConnection::tick()
|
||||||
// Ensure server-side player tick runs even when no move packet was received this tick.
|
// Ensure server-side player tick runs even when no move packet was received this tick.
|
||||||
// Without this, environmental damage (drowning, fire, lava) is never applied to clients
|
// Without this, environmental damage (drowning, fire, lava) is never applied to clients
|
||||||
// that don't send frequent move packets.
|
// that don't send frequent move packets.
|
||||||
if (!didTick && player != nullptr)
|
if (!didTick && player != nullptr && !server->IsServerPaused() && !app.IsAppPaused())
|
||||||
{
|
{
|
||||||
player->doTick(false);
|
player->doTick(false);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue