mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/LCE-Revelations.git
synced 2026-09-24 14:11:37 +00:00
Implement persistent hardcore death bans (XUID + IP) for dedicated server
On the dedicated server, hardcore death now persists XUID and IP bans to banned-players.json and banned-ips.json via the Access system, and disconnects the player. Bans survive server restarts. Client-hosted games retain the existing in-memory XUID ban with force-save behavior. - Add hardcore property to server.properties (forces Hard difficulty) - Add LevelData::setHardcore() so loaded worlds respect the server config - Add PlayerList::banPlayerForHardcoreDeath() with persistent XUID + IP bans - Reject respawn requests server-side in hardcore mode - Ensure server-side player ticks run without move packets (fixes environmental damage not applying for some clients) - Restore 0x8 hardcore bit on LoginPacket/RespawnPacket wire format so the client-side death screen detects hardcore mode correctly
This commit is contained in:
@@ -180,6 +180,10 @@ bool DerivedLevelData::isHardcore()
|
||||
return wrapped->isHardcore();
|
||||
}
|
||||
|
||||
void DerivedLevelData::setHardcore(bool hardcore)
|
||||
{
|
||||
}
|
||||
|
||||
LevelType *DerivedLevelData::getGenerator()
|
||||
{
|
||||
return wrapped->getGenerator();
|
||||
|
||||
@@ -53,6 +53,7 @@ public:
|
||||
bool isGenerateMapFeatures();
|
||||
void setGameType(GameType *gameType);
|
||||
bool isHardcore();
|
||||
void setHardcore(bool hardcore);
|
||||
LevelType *getGenerator();
|
||||
void setGenerator(LevelType *generator);
|
||||
bool getAllowCommands();
|
||||
|
||||
@@ -671,6 +671,11 @@ bool LevelData::isHardcore()
|
||||
return hardcore;
|
||||
}
|
||||
|
||||
void LevelData::setHardcore(bool hardcore)
|
||||
{
|
||||
this->hardcore = hardcore;
|
||||
}
|
||||
|
||||
bool LevelData::getAllowCommands()
|
||||
{
|
||||
return allowCommands;
|
||||
|
||||
@@ -141,6 +141,7 @@ public:
|
||||
virtual wstring getGeneratorOptions();
|
||||
virtual void setGeneratorOptions(const wstring &options);
|
||||
virtual bool isHardcore();
|
||||
virtual void setHardcore(bool hardcore);
|
||||
virtual bool getAllowCommands();
|
||||
virtual void setAllowCommands(bool allowCommands);
|
||||
virtual bool isInitialized();
|
||||
|
||||
@@ -149,7 +149,7 @@ void LoginPacket::write(DataOutputStream *dos) //throws IOException
|
||||
writeUtf(m_pLevelType->getGeneratorName(), dos);
|
||||
}
|
||||
dos->writeLong(seed);
|
||||
dos->writeInt(gameType | (m_isHardcore ? 0x8 : 0));
|
||||
dos->writeInt(m_isHardcore ? (gameType | 0x8) : gameType);
|
||||
dos->writeByte(dimension);
|
||||
dos->writeByte(mapHeight);
|
||||
dos->writeByte(maxPlayers);
|
||||
|
||||
@@ -70,7 +70,7 @@ void RespawnPacket::read(DataInputStream *dis) //throws IOException
|
||||
void RespawnPacket::write(DataOutputStream *dos) //throws IOException
|
||||
{
|
||||
dos->writeByte(dimension);
|
||||
dos->writeByte(playerGameType->getId() | (m_isHardcore ? 0x8 : 0));
|
||||
dos->writeByte(m_isHardcore ? (playerGameType->getId() | 0x8) : playerGameType->getId());
|
||||
dos->writeShort(mapHeight);
|
||||
if (m_pLevelType == nullptr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user