1
0

CheckBasicStyle: Check number of empty lines between functions (#4267)

Add check for number of empty lines between functions and fix the corresponding failures
This commit is contained in:
peterbell10 2018-07-26 22:24:36 +01:00 committed by GitHub
parent b8ab03bc6b
commit 950aeffff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
121 changed files with 192 additions and 166 deletions

View File

@ -22,7 +22,6 @@ cLuaServerHandle::cLuaServerHandle(UInt16 a_Port, cLuaState::cTableRefPtr && a_C
cLuaServerHandle::~cLuaServerHandle()
{
// If the server handle is still open, close it explicitly:

View File

@ -50,7 +50,6 @@ extern "C"
const cLuaState::cRet cLuaState::Return = {};
const cLuaState::cNil cLuaState::Nil = {};
@ -58,7 +57,6 @@ const cLuaState::cNil cLuaState::Nil = {};
////////////////////////////////////////////////////////////////////////////////
// cCanonLuaStates:
@ -135,6 +133,7 @@ void cLuaStateTracker::Add(cLuaState & a_LuaState)
void cLuaStateTracker::Del(cLuaState & a_LuaState)
{
auto & Instance = Get();

View File

@ -2454,6 +2454,7 @@ static int tolua_cClientHandle_IsUUIDOnline(lua_State * tolua_S)
static int tolua_cMobHeadEntity_SetOwner(lua_State * tolua_S)
{
// Check params:
@ -3493,7 +3494,6 @@ static int tolua_cHopperEntity_GetOutputBlockPos(lua_State * tolua_S)
static int tolua_cBoundingBox_CalcLineIntersection(lua_State * a_LuaState)
{
/* Function signatures:

View File

@ -15,7 +15,6 @@
/** Reads params that together form a Cuboid.
These can be:
- 6 numbers (MinX, MaxX, MinY, MaxY, MinZ, MaxZ)

View File

@ -620,7 +620,6 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S)
static int tolua_cWorld_TryGetHeight(lua_State * tolua_S)
{
/* Exported manually, because tolua would require the out-only param a_Height to be used when calling

View File

@ -51,6 +51,7 @@ AString cPlugin::GetLocalFolder(void) const
void cPlugin::SetLoadError(const AString & a_LoadError)
{
m_Status = cPluginManager::psError;

View File

@ -479,6 +479,7 @@ bool cPluginManager::CallHookEntityTeleport(cEntity & a_Entity, const Vector3d &
bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_World)
{
return GenericCallHook(HOOK_ENTITY_CHANGING_WORLD, [&](cPlugin * a_Plugin)
@ -491,6 +492,7 @@ bool cPluginManager::CallHookEntityChangingWorld(cEntity & a_Entity, cWorld & a_
bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_World)
{
return GenericCallHook(HOOK_ENTITY_CHANGED_WORLD, [&](cPlugin * a_Plugin)
@ -503,6 +505,7 @@ bool cPluginManager::CallHookEntityChangedWorld(cEntity & a_Entity, cWorld & a_W
bool cPluginManager::CallHookExecuteCommand(cPlayer * a_Player, const AStringVector & a_Split, const AString & a_EntireCommand, CommandResult & a_Result)
{
// Output the command being executed to log (for troubleshooting deadlocks-in-commands):
@ -643,6 +646,7 @@ bool cPluginManager::CallHookLogin(cClientHandle & a_Client, UInt32 a_ProtocolVe
bool cPluginManager::CallHookLoginForge(cClientHandle & a_Client, AStringMap & a_Mods)
{
return GenericCallHook(HOOK_LOGIN_FORGE, [&](cPlugin * a_Plugin)
@ -1068,6 +1072,7 @@ bool cPluginManager::CallHookSpawnedEntity(cWorld & a_World, cEntity & a_Entity)
bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monster)
{
return GenericCallHook(HOOK_SPAWNED_MONSTER, [&](cPlugin * a_Plugin)
@ -1080,6 +1085,7 @@ bool cPluginManager::CallHookSpawnedMonster(cWorld & a_World, cMonster & a_Monst
bool cPluginManager::CallHookSpawningEntity(cWorld & a_World, cEntity & a_Entity)
{
return GenericCallHook(HOOK_SPAWNING_ENTITY, [&](cPlugin * a_Plugin)

View File

@ -190,6 +190,7 @@ bool IsBiomeVeryCold(EMCSBiome a_Biome)
bool IsBiomeCold(EMCSBiome a_Biome)
{
switch (a_Biome)

View File

@ -629,17 +629,6 @@ void cBlockArea::DumpToRawFile(const AString & a_FileName)
void cBlockArea::Crop(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ)
{
if (
@ -2272,7 +2261,6 @@ NIBBLETYPE cBlockArea::GetNibble(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBL
void cBlockArea::CropBlockTypes(int a_AddMinX, int a_SubMaxX, int a_AddMinY, int a_SubMaxY, int a_AddMinZ, int a_SubMaxZ)
{
int NewSizeX = GetSizeX() - a_AddMinX - a_SubMaxX;
@ -2963,6 +2951,7 @@ void cBlockArea::cChunkReader::ChunkData(const cChunkData & a_BlockBuffer)
void cBlockArea::cChunkReader::BlockEntity(cBlockEntity * a_BlockEntity)
{
if (!m_Area.HasBlockEntities())

View File

@ -11,13 +11,6 @@
cBrewingstandEntity::cBrewingstandEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_BlockX, int a_BlockY, int a_BlockZ, cWorld * a_World):
Super(a_BlockType, a_BlockMeta, a_BlockX, a_BlockY, a_BlockZ, ContentsWidth, ContentsHeight, a_World),
m_IsDestroyed(false),
@ -160,7 +153,6 @@ bool cBrewingstandEntity::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
bool cBrewingstandEntity::UsedBy(cPlayer * a_Player)
{
cWindow * Window = GetWindow();
@ -207,7 +199,6 @@ void cBrewingstandEntity::BroadcastProgress(short a_ProgressbarID, short a_Value
void cBrewingstandEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
{
Super::OnSlotChanged(a_ItemGrid, a_SlotNum);

View File

@ -31,6 +31,7 @@ cChestEntity::cChestEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_
cChestEntity::~cChestEntity()
{
if (m_Neighbour != nullptr)

View File

@ -29,7 +29,6 @@ cCommandBlockEntity::cCommandBlockEntity(BLOCKTYPE a_BlockType, NIBBLETYPE a_Blo
bool cCommandBlockEntity::UsedBy(cPlayer * a_Player)
{
// Nothing to do

View File

@ -290,6 +290,8 @@ UInt32 cDispenserEntity::SpawnProjectileFromDispenser(int a_BlockX, int a_BlockY
Vector3d cDispenserEntity::GetShootVector(NIBBLETYPE a_Meta)
{
switch (a_Meta & E_META_DROPSPENSER_FACING_MASK)

View File

@ -11,7 +11,6 @@
enum
{
PROGRESSBAR_FUEL = 0,
@ -282,7 +281,6 @@ void cFurnaceEntity::OnSlotChanged(cItemGrid * a_ItemGrid, int a_SlotNum)
void cFurnaceEntity::UpdateInput(void)
{
if (!m_Contents.GetSlot(fsInput).IsEqual(m_LastInput))

View File

@ -40,6 +40,7 @@ void cMobHeadEntity::CopyFrom(const cBlockEntity & a_Src)
bool cMobHeadEntity::UsedBy(cPlayer * a_Player)
{
UNUSED(a_Player);

View File

@ -234,6 +234,7 @@ int BlockStringToType(const AString & a_BlockTypeString)
bool StringToItem(const AString & a_ItemTypeString, cItem & a_Item)
{
AString ItemName = TrimString(a_ItemTypeString);

View File

@ -11,6 +11,9 @@ void cBlockInfo::sHandlerDeleter::operator () (cBlockHandler * a_Handler)
}
cBlockInfo::cBlockInfoArray::cBlockInfoArray()
{
cBlockInfoArray & Info = *this;

View File

@ -149,6 +149,8 @@ NIBBLETYPE cBlockDoorHandler::MetaRotateCW(NIBBLETYPE a_Meta)
NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta)
{
/*
@ -181,6 +183,8 @@ NIBBLETYPE cBlockDoorHandler::MetaMirrorXY(NIBBLETYPE a_Meta)
NIBBLETYPE cBlockDoorHandler::MetaMirrorYZ(NIBBLETYPE a_Meta)
{
// Top bit (0x08) contains door panel type (Top / Bottom panel) Only Bottom panels contain position data

View File

@ -91,7 +91,6 @@
/*
// Tests the meta rotation and mirroring.
// Note that the cMetaRotator needs to have its assert paths disabled for this test to work!
@ -577,6 +576,7 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac
bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk)
{
return true;

View File

@ -28,7 +28,6 @@ NIBBLETYPE cChunkInterface::GetBlockMeta(Vector3i a_Pos)
bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta)
{
return m_ChunkMap->GetBlockTypeMeta(a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
@ -38,7 +37,6 @@ bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType,
/** Sets the block at the specified coords to the specified value.
Full processing, incl. updating neighbors, is performed.
*/
@ -72,7 +70,6 @@ void cChunkInterface::FastSetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLO
void cChunkInterface::FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
FastSetBlock( a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
@ -82,7 +79,6 @@ void cChunkInterface::FastSetBlock(const Vector3i & a_Pos, BLOCKTYPE a_BlockType
bool cChunkInterface::UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ)
{
return m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ);
@ -92,7 +88,6 @@ bool cChunkInterface::UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_Blo
bool cChunkInterface::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback)
{
return m_ChunkMap->ForEachChunkInRect(a_MinChunkX, a_MaxChunkX, a_MinChunkZ, a_MaxChunkZ, a_Callback);
@ -102,7 +97,6 @@ bool cChunkInterface::ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a
bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes)
{
return m_ChunkMap->WriteBlockArea(a_Area, a_MinBlockX, a_MinBlockY, a_MinBlockZ, a_DataTypes);
@ -112,7 +106,6 @@ bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a
bool cChunkInterface::DigBlock(cWorldInterface & a_WorldInterface, int a_X, int a_Y, int a_Z)
{
cBlockHandler * Handler = cBlockInfo::GetHandler(GetBlock({a_X, a_Y, a_Z}));

View File

@ -12,7 +12,6 @@ class cBlockPistonHandler;
template<BLOCKTYPE T>
class GetHandlerCompileTime;
@ -20,8 +19,6 @@ class GetHandlerCompileTime;
template<>
class GetHandlerCompileTime<E_BLOCK_TORCH>
{
@ -33,7 +30,6 @@ public:
template<>
class GetHandlerCompileTime<E_BLOCK_LEVER>
{
@ -45,7 +41,6 @@ public:
template<>
class GetHandlerCompileTime<E_BLOCK_STONE_BUTTON>
{
@ -57,7 +52,6 @@ public:
template<>
class GetHandlerCompileTime<E_BLOCK_TRIPWIRE_HOOK>
{
@ -69,7 +63,6 @@ public:
template<>
class GetHandlerCompileTime<E_BLOCK_WOODEN_DOOR>
{
@ -81,7 +74,6 @@ public:
template<>
class GetHandlerCompileTime<E_BLOCK_PISTON>
{

View File

@ -11,9 +11,6 @@
cBrewingRecipes::cBrewingRecipes()
{
ReloadRecipes();
@ -197,7 +194,6 @@ const cBrewingRecipes::cRecipe * cBrewingRecipes::GetRecipeFrom(const cItem & a_
bool cBrewingRecipes::IsIngredient(const cItem & a_Ingredient) const
{
// Check for gunpowder

View File

@ -365,6 +365,7 @@ void cWorld::BroadcastEntityVelocity(const cEntity & a_Entity, const cClientHand
void cWorld::BroadcastEntityAnimation(const cEntity & a_Entity, Int8 a_Animation, const cClientHandle * a_Exclude)
{
ForClientsWithEntity(a_Entity, *this, a_Exclude, [&](cClientHandle & a_Client)
@ -417,7 +418,6 @@ void cWorld::BroadcastParticleEffect(const AString & a_ParticleName, const Vecto
void cWorld::BroadcastPlayerListAddPlayer(const cPlayer & a_Player, const cClientHandle * a_Exclude)
{
ForClientsInWorld(*this, a_Exclude, [&](cClientHandle & a_Client)

View File

@ -645,7 +645,6 @@ bool cByteBuffer::WriteBEDouble(double a_Value)
bool cByteBuffer::WriteBool(bool a_Value)
{
CHECK_THREAD

View File

@ -44,11 +44,6 @@ local g_IgnoredFiles =
"Bindings/Bindings.h",
"Bindings/Bindings.cpp",
"Bindings/LuaState_Implementation.cpp",
"LeakFinder.cpp",
"LeakFinder.h",
"MersenneTwister.h",
"StackWalker.cpp",
"StackWalker.h",
}
--- The list of files not to be processed, as a dictionary (filename => true), built from g_IgnoredFiles
@ -241,6 +236,9 @@ local function ProcessFile(a_FileName)
local lineCounter = 1
local lastIndentLevel = 0
local isLastLineControl = false
local lastNonEmptyLine = 0
local isAfterFunction = false
local isSourceFile = a_FileName:match("%.cpp")
all = all:gsub("\r\n", "\n") -- normalize CRLF into LF-only
string.gsub(all .. "\n", "[^\n]*\n", -- Iterate over each line, while preserving empty lines
function(a_Line)
@ -296,6 +294,26 @@ local function ProcessFile(a_FileName)
lineWithSpace:find("^%s+else //") or
lineWithSpace:find("^%s+do %b()")
-- Check that exactly 5 empty lines are left beteen functions and no more than 5 elsewhere
if not(a_Line:find("^\n")) then
local numEmptyLines = (lineCounter - lastNonEmptyLine) - 1
local isStartOfFunction = (
isAfterFunction and
a_Line:find("^[%s%w]")
)
if (isSourceFile and isStartOfFunction and (numEmptyLines ~= 5)) then
ReportViolation(a_FileName, lineCounter - 1, 1, 1, "Leave exactly 5 empty lines between functions (found " .. numEmptyLines ..")")
elseif (numEmptyLines > 5) then
ReportViolation(a_FileName, lineCounter - 1, 1, 1, "Leave at most 5 consecutive empty lines (found " .. numEmptyLines .. ")")
end
lastNonEmptyLine = lineCounter
isAfterFunction = (a_Line == "}\n")
end
lineCounter = lineCounter + 1
end
)

View File

@ -511,6 +511,7 @@ void cChunk::Stay(bool a_Stay)
void cChunk::CollectMobCensus(cMobCensus & toFill)
{
toFill.CollectSpawnableChunk(*this);
@ -541,6 +542,7 @@ void cChunk::CollectMobCensus(cMobCensus & toFill)
void cChunk::GetThreeRandomNumbers(int & a_X, int & a_Y, int & a_Z, int a_MaxX, int a_MaxY, int a_MaxZ)
{
ASSERT(
@ -2291,6 +2293,7 @@ bool cChunk::DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBloc
bool cChunk::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCallback a_Callback)
{
return GenericDoWithBlockEntityAt<cBeaconEntity,
@ -2301,6 +2304,7 @@ bool cChunk::DoWithBeaconAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBeaconCal
bool cChunk::DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback a_Callback)
{
return GenericDoWithBlockEntityAt<cBedEntity,
@ -2311,6 +2315,7 @@ bool cChunk::DoWithBedAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBedCallback
bool cChunk::DoWithBrewingstandAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBrewingstandCallback a_Callback)
{
return GenericDoWithBlockEntityAt<cBrewingstandEntity,
@ -2474,7 +2479,6 @@ void cChunk::GetBlockInfo(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE
bool cChunk::GetChunkAndRelByAbsolute(const Vector3d & a_Position, cChunk ** a_Chunk, Vector3i & a_Rel)
{
return GetChunkAndRelByAbsolute(Vector3i(FloorC(a_Position.x), FloorC(a_Position.y), FloorC(a_Position.z)), a_Chunk, a_Rel);
@ -2499,6 +2503,9 @@ bool cChunk::GetChunkAndRelByAbsolute(const Vector3i & a_Position, cChunk ** a_C
}
cChunk * cChunk::GetNeighborChunk(int a_BlockX, int a_BlockZ)
{
// Convert coords to relative, then call the relative version:

View File

@ -575,6 +575,7 @@ void cChunkData::SetBlockTypes(const BLOCKTYPE * a_Src)
void cChunkData::SetMetas(const NIBBLETYPE * a_Src)
{
ASSERT(a_Src != nullptr);
@ -643,6 +644,7 @@ void cChunkData::SetBlockLight(const NIBBLETYPE * a_Src)
void cChunkData::SetSkyLight(const NIBBLETYPE * a_Src)
{
if (a_Src == nullptr)

View File

@ -306,6 +306,9 @@ bool cChunkMap::DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback a_Callbac
}
bool cChunkMap::DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback)
{
int ChunkX, ChunkZ;
@ -316,6 +319,7 @@ bool cChunkMap::DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback)
void cChunkMap::WakeUpSimulators(Vector3i a_Block)
{
cCSLock Lock(m_CSChunks);
@ -1678,6 +1682,7 @@ bool cChunkMap::DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurna
bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback a_Callback)
{
int ChunkX, ChunkZ;
@ -1695,6 +1700,7 @@ bool cChunkMap::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNot
bool cChunkMap::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback a_Callback)
{
int ChunkX, ChunkZ;
@ -2134,6 +2140,7 @@ void cChunkMap::SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ)
void cChunkMap::CollectMobCensus(cMobCensus & a_ToFill)
{
cCSLock Lock(m_CSChunks);
@ -2153,7 +2160,6 @@ void cChunkMap::CollectMobCensus(cMobCensus & a_ToFill)
void cChunkMap::SpawnMobs(cMobSpawner & a_MobSpawner)
{
cCSLock Lock(m_CSChunks);
@ -2313,7 +2319,6 @@ void cChunkMap::SetChunkAlwaysTicked(int a_ChunkX, int a_ChunkZ, bool a_AlwaysTi
void cChunkMap::TrackInDeadlockDetect(cDeadlockDetect & a_DeadlockDetect, const AString & a_WorldName)
{
a_DeadlockDetect.TrackCriticalSection(m_CSChunks, Printf("World %s chunkmap", a_WorldName.c_str()));

View File

@ -56,7 +56,6 @@ public:
////////////////////////////////////////////////////////////////////////////////
// cChunkSender:
@ -122,7 +121,6 @@ void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a
void cChunkSender::QueueSendChunkTo(int a_ChunkX, int a_ChunkZ, eChunkPriority a_Priority, cChunkClientHandles a_Clients)
{
{
@ -279,6 +277,7 @@ void cChunkSender::BlockEntity(cBlockEntity * a_Entity)
void cChunkSender::Entity(cEntity *)
{
// Nothing needed yet, perhaps in the future when we save entities into chunks we'd like to send them upon load, too ;)

View File

@ -51,7 +51,6 @@ static const std::chrono::milliseconds PING_TIME_MS = std::chrono::milliseconds(
int cClientHandle::s_ClientCount = 0;
@ -2705,6 +2704,7 @@ void cClientHandle::SendPickupSpawn(const cPickup & a_Pickup)
void cClientHandle::SendPaintingSpawn(const cPainting & a_Painting)
{
m_Protocol->SendPaintingSpawn(a_Painting);
@ -3088,6 +3088,7 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
void cClientHandle::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
m_Protocol->SendUpdateBlockEntity(a_BlockEntity);
@ -3120,6 +3121,7 @@ void cClientHandle::SendUseBed(const cEntity & a_Entity, int a_BlockX, int a_Blo
void cClientHandle::SendWeather(eWeather a_Weather)
{
m_Protocol->SendWeather(a_Weather);

View File

@ -46,7 +46,6 @@ class cNullCommandOutputCallback :
/** Accumulates all command output into a string. */
class cStringAccumCommandOutputCallback:
public cCommandOutputCallback

View File

@ -358,6 +358,7 @@ void cCraftingRecipes::LoadRecipes(void)
void cCraftingRecipes::ClearRecipes(void)
{
for (cRecipes::iterator itr = m_Recipes.begin(); itr != m_Recipes.end(); ++itr)

View File

@ -89,7 +89,6 @@ void cCuboid::Move(int a_OfsX, int a_OfsY, int a_OfsZ)
void cCuboid::Expand(int a_SubMinX, int a_AddMaxX, int a_SubMinY, int a_AddMaxY, int a_SubMinZ, int a_AddMaxZ)
{
if (p1.x < p2.x)

View File

@ -12,7 +12,6 @@ typedef std::vector<int> cSlotNums;
// tolua_begin
/** Experience Orb setup */

View File

@ -148,7 +148,6 @@ void cEnchantments::SetLevel(int a_EnchantmentID, unsigned int a_Level)
void cEnchantments::Clear(void)
{
m_Enchantments.clear();

View File

@ -15,7 +15,6 @@
// tolua_begin
class cArrowEntity :

View File

@ -29,6 +29,7 @@ cBoat::cBoat(Vector3d a_Pos, eMaterial a_Material) :
void cBoat::SpawnOn(cClientHandle & a_ClientHandle)
{
a_ClientHandle.SendSpawnVehicle(*this, 1);
@ -153,6 +154,7 @@ void cBoat::HandleSpeedFromAttachee(float a_Forward, float a_Sideways)
void cBoat::SetLastDamage(int TimeSinceLastHit)
{
m_LastDamage = TimeSinceLastHit;

View File

@ -185,6 +185,7 @@ void cEntity::WrapHeadYaw(void)
void cEntity::WrapRotation(void)
{
m_Rot.x = NormalizeAngleDegrees(m_Rot.x);
@ -194,6 +195,7 @@ void cEntity::WrapRotation(void)
void cEntity::WrapSpeed(void)
{
m_Speed.x = Clamp(m_Speed.x, -78.0, 78.0);
@ -264,7 +266,6 @@ void cEntity::DestroyNoScheduling(bool a_ShouldBroadcast)
void cEntity::TakeDamage(cEntity & a_Attacker)
{
int RawDamage = a_Attacker.GetRawDamageAgainst(*this);
@ -590,6 +591,7 @@ int cEntity::GetRawDamageAgainst(const cEntity & a_Receiver)
void cEntity::ApplyArmorDamage(int DamageBlocked)
{
// cEntities don't necessarily have armor to damage.
@ -681,7 +683,6 @@ int cEntity::GetEnchantmentCoverAgainst(const cEntity * a_Attacker, eDamageType
float cEntity::GetEnchantmentBlastKnockbackReduction()
{
UInt32 MaxLevel = 0;
@ -707,7 +708,6 @@ float cEntity::GetEnchantmentBlastKnockbackReduction()
int cEntity::GetArmorCoverAgainst(const cEntity * a_Attacker, eDamageType a_DamageType, int a_Damage)
{
// Returns the hitpoints out of a_RawDamage that the currently equipped armor would cover
@ -1323,6 +1323,7 @@ void cEntity::DetectCacti(void)
void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool a_SetPortalCooldown, bool a_ShouldSendRespawn)
{
m_NewWorld = a_World;
@ -1335,6 +1336,7 @@ void cEntity::ScheduleMoveToWorld(cWorld * a_World, Vector3d a_NewPosition, bool
bool cEntity::DetectPortal()
{
// If somebody scheduled a world change with ScheduleMoveToWorld, change worlds now.
@ -1961,6 +1963,7 @@ void cEntity::BroadcastMovementUpdate(const cClientHandle * a_Exclude)
cEntity * cEntity::GetAttached()
{
return m_AttachedTo;
@ -2107,6 +2110,7 @@ void cEntity::SetSpeed(double a_SpeedX, double a_SpeedY, double a_SpeedZ)
void cEntity::SetSpeedX(double a_SpeedX)
{
SetSpeed(a_SpeedX, m_Speed.y, m_Speed.z);
@ -2115,6 +2119,7 @@ void cEntity::SetSpeedX(double a_SpeedX)
void cEntity::SetSpeedY(double a_SpeedY)
{
SetSpeed(m_Speed.x, a_SpeedY, m_Speed.z);
@ -2123,6 +2128,7 @@ void cEntity::SetSpeedY(double a_SpeedY)
void cEntity::SetSpeedZ(double a_SpeedZ)
{
SetSpeed(m_Speed.x, m_Speed.y, a_SpeedZ);
@ -2140,6 +2146,7 @@ void cEntity::SetWidth(double a_Width)
void cEntity::AddSpeed(double a_AddSpeedX, double a_AddSpeedY, double a_AddSpeedZ)
{
DoSetSpeed(m_Speed.x + a_AddSpeedX, m_Speed.y + a_AddSpeedY, m_Speed.z + a_AddSpeedZ);
@ -2248,6 +2255,7 @@ void cEntity::AddLeashedMob(cMonster * a_Monster)
void cEntity::RemoveLeashedMob(cMonster * a_Monster)
{
ASSERT(a_Monster->GetLeashedTo() == this);
@ -2262,7 +2270,6 @@ void cEntity::RemoveLeashedMob(cMonster * a_Monster)
float cEntity::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower)
{
double EntitySize = m_Width * m_Width * m_Height;

View File

@ -82,6 +82,10 @@ void cExpOrb::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
}
}
bool cExpOrb::DoTakeDamage(TakeDamageInfo & a_TDI)
{
if (a_TDI.DamageType == dtCactusContact)

View File

@ -52,7 +52,6 @@ void cItemFrame::OnRightClicked(cPlayer & a_Player)
void cItemFrame::KilledBy(TakeDamageInfo & a_TDI)
{
if (m_Item.IsEmpty())

View File

@ -80,7 +80,6 @@ void cLeashKnot::TiePlayersLeashedMobs(cPlayer & a_Player, bool a_ShouldBroadcas
void cLeashKnot::KilledBy(TakeDamageInfo & a_TDI)
{
super::KilledBy(a_TDI);
@ -115,6 +114,7 @@ void cLeashKnot::SpawnOn(cClientHandle & a_ClientHandle)
void cLeashKnot::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
m_TicksAlive++;

View File

@ -109,6 +109,7 @@ cMinecart::cMinecart(ePayload a_Payload, double a_X, double a_Y, double a_Z) :
void cMinecart::SpawnOn(cClientHandle & a_ClientHandle)
{
a_ClientHandle.SendSpawnVehicle(*this, 10, static_cast<char>(m_Payload)); // 10 = Minecarts
@ -403,6 +404,7 @@ void cMinecart::HandleRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::millisecon
void cMinecart::HandlePoweredRailPhysics(NIBBLETYPE a_RailMeta)
{
// If the rail is powered set to speed up else slow down.
@ -580,6 +582,7 @@ void cMinecart::HandleDetectorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::mi
void cMinecart::HandleActivatorRailPhysics(NIBBLETYPE a_RailMeta, std::chrono::milliseconds a_Dt)
{
HandleRailPhysics(a_RailMeta & 0x07, a_Dt);
@ -869,6 +872,7 @@ bool cMinecart::TestBlockCollision(NIBBLETYPE a_RailMeta)
bool cMinecart::TestEntityCollision(NIBBLETYPE a_RailMeta)
{
cMinecartCollisionCallback MinecartCollisionCallback(

View File

@ -20,7 +20,6 @@ cPainting::cPainting(const AString & a_Name, eBlockFace a_Direction, double a_X,
void cPainting::SpawnOn(cClientHandle & a_Client)
{
super::SpawnOn(a_Client);

View File

@ -984,6 +984,7 @@ void cPlayer::SetFlying(bool a_IsFlying)
void cPlayer::ApplyArmorDamage(int a_DamageBlocked)
{
short ArmorDamage = static_cast<short>(std::max(a_DamageBlocked / 4, 1));
@ -1247,6 +1248,7 @@ double cPlayer::GetEyeHeight(void) const
Vector3d cPlayer::GetEyePosition(void) const
{
return Vector3d( GetPosX(), m_Stance, GetPosZ());
@ -1282,6 +1284,7 @@ bool cPlayer::IsGameModeAdventure(void) const
bool cPlayer::IsGameModeSpectator(void) const
{
return (GetEffectiveGameMode() == gmSpectator);
@ -2979,6 +2982,7 @@ void cPlayer::FreezeInternal(const Vector3d & a_Location, bool a_ManuallyFrozen)
float cPlayer::GetLiquidHeightPercent(NIBBLETYPE a_Meta)
{
if (a_Meta >= 8)
@ -3073,7 +3077,6 @@ float cPlayer::GetPlayerRelativeBlockHardness(BLOCKTYPE a_Block)
float cPlayer::GetExplosionExposureRate(Vector3d a_ExplosionPosition, float a_ExlosionPower)
{
if (

View File

@ -19,6 +19,7 @@ cTNTEntity::cTNTEntity(Vector3d a_Pos, int a_FuseTicks) :
void cTNTEntity::SpawnOn(cClientHandle & a_ClientHandle)
{
a_ClientHandle.SendSpawnObject(*this, 50, 1, 0, 0); // 50 means TNT

View File

@ -382,6 +382,7 @@ void cBioGenDistortedVoronoi::InitializeBiomeGen(cIniFile & a_IniFile)
void cBioGenDistortedVoronoi::Distort(int a_BlockX, int a_BlockZ, int & a_DistortedX, int & a_DistortedZ)
{
double NoiseX = m_Noise.CubicNoise3D(static_cast<float>(a_BlockX / m_CellSize), static_cast<float>(a_BlockZ / m_CellSize), 1000);

View File

@ -609,7 +609,6 @@ cStructGenWormNestCaves::cCaveSystem::~cCaveSystem()
void cStructGenWormNestCaves::cCaveSystem::DrawIntoChunk(cChunkDesc & a_ChunkDesc)
{
int ChunkX = a_ChunkDesc.GetChunkX();
@ -701,7 +700,6 @@ cGridStructGen::cStructurePtr cStructGenWormNestCaves::CreateStructure(int a_Gri
////////////////////////////////////////////////////////////////////////////////
// cStructGenMarbleCaves:

View File

@ -124,6 +124,7 @@ void cChunkDesc::SetBiome(int a_RelX, int a_RelZ, EMCSBiome a_BiomeID)
EMCSBiome cChunkDesc::GetBiome(int a_RelX, int a_RelZ)
{
return cChunkDef::GetBiome(m_BiomeMap, a_RelX, a_RelZ);
@ -268,6 +269,7 @@ bool cChunkDesc::IsUsingDefaultFinish(void) const
void cChunkDesc::WriteBlockArea(const cBlockArea & a_BlockArea, int a_RelX, int a_RelY, int a_RelZ, cBlockArea::eMergeStrategy a_MergeStrategy)
{
m_BlockArea.Merge(a_BlockArea, a_RelX, a_RelY, a_RelZ, a_MergeStrategy);

View File

@ -282,6 +282,7 @@ void cChunkGenerator::Execute(void)
void cChunkGenerator::DoGenerate(int a_ChunkX, int a_ChunkZ)
{
ASSERT(m_PluginInterface != nullptr);

View File

@ -156,7 +156,6 @@ static cPattern::BlockInfo tbOFOrangeClay[] =
////////////////////////////////////////////////////////////////////////////////
// Individual patterns to use:

View File

@ -283,7 +283,6 @@ protected:
////////////////////////////////////////////////////////////////////////////////
// cDungeonRoomsFinisher:
@ -308,7 +307,6 @@ cDungeonRoomsFinisher::cDungeonRoomsFinisher(cTerrainShapeGenPtr a_ShapeGen, int
cDungeonRoomsFinisher::cStructurePtr cDungeonRoomsFinisher::CreateStructure(int a_GridX, int a_GridZ, int a_OriginX, int a_OriginZ)
{
// Select a random room size in each direction:

View File

@ -295,7 +295,6 @@ bool cHeiGenMultiCache::GetHeightAt(int a_ChunkX, int a_ChunkZ, int a_RelX, int
////////////////////////////////////////////////////////////////////////////////
// cHeiGenClassic:

View File

@ -174,7 +174,6 @@ protected:
/** Generates a 2D array of random integers in the specified range [0 .. Range). */
template <int Range, int SizeX, int SizeZ = SizeX>
class cIntGenChoice :
@ -206,7 +205,6 @@ public:
/** Decides between the ocean and landmass biomes.
Has a threshold (in percent) of how much land, the larger the threshold, the more land.
Generates 0 for ocean, biome group ID for landmass. */
@ -1117,7 +1115,6 @@ protected:
/** Adds a "rare" flag to random biome groups, based on the given chance. */
template <int SizeX, int SizeZ = SizeX>
class cIntGenRareBiomeGroups:

View File

@ -783,6 +783,7 @@ void cBiomalNoise3DComposable::GetBiomeParams(EMCSBiome a_Biome, NOISE_DATATYPE
void cBiomalNoise3DComposable::GenShape(int a_ChunkX, int a_ChunkZ, cChunkDesc::Shape & a_Shape)
{
GenerateNoiseArrayIfNeeded(a_ChunkX, a_ChunkZ);

View File

@ -14,7 +14,6 @@
class cPieceStructuresGen::cGen:
public cGridStructGen
{
@ -119,7 +118,6 @@ protected:
////////////////////////////////////////////////////////////////////////////////
// cPieceStructuresGen:

View File

@ -137,6 +137,7 @@ void cPrefab::Draw(cChunkDesc & a_Dest, const cPlacedPiece * a_Placement) const
void cPrefab::Draw(cChunkDesc & a_Dest, const Vector3i & a_Placement, int a_NumRotations) const
{
// Draw the basic image:

View File

@ -106,7 +106,6 @@ protected:
/** Generates a 2D array of random integers in the specified range [0 .. Range). */
class cProtIntGenChoice :
public cProtIntGenWithNoise
@ -141,7 +140,6 @@ protected:
/** Decides between the ocean and landmass biomes.
Has a threshold (in percent) of how much land, the larger the threshold, the more land.
Generates 0 for ocean, biome group ID for landmass. */
@ -1366,7 +1364,6 @@ protected:
/** Adds a "rare" flag to random biome groups, based on the given chance. */
class cProtIntGenRareBiomeGroups:
public cProtIntGenWithNoise

View File

@ -99,7 +99,6 @@ cGridStructGen::cStructurePtr cStructGenRavines::CreateStructure(int a_GridX, in
////////////////////////////////////////////////////////////////////////////////
// cStructGenRavines::cRavine

View File

@ -35,4 +35,3 @@ protected:

View File

@ -106,7 +106,6 @@ protected:
class cStructGenDirectOverhangs :
public cFinishGen
{

View File

@ -13,7 +13,6 @@
class cHTTPMessage
{
public:

View File

@ -119,6 +119,7 @@ void cHTTPMessageParser::Reset(void)
size_t cHTTPMessageParser::ParseFirstLine(void)
{
auto idxLineEnd = m_Buffer.find("\r\n");
@ -136,6 +137,7 @@ size_t cHTTPMessageParser::ParseFirstLine(void)
size_t cHTTPMessageParser::ParseBody(const char * a_Data, size_t a_Size)
{
if (m_TransferEncodingParser == nullptr)

View File

@ -27,7 +27,6 @@ class cSslConfig;
class cHTTPServer
{
public:

View File

@ -142,7 +142,6 @@ void cHTTPServerConnection::OnRemoteClosed(void)
void cHTTPServerConnection::OnError(int a_ErrorCode, const AString & a_ErrorMsg)
{
OnRemoteClosed();

View File

@ -10,7 +10,6 @@
// DEBUG: Self-test
#if 0

View File

@ -101,6 +101,8 @@ int cInventory::HowManyCanFit(const cItem & a_ItemStack, int a_BeginSlotNum, int
int cInventory::AddItem(const cItem & a_Item, bool a_AllowNewStacks)
{
cItem ToAdd(a_Item);

View File

@ -709,7 +709,6 @@ bool cItemHandler::IsPlaceable(void)
bool cItemHandler::CanRepairWithRawMaterial(short a_ItemType)
{
UNUSED(a_ItemType);
@ -840,10 +839,6 @@ cItemHandler::FoodInfo cItemHandler::GetFoodInfo(const cItem * a_Item)
float cItemHandler::GetBlockBreakingStrength(BLOCKTYPE a_Block)
{
return 1.0f;

View File

@ -12,7 +12,6 @@
/** Chunk data callback that takes the chunk data and puts them into cLightingThread's m_BlockTypes[] / m_HeightMap[]: */
class cReader :
public cChunkDataCallback
@ -231,7 +230,6 @@ void cLightingThread::Execute(void)
void cLightingThread::LightChunk(cLightingChunkStay & a_Item)
{
// If the chunk is already lit, skip it (report as success):

View File

@ -13,7 +13,6 @@
cLineBlockTracer::cLineBlockTracer(cWorld & a_World, cCallbacks & a_Callbacks) :
super(a_World, a_Callbacks),
m_StartX(0.0),

View File

@ -199,7 +199,6 @@ eDimension cMap::GetDimension(void) const
void cMap::Resize(unsigned int a_Width, unsigned int a_Height)
{
if ((m_Width == a_Width) && (m_Height == a_Height))
@ -333,6 +332,7 @@ const cMapDecorator cMap::CreateDecorator(const cEntity * a_TrackedEntity)
unsigned int cMap::GetPixelWidth(void) const
{
return static_cast<unsigned int>(pow(2.0, static_cast<double>(m_Scale)));

View File

@ -33,6 +33,7 @@ bool cMemorySettingsRepository::HasValue(const AString & a_KeyName, const AStrin
int cMemorySettingsRepository::AddKeyName(const AString & a_keyname)
{
m_Map.emplace(a_keyname, std::unordered_multimap<AString, sValue>{});
@ -70,7 +71,6 @@ bool cMemorySettingsRepository::DeleteKeyComment(const AString & keyname, const
void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, const AString & a_Value)
{
if (m_Writable)
@ -82,6 +82,7 @@ void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AStri
void cMemorySettingsRepository::AddValue (const AString & a_KeyName, const AString & a_ValueName, Int64 a_Value)
{
if (m_Writable)
@ -201,6 +202,7 @@ Int64 cMemorySettingsRepository::GetValueSetI(const AString & a_KeyName, const A
bool cMemorySettingsRepository::GetValueSetB(const AString & a_KeyName, const AString & a_ValueName, const bool defValue)
{
auto outerIter = m_Map.find(a_KeyName);
@ -253,6 +255,7 @@ bool cMemorySettingsRepository::SetValue (const AString & a_KeyName, const AStri
bool cMemorySettingsRepository::SetValueI(const AString & a_KeyName, const AString & a_ValueName, const int a_Value, const bool a_CreateIfNotExists)
{
if (!m_Writable)
@ -305,6 +308,10 @@ bool cMemorySettingsRepository::DeleteValue(const AString & a_KeyName, const ASt
return true;
}
bool cMemorySettingsRepository::Flush()
{
return true;

View File

@ -36,6 +36,10 @@ void cMobProximityCounter::CollectMob(cEntity & a_Monster, cChunk & a_Chunk, dou
}
void cMobProximityCounter::convertMaps()
{
for (tMonsterToDistance::const_iterator itr = m_MonsterToDistance.begin(); itr != m_MonsterToDistance.end(); ++itr)
@ -44,6 +48,10 @@ void cMobProximityCounter::convertMaps()
}
}
cMobProximityCounter::sIterablePair cMobProximityCounter::getMobWithinThosesDistances(double a_DistanceMin, double a_DistanceMax)
{
sIterablePair toReturn;

View File

@ -36,7 +36,6 @@ void cAggressiveMonster::InStateChasing(std::chrono::milliseconds a_Dt, cChunk &
void cAggressiveMonster::EventSeePlayer(cPlayer * a_Player, cChunk & a_Chunk)
{
if (!a_Player->CanMobsTarget())

View File

@ -7,8 +7,6 @@
cChicken::cChicken(void) :
super("Chicken", mtChicken, "entity.chicken.hurt", "entity.chicken.death", 0.4, 0.7),
m_EggDropTimer(0)
@ -20,6 +18,7 @@ cChicken::cChicken(void) :
void cChicken::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
super::Tick(a_Dt, a_Chunk);

View File

@ -8,8 +8,6 @@
cCow::cCow(void) :
super("Cow", mtCow, "entity.cow.hurt", "entity.cow.death", 0.9, 1.3)
{

View File

@ -97,6 +97,7 @@ void cEnderman::GetDrops(cItems & a_Drops, cEntity * a_Killer)
void cEnderman::CheckEventSeePlayer(cChunk & a_Chunk)
{
if (GetTarget() != nullptr)

View File

@ -27,6 +27,8 @@ void cMagmaCube::GetDrops(cItems & a_Drops, cEntity * a_Killer)
AString cMagmaCube::GetSizeName(int a_Size)
{
if (a_Size == 1)

View File

@ -1079,7 +1079,6 @@ int cMonster::GetSpawnDelay(cMonster::eFamily a_MobFamily)
/** Sets the target. */
void cMonster::SetTarget (cPawn * a_NewTarget)
{
@ -1347,6 +1346,7 @@ void cMonster::HandleDaylightBurning(cChunk & a_Chunk, bool WouldBurn)
bool cMonster::WouldBurnAt(Vector3d a_Location, cChunk & a_Chunk)
{
// If the Y coord is out of range, return the most logical result without considering anything else:

View File

@ -8,11 +8,6 @@
cMooshroom::cMooshroom(void) :
super("Mooshroom", mtMooshroom, "entity.cow.hurt", "entity.cow.death", 0.9, 1.3)
{

View File

@ -66,6 +66,10 @@ cPath::cPath(
ProcessCell(GetCell(m_Source), nullptr, 0);
}
cPath::cPath() : m_IsValid(false)
{
@ -73,6 +77,8 @@ cPath::cPath() : m_IsValid(false)
ePathFinderStatus cPath::CalculationStep(cChunk & a_Chunk)
{
m_Chunk = &a_Chunk;

View File

@ -182,6 +182,7 @@ void cVillager::HandleFarmerTryHarvestCrops()
void cVillager::HandleFarmerPlaceCrops()
{
// Check if there is still farmland at the spot where the crops were.

View File

@ -88,6 +88,10 @@ void cWolf::NotifyAlliesOfFight(cPawn * a_Opponent)
);
}
bool cWolf::Attack(std::chrono::milliseconds a_Dt)
{
UNUSED(a_Dt);
@ -384,6 +388,8 @@ void cWolf::TickFollowPlayer()
void cWolf::InStateIdle(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
if (!IsTame())

View File

@ -9,7 +9,6 @@
const double cNetherPortalScanner::OutOffset = 2;
const double cNetherPortalScanner::AcrossOffset = 0.5;

View File

@ -62,6 +62,7 @@ void cEvent::Set(void)
void cEvent::SetAll(void)
{
{

View File

@ -213,7 +213,6 @@ long cFile::Seek (int iPosition)
long cFile::Tell (void) const
{
ASSERT(IsOpen());

View File

@ -29,7 +29,6 @@ typedef std::shared_ptr<cX509Cert> cX509CertPtr;
/** Interface that provides the methods available on a single TCP connection. */
class cTCPLink
{

View File

@ -235,7 +235,6 @@ void cTCPLinkImpl::Close(void)
AString cTCPLinkImpl::StartTLSClient(
cX509CertPtr a_OwnCert,
cCryptoKeyPtr a_OwnPrivKey

View File

@ -715,6 +715,7 @@ WinStackWalker::WinStackWalker(DWORD dwProcessId, HANDLE hProcess)
WinStackWalker::WinStackWalker(int options, LPCSTR szSymPath, DWORD dwProcessId, HANDLE hProcess)
{
this->m_options = options;

View File

@ -20,6 +20,7 @@ bool cOverridesSettingsRepository::KeyExists(const AString a_keyName) const
bool cOverridesSettingsRepository::HasValue(const AString & a_KeyName, const AString & a_ValueName) const
{
return m_Overrides->HasValue(a_KeyName, a_ValueName) || m_Main->HasValue(a_KeyName, a_ValueName);
@ -260,6 +261,8 @@ bool cOverridesSettingsRepository::DeleteValue(const AString & a_KeyName, const
bool cOverridesSettingsRepository::Flush()
{
return m_Overrides->Flush() && m_Main->Flush();

View File

@ -20,7 +20,6 @@ cProbabDistrib::cProbabDistrib(int a_MaxValue) :
void cProbabDistrib::SetPoints(const cProbabDistrib::cPoints & a_Points)
{
ASSERT(!a_Points.empty());

View File

@ -181,6 +181,7 @@ AStringMap cForgeHandshake::ParseModList(const char * a_Data, size_t a_Size)
void cForgeHandshake::HandleClientHello(cClientHandle * a_Client, const char * a_Data, size_t a_Size)
{
if (a_Size == 2)
@ -201,6 +202,7 @@ void cForgeHandshake::HandleClientHello(cClientHandle * a_Client, const char * a
void cForgeHandshake::HandleModList(cClientHandle * a_Client, const char * a_Data, size_t a_Size)
{
LOGD("Received ModList");
@ -248,6 +250,7 @@ void cForgeHandshake::HandleModList(cClientHandle * a_Client, const char * a_Dat
void cForgeHandshake::HandleHandshakeAck(cClientHandle * a_Client, const char * a_Data, size_t a_Size)
{
if (a_Size != 2)

View File

@ -38,7 +38,6 @@ const int MAX_PER_QUERY = 100;
/** Returns the CA certificates that should be trusted for Mojang-related connections. */
static cX509CertPtr GetCACerts(void)
{

View File

@ -191,6 +191,7 @@ void cProtocolRecognizer::SendBlockChanges(int a_ChunkX, int a_ChunkZ, const sSe
void cProtocolRecognizer::SendCameraSetTo(const cEntity & a_Entity)
{
ASSERT(m_Protocol != nullptr);
@ -288,6 +289,7 @@ void cProtocolRecognizer::SendDisconnect(const AString & a_Reason)
void cProtocolRecognizer::SendEditSign(int a_BlockX, int a_BlockY, int a_BlockZ)
{
ASSERT(m_Protocol != nullptr);
@ -438,7 +440,6 @@ void cProtocolRecognizer::SendHeldItemChange(int a_ItemIndex)
void cProtocolRecognizer::SendHideTitle(void)
{
ASSERT(m_Protocol != nullptr);

View File

@ -520,7 +520,6 @@ void cProtocol_1_11_0::WriteBlockEntity(cPacketizer & a_Pkt, const cBlockEntity
void cProtocol_1_11_0::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int a_FadeOutTicks)
{
ASSERT(m_State == 3); // In game mode?
@ -536,7 +535,6 @@ void cProtocol_1_11_0::SendTitleTimes(int a_FadeInTicks, int a_DisplayTicks, int
void cProtocol_1_11_0::HandlePacketBlockPlace(cByteBuffer & a_ByteBuffer)
{
int BlockX, BlockY, BlockZ;

View File

@ -710,6 +710,7 @@ void cProtocol_1_8_0::SendLogin(const cPlayer & a_Player, const cWorld & a_World
void cProtocol_1_8_0::SendLoginSuccess(void)
{
ASSERT(m_State == 2); // State: login?
@ -1550,6 +1551,7 @@ void cProtocol_1_8_0::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
void cProtocol_1_8_0::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
ASSERT(m_State == 3); // In game mode?
@ -2060,6 +2062,7 @@ void cProtocol_1_8_0::AddReceivedData(const char * a_Data, size_t a_Size)
bool cProtocol_1_8_0::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType)
{
switch (m_State)

View File

@ -649,7 +649,6 @@ void cProtocol_1_9_0::SendHeldItemChange(int a_ItemIndex)
void cProtocol_1_9_0::SendHideTitle(void)
{
ASSERT(m_State == 3); // In game mode?
@ -751,6 +750,7 @@ void cProtocol_1_9_0::SendLogin(const cPlayer & a_Player, const cWorld & a_World
void cProtocol_1_9_0::SendLoginSuccess(void)
{
ASSERT(m_State == 2); // State: login?
@ -1597,6 +1597,7 @@ void cProtocol_1_9_0::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
void cProtocol_1_9_0::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
ASSERT(m_State == 3); // In game mode?
@ -2107,6 +2108,7 @@ void cProtocol_1_9_0::AddReceivedData(const char * a_Data, size_t a_Size)
bool cProtocol_1_9_0::HandlePacket(cByteBuffer & a_ByteBuffer, UInt32 a_PacketType)
{
switch (m_State)

View File

@ -770,7 +770,6 @@ std::vector<cUUID> cRankManager::GetAllPlayerUUIDs(void)
AStringVector cRankManager::GetAllRanks(void)
{
ASSERT(m_IsInitialized);
@ -2202,7 +2201,6 @@ bool cRankManager::UpdatePlayerName(const cUUID & a_PlayerUUID, const AString &
bool cRankManager::AreDBTablesEmpty(void)
{
return (
@ -2275,6 +2273,7 @@ void cRankManager::CreateDefaults(void)
bool cRankManager::DoesColumnExist(const char * a_TableName, const char * a_ColumnName)
{
try

View File

@ -249,6 +249,7 @@ void cTeam::Reset(void)
void cTeam::SetDisplayName(const AString & a_Name)
{
m_DisplayName = a_Name;

View File

@ -260,6 +260,7 @@ void cServer::UnregisterForgeMod(const AString & a_ModName, UInt32 a_ProtocolVer
AStringMap & cServer::RegisteredForgeMods(const UInt32 a_Protocol)
{
auto it = m_ForgeModsByVersion.find(a_Protocol);
@ -277,6 +278,7 @@ AStringMap & cServer::RegisteredForgeMods(const UInt32 a_Protocol)
const AStringMap & cServer::GetRegisteredForgeMods(const UInt32 a_Protocol)
{
return RegisteredForgeMods(a_Protocol);
@ -285,6 +287,7 @@ const AStringMap & cServer::GetRegisteredForgeMods(const UInt32 a_Protocol)
bool cServer::IsPlayerInQueue(AString a_Username)
{
cCSLock Lock(m_CSClients);

View File

@ -127,7 +127,6 @@ void cSetChunkData::CalculateHeightMap(void)
void cSetChunkData::RemoveInvalidBlockEntities(void)
{
for (cBlockEntities::iterator itr = m_BlockEntities.begin(); itr != m_BlockEntities.end();)

Some files were not shown because too many files have changed in this diff Show More