From 82a06725bddd18e88db59afac65435bf3079a26b Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Fri, 10 Jan 2014 16:31:45 +0100
Subject: Added cFinishGenNetherSprinkleFoliage.
---
src/Generating/ComposableGenerator.cpp | 8 ++++--
src/Generating/FinishGen.cpp | 45 ++++++++++++++++++++++++++++++++++
src/Generating/FinishGen.h | 22 +++++++++++++++++
3 files changed, 73 insertions(+), 2 deletions(-)
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index c86568c95..0c082bdfe 100644
--- a/src/Generating/ComposableGenerator.cpp
+++ b/src/Generating/ComposableGenerator.cpp
@@ -402,9 +402,9 @@ void cComposableGenerator::InitStructureGens(cIniFile & a_IniFile)
void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
{
int Seed = m_ChunkGenerator.GetSeed();
- AString Structures = a_IniFile.GetValueSet("Generator", "Finishers", "SprinkleFoliage,Ice,Snow,Lilypads,BottomLava,DeadBushes,PreSimulator");
+ AString Finishers = a_IniFile.GetValueSet("Generator", "Finishers", "SprinkleFoliage,Ice,Snow,Lilypads,BottomLava,DeadBushes,PreSimulator");
- AStringVector Str = StringSplitAndTrim(Structures, ",");
+ AStringVector Str = StringSplitAndTrim(Finishers, ",");
for (AStringVector::const_iterator itr = Str.begin(); itr != Str.end(); ++itr)
{
// Finishers, alpha-sorted:
@@ -442,6 +442,10 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
{
m_FinishGens.push_back(new cFinishGenSprinkleFoliage(Seed));
}
+ else if (NoCaseCompare(*itr, "NetherSprinkleFoliage") == 0)
+ {
+ m_FinishGens.push_back(new cFinishGenNetherSprinkleFoliage(Seed));
+ }
else if (NoCaseCompare(*itr, "WaterSprings") == 0)
{
m_FinishGens.push_back(new cFinishGenFluidSprings(Seed, E_BLOCK_WATER, a_IniFile, *m_World));
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 145fe22e0..8c05b2135 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -39,6 +39,51 @@ static inline bool IsWater(BLOCKTYPE a_BlockType)
+///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
+// cFinishGenNetherSprinkleFoliage:
+
+void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
+{
+ double ChunkX = a_ChunkDesc.GetChunkX() + 0.5; // We can't devide through 0 so lets add 0.5 to all the chunk coordinates.
+ double ChunkZ = a_ChunkDesc.GetChunkZ() + 0.5;
+
+ for (int z = 0; z < cChunkDef::Width; z++)
+ {
+ for (int x = 0; x < cChunkDef::Width; x++)
+ {
+ for (int y = 1; y < cChunkDef::Height; y++)
+ {
+ if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(x, y - 1, z)]) // Only place on solid blocks
+ {
+ continue;
+ }
+ if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
+ {
+ continue;
+ }
+
+ NOISE_DATATYPE Val = m_Noise.CubicNoise1D((float) ((ChunkX * x) * (ChunkZ * z) * y));
+ if (Val < -0.98)
+ {
+ a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_BROWN_MUSHROOM);
+ }
+ else if (Val < -0.96)
+ {
+ a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_RED_MUSHROOM);
+ }
+ else if (Val < -0.94)
+ {
+ a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_FIRE);
+ }
+ }
+ }
+ }
+}
+
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cFinishGenSprinkleFoliage:
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h
index ed7df5909..e6007a174 100644
--- a/src/Generating/FinishGen.h
+++ b/src/Generating/FinishGen.h
@@ -47,6 +47,27 @@ protected:
+class cFinishGenNetherSprinkleFoliage :
+ public cFinishGen
+{
+public:
+ cFinishGenNetherSprinkleFoliage(int a_Seed) :
+ m_Noise(a_Seed),
+ m_Seed(a_Seed)
+ {
+ }
+
+protected:
+ cNoise m_Noise;
+ int m_Seed;
+
+ virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
+} ;
+
+
+
+
+
class cFinishGenSprinkleFoliage :
public cFinishGen
{
@@ -117,6 +138,7 @@ public:
{
}
+ int GetLevel(void) const { return m_Level; }
protected:
int m_Level;
--
cgit v1.2.3
From ce030bc7c9838a2c0c60b18a0e53bb40ff0fda26 Mon Sep 17 00:00:00 2001
From: Tycho
Date: Fri, 17 Jan 2014 10:07:33 -0800
Subject: Implemented xsofts suggestion for a saturating counter in the
scheduler
---
src/World.cpp | 10 +++++-----
src/World.h | 3 +++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/src/World.cpp b/src/World.cpp
index edf27050d..e4c03699f 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -875,10 +875,6 @@ void cWorld::TickScheduledTasks()
Tasks.push_back(m_ScheduledTasks.front());
m_ScheduledTasks.pop_front();
}
- for(;itr != m_ScheduledTasks.end(); itr++)
- {
- (*itr)->Ticks--;
- }
}
// Execute and delete each task:
@@ -887,6 +883,9 @@ void cWorld::TickScheduledTasks()
(*itr)->Run(*this);
delete *itr;
} // for itr - m_Tasks[]
+
+ // Increment TickID
+ m_TickID = (m_TickID+1) &0xFFFF;
}
@@ -2623,10 +2622,11 @@ void cWorld::QueueTask(cTask * a_Task)
void cWorld::ScheduleTask(cScheduledTask * a_Task)
{
+ a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0xFFFF;
cCSLock Lock(m_CSScheduledTasks);
for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++)
{
- if((*itr)->Ticks >= a_Task->Ticks)
+ if((*itr)->Ticks >= a_Task->Ticks && (a_Task->Ticks > m_TickID || (*itr)->Ticks < m_TickID))
{
m_ScheduledTasks.insert(itr, a_Task);
return;
diff --git a/src/World.h b/src/World.h
index 1ecf41507..2fd7319cf 100644
--- a/src/World.h
+++ b/src/World.h
@@ -772,6 +772,9 @@ private:
/// the future; guarded by m_CSScheduledTasks
ScheduledTaskList m_ScheduledTasks;
+ /// Current Tick number for sceduled tasks
+ int m_TickID;
+
/// Guards m_Clients
cCriticalSection m_CSClients;
--
cgit v1.2.3
From 287144839e446001015b70a34146c6f321812eda Mon Sep 17 00:00:00 2001
From: Tycho
Date: Fri, 17 Jan 2014 10:23:40 -0800
Subject: Increased tick count to long
---
src/World.cpp | 4 ++--
src/World.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/World.cpp b/src/World.cpp
index e4c03699f..f4b5f1ad8 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -885,7 +885,7 @@ void cWorld::TickScheduledTasks()
} // for itr - m_Tasks[]
// Increment TickID
- m_TickID = (m_TickID+1) &0xFFFF;
+ m_TickID = (m_TickID+1) & 0x7FFFFFFF;
}
@@ -2622,7 +2622,7 @@ void cWorld::QueueTask(cTask * a_Task)
void cWorld::ScheduleTask(cScheduledTask * a_Task)
{
- a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0xFFFF;
+ a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0x7FFFFFFF;
cCSLock Lock(m_CSScheduledTasks);
for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++)
{
diff --git a/src/World.h b/src/World.h
index 2fd7319cf..1fe2740ad 100644
--- a/src/World.h
+++ b/src/World.h
@@ -773,7 +773,7 @@ private:
ScheduledTaskList m_ScheduledTasks;
/// Current Tick number for sceduled tasks
- int m_TickID;
+ long m_TickID;
/// Guards m_Clients
cCriticalSection m_CSClients;
--
cgit v1.2.3
From 7c787de2615fb50169e92bbda388c4ef6b29d90a Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Fri, 17 Jan 2014 22:58:01 +0100
Subject: First attempt at creating a clumb version NetherFinisher.
---
src/Generating/FinishGen.cpp | 84 ++++++++++++++++++++++++++++++++------------
src/Generating/FinishGen.h | 1 +
2 files changed, 63 insertions(+), 22 deletions(-)
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 8c05b2135..87f00cbab 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -44,46 +44,86 @@ static inline bool IsWater(BLOCKTYPE a_BlockType)
void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
{
- double ChunkX = a_ChunkDesc.GetChunkX() + 0.5; // We can't devide through 0 so lets add 0.5 to all the chunk coordinates.
- double ChunkZ = a_ChunkDesc.GetChunkZ() + 0.5;
+ double ChunkX = a_ChunkDesc.GetChunkX() + 0.1; // We can't devide through 0 so lets add 0.1 to all the chunk coordinates.
+ double ChunkZ = a_ChunkDesc.GetChunkZ() + 0.1;
+
+ NOISE_DATATYPE Val = m_Noise.CubicNoise2D((float) ChunkX, (float) ChunkZ);
+
+ int Pos;
+ if (Val <= 0)
+ {
+ Pos = (int) (Val + 1) * 16;
+ }
+ else if (Val <= 1)
+ {
+ Pos = (int) Val * 16;
+ }
+ else
+ {
+ Pos = (int) 16 / Val;
+ }
+
+ for (int y = 1; y < cChunkDef::Height; y++)
+ {
+ if (a_ChunkDesc.GetBlockType(Pos, y, Pos) != E_BLOCK_AIR)
+ {
+ continue;
+ }
+ if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(Pos, y - 1, Pos)]) // Only place on solid blocks
+ {
+ continue;
+ }
+
+ NOISE_DATATYPE BlockType = m_Noise.CubicNoise2D(ChunkX / ChunkZ, y * 0.01f);
+ if (BlockType > 0.08)
+ {
+ TryPlaceClumb(a_ChunkDesc, Pos, y, Pos, E_BLOCK_BROWN_MUSHROOM);
+ }
+ else if (BlockType > -0.18)
+ {
+ TryPlaceClumb(a_ChunkDesc, Pos, y, Pos, E_BLOCK_RED_MUSHROOM);
+ }
+ else if (BlockType > -0.28)
+ {
+ TryPlaceClumb(a_ChunkDesc, Pos, y, Pos, E_BLOCK_FIRE);
+ }
+ }
+}
- for (int z = 0; z < cChunkDef::Width; z++)
+
+
+
+
+void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
+{
+ a_ChunkDesc.SetBlockType(a_RelX, a_RelY, a_RelZ, a_Block);
+ for (int x = a_RelX - 4; x < a_RelX + 4; x++)
{
- for (int x = 0; x < cChunkDef::Width; x++)
+ float xx = (float) a_ChunkDesc.GetChunkX() * cChunkDef::Width + x;
+ for (int z = a_RelZ - 4; x < a_RelX + 4; x++)
{
- for (int y = 1; y < cChunkDef::Height; y++)
+ float zz = (float) a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z;
+ for (int y = a_RelY - 2; y < a_RelY + 2; y++)
{
- if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(x, y - 1, z)]) // Only place on solid blocks
+ if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR) // Don't replace non air blocks.
{
continue;
}
- if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
+ if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(x, y - 1, z)]) // Only place on solid blocks
{
continue;
}
- NOISE_DATATYPE Val = m_Noise.CubicNoise1D((float) ((ChunkX * x) * (ChunkZ * z) * y));
- if (Val < -0.98)
- {
- a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_BROWN_MUSHROOM);
- }
- else if (Val < -0.96)
- {
- a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_RED_MUSHROOM);
- }
- else if (Val < -0.94)
+ NOISE_DATATYPE Val = m_Noise.CubicNoise1D(xx * zz * 0.1f / y);
+ if (Val > 1)
{
- a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_FIRE);
+ a_ChunkDesc.SetBlockType(x, y, z, a_Block);
}
}
}
}
}
-
-
-
-
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cFinishGenSprinkleFoliage:
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h
index e6007a174..1e00ffa6c 100644
--- a/src/Generating/FinishGen.h
+++ b/src/Generating/FinishGen.h
@@ -61,6 +61,7 @@ protected:
cNoise m_Noise;
int m_Seed;
+ void TryPlaceClumb(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block);
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
} ;
--
cgit v1.2.3
From 9f17c9799bfdbf1a6594c41a42b60492d66e7d5b Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 00:27:13 +0100
Subject: It now actualy works.
---
src/Generating/FinishGen.cpp | 62 ++++++++++++++++++++++++++++++--------------
1 file changed, 42 insertions(+), 20 deletions(-)
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 87f00cbab..9c98994e2 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -47,45 +47,63 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
double ChunkX = a_ChunkDesc.GetChunkX() + 0.1; // We can't devide through 0 so lets add 0.1 to all the chunk coordinates.
double ChunkZ = a_ChunkDesc.GetChunkZ() + 0.1;
- NOISE_DATATYPE Val = m_Noise.CubicNoise2D((float) ChunkX, (float) ChunkZ);
+ NOISE_DATATYPE Val1 = m_Noise.CubicNoise2D((float) (ChunkX * ChunkZ * 0.01f), (float) (ChunkZ / ChunkX * 0.01f));
+ NOISE_DATATYPE Val2 = m_Noise.CubicNoise2D((float) (ChunkX / ChunkZ / 0.01f), (float) (ChunkZ * ChunkX / 0.01f));
+
+ if (Val1 < 0)
+ {
+ Val1 = -Val1;
+ }
- int Pos;
- if (Val <= 0)
+ if (Val2 < 0)
{
- Pos = (int) (Val + 1) * 16;
+ Val2 = -Val2;
}
- else if (Val <= 1)
+
+ int PosX, PosZ;
+ // Calculate PosX
+ if (Val1 <= 1)
{
- Pos = (int) Val * 16;
+ PosX = (int) floor(Val1 * 16);
}
else
{
- Pos = (int) 16 / Val;
+ PosX = (int) floor(16 / Val1);
}
+ // Calculate PosZ
+ if (Val2 <= 1)
+ {
+ PosZ = (int) floor(Val2 * 16);
+ }
+ else
+ {
+ PosZ = (int) floor(16 / Val2);
+ }
+
for (int y = 1; y < cChunkDef::Height; y++)
{
- if (a_ChunkDesc.GetBlockType(Pos, y, Pos) != E_BLOCK_AIR)
+ if (a_ChunkDesc.GetBlockType(PosX, y, PosZ) != E_BLOCK_AIR)
{
continue;
}
- if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(Pos, y - 1, Pos)]) // Only place on solid blocks
+ if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(PosX, y - 1, PosZ)]) // Only place on solid blocks
{
continue;
}
- NOISE_DATATYPE BlockType = m_Noise.CubicNoise2D(ChunkX / ChunkZ, y * 0.01f);
- if (BlockType > 0.08)
+ NOISE_DATATYPE BlockType = m_Noise.CubicNoise1D((float) (ChunkX * ChunkZ) / (y * 0.1f));
+ if (BlockType < 0.10)
{
- TryPlaceClumb(a_ChunkDesc, Pos, y, Pos, E_BLOCK_BROWN_MUSHROOM);
+ TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM);
}
- else if (BlockType > -0.18)
+ else if (BlockType < -0.09)
{
- TryPlaceClumb(a_ChunkDesc, Pos, y, Pos, E_BLOCK_RED_MUSHROOM);
+ TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_RED_MUSHROOM);
}
- else if (BlockType > -0.28)
+ else if (BlockType < -0.08)
{
- TryPlaceClumb(a_ChunkDesc, Pos, y, Pos, E_BLOCK_FIRE);
+ TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_FIRE);
}
}
}
@@ -100,7 +118,7 @@ void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, in
for (int x = a_RelX - 4; x < a_RelX + 4; x++)
{
float xx = (float) a_ChunkDesc.GetChunkX() * cChunkDef::Width + x;
- for (int z = a_RelZ - 4; x < a_RelX + 4; x++)
+ for (int z = a_RelZ - 4; z < a_RelZ + 4; z++)
{
float zz = (float) a_ChunkDesc.GetChunkZ() * cChunkDef::Width + z;
for (int y = a_RelY - 2; y < a_RelY + 2; y++)
@@ -114,16 +132,20 @@ void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, in
continue;
}
- NOISE_DATATYPE Val = m_Noise.CubicNoise1D(xx * zz * 0.1f / y);
- if (Val > 1)
+ NOISE_DATATYPE Val = m_Noise.CubicNoise2D(xx, zz);
+ if (Val < -0.70)
{
- a_ChunkDesc.SetBlockType(x, y, z, a_Block);
+ a_ChunkDesc.SetBlockType(x, y, z, a_Block);
}
}
}
}
}
+
+
+
+
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cFinishGenSprinkleFoliage:
--
cgit v1.2.3
From 087d650aed362cbf14fdd50940d69d5dff6c4667 Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 00:37:21 +0100
Subject: Fixed bug where only brown mushrooms would spawn.
---
src/Generating/FinishGen.cpp | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 9c98994e2..0b5205c5c 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -93,15 +93,15 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
}
NOISE_DATATYPE BlockType = m_Noise.CubicNoise1D((float) (ChunkX * ChunkZ) / (y * 0.1f));
- if (BlockType < 0.10)
+ if (BlockType < -0.30)
{
TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM);
}
- else if (BlockType < -0.09)
+ else if (BlockType < -0.20)
{
TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_RED_MUSHROOM);
}
- else if (BlockType < -0.08)
+ else if (BlockType < -0.10)
{
TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_FIRE);
}
--
cgit v1.2.3
From dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5 Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 13:45:41 +0100
Subject: Some tweaks. Everything generates more often. Fire can only spawn on
ForeverBurning blocks.
---
src/Generating/FinishGen.cpp | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 0b5205c5c..5726c5806 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -13,6 +13,7 @@
#include "../Noise.h"
#include "../BlockID.h"
#include "../Simulator/FluidSimulator.h" // for cFluidSimulator::CanWashAway()
+#include "../Simulator/FireSimulator.h"
#include "../World.h"
@@ -93,15 +94,15 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
}
NOISE_DATATYPE BlockType = m_Noise.CubicNoise1D((float) (ChunkX * ChunkZ) / (y * 0.1f));
- if (BlockType < -0.30)
+ if (BlockType < -0.7)
{
TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM);
}
- else if (BlockType < -0.20)
+ else if (BlockType < 0)
{
TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_RED_MUSHROOM);
}
- else if (BlockType < -0.10)
+ else if (BlockType < 0.7)
{
TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_FIRE);
}
@@ -114,7 +115,8 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
{
- a_ChunkDesc.SetBlockType(a_RelX, a_RelY, a_RelZ, a_Block);
+ bool IsFireBlock = a_Block == E_BLOCK_FIRE;
+
for (int x = a_RelX - 4; x < a_RelX + 4; x++)
{
float xx = (float) a_ChunkDesc.GetChunkX() * cChunkDef::Width + x;
@@ -127,11 +129,22 @@ void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, in
{
continue;
}
- if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(x, y - 1, z)]) // Only place on solid blocks
+
+ BLOCKTYPE BlockBelow = a_ChunkDesc.GetBlockType(x, y - 1, z);
+ if (!g_BlockIsSolid[BlockBelow]) // Only place on solid blocks
{
continue;
}
+ if (IsFireBlock) // don't place fire on non-forever burning blocks.
+ {
+ if (!cFireSimulator::DoesBurnForever(BlockBelow))
+ {
+ continue;
+ }
+ }
+
+
NOISE_DATATYPE Val = m_Noise.CubicNoise2D(xx, zz);
if (Val < -0.70)
{
--
cgit v1.2.3
From ca27f87272c647d583f6df2491c7f2cc4cd729a2 Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 14:16:07 +0100
Subject: Renamed cFinishGenNetherSprinkleFoliage to
cFinishGenNetherClumpFoliage. Fixed typo's
---
src/Generating/ComposableGenerator.cpp | 4 ++--
src/Generating/FinishGen.cpp | 12 ++++++------
src/Generating/FinishGen.h | 4 ++--
3 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index 0c082bdfe..9817b6654 100644
--- a/src/Generating/ComposableGenerator.cpp
+++ b/src/Generating/ComposableGenerator.cpp
@@ -442,9 +442,9 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
{
m_FinishGens.push_back(new cFinishGenSprinkleFoliage(Seed));
}
- else if (NoCaseCompare(*itr, "NetherSprinkleFoliage") == 0)
+ else if (NoCaseCompare(*itr, "NetherClumpFoliage") == 0)
{
- m_FinishGens.push_back(new cFinishGenNetherSprinkleFoliage(Seed));
+ m_FinishGens.push_back(new cFinishGenNetherClumpFoliage(Seed));
}
else if (NoCaseCompare(*itr, "WaterSprings") == 0)
{
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index 5726c5806..cd4ef13aa 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -41,9 +41,9 @@ static inline bool IsWater(BLOCKTYPE a_BlockType)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
-// cFinishGenNetherSprinkleFoliage:
+// cFinishGenNetherClumpFoliage:
-void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
+void cFinishGenNetherClumpFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
{
double ChunkX = a_ChunkDesc.GetChunkX() + 0.1; // We can't devide through 0 so lets add 0.1 to all the chunk coordinates.
double ChunkZ = a_ChunkDesc.GetChunkZ() + 0.1;
@@ -96,15 +96,15 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
NOISE_DATATYPE BlockType = m_Noise.CubicNoise1D((float) (ChunkX * ChunkZ) / (y * 0.1f));
if (BlockType < -0.7)
{
- TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM);
+ TryPlaceClump(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM);
}
else if (BlockType < 0)
{
- TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_RED_MUSHROOM);
+ TryPlaceClump(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_RED_MUSHROOM);
}
else if (BlockType < 0.7)
{
- TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_FIRE);
+ TryPlaceClump(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_FIRE);
}
}
}
@@ -113,7 +113,7 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
-void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
+void cFinishGenNetherSprinkleFoliage::TryPlaceClump(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
{
bool IsFireBlock = a_Block == E_BLOCK_FIRE;
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h
index 1e00ffa6c..bced264e1 100644
--- a/src/Generating/FinishGen.h
+++ b/src/Generating/FinishGen.h
@@ -51,7 +51,7 @@ class cFinishGenNetherSprinkleFoliage :
public cFinishGen
{
public:
- cFinishGenNetherSprinkleFoliage(int a_Seed) :
+ cFinishGenNetherClumpFoliage(int a_Seed) :
m_Noise(a_Seed),
m_Seed(a_Seed)
{
@@ -61,7 +61,7 @@ protected:
cNoise m_Noise;
int m_Seed;
- void TryPlaceClumb(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block);
+ void TryPlaceClump(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block);
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
} ;
--
cgit v1.2.3
From 9a9b51a5134d8afd8f089d247c59668bd7da695d Mon Sep 17 00:00:00 2001
From: andrew
Date: Sat, 18 Jan 2014 15:16:47 +0200
Subject: Basic command block implementation
---
CONTRIBUTORS | 1 +
src/BlockEntities/BlockEntity.cpp | 24 +++--
src/BlockEntities/CommandBlockEntity.cpp | 173 +++++++++++++++++++++++++++++++
src/BlockEntities/CommandBlockEntity.h | 85 +++++++++++++++
src/Chunk.cpp | 34 ++++++
src/Chunk.h | 16 +--
src/ChunkMap.cpp | 17 +++
src/ChunkMap.h | 23 ++--
src/Simulator/RedstoneSimulator.cpp | 27 ++++-
src/Simulator/RedstoneSimulator.h | 4 +
src/World.cpp | 9 ++
src/World.h | 16 +--
12 files changed, 396 insertions(+), 33 deletions(-)
create mode 100644 src/BlockEntities/CommandBlockEntity.cpp
create mode 100644 src/BlockEntities/CommandBlockEntity.h
diff --git a/CONTRIBUTORS b/CONTRIBUTORS
index 150bcf09e..b15a36a38 100644
--- a/CONTRIBUTORS
+++ b/CONTRIBUTORS
@@ -20,5 +20,6 @@ worktycho
Sxw1212
tonibm19
Diusrex
+structinf (xdot)
Please add yourself to this list if you contribute to MCServer.
diff --git a/src/BlockEntities/BlockEntity.cpp b/src/BlockEntities/BlockEntity.cpp
index 5d7e4a37a..97b5c1a66 100644
--- a/src/BlockEntities/BlockEntity.cpp
+++ b/src/BlockEntities/BlockEntity.cpp
@@ -6,6 +6,7 @@
#include "Globals.h"
#include "BlockEntity.h"
#include "ChestEntity.h"
+#include "CommandBlockEntity.h"
#include "DispenserEntity.h"
#include "DropperEntity.h"
#include "EnderChestEntity.h"
@@ -23,17 +24,18 @@ cBlockEntity * cBlockEntity::CreateByBlockType(BLOCKTYPE a_BlockType, NIBBLETYPE
{
switch (a_BlockType)
{
- case E_BLOCK_CHEST: return new cChestEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_DISPENSER: return new cDispenserEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_DROPPER: return new cDropperEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_ENDER_CHEST: return new cEnderChestEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_LIT_FURNACE: return new cFurnaceEntity (a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_World);
- case E_BLOCK_FURNACE: return new cFurnaceEntity (a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_World);
- case E_BLOCK_HOPPER: return new cHopperEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_SIGN_POST: return new cSignEntity (a_BlockType, a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_WALLSIGN: return new cSignEntity (a_BlockType, a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_NOTE_BLOCK: return new cNoteEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
- case E_BLOCK_JUKEBOX: return new cJukeboxEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_CHEST: return new cChestEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_COMMAND_BLOCK: return new cCommandBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_DISPENSER: return new cDispenserEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_DROPPER: return new cDropperEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_ENDER_CHEST: return new cEnderChestEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_LIT_FURNACE: return new cFurnaceEntity (a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_World);
+ case E_BLOCK_FURNACE: return new cFurnaceEntity (a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta, a_World);
+ case E_BLOCK_HOPPER: return new cHopperEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_SIGN_POST: return new cSignEntity (a_BlockType, a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_WALLSIGN: return new cSignEntity (a_BlockType, a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_NOTE_BLOCK: return new cNoteEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
+ case E_BLOCK_JUKEBOX: return new cJukeboxEntity (a_BlockX, a_BlockY, a_BlockZ, a_World);
}
LOGD("%s: Requesting creation of an unknown block entity - block type %d (%s)",
__FUNCTION__, a_BlockType, ItemTypeToString(a_BlockType).c_str()
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
new file mode 100644
index 000000000..6e371e0fe
--- /dev/null
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -0,0 +1,173 @@
+
+// CommandBlockEntity.cpp
+
+// Implements the cCommandBlockEntity class representing a single command block in the world
+
+#include "Globals.h" // NOTE: MSVC stupidness requires this to be the same across all modules
+#include "json/json.h"
+#include "CommandBlockEntity.h"
+#include "../Entities/Player.h"
+
+
+
+
+
+cCommandBlockEntity::cCommandBlockEntity(int a_X, int a_Y, int a_Z, cWorld * a_World) :
+ super(E_BLOCK_COMMAND_BLOCK, a_X, a_Y, a_Z, a_World),
+ m_ShouldExecute(false),
+ m_IsPowered(false)
+{
+ SetBlockEntity(this); // cBlockEntityWindowOwner
+}
+
+
+
+
+
+
+cCommandBlockEntity::~cCommandBlockEntity()
+{
+ // Tell window its owner is destroyed
+ cWindow * Window = GetWindow();
+ if (Window != NULL)
+ {
+ Window->OwnerDestroyed();
+ }
+}
+
+
+
+
+
+
+void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
+{
+ cWindow * Window = GetWindow();
+ if (Window == NULL)
+ {
+ //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this));
+ Window = GetWindow();
+ }
+
+ if (Window != NULL)
+ {
+ if (a_Player->GetWindow() != Window)
+ {
+ a_Player->OpenWindow(Window);
+ }
+ }
+}
+
+
+
+
+
+void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
+{
+ m_Command = a_Cmd;LOGD("Hrey %s", a_Cmd.c_str());
+}
+
+
+
+
+
+const AString & cCommandBlockEntity::GetCommand(void) const
+{
+ return m_Command;
+}
+
+
+
+
+
+const AString & cCommandBlockEntity::GetLastOutput(void) const
+{
+ return m_LastOutput;
+}
+
+
+
+
+
+void cCommandBlockEntity::Activate(void)
+{
+ m_ShouldExecute = true;
+}
+
+
+
+
+
+void cCommandBlockEntity::SetRedstonePower(bool a_IsPowered)
+{
+ if (a_IsPowered && !m_IsPowered)
+ {
+ Activate();
+ }
+ m_IsPowered = a_IsPowered;
+}
+
+
+
+
+
+bool cCommandBlockEntity::Tick(float a_Dt, cChunk & a_Chunk)
+{
+ if (!m_ShouldExecute)
+ {
+ return false;
+ }
+
+ m_ShouldExecute = false;
+ Execute();
+ return true;
+}
+
+
+
+
+
+void cCommandBlockEntity::SendTo(cClientHandle & a_Client)
+{
+ // Nothing needs to be sent
+ UNUSED(a_Client);
+}
+
+
+
+
+
+bool cCommandBlockEntity::LoadFromJson(const Json::Value & a_Value)
+{
+ m_Command = a_Value.get("Command", "").asString();
+
+ m_LastOutput = a_Value.get("LastOutput", "").asString();
+
+ return true;
+}
+
+
+
+
+
+void cCommandBlockEntity::SaveToJson(Json::Value & a_Value)
+{
+ a_Value["Command"] = m_Command;
+
+ a_Value["LastOutput"] = m_LastOutput;
+}
+
+
+
+
+
+void cCommandBlockEntity::Execute()
+{
+ // TODO: Parse arguments and dispatch command
+ LOGD("Command: %s", m_Command.c_str());
+ m_LastOutput = "";
+}
+
+
+
+
diff --git a/src/BlockEntities/CommandBlockEntity.h b/src/BlockEntities/CommandBlockEntity.h
new file mode 100644
index 000000000..266a3c33d
--- /dev/null
+++ b/src/BlockEntities/CommandBlockEntity.h
@@ -0,0 +1,85 @@
+
+// CommandBlockEntity.h
+
+// Declares the cCommandBlockEntity class representing a single command block in the world
+
+
+
+
+
+#pragma once
+
+#include "BlockEntityWithItems.h"
+#include "../UI/WindowOwner.h"
+
+
+
+
+
+namespace Json
+{
+ class Value;
+}
+
+
+
+
+
+// tolua_begin
+
+class cCommandBlockEntity :
+ public cBlockEntity,
+ public cBlockEntityWindowOwner
+{
+ typedef cBlockEntity super;
+
+public:
+
+ // tolua_end
+
+ /// Creates a new empty command block entity
+ cCommandBlockEntity(int a_X, int a_Y, int a_Z, cWorld * a_World);
+ virtual ~cCommandBlockEntity();
+
+ bool LoadFromJson( const Json::Value& a_Value );
+ virtual void SaveToJson(Json::Value& a_Value ) override;
+
+ virtual bool Tick(float a_Dt, cChunk & a_Chunk) override;
+ virtual void SendTo(cClientHandle & a_Client) override;
+ virtual void UsedBy(cPlayer * a_Player) override;
+
+ // tolua_begin
+
+ /// Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate
+ void SetRedstonePower(bool a_IsPowered);
+
+ /// Sets the command block to execute a command in the next tick
+ void Activate(void);
+
+ /// Sets the command
+ void SetCommand(const AString & a_Cmd);
+
+ /// Retrieves stored command
+ const AString & GetCommand(void) const;
+
+ /// Retrieves the last line of output generated by the command block
+ const AString & GetLastOutput(void) const;
+
+ // tolua_end
+
+private:
+
+ /// Executes the associated command
+ void Execute();
+
+ bool m_ShouldExecute;
+ bool m_IsPowered;
+
+ AString m_Command;
+
+ AString m_LastOutput;
+} ; // tolua_export
+
+
+
+
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 0735c8144..a72464ec3 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1298,6 +1298,7 @@ void cChunk::CreateBlockEntities(void)
switch (BlockType)
{
case E_BLOCK_CHEST:
+ case E_BLOCK_COMMAND_BLOCK:
case E_BLOCK_DISPENSER:
case E_BLOCK_DROPPER:
case E_BLOCK_ENDER_CHEST:
@@ -1425,6 +1426,7 @@ void cChunk::SetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType,
switch (a_BlockType)
{
case E_BLOCK_CHEST:
+ case E_BLOCK_COMMAND_BLOCK:
case E_BLOCK_DISPENSER:
case E_BLOCK_DROPPER:
case E_BLOCK_ENDER_CHEST:
@@ -2268,6 +2270,38 @@ bool cChunk::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBl
+bool cChunk::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback)
+{
+ // The blockentity list is locked by the parent chunkmap's CS
+ for (cBlockEntityList::iterator itr = m_BlockEntities.begin(), itr2 = itr; itr != m_BlockEntities.end(); itr = itr2)
+ {
+ ++itr2;
+ if (((*itr)->GetPosX() != a_BlockX) || ((*itr)->GetPosY() != a_BlockY) || ((*itr)->GetPosZ() != a_BlockZ))
+ {
+ continue;
+ }
+ if ((*itr)->GetBlockType() != E_BLOCK_COMMAND_BLOCK)
+ {
+ // There is a block entity here, but of different type. No other block entity can be here, so we can safely bail out
+ return false;
+ }
+
+ // The correct block entity is here,
+ if (a_Callback.Item((cCommandBlockEntity *)*itr))
+ {
+ return false;
+ }
+ return true;
+ } // for itr - m_BlockEntitites[]
+
+ // Not found:
+ return false;
+}
+
+
+
+
+
bool cChunk::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4)
{
// The blockentity list is locked by the parent chunkmap's CS
diff --git a/src/Chunk.h b/src/Chunk.h
index f0a50c3c4..4ac38c46c 100644
--- a/src/Chunk.h
+++ b/src/Chunk.h
@@ -40,12 +40,13 @@ class cFluidSimulatorData;
class cMobCensus;
class cMobSpawner;
-typedef std::list cClientHandleList;
-typedef cItemCallback cEntityCallback;
-typedef cItemCallback cChestCallback;
-typedef cItemCallback cDispenserCallback;
-typedef cItemCallback cFurnaceCallback;
-typedef cItemCallback cNoteBlockCallback;
+typedef std::list cClientHandleList;
+typedef cItemCallback cEntityCallback;
+typedef cItemCallback cChestCallback;
+typedef cItemCallback cDispenserCallback;
+typedef cItemCallback cFurnaceCallback;
+typedef cItemCallback cNoteBlockCallback;
+typedef cItemCallback cCommandBlockCallback;
@@ -237,6 +238,9 @@ public:
/// Calls the callback for the noteblock at the specified coords; returns false if there's no noteblock at those coords or callback returns true, returns true if found
bool DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback & a_Callback);
+ /// Calls the callback for the command block at the specified coords; returns false if there's no command block at those coords or callback returns true, returns true if found
+ bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback);
+
/// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // Lua-accessible
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index e14090b18..5797eb453 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -1968,6 +1968,23 @@ 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;
+ int BlockX = a_BlockX, BlockY = a_BlockY, BlockZ = a_BlockZ;
+ cChunkDef::AbsoluteToRelative(BlockX, BlockY, BlockZ, ChunkX, ChunkZ);
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunkNoGen(ChunkX, ZERO_CHUNK_Y, ChunkZ);
+ if ((Chunk == NULL) && !Chunk->IsValid())
+ {
+ return false;
+ }
+ return Chunk->DoWithCommandBlockAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback);
+}
+
+
+
+
bool cChunkMap::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4)
{
diff --git a/src/ChunkMap.h b/src/ChunkMap.h
index e688d1f93..e9d8ee30b 100644
--- a/src/ChunkMap.h
+++ b/src/ChunkMap.h
@@ -23,6 +23,7 @@ class cDropperEntity;
class cDropSpenserEntity;
class cFurnaceEntity;
class cNoteEntity;
+class cCommandBlockEntity;
class cPawn;
class cPickup;
class cChunkDataSerializer;
@@ -32,15 +33,16 @@ class cMobSpawner;
typedef std::list cClientHandleList;
typedef cChunk * cChunkPtr;
-typedef cItemCallback cEntityCallback;
-typedef cItemCallback cBlockEntityCallback;
-typedef cItemCallback cChestCallback;
-typedef cItemCallback cDispenserCallback;
-typedef cItemCallback cDropperCallback;
-typedef cItemCallback cDropSpenserCallback;
-typedef cItemCallback cFurnaceCallback;
-typedef cItemCallback cNoteBlockCallback;
-typedef cItemCallback cChunkCallback;
+typedef cItemCallback cEntityCallback;
+typedef cItemCallback cBlockEntityCallback;
+typedef cItemCallback cChestCallback;
+typedef cItemCallback cDispenserCallback;
+typedef cItemCallback cDropperCallback;
+typedef cItemCallback cDropSpenserCallback;
+typedef cItemCallback cFurnaceCallback;
+typedef cItemCallback cNoteBlockCallback;
+typedef cItemCallback cCommandBlockCallback;
+typedef cItemCallback cChunkCallback;
@@ -236,6 +238,9 @@ public:
/// Calls the callback for the noteblock at the specified coords; returns false if there's no noteblock at those coords or callback returns true, returns true if found
bool DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback & a_Callback); // Lua-accessible
+ /// Calls the callback for the command block at the specified coords; returns false if there's no command block at those coords or callback returns true, returns true if found
+ bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback); // Lua-accessible
+
/// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // Lua-accessible
diff --git a/src/Simulator/RedstoneSimulator.cpp b/src/Simulator/RedstoneSimulator.cpp
index 469680098..e361cbf49 100644
--- a/src/Simulator/RedstoneSimulator.cpp
+++ b/src/Simulator/RedstoneSimulator.cpp
@@ -4,6 +4,7 @@
#include "RedstoneSimulator.h"
#include "../BlockEntities/DropSpenserEntity.h"
#include "../BlockEntities/NoteEntity.h"
+#include "../BlockEntities/CommandBlockEntity.h"
#include "../Entities/TNTEntity.h"
#include "../Blocks/BlockTorch.h"
#include "../Blocks/BlockDoor.h"
@@ -215,11 +216,12 @@ void cRedstoneSimulator::SimulateChunk(float a_Dt, int a_ChunkX, int a_ChunkZ, c
{
case E_BLOCK_BLOCK_OF_REDSTONE: HandleRedstoneBlock(a_X, dataitr->y, a_Z); break;
case E_BLOCK_LEVER: HandleRedstoneLever(a_X, dataitr->y, a_Z); break;
- case E_BLOCK_TNT: HandleTNT(a_X, dataitr->y, a_Z); break;
+ case E_BLOCK_TNT: HandleTNT(a_X, dataitr->y, a_Z); break;
case E_BLOCK_TRAPDOOR: HandleTrapdoor(a_X, dataitr->y, a_Z); break;
case E_BLOCK_REDSTONE_WIRE: HandleRedstoneWire(a_X, dataitr->y, a_Z); break;
case E_BLOCK_NOTE_BLOCK: HandleNoteBlock(a_X, dataitr->y, a_Z); break;
case E_BLOCK_DAYLIGHT_SENSOR: HandleDaylightSensor(a_X, dataitr->y, a_Z); break;
+ case E_BLOCK_COMMAND_BLOCK: HandleCommandBlock(a_X, dataitr->y, a_Z); break;
case E_BLOCK_REDSTONE_TORCH_OFF:
case E_BLOCK_REDSTONE_TORCH_ON:
@@ -763,6 +765,29 @@ void cRedstoneSimulator::HandleDoor(int a_BlockX, int a_BlockY, int a_BlockZ)
+void cRedstoneSimulator::HandleCommandBlock(int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+ class cSetPowerToCommandBlock :
+ public cCommandBlockCallback
+ {
+ bool m_IsPowered;
+ public:
+ cSetPowerToCommandBlock(bool a_IsPowered) : m_IsPowered(a_IsPowered) {}
+
+ virtual bool Item(cCommandBlockEntity * a_CommandBlock) override
+ {
+ a_CommandBlock->SetRedstonePower(m_IsPowered);
+ return false;
+ }
+ } CmdBlockSP (AreCoordsPowered(a_BlockX, a_BlockY, a_BlockZ));
+
+ m_World.DoWithCommandBlockAt(a_BlockX, a_BlockY, a_BlockZ, CmdBlockSP);
+}
+
+
+
+
+
void cRedstoneSimulator::HandleRail(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyType)
{
switch (a_MyType)
diff --git a/src/Simulator/RedstoneSimulator.h b/src/Simulator/RedstoneSimulator.h
index 63a5be3d3..bb2efeb8a 100644
--- a/src/Simulator/RedstoneSimulator.h
+++ b/src/Simulator/RedstoneSimulator.h
@@ -110,6 +110,8 @@ private:
void HandleRedstoneLamp(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyState);
/** Handles doords */
void HandleDoor(int a_BlockX, int a_BlockY, int a_BlockZ);
+ /** Handles command blocks */
+ void HandleCommandBlock(int a_BlockX, int a_BlockY, int a_BlockZ);
/** Handles activator, detector, and powered rails */
void HandleRail(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_MyType);
/** Handles trapdoors */
@@ -166,6 +168,7 @@ private:
switch (Block)
{
case E_BLOCK_ACTIVATOR_RAIL:
+ case E_BLOCK_COMMAND_BLOCK:
case E_BLOCK_PISTON:
case E_BLOCK_STICKY_PISTON:
case E_BLOCK_DISPENSER:
@@ -220,6 +223,7 @@ private:
case E_BLOCK_ACTIVATOR_RAIL:
case E_BLOCK_ACTIVE_COMPARATOR:
case E_BLOCK_BLOCK_OF_REDSTONE:
+ case E_BLOCK_COMMAND_BLOCK:
case E_BLOCK_DETECTOR_RAIL:
case E_BLOCK_DISPENSER:
case E_BLOCK_DAYLIGHT_SENSOR:
diff --git a/src/World.cpp b/src/World.cpp
index 3e7c0ef74..7c56d2efb 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -1149,6 +1149,15 @@ bool cWorld::DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBl
+bool cWorld::DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback)
+{
+ return m_ChunkMap->DoWithCommandBlockAt(a_BlockX, a_BlockY, a_BlockZ, a_Callback);
+}
+
+
+
+
+
bool cWorld::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4)
{
return m_ChunkMap->GetSignLines(a_BlockX, a_BlockY, a_BlockZ, a_Line1, a_Line2, a_Line3, a_Line4);
diff --git a/src/World.h b/src/World.h
index ef74a65c7..c410e658e 100644
--- a/src/World.h
+++ b/src/World.h
@@ -46,12 +46,13 @@ class cMobCensus;
typedef std::list< cPlayer * > cPlayerList;
-typedef cItemCallback cPlayerListCallback;
-typedef cItemCallback cEntityCallback;
-typedef cItemCallback cChestCallback;
-typedef cItemCallback cDispenserCallback;
-typedef cItemCallback cFurnaceCallback;
-typedef cItemCallback cNoteBlockCallback;
+typedef cItemCallback cPlayerListCallback;
+typedef cItemCallback cEntityCallback;
+typedef cItemCallback cChestCallback;
+typedef cItemCallback cDispenserCallback;
+typedef cItemCallback cFurnaceCallback;
+typedef cItemCallback cNoteBlockCallback;
+typedef cItemCallback cCommandBlockCallback;
@@ -466,6 +467,9 @@ public:
/// Calls the callback for the noteblock at the specified coords; returns false if there's no noteblock at those coords or callback returns true, returns true if found
bool DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback & a_Callback); // Exported in ManualBindings.cpp
+
+ /// Calls the callback for the command block at the specified coords; returns false if there's no command block at those coords or callback returns true, returns true if found
+ bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback); // TODO: Export
/// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // Exported in ManualBindings.cpp
--
cgit v1.2.3
From 188cb1f6bc0172a8bb6bb12154e004517cef31f8 Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 14:17:26 +0100
Subject: Fixed errors.
---
src/Generating/FinishGen.cpp | 2 +-
src/Generating/FinishGen.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp
index cd4ef13aa..4ac6ff0f3 100644
--- a/src/Generating/FinishGen.cpp
+++ b/src/Generating/FinishGen.cpp
@@ -113,7 +113,7 @@ void cFinishGenNetherClumpFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
-void cFinishGenNetherSprinkleFoliage::TryPlaceClump(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
+void cFinishGenNetherClumpFoliage::TryPlaceClump(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
{
bool IsFireBlock = a_Block == E_BLOCK_FIRE;
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h
index bced264e1..a444721f8 100644
--- a/src/Generating/FinishGen.h
+++ b/src/Generating/FinishGen.h
@@ -47,7 +47,7 @@ protected:
-class cFinishGenNetherSprinkleFoliage :
+class cFinishGenNetherClumpFoliage :
public cFinishGen
{
public:
--
cgit v1.2.3
From be5299350a3b808ade39df7e9654eda47732e96e Mon Sep 17 00:00:00 2001
From: andrew
Date: Sat, 18 Jan 2014 15:40:47 +0200
Subject: Command block (de)serialization
---
src/BlockEntities/CommandBlockEntity.cpp | 32 +++++++++++++++++++++++-
src/BlockEntities/CommandBlockEntity.h | 13 ++++++++--
src/WorldStorage/NBTChunkSerializer.cpp | 37 ++++++++++++++++++++--------
src/WorldStorage/NBTChunkSerializer.h | 2 ++
src/WorldStorage/WSSAnvil.cpp | 42 ++++++++++++++++++++++++++++++++
src/WorldStorage/WSSAnvil.h | 17 +++++++------
6 files changed, 122 insertions(+), 21 deletions(-)
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 6e371e0fe..88e55dece 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -45,7 +45,7 @@ void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
cWindow * Window = GetWindow();
if (Window == NULL)
{
- //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this));
+ //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this)); FIXME
Window = GetWindow();
}
@@ -71,6 +71,24 @@ void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
+void cCommandBlockEntity::SetLastOutput(const AString & a_LastOut)
+{
+ m_LastOutput = a_LastOut;
+}
+
+
+
+
+
+void cCommandBlockEntity::SetResult(const NIBBLETYPE a_Result)
+{
+ m_Result = a_Result;
+}
+
+
+
+
+
const AString & cCommandBlockEntity::GetCommand(void) const
{
return m_Command;
@@ -89,6 +107,15 @@ const AString & cCommandBlockEntity::GetLastOutput(void) const
+NIBBLETYPE cCommandBlockEntity::GetResult(void) const
+{
+ return m_Result;
+}
+
+
+
+
+
void cCommandBlockEntity::Activate(void)
{
m_ShouldExecute = true;
@@ -164,8 +191,11 @@ void cCommandBlockEntity::SaveToJson(Json::Value & a_Value)
void cCommandBlockEntity::Execute()
{
// TODO: Parse arguments and dispatch command
+
LOGD("Command: %s", m_Command.c_str());
+
m_LastOutput = "";
+ m_Result = 0;
}
diff --git a/src/BlockEntities/CommandBlockEntity.h b/src/BlockEntities/CommandBlockEntity.h
index 266a3c33d..c4529a1e6 100644
--- a/src/BlockEntities/CommandBlockEntity.h
+++ b/src/BlockEntities/CommandBlockEntity.h
@@ -48,6 +48,10 @@ public:
virtual void SendTo(cClientHandle & a_Client) override;
virtual void UsedBy(cPlayer * a_Player) override;
+ void SetLastOutput(const AString & a_LastOut);
+
+ void SetResult(const NIBBLETYPE a_Result);
+
// tolua_begin
/// Sets the internal redstone power flag to "on" or "off", depending on the parameter. Calls Activate() if appropriate
@@ -64,6 +68,9 @@ public:
/// Retrieves the last line of output generated by the command block
const AString & GetLastOutput(void) const;
+
+ /// Retrieves the result (signal strength) of the last operation
+ NIBBLETYPE GetResult(void) const;
// tolua_end
@@ -75,9 +82,11 @@ private:
bool m_ShouldExecute;
bool m_IsPowered;
- AString m_Command;
+ AString m_Command;
+
+ AString m_LastOutput;
- AString m_LastOutput;
+ NIBBLETYPE m_Result;
} ; // tolua_export
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index e1205f2be..b5b5e555b 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -10,6 +10,7 @@
#include "FastNBT.h"
#include "../BlockEntities/ChestEntity.h"
+#include "../BlockEntities/CommandBlockEntity.h"
#include "../BlockEntities/DispenserEntity.h"
#include "../BlockEntities/DropperEntity.h"
#include "../BlockEntities/FurnaceEntity.h"
@@ -219,8 +220,23 @@ void cNBTChunkSerializer::AddJukeboxEntity(cJukeboxEntity * a_Jukebox)
void cNBTChunkSerializer::AddNoteEntity(cNoteEntity * a_Note)
{
m_Writer.BeginCompound("");
- AddBasicTileEntity(a_Note, "Music");
- m_Writer.AddByte("note", a_Note->GetPitch());
+ AddBasicTileEntity(a_Note, "Music");
+ m_Writer.AddByte("note", a_Note->GetPitch());
+ m_Writer.EndCompound();
+}
+
+
+
+
+
+void cNBTChunkSerializer::AddCommandBlockEntity(cCommandBlockEntity * a_CmdBlock)
+{
+ m_Writer.BeginCompound("");
+ AddBasicTileEntity(a_CmdBlock, "Control");
+ m_Writer.AddString("Command", a_CmdBlock->GetCommand());
+ m_Writer.AddInt ("SuccessCount", a_CmdBlock->GetResult());
+ m_Writer.AddString("LastOutput", a_CmdBlock->GetLastOutput());
+ m_Writer.AddByte ("TrackOutput", 1); // Unknown (?)
m_Writer.EndCompound();
}
@@ -639,15 +655,16 @@ void cNBTChunkSerializer::BlockEntity(cBlockEntity * a_Entity)
// Add tile-entity into NBT:
switch (a_Entity->GetBlockType())
{
- case E_BLOCK_CHEST: AddChestEntity ((cChestEntity *) a_Entity); break;
- case E_BLOCK_DISPENSER: AddDispenserEntity ((cDispenserEntity *) a_Entity); break;
- case E_BLOCK_DROPPER: AddDropperEntity ((cDropperEntity *) a_Entity); break;
- case E_BLOCK_FURNACE: AddFurnaceEntity ((cFurnaceEntity *) a_Entity); break;
- case E_BLOCK_HOPPER: AddHopperEntity ((cHopperEntity *) a_Entity); break;
+ case E_BLOCK_CHEST: AddChestEntity ((cChestEntity *) a_Entity); break;
+ case E_BLOCK_DISPENSER: AddDispenserEntity ((cDispenserEntity *) a_Entity); break;
+ case E_BLOCK_DROPPER: AddDropperEntity ((cDropperEntity *) a_Entity); break;
+ case E_BLOCK_FURNACE: AddFurnaceEntity ((cFurnaceEntity *) a_Entity); break;
+ case E_BLOCK_HOPPER: AddHopperEntity ((cHopperEntity *) a_Entity); break;
case E_BLOCK_SIGN_POST:
- case E_BLOCK_WALLSIGN: AddSignEntity ((cSignEntity *) a_Entity); break;
- case E_BLOCK_NOTE_BLOCK: AddNoteEntity ((cNoteEntity *) a_Entity); break;
- case E_BLOCK_JUKEBOX: AddJukeboxEntity ((cJukeboxEntity *) a_Entity); break;
+ case E_BLOCK_WALLSIGN: AddSignEntity ((cSignEntity *) a_Entity); break;
+ case E_BLOCK_NOTE_BLOCK: AddNoteEntity ((cNoteEntity *) a_Entity); break;
+ case E_BLOCK_JUKEBOX: AddJukeboxEntity ((cJukeboxEntity *) a_Entity); break;
+ case E_BLOCK_COMMAND_BLOCK: AddCommandBlockEntity((cCommandBlockEntity *) a_Entity); break;
default:
{
ASSERT(!"Unhandled block entity saved into Anvil");
diff --git a/src/WorldStorage/NBTChunkSerializer.h b/src/WorldStorage/NBTChunkSerializer.h
index 9d4ac208c..245b68063 100644
--- a/src/WorldStorage/NBTChunkSerializer.h
+++ b/src/WorldStorage/NBTChunkSerializer.h
@@ -21,6 +21,7 @@ class cEntity;
class cBlockEntity;
class cBoat;
class cChestEntity;
+class cCommandBlockEntity;
class cDispenserEntity;
class cDropperEntity;
class cFurnaceEntity;
@@ -92,6 +93,7 @@ protected:
void AddJukeboxEntity (cJukeboxEntity * a_Jukebox);
void AddNoteEntity (cNoteEntity * a_Note);
void AddSignEntity (cSignEntity * a_Sign);
+ void AddCommandBlockEntity(cCommandBlockEntity * a_CmdBlock);
// Entities:
void AddBasicEntity (cEntity * a_Entity, const AString & a_ClassName);
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 16513cd1b..85821fa51 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -15,6 +15,7 @@
#include "../StringCompression.h"
#include "../BlockEntities/ChestEntity.h"
+#include "../BlockEntities/CommandBlockEntity.h"
#include "../BlockEntities/DispenserEntity.h"
#include "../BlockEntities/DropperEntity.h"
#include "../BlockEntities/FurnaceEntity.h"
@@ -567,6 +568,10 @@ void cWSSAnvil::LoadBlockEntitiesFromNBT(cBlockEntityList & a_BlockEntities, con
{
LoadChestFromNBT(a_BlockEntities, a_NBT, Child);
}
+ else if (strncmp(a_NBT.GetData(sID), "Control", a_NBT.GetDataLength(sID)) == 0)
+ {
+ LoadCommandBlockFromNBT(a_BlockEntities, a_NBT, Child);
+ }
else if (strncmp(a_NBT.GetData(sID), "Dropper", a_NBT.GetDataLength(sID)) == 0)
{
LoadDropperFromNBT(a_BlockEntities, a_NBT, Child);
@@ -915,6 +920,43 @@ void cWSSAnvil::LoadSignFromNBT(cBlockEntityList & a_BlockEntities, const cParse
+void cWSSAnvil::LoadCommandBlockFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx)
+{
+ ASSERT(a_NBT.GetType(a_TagIdx) == TAG_Compound);
+ int x, y, z;
+ if (!GetBlockEntityNBTPos(a_NBT, a_TagIdx, x, y, z))
+ {
+ return;
+ }
+ std::auto_ptr CmdBlock(new cCommandBlockEntity(x, y, z, m_World));
+
+ int currentLine = a_NBT.FindChildByName(a_TagIdx, "Command");
+ if (currentLine >= 0)
+ {
+ CmdBlock->SetCommand(a_NBT.GetString(currentLine));
+ }
+
+ currentLine = a_NBT.FindChildByName(a_TagIdx, "SuccessCount");
+ if (currentLine >= 0)
+ {
+ CmdBlock->SetResult(a_NBT.GetInt(currentLine));
+ }
+
+ currentLine = a_NBT.FindChildByName(a_TagIdx, "LastOutput");
+ if (currentLine >= 0)
+ {
+ CmdBlock->SetLastOutput(a_NBT.GetString(currentLine));
+ }
+
+ // FIXME: TrackOutput
+
+ a_BlockEntities.push_back(CmdBlock.release());
+}
+
+
+
+
+
void cWSSAnvil::LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_EntityTagIdx, const char * a_IDTag, int a_IDTagLength)
{
if (strncmp(a_IDTag, "Boat", a_IDTagLength) == 0)
diff --git a/src/WorldStorage/WSSAnvil.h b/src/WorldStorage/WSSAnvil.h
index e66e63b08..5093ad083 100644
--- a/src/WorldStorage/WSSAnvil.h
+++ b/src/WorldStorage/WSSAnvil.h
@@ -131,14 +131,15 @@ protected:
*/
void LoadItemGridFromNBT(cItemGrid & a_ItemGrid, const cParsedNBT & a_NBT, int a_ItemsTagIdx, int s_SlotOffset = 0);
- void LoadChestFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadDispenserFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadDropperFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadFurnaceFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE * a_BlockTypes, NIBBLETYPE * a_BlockMetas);
- void LoadHopperFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadJukeboxFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadNoteFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
- void LoadSignFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadChestFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadDispenserFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadDropperFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadFurnaceFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx, BLOCKTYPE * a_BlockTypes, NIBBLETYPE * a_BlockMetas);
+ void LoadHopperFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadJukeboxFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadNoteFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadSignFromNBT (cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
+ void LoadCommandBlockFromNBT(cBlockEntityList & a_BlockEntities, const cParsedNBT & a_NBT, int a_TagIdx);
void LoadEntityFromNBT(cEntityList & a_Entities, const cParsedNBT & a_NBT, int a_EntityTagIdx, const char * a_IDTag, int a_IDTagLength);
--
cgit v1.2.3
From 160a27ccedf0aa8590bcf03abc9154eb1ee7b72d Mon Sep 17 00:00:00 2001
From: Tycho
Date: Sat, 18 Jan 2014 06:15:33 -0800
Subject: switched to using m_WorldAge rather than m_TickID
---
src/World.cpp | 9 +++------
src/World.h | 3 ---
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/World.cpp b/src/World.cpp
index f4b5f1ad8..a466acb84 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -870,7 +870,7 @@ void cWorld::TickScheduledTasks()
{
cCSLock Lock(m_CSScheduledTasks);
ScheduledTaskList::iterator itr = m_ScheduledTasks.begin();
- while (itr != m_ScheduledTasks.end() && (*itr)->Ticks > 0)
+ while (itr != m_ScheduledTasks.end() && (*itr)->Ticks < m_WorldAge)
{
Tasks.push_back(m_ScheduledTasks.front());
m_ScheduledTasks.pop_front();
@@ -883,9 +883,6 @@ void cWorld::TickScheduledTasks()
(*itr)->Run(*this);
delete *itr;
} // for itr - m_Tasks[]
-
- // Increment TickID
- m_TickID = (m_TickID+1) & 0x7FFFFFFF;
}
@@ -2622,11 +2619,11 @@ void cWorld::QueueTask(cTask * a_Task)
void cWorld::ScheduleTask(cScheduledTask * a_Task)
{
- a_Task->Ticks = (a_Task->Ticks + m_TickID) & 0x7FFFFFFF;
+ a_Task->Ticks = a_Task->Ticks + m_WorldAge;
cCSLock Lock(m_CSScheduledTasks);
for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++)
{
- if((*itr)->Ticks >= a_Task->Ticks && (a_Task->Ticks > m_TickID || (*itr)->Ticks < m_TickID))
+ if((*itr)->Ticks >= a_Task->Ticks)
{
m_ScheduledTasks.insert(itr, a_Task);
return;
diff --git a/src/World.h b/src/World.h
index 1fe2740ad..1ecf41507 100644
--- a/src/World.h
+++ b/src/World.h
@@ -772,9 +772,6 @@ private:
/// the future; guarded by m_CSScheduledTasks
ScheduledTaskList m_ScheduledTasks;
- /// Current Tick number for sceduled tasks
- long m_TickID;
-
/// Guards m_Clients
cCriticalSection m_CSClients;
--
cgit v1.2.3
From 1ad6469a180dfe6932c756fe3c99bcada3ee0b7e Mon Sep 17 00:00:00 2001
From: andrew
Date: Sat, 18 Jan 2014 16:59:33 +0200
Subject: Command blocks: Execute()
---
src/Bindings/ManualBindings.cpp | 22 ++++++++++++----------
src/BlockEntities/CommandBlockEntity.cpp | 32 +++++++++++++++++++++++++++-----
src/Server.cpp | 2 +-
src/World.h | 2 +-
src/WorldStorage/WSSAnvil.cpp | 2 +-
5 files changed, 42 insertions(+), 18 deletions(-)
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index ebee2d697..3ebe7b294 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -14,6 +14,7 @@
#include "../WebAdmin.h"
#include "../ClientHandle.h"
#include "../BlockEntities/ChestEntity.h"
+#include "../BlockEntities/CommandBlockEntity.h"
#include "../BlockEntities/DispenserEntity.h"
#include "../BlockEntities/DropperEntity.h"
#include "../BlockEntities/FurnaceEntity.h"
@@ -2265,16 +2266,17 @@ void ManualBindings::Bind(lua_State * tolua_S)
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cWorld");
- tolua_function(tolua_S, "DoWithBlockEntityAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithChestAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithDispenserAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithDropSpenserAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithDropperAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithEntityByID", tolua_DoWithID< cWorld, cEntity, &cWorld::DoWithEntityByID>);
- tolua_function(tolua_S, "DoWithFurnaceAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithNoteBlockAt", tolua_DoWithXYZ);
- tolua_function(tolua_S, "DoWithPlayer", tolua_DoWith< cWorld, cPlayer, &cWorld::DoWithPlayer>);
- tolua_function(tolua_S, "FindAndDoWithPlayer", tolua_DoWith< cWorld, cPlayer, &cWorld::FindAndDoWithPlayer>);
+ tolua_function(tolua_S, "DoWithBlockEntityAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithChestAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithDispenserAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithDropSpenserAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithDropperAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithEntityByID", tolua_DoWithID< cWorld, cEntity, &cWorld::DoWithEntityByID>);
+ tolua_function(tolua_S, "DoWithFurnaceAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithNoteBlockAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithCommandBlockAt", tolua_DoWithXYZ);
+ tolua_function(tolua_S, "DoWithPlayer", tolua_DoWith< cWorld, cPlayer, &cWorld::DoWithPlayer>);
+ tolua_function(tolua_S, "FindAndDoWithPlayer", tolua_DoWith< cWorld, cPlayer, &cWorld::FindAndDoWithPlayer>);
tolua_function(tolua_S, "ForEachBlockEntityInChunk", tolua_ForEachInChunk);
tolua_function(tolua_S, "ForEachChestInChunk", tolua_ForEachInChunk);
tolua_function(tolua_S, "ForEachEntity", tolua_ForEach< cWorld, cEntity, &cWorld::ForEachEntity>);
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 88e55dece..e70e259aa 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -8,6 +8,10 @@
#include "CommandBlockEntity.h"
#include "../Entities/Player.h"
+#include "CommandOutput.h"
+#include "Root.h"
+#include "Server.h" // ExecuteConsoleCommand()
+
@@ -45,7 +49,8 @@ void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
cWindow * Window = GetWindow();
if (Window == NULL)
{
- //OpenWindow(new cDropSpenserWindow(m_PosX, m_PosY, m_PosZ, this)); FIXME
+ // TODO 2014-01-18 xdot: Open the appropriate window.
+ // OpenWindow(new cCommandBlockWindow(m_PosX, m_PosY, m_PosZ, this));
Window = GetWindow();
}
@@ -64,7 +69,7 @@ void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
{
- m_Command = a_Cmd;LOGD("Hrey %s", a_Cmd.c_str());
+ m_Command = a_Cmd;
}
@@ -190,11 +195,28 @@ void cCommandBlockEntity::SaveToJson(Json::Value & a_Value)
void cCommandBlockEntity::Execute()
{
- // TODO: Parse arguments and dispatch command
+ class CommandBlockOutCb :
+ public cCommandOutputCallback
+ {
+ cCommandBlockEntity* m_CmdBlock;
+
+ public:
+ CommandBlockOutCb(cCommandBlockEntity* a_CmdBlock) : m_CmdBlock(a_CmdBlock) {}
+
+ virtual void Out(const AString & a_Text)
+ {
+ ASSERT(m_CmdBlock != NULL);
+
+ // Overwrite field
+ m_CmdBlock->SetLastOutput(a_Text);
+ }
+ } CmdBlockOutCb(this);
+
+ cServer* Server = cRoot::Get()->GetServer();
- LOGD("Command: %s", m_Command.c_str());
+ Server->ExecuteConsoleCommand(m_Command, CmdBlockOutCb);
- m_LastOutput = "";
+ // TODO 2014-01-18 xdot: Update the signal strength.
m_Result = 0;
}
diff --git a/src/Server.cpp b/src/Server.cpp
index 49067c17f..5280270b9 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -459,7 +459,7 @@ void cServer::ExecuteConsoleCommand(const AString & a_Cmd, cCommandOutputCallbac
{
return;
}
-
+
// Special handling: "stop" and "restart" are built in
if ((split[0].compare("stop") == 0) || (split[0].compare("restart") == 0))
{
diff --git a/src/World.h b/src/World.h
index c410e658e..1a7ad0cb1 100644
--- a/src/World.h
+++ b/src/World.h
@@ -469,7 +469,7 @@ public:
bool DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback & a_Callback); // Exported in ManualBindings.cpp
/// Calls the callback for the command block at the specified coords; returns false if there's no command block at those coords or callback returns true, returns true if found
- bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback); // TODO: Export
+ bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback); // Exported in ManualBindings.cpp
/// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // Exported in ManualBindings.cpp
diff --git a/src/WorldStorage/WSSAnvil.cpp b/src/WorldStorage/WSSAnvil.cpp
index 85821fa51..96a77152b 100644
--- a/src/WorldStorage/WSSAnvil.cpp
+++ b/src/WorldStorage/WSSAnvil.cpp
@@ -948,7 +948,7 @@ void cWSSAnvil::LoadCommandBlockFromNBT(cBlockEntityList & a_BlockEntities, cons
CmdBlock->SetLastOutput(a_NBT.GetString(currentLine));
}
- // FIXME: TrackOutput
+ // TODO 2014-01-18 xdot: Figure out what TrackOutput is and parse it.
a_BlockEntities.push_back(CmdBlock.release());
}
--
cgit v1.2.3
From b3ac2d9e2319d896ddf18094224db7492031de5a Mon Sep 17 00:00:00 2001
From: Alexander Harkness
Date: Sat, 18 Jan 2014 15:17:19 +0000
Subject: Fix bad nested headings.
---
COMPILING.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/COMPILING.md b/COMPILING.md
index 31222a5d8..eceeefee7 100644
--- a/COMPILING.md
+++ b/COMPILING.md
@@ -81,8 +81,8 @@ This is useful if you want to compile MCServer to use on another 32-bit machine.
to your cmake command and 32 bit will be forced.
-Compiling for another computer
-------------------------------
+### Compiling for another computer ###
+
When compiling for another computer it is important to set cross compiling mode. This tells the compiler not to optimise for your machine. It can be used with debug or release mode. To enable simply add:
--
cgit v1.2.3
From e68521deac8bebc8206277d209beef22f238be6c Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sat, 18 Jan 2014 17:03:43 +0100
Subject: Alpha-sorted the finishers.
---
src/Generating/ComposableGenerator.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Generating/ComposableGenerator.cpp b/src/Generating/ComposableGenerator.cpp
index b01f84627..cfa7e9c6f 100644
--- a/src/Generating/ComposableGenerator.cpp
+++ b/src/Generating/ComposableGenerator.cpp
@@ -396,6 +396,10 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
{
m_FinishGens.push_back(new cFinishGenSingleBiomeSingleTopBlock(Seed, E_BLOCK_LILY_PAD, biSwampland, 4, E_BLOCK_WATER, E_BLOCK_STATIONARY_WATER));
}
+ else if (NoCaseCompare(*itr, "NetherClumpFoliage") == 0)
+ {
+ m_FinishGens.push_back(new cFinishGenNetherClumpFoliage(Seed));
+ }
else if (NoCaseCompare(*itr, "PreSimulator") == 0)
{
m_FinishGens.push_back(new cFinishGenPreSimulator);
@@ -408,10 +412,6 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
{
m_FinishGens.push_back(new cFinishGenSprinkleFoliage(Seed));
}
- else if (NoCaseCompare(*itr, "NetherClumpFoliage") == 0)
- {
- m_FinishGens.push_back(new cFinishGenNetherClumpFoliage(Seed));
- }
else if (NoCaseCompare(*itr, "WaterSprings") == 0)
{
m_FinishGens.push_back(new cFinishGenFluidSprings(Seed, E_BLOCK_WATER, a_IniFile, Dimension));
--
cgit v1.2.3
From 02c9aa2b1e86974df4ef8ea152465719169bdac5 Mon Sep 17 00:00:00 2001
From: andrew
Date: Sat, 18 Jan 2014 19:58:46 +0200
Subject: Parse the MC|AdvCdm plugin message
---
src/BlockEntities/CommandBlockEntity.cpp | 2 +
src/ClientHandle.cpp | 64 ++++++++++++++++++++++++++++++++
src/ClientHandle.h | 3 ++
src/WorldStorage/NBTChunkSerializer.cpp | 2 +-
4 files changed, 70 insertions(+), 1 deletion(-)
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index e70e259aa..c29e3dff8 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -212,6 +212,8 @@ void cCommandBlockEntity::Execute()
}
} CmdBlockOutCb(this);
+ LOGD("cCommandBlockEntity: Executing command %s", m_Command.c_str());
+
cServer* Server = cRoot::Get()->GetServer();
Server->ExecuteConsoleCommand(m_Command, CmdBlockOutCb);
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index c8513d516..0a97ba6c8 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -8,6 +8,7 @@
#include "Entities/Player.h"
#include "Inventory.h"
#include "BlockEntities/ChestEntity.h"
+#include "BlockEntities/CommandBlockEntity.h"
#include "BlockEntities/SignEntity.h"
#include "UI/Window.h"
#include "Item.h"
@@ -545,6 +546,15 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ,
void cClientHandle::HandlePluginMessage(const AString & a_Channel, const AString & a_Message)
{
+ if (a_Channel == "MC|AdvCdm") // Command block
+ {
+ const char* Data = a_Message.c_str();
+
+ HandleCommandBlockMessage(Data, a_Message.size());
+
+ return;
+ }
+
cPluginManager::Get()->CallHookPluginMessage(*this, a_Channel, a_Message);
}
@@ -552,6 +562,60 @@ void cClientHandle::HandlePluginMessage(const AString & a_Channel, const AString
+void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a_Length)
+{
+ if (a_Length < 14)
+ {
+ LOGD("Malformed MC|AdvCdm packet.");
+ return;
+ }
+
+ int BlockX, BlockY, BlockZ;
+
+ AString Command;
+
+ switch (a_Data[0])
+ {
+ case 0x00:
+ {
+ BlockX = GetBEInt(a_Data + 1);
+ BlockY = GetBEInt(a_Data + 5);
+ BlockZ = GetBEInt(a_Data + 9);
+
+ Command = AString(a_Data + 14, (int)a_Data[13]);
+ break;
+ }
+
+ default:
+ {
+ LOGD("Unhandled MC|AdvCdm packet mode.");
+ return;
+ }
+ }
+
+ class cUpdateCommandBlock :
+ public cCommandBlockCallback
+ {
+ AString m_Command;
+ public:
+ cUpdateCommandBlock(const AString & a_Command) : m_Command(a_Command) {}
+
+ virtual bool Item(cCommandBlockEntity * a_CommandBlock) override
+ {
+ a_CommandBlock->SetCommand(m_Command);
+ return false;
+ }
+ } CmdBlockCB (Command);
+
+ cWorld * World = m_Player->GetWorld();
+
+ World->DoWithCommandBlockAt(BlockX, BlockY, BlockZ, CmdBlockCB);
+}
+
+
+
+
+
void cClientHandle::HandleLeftClick(int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, char a_Status)
{
LOGD("HandleLeftClick: {%i, %i, %i}; Face: %i; Stat: %i",
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index da2704b72..373ca9e2e 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -324,6 +324,9 @@ private:
/// Handles the DIG_FINISHED dig packet:
void HandleBlockDigFinished(int a_BlockX, int a_BlockY, int a_BlockZ, char a_BlockFace, BLOCKTYPE a_OldBlock, NIBBLETYPE a_OldMeta);
+
+ /// Handles the "MC|AdvCdm" plugin message
+ void HandleCommandBlockMessage(const char* a_Data, unsigned int a_Length);
// cSocketThreads::cCallback overrides:
virtual void DataReceived (const char * a_Data, int a_Size) override; // Data is received from the client
diff --git a/src/WorldStorage/NBTChunkSerializer.cpp b/src/WorldStorage/NBTChunkSerializer.cpp
index b5b5e555b..447296c7f 100644
--- a/src/WorldStorage/NBTChunkSerializer.cpp
+++ b/src/WorldStorage/NBTChunkSerializer.cpp
@@ -236,7 +236,7 @@ void cNBTChunkSerializer::AddCommandBlockEntity(cCommandBlockEntity * a_CmdBlock
m_Writer.AddString("Command", a_CmdBlock->GetCommand());
m_Writer.AddInt ("SuccessCount", a_CmdBlock->GetResult());
m_Writer.AddString("LastOutput", a_CmdBlock->GetLastOutput());
- m_Writer.AddByte ("TrackOutput", 1); // Unknown (?)
+ m_Writer.AddByte ("TrackOutput", 1); // TODO 2014-01-18 xdot: Figure out what TrackOutput is and save it.
m_Writer.EndCompound();
}
--
cgit v1.2.3
From 1cced1664f8d8677a1a4ad748b6ccd884705b5f0 Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 19:41:31 +0100
Subject: Removed the particles when a mob spawns.
---
src/World.cpp | 3 ---
1 file changed, 3 deletions(-)
diff --git a/src/World.cpp b/src/World.cpp
index 3e7c0ef74..70cd0b2ef 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -2766,9 +2766,6 @@ int cWorld::SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eTyp
{
Monster->SetPosition(a_PosX, a_PosY, a_PosZ);
}
-
- // Because it's logical that ALL mob spawns need spawn effects, not just spawners
- BroadcastSoundParticleEffect(2004, (int)a_PosX, (int)a_PosY, (int)a_PosZ, 0);
return SpawnMobFinalize(Monster);
}
--
cgit v1.2.3
From d93a4362b4275d94efe9a40a76a095d52448d0d8 Mon Sep 17 00:00:00 2001
From: Tycho
Date: Sat, 18 Jan 2014 10:57:25 -0800
Subject: Fixed iterators bug
---
src/World.cpp | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/src/World.cpp b/src/World.cpp
index a466acb84..134773f67 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -869,8 +869,7 @@ void cWorld::TickScheduledTasks()
// Make a copy of the tasks to avoid deadlocks on accessing m_Tasks
{
cCSLock Lock(m_CSScheduledTasks);
- ScheduledTaskList::iterator itr = m_ScheduledTasks.begin();
- while (itr != m_ScheduledTasks.end() && (*itr)->Ticks < m_WorldAge)
+ while (!m_ScheduledTasks.empty() && m_ScheduledTasks.front()->Ticks < m_WorldAge)
{
Tasks.push_back(m_ScheduledTasks.front());
m_ScheduledTasks.pop_front();
--
cgit v1.2.3
From fab726282c5d2e04cdc9daa88b5d0a05ead8cf33 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sat, 18 Jan 2014 20:20:56 +0100
Subject: HTTP connections aren't kept alive unless explicitly enabled.
Only the client can decide that the connection can be kept alive, we must close the socket if the client doesn't indicate keepalive support.
This will provide a fix for #390 when #560 is fixed; until then the issue remains, just it's no longer HTTPServer's fault.
---
src/HTTPServer/HTTPConnection.cpp | 6 +++++
src/HTTPServer/HTTPConnection.h | 31 +++++++++++++-----------
src/HTTPServer/HTTPMessage.cpp | 7 +++++-
src/HTTPServer/HTTPMessage.h | 51 ++++++++++++++++++++++-----------------
4 files changed, 58 insertions(+), 37 deletions(-)
diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp
index 3d30ab177..a4af706f2 100644
--- a/src/HTTPServer/HTTPConnection.cpp
+++ b/src/HTTPServer/HTTPConnection.cpp
@@ -205,6 +205,12 @@ void cHTTPConnection::DataReceived(const char * a_Data, int a_Size)
{
m_State = wcsRecvIdle;
m_HTTPServer.RequestFinished(*this, *m_CurrentRequest);
+ if (!m_CurrentRequest->DoesAllowKeepAlive())
+ {
+ m_State = wcsInvalid;
+ m_HTTPServer.CloseConnection(*this);
+ return;
+ }
delete m_CurrentRequest;
m_CurrentRequest = NULL;
}
diff --git a/src/HTTPServer/HTTPConnection.h b/src/HTTPServer/HTTPConnection.h
index 00941f2ae..5b8103554 100644
--- a/src/HTTPServer/HTTPConnection.h
+++ b/src/HTTPServer/HTTPConnection.h
@@ -41,49 +41,52 @@ public:
cHTTPConnection(cHTTPServer & a_HTTPServer);
virtual ~cHTTPConnection();
- /// Sends HTTP status code together with a_Reason (used for HTTP errors)
+ /** Sends HTTP status code together with a_Reason (used for HTTP errors) */
void SendStatusAndReason(int a_StatusCode, const AString & a_Reason);
- /// Sends the "401 unauthorized" reply together with instructions on authorizing, using the specified realm
+ /** Sends the "401 unauthorized" reply together with instructions on authorizing, using the specified realm */
void SendNeedAuth(const AString & a_Realm);
- /// Sends the headers contained in a_Response
+ /** Sends the headers contained in a_Response */
void Send(const cHTTPResponse & a_Response);
- /// Sends the data as the response (may be called multiple times)
+ /** Sends the data as the response (may be called multiple times) */
void Send(const void * a_Data, int a_Size);
- /// Sends the data as the response (may be called multiple times)
+ /** Sends the data as the response (may be called multiple times) */
void Send(const AString & a_Data) { Send(a_Data.data(), a_Data.size()); }
- /// Indicates that the current response is finished, gets ready for receiving another request (HTTP 1.1 keepalive)
+ /** Indicates that the current response is finished, gets ready for receiving another request (HTTP 1.1 keepalive) */
void FinishResponse(void);
- /// Resets the connection for a new request. Depending on the state, this will send an "InternalServerError" status or a "ResponseEnd"
+ /** Resets the internal connection state for a new request.
+ Depending on the state, this will send an "InternalServerError" status or a "ResponseEnd" */
void AwaitNextRequest(void);
- /// Terminates the connection; finishes any request being currently processed
+ /** Terminates the connection; finishes any request being currently processed */
void Terminate(void);
protected:
typedef std::map cNameValueMap;
- /// The parent webserver that is to be notified of events on this connection
+ /** The parent webserver that is to be notified of events on this connection */
cHTTPServer & m_HTTPServer;
- /// All the incoming data until the entire request header is parsed
+ /** All the incoming data until the entire request header is parsed */
AString m_IncomingHeaderData;
- /// Status in which the request currently is
+ /** Status in which the request currently is */
eState m_State;
- /// Data that is queued for sending, once the socket becomes writable
+ /** Data that is queued for sending, once the socket becomes writable */
AString m_OutgoingData;
- /// The request being currently received (valid only between having parsed the headers and finishing receiving the body)
+ /** The request being currently received
+ Valid only between having parsed the headers and finishing receiving the body. */
cHTTPRequest * m_CurrentRequest;
- /// Number of bytes that remain to read for the complete body of the message to be received. Valid only in wcsRecvBody
+ /** Number of bytes that remain to read for the complete body of the message to be received.
+ Valid only in wcsRecvBody */
int m_CurrentRequestBodyRemaining;
diff --git a/src/HTTPServer/HTTPMessage.cpp b/src/HTTPServer/HTTPMessage.cpp
index ab23866e6..98627eb8e 100644
--- a/src/HTTPServer/HTTPMessage.cpp
+++ b/src/HTTPServer/HTTPMessage.cpp
@@ -72,7 +72,8 @@ cHTTPRequest::cHTTPRequest(void) :
m_EnvelopeParser(*this),
m_IsValid(true),
m_UserData(NULL),
- m_HasAuth(false)
+ m_HasAuth(false),
+ m_AllowKeepAlive(false)
{
}
@@ -236,6 +237,10 @@ void cHTTPRequest::OnHeaderLine(const AString & a_Key, const AString & a_Value)
m_HasAuth = true;
}
}
+ if ((a_Key == "Connection") && (NoCaseCompare(a_Value, "keep-alive") == 0))
+ {
+ m_AllowKeepAlive = true;
+ }
AddHeader(a_Key, a_Value);
}
diff --git a/src/HTTPServer/HTTPMessage.h b/src/HTTPServer/HTTPMessage.h
index 2a4c2879e..ab3338db7 100644
--- a/src/HTTPServer/HTTPMessage.h
+++ b/src/HTTPServer/HTTPMessage.h
@@ -35,7 +35,7 @@ public:
// Force a virtual destructor in all descendants
virtual ~cHTTPMessage() {};
- /// Adds a header into the internal map of headers. Recognizes special headers: Content-Type and Content-Length
+ /** Adds a header into the internal map of headers. Recognizes special headers: Content-Type and Content-Length */
void AddHeader(const AString & a_Key, const AString & a_Value);
void SetContentType (const AString & a_ContentType) { m_ContentType = a_ContentType; }
@@ -51,10 +51,10 @@ protected:
cNameValueMap m_Headers;
- /// Type of the content; parsed by AddHeader(), set directly by SetContentLength()
+ /** Type of the content; parsed by AddHeader(), set directly by SetContentLength() */
AString m_ContentType;
- /// Length of the content that is to be received. -1 when the object is created, parsed by AddHeader() or set directly by SetContentLength()
+ /** Length of the content that is to be received. -1 when the object is created, parsed by AddHeader() or set directly by SetContentLength() */
int m_ContentLength;
} ;
@@ -76,64 +76,71 @@ public:
*/
int ParseHeaders(const char * a_Data, int a_Size);
- /// Returns true if the request did contain a Content-Length header
+ /** Returns true if the request did contain a Content-Length header */
bool HasReceivedContentLength(void) const { return (m_ContentLength >= 0); }
- /// Returns the method used in the request
+ /** Returns the method used in the request */
const AString & GetMethod(void) const { return m_Method; }
- /// Returns the URL used in the request
+ /** Returns the URL used in the request */
const AString & GetURL(void) const { return m_URL; }
- /// Returns the URL used in the request, without any parameters
+ /** Returns the URL used in the request, without any parameters */
AString GetBareURL(void) const;
- /// Sets the UserData pointer that is stored within this request. The request doesn't touch this data (doesn't delete it)!
+ /** Sets the UserData pointer that is stored within this request.
+ The request doesn't touch this data (doesn't delete it)! */
void SetUserData(void * a_UserData) { m_UserData = a_UserData; }
- /// Retrieves the UserData pointer that has been stored within this request.
+ /** Retrieves the UserData pointer that has been stored within this request. */
void * GetUserData(void) const { return m_UserData; }
- /// Returns true if more data is expected for the request headers
+ /** Returns true if more data is expected for the request headers */
bool IsInHeaders(void) const { return m_EnvelopeParser.IsInHeaders(); }
- /// Returns true if the request did present auth data that was understood by the parser
+ /** Returns true if the request did present auth data that was understood by the parser */
bool HasAuth(void) const { return m_HasAuth; }
- /// Returns the username that the request presented. Only valid if HasAuth() is true
+ /** Returns the username that the request presented. Only valid if HasAuth() is true */
const AString & GetAuthUsername(void) const { return m_AuthUsername; }
- /// Returns the password that the request presented. Only valid if HasAuth() is true
+ /** Returns the password that the request presented. Only valid if HasAuth() is true */
const AString & GetAuthPassword(void) const { return m_AuthPassword; }
+ bool DoesAllowKeepAlive(void) const { return m_AllowKeepAlive; }
+
protected:
- /// Parser for the envelope data
+ /** Parser for the envelope data */
cEnvelopeParser m_EnvelopeParser;
- /// True if the data received so far is parsed successfully. When false, all further parsing is skipped
+ /** True if the data received so far is parsed successfully. When false, all further parsing is skipped */
bool m_IsValid;
- /// Bufferred incoming data, while parsing for the request line
+ /** Bufferred incoming data, while parsing for the request line */
AString m_IncomingHeaderData;
- /// Method of the request (GET / PUT / POST / ...)
+ /** Method of the request (GET / PUT / POST / ...) */
AString m_Method;
- /// Full URL of the request
+ /** Full URL of the request */
AString m_URL;
- /// Data that the HTTPServer callbacks are allowed to store.
+ /** Data that the HTTPServer callbacks are allowed to store. */
void * m_UserData;
- /// Set to true if the request contains auth data that was understood by the parser
+ /** Set to true if the request contains auth data that was understood by the parser */
bool m_HasAuth;
- /// The username used for auth
+ /** The username used for auth */
AString m_AuthUsername;
- /// The password used for auth
+ /** The password used for auth */
AString m_AuthPassword;
+ /** Set to true if the request indicated that it supports keepalives.
+ If false, the server will close the connection once the request is finished */
+ bool m_AllowKeepAlive;
+
/** Parses the incoming data for the first line (RequestLine)
Returns the number of bytes consumed, or -1 for an error
--
cgit v1.2.3
From a037172465932de7d0d7d725c3c8ec5b2fa44029 Mon Sep 17 00:00:00 2001
From: andrew
Date: Sat, 18 Jan 2014 21:27:54 +0200
Subject: Command block fixes
---
src/BlockEntities/CommandBlockEntity.cpp | 36 +++-----------------------------
src/BlockEntities/CommandBlockEntity.h | 7 ++-----
src/ClientHandle.cpp | 17 ++++++++++-----
3 files changed, 17 insertions(+), 43 deletions(-)
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index c29e3dff8..543d47b7a 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -20,24 +20,7 @@ cCommandBlockEntity::cCommandBlockEntity(int a_X, int a_Y, int a_Z, cWorld * a_W
super(E_BLOCK_COMMAND_BLOCK, a_X, a_Y, a_Z, a_World),
m_ShouldExecute(false),
m_IsPowered(false)
-{
- SetBlockEntity(this); // cBlockEntityWindowOwner
-}
-
-
-
-
-
-
-cCommandBlockEntity::~cCommandBlockEntity()
-{
- // Tell window its owner is destroyed
- cWindow * Window = GetWindow();
- if (Window != NULL)
- {
- Window->OwnerDestroyed();
- }
-}
+{}
@@ -46,21 +29,8 @@ cCommandBlockEntity::~cCommandBlockEntity()
void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
{
- cWindow * Window = GetWindow();
- if (Window == NULL)
- {
- // TODO 2014-01-18 xdot: Open the appropriate window.
- // OpenWindow(new cCommandBlockWindow(m_PosX, m_PosY, m_PosZ, this));
- Window = GetWindow();
- }
-
- if (Window != NULL)
- {
- if (a_Player->GetWindow() != Window)
- {
- a_Player->OpenWindow(Window);
- }
- }
+ // Nothing to do
+ UNUSED(a_Player);
}
diff --git a/src/BlockEntities/CommandBlockEntity.h b/src/BlockEntities/CommandBlockEntity.h
index c4529a1e6..12157670f 100644
--- a/src/BlockEntities/CommandBlockEntity.h
+++ b/src/BlockEntities/CommandBlockEntity.h
@@ -9,8 +9,7 @@
#pragma once
-#include "BlockEntityWithItems.h"
-#include "../UI/WindowOwner.h"
+#include "BlockEntity.h"
@@ -28,8 +27,7 @@ namespace Json
// tolua_begin
class cCommandBlockEntity :
- public cBlockEntity,
- public cBlockEntityWindowOwner
+ public cBlockEntity
{
typedef cBlockEntity super;
@@ -39,7 +37,6 @@ public:
/// Creates a new empty command block entity
cCommandBlockEntity(int a_X, int a_Y, int a_Z, cWorld * a_World);
- virtual ~cCommandBlockEntity();
bool LoadFromJson( const Json::Value& a_Value );
virtual void SaveToJson(Json::Value& a_Value ) override;
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 0a97ba6c8..faf583fbb 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -570,19 +570,26 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
return;
}
+ cByteBuffer Buffer(a_Length);
+ Buffer.Write(a_Data, a_Length);
+
int BlockX, BlockY, BlockZ;
AString Command;
- switch (a_Data[0])
+ char Mode;
+
+ Buffer.ReadChar(Mode);
+
+ switch (Mode)
{
case 0x00:
{
- BlockX = GetBEInt(a_Data + 1);
- BlockY = GetBEInt(a_Data + 5);
- BlockZ = GetBEInt(a_Data + 9);
+ Buffer.ReadBEInt(BlockX);
+ Buffer.ReadBEInt(BlockY);
+ Buffer.ReadBEInt(BlockZ);
- Command = AString(a_Data + 14, (int)a_Data[13]);
+ Buffer.ReadVarUTF8String(Command);
break;
}
--
cgit v1.2.3
From 7153bc0578033c583e6ab6ddfc9d184388b90e22 Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sat, 18 Jan 2014 23:42:48 +0100
Subject: Fixed compiler error.
---
VC2008/MCServer.vcproj | 8 ++++++++
src/BlockEntities/CommandBlockEntity.cpp | 6 +++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj
index 0927f2f7b..85ef1e24f 100644
--- a/VC2008/MCServer.vcproj
+++ b/VC2008/MCServer.vcproj
@@ -2910,6 +2910,14 @@
RelativePath="..\src\BlockEntities\ChestEntity.h"
>
+
+
+
+
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 543d47b7a..ca617b04d 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -8,9 +8,9 @@
#include "CommandBlockEntity.h"
#include "../Entities/Player.h"
-#include "CommandOutput.h"
-#include "Root.h"
-#include "Server.h" // ExecuteConsoleCommand()
+#include "../CommandOutput.h"
+#include "../Root.h"
+#include "../Server.h" // ExecuteConsoleCommand()
--
cgit v1.2.3
From 24df625fbd86184b7a9404aab92a40ecfeaf455f Mon Sep 17 00:00:00 2001
From: STRWarrior
Date: Sun, 19 Jan 2014 00:04:46 +0100
Subject: Exported cFloater to the Lua API.
---
src/Bindings/AllToLua.pkg | 1 +
src/Entities/Floater.h | 10 +++++++---
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/Bindings/AllToLua.pkg b/src/Bindings/AllToLua.pkg
index 2d0300ebf..f65aed9bb 100644
--- a/src/Bindings/AllToLua.pkg
+++ b/src/Bindings/AllToLua.pkg
@@ -31,6 +31,7 @@ $cfile "../Defines.h"
$cfile "../ChatColor.h"
$cfile "../ClientHandle.h"
$cfile "../Entities/Entity.h"
+$cfile "../Entities/Floater.h"
$cfile "../Entities/Pawn.h"
$cfile "../Entities/Player.h"
$cfile "../Entities/Pickup.h"
diff --git a/src/Entities/Floater.h b/src/Entities/Floater.h
index 4bbe3f352..162b74e75 100644
--- a/src/Entities/Floater.h
+++ b/src/Entities/Floater.h
@@ -7,21 +7,25 @@
+// tolua_begin
class cFloater :
public cEntity
{
typedef cFloater super;
public:
-
+
+ //tolua_end
cFloater(double a_X, double a_Y, double a_Z, Vector3d a_Speed, int a_PlayerID, int a_CountDownTime);
virtual void SpawnOn(cClientHandle & a_Client) override;
virtual void Tick(float a_Dt, cChunk & a_Chunk) override;
-
+
+ // tolua_begin
bool CanPickup(void) const { return m_CanPickupItem; }
int GetOwnerID(void) const { return m_PlayerID; }
int GetAttachedMobID(void) const { return m_AttachedMobID; }
+ // tolua_end
protected:
// Position
@@ -37,4 +41,4 @@ protected:
// Entity IDs
int m_PlayerID;
int m_AttachedMobID;
-} ;
\ No newline at end of file
+} ; // tolua_export
\ No newline at end of file
--
cgit v1.2.3
From f8c8dcc7f36366dc6b59e6741d466e739322d5d1 Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Sun, 19 Jan 2014 00:54:38 +0000
Subject: Improved command blocks
* Their command and previous output are displayed on the client
* They have a BlockHandler implementation, so you can't place blocks on
them anymore
+ As a side effect, implemented UpdateBlockEntity
---
src/BlockEntities/CommandBlockEntity.cpp | 42 ++++++++++++++++++++++++++++----
src/Blocks/BlockCommandBlock.h | 32 ++++++++++++++++++++++++
src/Blocks/BlockHandler.cpp | 2 ++
src/ClientHandle.cpp | 9 +++++++
src/ClientHandle.h | 2 ++
src/Protocol/Protocol.h | 2 ++
src/Protocol/Protocol125.h | 1 +
src/Protocol/Protocol17x.cpp | 25 +++++++++++++++++++
src/Protocol/Protocol17x.h | 2 ++
src/Protocol/ProtocolRecognizer.cpp | 10 ++++++++
src/Protocol/ProtocolRecognizer.h | 2 ++
11 files changed, 124 insertions(+), 5 deletions(-)
create mode 100644 src/Blocks/BlockCommandBlock.h
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 543d47b7a..6e5c8087e 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -7,10 +7,11 @@
#include "json/json.h"
#include "CommandBlockEntity.h"
#include "../Entities/Player.h"
+#include "../WorldStorage/FastNBT.h"
-#include "CommandOutput.h"
-#include "Root.h"
-#include "Server.h" // ExecuteConsoleCommand()
+#include "../CommandOutput.h"
+#include "../Root.h"
+#include "../Server.h" // ExecuteConsoleCommand()
@@ -40,6 +41,15 @@ void cCommandBlockEntity::UsedBy(cPlayer * a_Player)
void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
{
m_Command = a_Cmd;
+
+ /*
+ Vanilla requires that the server send a Block Entity Update after a command has been set
+ Therefore, command blocks don't support on-the-fly (when window is open) updating of a command and therefore...
+ ...the following code can't be put in UsedBy just before the window opens
+
+ Just documenting my experience in getting this to work :P
+ */
+ m_World->BroadcastBlockEntity(GetPosX(), GetPosY(), GetPosZ());
}
@@ -131,8 +141,30 @@ bool cCommandBlockEntity::Tick(float a_Dt, cChunk & a_Chunk)
void cCommandBlockEntity::SendTo(cClientHandle & a_Client)
{
- // Nothing needs to be sent
- UNUSED(a_Client);
+ cFastNBTWriter Writer;
+ Writer.AddByte("TrackOutput", 1); // Neither I nor the MC wiki has any idea about this
+ Writer.AddInt("SuccessCount", GetResult());
+ Writer.AddInt("x", GetPosX());
+ Writer.AddInt("y", GetPosY());
+ Writer.AddInt("z", GetPosZ());
+ Writer.AddString("Command", GetCommand().c_str());
+ // You can set custom names for windows in Vanilla
+ // For a command block, this would be the 'name' prepended to anything it outputs into global chat
+ // MCS doesn't have this, so just leave it @ '@'. (geddit?)
+ Writer.AddString("CustomName", "@");
+ Writer.AddString("id", "Control"); // "Tile Entity ID" - MC wiki; vanilla server always seems to send this though
+
+ if (!GetLastOutput().empty())
+ {
+ AString Output;
+ Printf(Output, "{\"text\":\"%s\"}", GetLastOutput().c_str());
+
+ Writer.AddString("LastOutput", Output.c_str());
+ }
+
+ Writer.Finish();
+
+ a_Client.SendUpdateBlockEntity(GetPosX(), GetPosY(), GetPosZ(), 2, Writer);
}
diff --git a/src/Blocks/BlockCommandBlock.h b/src/Blocks/BlockCommandBlock.h
new file mode 100644
index 000000000..cf0103765
--- /dev/null
+++ b/src/Blocks/BlockCommandBlock.h
@@ -0,0 +1,32 @@
+
+#pragma once
+
+#include "BlockEntity.h"
+
+
+
+
+
+class cBlockCommandBlockHandler :
+ public cBlockEntityHandler
+{
+public:
+ cBlockCommandBlockHandler(BLOCKTYPE a_BlockType)
+ : cBlockEntityHandler(a_BlockType)
+ {
+ }
+
+ virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override
+ {
+ a_Pickups.push_back(cItem(E_BLOCK_AIR, 8, 0));
+ }
+
+ virtual const char * GetStepSound(void) override
+ {
+ return "step.stone";
+ }
+} ;
+
+
+
+
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index ff1022e12..b9c0887ce 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -14,6 +14,7 @@
#include "BlockChest.h"
#include "BlockCloth.h"
#include "BlockCobWeb.h"
+#include "BlockCommandBlock.h"
#include "BlockComparator.h"
#include "BlockCrops.h"
#include "BlockDeadBush.h"
@@ -116,6 +117,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType)
case E_BLOCK_CAULDRON: return new cBlockCauldronHandler (a_BlockType);
case E_BLOCK_CHEST: return new cBlockChestHandler (a_BlockType);
case E_BLOCK_COAL_ORE: return new cBlockOreHandler (a_BlockType);
+ case E_BLOCK_COMMAND_BLOCK: return new cBlockCommandBlockHandler (a_BlockType);
case E_BLOCK_ACTIVE_COMPARATOR: return new cBlockComparatorHandler (a_BlockType);
case E_BLOCK_COBBLESTONE: return new cBlockStoneHandler (a_BlockType);
case E_BLOCK_COBBLESTONE_STAIRS: return new cBlockStairsHandler (a_BlockType);
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index faf583fbb..93dc78642 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -20,6 +20,7 @@
#include "Items/ItemHandler.h"
#include "Blocks/BlockHandler.h"
#include "Blocks/BlockSlab.h"
+#include "WorldStorage/FastNBT.h"
#include "Vector3f.h"
#include "Vector3d.h"
@@ -2203,6 +2204,14 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
+void cClientHandle::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT)
+{
+ m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_NBT);
+}
+
+
+
+
void cClientHandle::SendUpdateSign(
int a_BlockX, int a_BlockY, int a_BlockZ,
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 373ca9e2e..2ac240b17 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -16,6 +16,7 @@
#include "OSSupport/SocketThreads.h"
#include "ChunkDef.h"
#include "ByteBuffer.h"
+#include "WorldStorage/FastNBT.h"
@@ -136,6 +137,7 @@ public:
void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ);
void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay);
void SendUnloadChunk (int a_ChunkX, int a_ChunkZ);
+ void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT);
void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ );
void SendWeather (eWeather a_Weather);
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 3293da32c..6af0af25d 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -12,6 +12,7 @@
#include "../Defines.h"
#include "../Endianness.h"
+#include "../WorldStorage/FastNBT.h"
@@ -103,6 +104,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) = 0;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) = 0;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) = 0;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) = 0;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) = 0;
virtual void SendWeather (eWeather a_Weather) = 0;
diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h
index d0e5c9428..97b194d76 100644
--- a/src/Protocol/Protocol125.h
+++ b/src/Protocol/Protocol125.h
@@ -79,6 +79,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) override {};
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 5b3a79555..01a6b0bde 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -892,6 +892,20 @@ void cProtocol172::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
+void cProtocol172::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT)
+{
+ cPacketizer Pkt(*this, 0x35); // Update tile entity packet
+ Pkt.WriteInt(a_BlockX);
+ Pkt.WriteShort(a_BlockY);
+ Pkt.WriteInt(a_BlockZ);
+ Pkt.WriteByte(a_Action);
+
+ Pkt.WriteBlockEntity(a_NBT);
+}
+
+
+
+
void cProtocol172::SendUpdateSign(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4)
{
@@ -1819,6 +1833,17 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item)
+void cProtocol172::cPacketizer::WriteBlockEntity(const cFastNBTWriter & a_NBT)
+{
+ AString Compressed;
+ CompressStringGZIP(a_NBT.GetResult().data(), a_NBT.GetResult().size(), Compressed);
+ WriteShort(Compressed.size());
+ WriteBuf(Compressed.data(), Compressed.size());
+}
+
+
+
+
void cProtocol172::cPacketizer::WriteByteAngle(double a_Angle)
{
diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h
index 07dba834b..6e04a0ffb 100644
--- a/src/Protocol/Protocol17x.h
+++ b/src/Protocol/Protocol17x.h
@@ -102,6 +102,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) override;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
@@ -189,6 +190,7 @@ protected:
void WriteEntityMetadata(const cEntity & a_Entity); // Writes the metadata for the specified entity, not including the terminating 0x7f
void WriteMobMetadata(const cMonster & a_Mob); // Writes the mob-specific metadata for the specified mob
void WriteEntityProperties(const cEntity & a_Entity); // Writes the entity properties for the specified entity, including the Count field
+ void WriteBlockEntity(const cFastNBTWriter & a_NBT);
protected:
cProtocol172 & m_Protocol;
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index a21f4f042..579469fb4 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -636,6 +636,16 @@ void cProtocolRecognizer::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
+void cProtocolRecognizer::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT)
+{
+ ASSERT(m_Protocol != NULL);
+ m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_NBT);
+}
+
+
+
+
+
void cProtocolRecognizer::SendUpdateSign(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4)
{
ASSERT(m_Protocol != NULL);
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index e94f4cde8..410ba556e 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -12,6 +12,7 @@
#include "Protocol.h"
#include "../ByteBuffer.h"
+#include "../WorldStorage/FastNBT.h"
@@ -114,6 +115,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) override;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
--
cgit v1.2.3
From 71b01234a2eadbf3512e8efcdd28b2728d720628 Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Sun, 19 Jan 2014 00:55:08 +0000
Subject: ProtoProxy: UpdateBlockEntity NBT is written
---
Tools/ProtoProxy/Connection.cpp | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/Tools/ProtoProxy/Connection.cpp b/Tools/ProtoProxy/Connection.cpp
index 34da9b700..cd66e2dfd 100644
--- a/Tools/ProtoProxy/Connection.cpp
+++ b/Tools/ProtoProxy/Connection.cpp
@@ -2496,7 +2496,8 @@ bool cConnection::HandleServerUpdateTileEntity(void)
HANDLE_SERVER_PACKET_READ(ReadBEShort, short, BlockY);
HANDLE_SERVER_PACKET_READ(ReadBEInt, int, BlockZ);
HANDLE_SERVER_PACKET_READ(ReadByte, Byte, Action);
- HANDLE_SERVER_PACKET_READ(ReadBEShort, short, DataLength);
+ HANDLE_SERVER_PACKET_READ(ReadBEShort, short, DataLength);
+
AString Data;
if ((DataLength > 0) && !m_ServerBuffer.ReadString(Data, DataLength))
{
@@ -2506,6 +2507,18 @@ bool cConnection::HandleServerUpdateTileEntity(void)
Log(" Block = {%d, %d, %d}", BlockX, BlockY, BlockZ);
Log(" Action = %d", Action);
DataLog(Data.data(), Data.size(), " Data (%u bytes)", Data.size());
+
+ // Save metadata to a file:
+ AString fnam;
+ Printf(fnam, "%s_item_%08x.nbt", m_LogNameBase.c_str(), m_ItemIdx++);
+ FILE * f = fopen(fnam.c_str(), "wb");
+ if (f != NULL)
+ {
+ fwrite(Data.data(), 1, Data.size(), f);
+ fclose(f);
+ Log("(saved to file \"%s\")", fnam.c_str());
+ }
+
COPY_TO_CLIENT();
return true;
}
--
cgit v1.2.3
From a85b2897e0e9563be69ed2fde944573459103d56 Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Sun, 19 Jan 2014 01:06:19 +0000
Subject: Implemented MC|Brand response
---
src/ClientHandle.cpp | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 93dc78642..8f95212e1 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -547,12 +547,18 @@ void cClientHandle::HandlePlayerPos(double a_PosX, double a_PosY, double a_PosZ,
void cClientHandle::HandlePluginMessage(const AString & a_Channel, const AString & a_Message)
{
- if (a_Channel == "MC|AdvCdm") // Command block
+ if (a_Channel == "MC|AdvCdm") // Command block, set text, Client -> Server
{
const char* Data = a_Message.c_str();
-
HandleCommandBlockMessage(Data, a_Message.size());
-
+ return;
+ }
+ else if (a_Channel == "MC|Brand") // Client <-> Server branding exchange
+ {
+ // We are custom,
+ // We are awesome,
+ // We are MCServer.
+ SendPluginMessage("MC|Brand", "MCServer");
return;
}
--
cgit v1.2.3
From 1af89a8b50a382ef0f5c137a84ab2816c45cc73c Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Sun, 19 Jan 2014 13:25:35 +0000
Subject: Changed SendBlockEntity format slightly
* Writing NBT is now in Protocol, not BlockEntity files
* Fixed a last output bug
---
src/BlockEntities/CommandBlockEntity.cpp | 26 ++-----------------
src/ClientHandle.cpp | 9 ++++---
src/ClientHandle.h | 3 +--
src/Protocol/Protocol.h | 3 +--
src/Protocol/Protocol125.h | 2 +-
src/Protocol/Protocol17x.cpp | 43 +++++++++++++++++++++++++++++---
src/Protocol/Protocol17x.h | 4 +--
src/Protocol/ProtocolRecognizer.cpp | 4 +--
src/Protocol/ProtocolRecognizer.h | 3 +--
9 files changed, 55 insertions(+), 42 deletions(-)
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 6e5c8087e..38737d619 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -58,6 +58,7 @@ void cCommandBlockEntity::SetCommand(const AString & a_Cmd)
void cCommandBlockEntity::SetLastOutput(const AString & a_LastOut)
{
+ m_World->BroadcastBlockEntity(GetPosX(), GetPosY(), GetPosZ());
m_LastOutput = a_LastOut;
}
@@ -141,30 +142,7 @@ bool cCommandBlockEntity::Tick(float a_Dt, cChunk & a_Chunk)
void cCommandBlockEntity::SendTo(cClientHandle & a_Client)
{
- cFastNBTWriter Writer;
- Writer.AddByte("TrackOutput", 1); // Neither I nor the MC wiki has any idea about this
- Writer.AddInt("SuccessCount", GetResult());
- Writer.AddInt("x", GetPosX());
- Writer.AddInt("y", GetPosY());
- Writer.AddInt("z", GetPosZ());
- Writer.AddString("Command", GetCommand().c_str());
- // You can set custom names for windows in Vanilla
- // For a command block, this would be the 'name' prepended to anything it outputs into global chat
- // MCS doesn't have this, so just leave it @ '@'. (geddit?)
- Writer.AddString("CustomName", "@");
- Writer.AddString("id", "Control"); // "Tile Entity ID" - MC wiki; vanilla server always seems to send this though
-
- if (!GetLastOutput().empty())
- {
- AString Output;
- Printf(Output, "{\"text\":\"%s\"}", GetLastOutput().c_str());
-
- Writer.AddString("LastOutput", Output.c_str());
- }
-
- Writer.Finish();
-
- a_Client.SendUpdateBlockEntity(GetPosX(), GetPosY(), GetPosZ(), 2, Writer);
+ a_Client.SendUpdateBlockEntity(GetPosX(), GetPosY(), GetPosZ(), 2, *this);
}
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 8f95212e1..327fc0358 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -20,7 +20,6 @@
#include "Items/ItemHandler.h"
#include "Blocks/BlockHandler.h"
#include "Blocks/BlockSlab.h"
-#include "WorldStorage/FastNBT.h"
#include "Vector3f.h"
#include "Vector3d.h"
@@ -573,6 +572,7 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
{
if (a_Length < 14)
{
+ SendChat(Printf("%s[INFO]%s Failure setting command block command; bad request", cChatColor::Red.c_str(), cChatColor::White.c_str()));
LOGD("Malformed MC|AdvCdm packet.");
return;
}
@@ -602,6 +602,7 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
default:
{
+ SendChat(Printf("%s[INFO]%s Failure setting command block command; unhandled mode", cChatColor::Red.c_str(), cChatColor::White.c_str()));
LOGD("Unhandled MC|AdvCdm packet mode.");
return;
}
@@ -624,6 +625,8 @@ void cClientHandle::HandleCommandBlockMessage(const char* a_Data, unsigned int a
cWorld * World = m_Player->GetWorld();
World->DoWithCommandBlockAt(BlockX, BlockY, BlockZ, CmdBlockCB);
+
+ SendChat(Printf("%s[INFO]%s Successfully set command block command", cChatColor::Green.c_str(), cChatColor::White.c_str()));
}
@@ -2210,9 +2213,9 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
-void cClientHandle::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT)
+void cClientHandle::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity)
{
- m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_NBT);
+ m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_BlockEntity);
}
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index 2ac240b17..daa185ca0 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -16,7 +16,6 @@
#include "OSSupport/SocketThreads.h"
#include "ChunkDef.h"
#include "ByteBuffer.h"
-#include "WorldStorage/FastNBT.h"
@@ -137,7 +136,7 @@ public:
void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ);
void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay);
void SendUnloadChunk (int a_ChunkX, int a_ChunkZ);
- void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT);
+ void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity);
void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ );
void SendWeather (eWeather a_Weather);
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index 6af0af25d..ac925e382 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -12,7 +12,6 @@
#include "../Defines.h"
#include "../Endianness.h"
-#include "../WorldStorage/FastNBT.h"
@@ -104,7 +103,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) = 0;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) = 0;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) = 0;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) = 0;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) = 0;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) = 0;
virtual void SendWeather (eWeather a_Weather) = 0;
diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h
index 97b194d76..ec72ddd01 100644
--- a/src/Protocol/Protocol125.h
+++ b/src/Protocol/Protocol125.h
@@ -79,7 +79,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) override {};
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) override {};
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index 01a6b0bde..c85641ca8 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -24,6 +24,7 @@ Implements the 1.7.x protocol classes:
#include "../Entities/Player.h"
#include "../Mobs/IncludeAllMonsters.h"
#include "../UI/Window.h"
+#include "../BlockEntities/CommandBlockEntity.h"
@@ -892,7 +893,7 @@ void cProtocol172::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
-void cProtocol172::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT)
+void cProtocol172::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity)
{
cPacketizer Pkt(*this, 0x35); // Update tile entity packet
Pkt.WriteInt(a_BlockX);
@@ -900,7 +901,7 @@ void cProtocol172::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_Block
Pkt.WriteInt(a_BlockZ);
Pkt.WriteByte(a_Action);
- Pkt.WriteBlockEntity(a_NBT);
+ Pkt.WriteBlockEntity(a_BlockEntity);
}
@@ -1833,10 +1834,44 @@ void cProtocol172::cPacketizer::WriteItem(const cItem & a_Item)
-void cProtocol172::cPacketizer::WriteBlockEntity(const cFastNBTWriter & a_NBT)
+void cProtocol172::cPacketizer::WriteBlockEntity(const cBlockEntity & a_BlockEntity)
{
+ cFastNBTWriter Writer;
+
+ switch (a_BlockEntity.GetBlockType())
+ {
+ case E_BLOCK_COMMAND_BLOCK:
+ {
+ cCommandBlockEntity & CommandBlockEntity = (cCommandBlockEntity &)a_BlockEntity;
+
+ Writer.AddByte("TrackOutput", 1); // Neither I nor the MC wiki has any idea about this
+ Writer.AddInt("SuccessCount", CommandBlockEntity.GetResult());
+ Writer.AddInt("x", CommandBlockEntity.GetPosX());
+ Writer.AddInt("y", CommandBlockEntity.GetPosY());
+ Writer.AddInt("z", CommandBlockEntity.GetPosZ());
+ Writer.AddString("Command", CommandBlockEntity.GetCommand().c_str());
+ // You can set custom names for windows in Vanilla
+ // For a command block, this would be the 'name' prepended to anything it outputs into global chat
+ // MCS doesn't have this, so just leave it @ '@'. (geddit?)
+ Writer.AddString("CustomName", "@");
+ Writer.AddString("id", "Control"); // "Tile Entity ID" - MC wiki; vanilla server always seems to send this though
+
+ if (!CommandBlockEntity.GetLastOutput().empty())
+ {
+ AString Output;
+ Printf(Output, "{\"text\":\"%s\"}", CommandBlockEntity.GetLastOutput().c_str());
+
+ Writer.AddString("LastOutput", Output.c_str());
+ }
+ break;
+ }
+ default: break;
+ }
+
+ Writer.Finish();
+
AString Compressed;
- CompressStringGZIP(a_NBT.GetResult().data(), a_NBT.GetResult().size(), Compressed);
+ CompressStringGZIP(Writer.GetResult().data(), Writer.GetResult().size(), Compressed);
WriteShort(Compressed.size());
WriteBuf(Compressed.data(), Compressed.size());
}
diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h
index 6e04a0ffb..b1d902507 100644
--- a/src/Protocol/Protocol17x.h
+++ b/src/Protocol/Protocol17x.h
@@ -102,7 +102,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) override;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) override;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
@@ -190,7 +190,7 @@ protected:
void WriteEntityMetadata(const cEntity & a_Entity); // Writes the metadata for the specified entity, not including the terminating 0x7f
void WriteMobMetadata(const cMonster & a_Mob); // Writes the mob-specific metadata for the specified mob
void WriteEntityProperties(const cEntity & a_Entity); // Writes the entity properties for the specified entity, including the Count field
- void WriteBlockEntity(const cFastNBTWriter & a_NBT);
+ void WriteBlockEntity(const cBlockEntity & a_BlockEntity);
protected:
cProtocol172 & m_Protocol;
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 579469fb4..86f46f02f 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -636,10 +636,10 @@ void cProtocolRecognizer::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
-void cProtocolRecognizer::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT)
+void cProtocolRecognizer::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity)
{
ASSERT(m_Protocol != NULL);
- m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_NBT);
+ m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_BlockEntity);
}
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index 410ba556e..c1c8abdd5 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -12,7 +12,6 @@
#include "Protocol.h"
#include "../ByteBuffer.h"
-#include "../WorldStorage/FastNBT.h"
@@ -115,7 +114,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cFastNBTWriter & a_NBT) override;
+ virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) override;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
--
cgit v1.2.3
From 2a4fa72d107fd5bcb8d77c1f880c9004f0bba4b1 Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Sun, 19 Jan 2014 13:43:42 +0000
Subject: Updated core
---
MCServer/Plugins/Core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core
index 1d524e4e7..e96955202 160000
--- a/MCServer/Plugins/Core
+++ b/MCServer/Plugins/Core
@@ -1 +1 @@
-Subproject commit 1d524e4e7d2b1178f2b772c95766c63c338ad711
+Subproject commit e9695520248ef32f229162ba2b0ee6792749777d
--
cgit v1.2.3
From dc70d04cddee5d4888fa22854d291bfee0cfc293 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sat, 18 Jan 2014 20:50:16 +0100
Subject: SocketThreads: Removed unused code.
---
src/OSSupport/SocketThreads.cpp | 51 -----------------------------------------
src/OSSupport/SocketThreads.h | 5 ++--
2 files changed, 3 insertions(+), 53 deletions(-)
diff --git a/src/OSSupport/SocketThreads.cpp b/src/OSSupport/SocketThreads.cpp
index 3e505616c..b222a2e4e 100644
--- a/src/OSSupport/SocketThreads.cpp
+++ b/src/OSSupport/SocketThreads.cpp
@@ -71,29 +71,6 @@ bool cSocketThreads::AddClient(const cSocket & a_Socket, cCallback * a_Client)
-/*
-void cSocketThreads::RemoveClient(const cSocket * a_Socket)
-{
- // Remove the socket (and associated client) from processing
-
- cCSLock Lock(m_CS);
- for (cSocketThreadList::iterator itr = m_Threads.begin(); itr != m_Threads.end(); ++itr)
- {
- if ((*itr)->RemoveSocket(a_Socket))
- {
- return;
- }
- } // for itr - m_Threads[]
-
- // Cannot assert here, this may actually happen legally, since cClientHandle has to clean up the socket and it may have already closed in the meantime
- // ASSERT(!"Removing an unknown socket");
-}
-*/
-
-
-
-
-
void cSocketThreads::RemoveClient(const cCallback * a_Client)
{
// Remove the associated socket and the client from processing
@@ -284,34 +261,6 @@ bool cSocketThreads::cSocketThread::RemoveClient(const cCallback * a_Client)
-bool cSocketThreads::cSocketThread::RemoveSocket(const cSocket * a_Socket)
-{
- // Returns true if removed, false if not found
-
- for (int i = m_NumSlots - 1; i >= 0 ; --i)
- {
- if (m_Slots[i].m_Socket != *a_Socket)
- {
- continue;
- }
-
- // Found, remove it:
- m_Slots[i] = m_Slots[--m_NumSlots];
-
- // Notify the thread of the change:
- ASSERT(m_ControlSocket2.IsValid());
- m_ControlSocket2.Send("r", 1);
- return true;
- } // for i - m_Slots[]
-
- // Not found
- return false;
-}
-
-
-
-
-
bool cSocketThreads::cSocketThread::HasClient(const cCallback * a_Client) const
{
for (int i = m_NumSlots - 1; i >= 0; --i)
diff --git a/src/OSSupport/SocketThreads.h b/src/OSSupport/SocketThreads.h
index 858729c49..e16ae69fb 100644
--- a/src/OSSupport/SocketThreads.h
+++ b/src/OSSupport/SocketThreads.h
@@ -81,7 +81,9 @@ public:
/// Add a (socket, client) pair for processing, data from a_Socket is to be sent to a_Client; returns true if successful
bool AddClient(const cSocket & a_Socket, cCallback * a_Client);
- /// Remove the associated socket and the client from processing. The socket is left to send its data and is removed only after all its m_OutgoingData is sent
+ /** Remove the associated socket and the client from processing.
+ The socket is left to send its data and is removed only after all its m_OutgoingData is sent
+ */
void RemoveClient(const cCallback * a_Client);
/// Notify the thread responsible for a_Client that the client has something to write
@@ -114,7 +116,6 @@ private:
void AddClient (const cSocket & a_Socket, cCallback * a_Client); // Takes ownership of the socket
bool RemoveClient(const cCallback * a_Client); // Returns true if removed, false if not found
- bool RemoveSocket(const cSocket * a_Socket); // Returns true if removed, false if not found
bool HasClient (const cCallback * a_Client) const;
bool HasSocket (const cSocket * a_Socket) const;
bool NotifyWrite (const cCallback * a_Client); // Returns true if client handled by this thread
--
cgit v1.2.3
From f75d1adf0e3bee8df27ee3aa5d0607e202ce252f Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 16:15:35 +0100
Subject: Removed obsolete MSVC project files.
Windows builds now use CMake as well.
---
VC2008/.gitignore | 8 -
VC2008/CryptoPP.cbp | 311 ---
VC2008/CryptoPP.vcproj | 5841 ---------------------------------------
VC2008/GenerateBindings.cmd | 3 -
VC2008/JsonCpp.cbp | 81 -
VC2008/JsonCpp.vcproj | 372 ---
VC2008/Lua.cbp | 184 --
VC2008/Lua.vcproj | 584 ----
VC2008/MCServer.cbp | 585 ----
VC2008/MCServer.sln | 108 -
VC2008/MCServer.vcproj | 3294 ----------------------
VC2008/MCServer.vcproj.user | 89 -
VC2008/ToLua.cbp | 102 -
VC2008/ToLua.vcproj | 372 ---
VC2008/expat.cbp | 77 -
VC2008/expat.vcproj | 288 --
VC2008/tolua.snippet | 25 -
VC2008/zlib.cbp | 121 -
VC2008/zlib.vcproj | 448 ---
VC2013/.gitignore | 11 -
VC2013/CryptoPP.vcxproj | 1039 -------
VC2013/CryptoPP.vcxproj.filters | 600 ----
VC2013/GenerateBindings.cmd | 3 -
VC2013/JsonCpp.vcxproj | 181 --
VC2013/JsonCpp.vcxproj.filters | 36 -
VC2013/Lua.vcxproj | 234 --
VC2013/Lua.vcxproj.filters | 129 -
VC2013/MCServer.sln | 102 -
VC2013/MCServer.vcxproj | 971 -------
VC2013/MCServer.vcxproj.filters | 1698 ------------
VC2013/ToLua.vcxproj | 179 --
VC2013/ToLua.vcxproj.filters | 34 -
VC2013/expat.vcxproj | 128 -
VC2013/expat.vcxproj.filters | 67 -
VC2013/tolua.snippet | 25 -
VC2013/zlib.vcxproj | 198 --
VC2013/zlib.vcxproj.filters | 91 -
37 files changed, 18619 deletions(-)
delete mode 100644 VC2008/.gitignore
delete mode 100644 VC2008/CryptoPP.cbp
delete mode 100644 VC2008/CryptoPP.vcproj
delete mode 100644 VC2008/GenerateBindings.cmd
delete mode 100644 VC2008/JsonCpp.cbp
delete mode 100644 VC2008/JsonCpp.vcproj
delete mode 100644 VC2008/Lua.cbp
delete mode 100644 VC2008/Lua.vcproj
delete mode 100644 VC2008/MCServer.cbp
delete mode 100644 VC2008/MCServer.sln
delete mode 100644 VC2008/MCServer.vcproj
delete mode 100644 VC2008/MCServer.vcproj.user
delete mode 100644 VC2008/ToLua.cbp
delete mode 100644 VC2008/ToLua.vcproj
delete mode 100644 VC2008/expat.cbp
delete mode 100644 VC2008/expat.vcproj
delete mode 100644 VC2008/tolua.snippet
delete mode 100644 VC2008/zlib.cbp
delete mode 100644 VC2008/zlib.vcproj
delete mode 100644 VC2013/.gitignore
delete mode 100644 VC2013/CryptoPP.vcxproj
delete mode 100644 VC2013/CryptoPP.vcxproj.filters
delete mode 100644 VC2013/GenerateBindings.cmd
delete mode 100644 VC2013/JsonCpp.vcxproj
delete mode 100644 VC2013/JsonCpp.vcxproj.filters
delete mode 100644 VC2013/Lua.vcxproj
delete mode 100644 VC2013/Lua.vcxproj.filters
delete mode 100644 VC2013/MCServer.sln
delete mode 100644 VC2013/MCServer.vcxproj
delete mode 100644 VC2013/MCServer.vcxproj.filters
delete mode 100644 VC2013/ToLua.vcxproj
delete mode 100644 VC2013/ToLua.vcxproj.filters
delete mode 100644 VC2013/expat.vcxproj
delete mode 100644 VC2013/expat.vcxproj.filters
delete mode 100644 VC2013/tolua.snippet
delete mode 100644 VC2013/zlib.vcxproj
delete mode 100644 VC2013/zlib.vcxproj.filters
diff --git a/VC2008/.gitignore b/VC2008/.gitignore
deleted file mode 100644
index e31475ed0..000000000
--- a/VC2008/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-Debug/
-Debug profiled/
-Debug_LuaStatic/
-Release/
-Release profiled/
-*.user
-*.ncb
-*.suo
diff --git a/VC2008/CryptoPP.cbp b/VC2008/CryptoPP.cbp
deleted file mode 100644
index 55b322b92..000000000
--- a/VC2008/CryptoPP.cbp
+++ /dev/null
@@ -1,311 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/CryptoPP.vcproj b/VC2008/CryptoPP.vcproj
deleted file mode 100644
index f44729d8a..000000000
--- a/VC2008/CryptoPP.vcproj
+++ /dev/null
@@ -1,5841 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/GenerateBindings.cmd b/VC2008/GenerateBindings.cmd
deleted file mode 100644
index e247d7f4f..000000000
--- a/VC2008/GenerateBindings.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-set ALLTOLUA_WAIT=N
-cd ..\src\Bindings
-AllToLua.bat
\ No newline at end of file
diff --git a/VC2008/JsonCpp.cbp b/VC2008/JsonCpp.cbp
deleted file mode 100644
index f4826b2f1..000000000
--- a/VC2008/JsonCpp.cbp
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/JsonCpp.vcproj b/VC2008/JsonCpp.vcproj
deleted file mode 100644
index 6fae46445..000000000
--- a/VC2008/JsonCpp.vcproj
+++ /dev/null
@@ -1,372 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/Lua.cbp b/VC2008/Lua.cbp
deleted file mode 100644
index 33353656a..000000000
--- a/VC2008/Lua.cbp
+++ /dev/null
@@ -1,184 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/Lua.vcproj b/VC2008/Lua.vcproj
deleted file mode 100644
index d08d738ea..000000000
--- a/VC2008/Lua.vcproj
+++ /dev/null
@@ -1,584 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/MCServer.cbp b/VC2008/MCServer.cbp
deleted file mode 100644
index 0d63e9291..000000000
--- a/VC2008/MCServer.cbp
+++ /dev/null
@@ -1,585 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/MCServer.sln b/VC2008/MCServer.sln
deleted file mode 100644
index a36150483..000000000
--- a/VC2008/MCServer.sln
+++ /dev/null
@@ -1,108 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C++ Express 2008
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCServer", "MCServer.vcproj", "{32012054-0C96-4C43-AB27-174FF8E72D66}"
- ProjectSection(ProjectDependencies) = postProject
- {082E8185-7B3A-4945-8C82-9132341A329D} = {082E8185-7B3A-4945-8C82-9132341A329D}
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96} = {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF} = {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35} = {EEAB54AD-114C-4AB8-8482-0A52D502BD35}
- {5AAA90B9-946D-4034-83F3-676B06A6E326} = {5AAA90B9-946D-4034-83F3-676B06A6E326}
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA} = {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcproj", "{EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JsonCpp", "JsonCpp.vcproj", "{5AAA90B9-946D-4034-83F3-676B06A6E326}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lua", "Lua.vcproj", "{082E8185-7B3A-4945-8C82-9132341A329D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ToLua", "ToLua.vcproj", "{EEAB54AD-114C-4AB8-8482-0A52D502BD35}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryptoPP", "CryptoPP.vcproj", "{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expat", "expat.vcproj", "{5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug profiled|Win32 = Debug profiled|Win32
- Debug_LuaStatic|Win32 = Debug_LuaStatic|Win32
- Debug|Win32 = Debug|Win32
- Release profiled|Win32 = Release profiled|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug|Win32.ActiveCfg = Debug|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug|Win32.Build.0 = Debug|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release|Win32.ActiveCfg = Release|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release|Win32.Build.0 = Release|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug|Win32.ActiveCfg = Debug|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug|Win32.Build.0 = Debug|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release|Win32.ActiveCfg = Release|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release|Win32.Build.0 = Release|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug|Win32.ActiveCfg = Debug|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug|Win32.Build.0 = Debug|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release|Win32.ActiveCfg = Release|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release|Win32.Build.0 = Release|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug|Win32.ActiveCfg = Debug|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug|Win32.Build.0 = Debug|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release|Win32.ActiveCfg = Release|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release|Win32.Build.0 = Release|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug|Win32.ActiveCfg = Debug|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug|Win32.Build.0 = Debug|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release|Win32.ActiveCfg = Release|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release|Win32.Build.0 = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug profiled|Win32.ActiveCfg = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug profiled|Win32.Build.0 = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.ActiveCfg = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.Build.0 = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release profiled|Win32.ActiveCfg = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release profiled|Win32.Build.0 = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.ActiveCfg = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.Build.0 = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug profiled|Win32.ActiveCfg = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug profiled|Win32.Build.0 = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug|Win32.ActiveCfg = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug|Win32.Build.0 = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release profiled|Win32.ActiveCfg = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release profiled|Win32.Build.0 = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release|Win32.ActiveCfg = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/VC2008/MCServer.vcproj b/VC2008/MCServer.vcproj
deleted file mode 100644
index 85ef1e24f..000000000
--- a/VC2008/MCServer.vcproj
+++ /dev/null
@@ -1,3294 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/MCServer.vcproj.user b/VC2008/MCServer.vcproj.user
deleted file mode 100644
index b53d3ff35..000000000
--- a/VC2008/MCServer.vcproj.user
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/ToLua.cbp b/VC2008/ToLua.cbp
deleted file mode 100644
index c7f24afcc..000000000
--- a/VC2008/ToLua.cbp
+++ /dev/null
@@ -1,102 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/ToLua.vcproj b/VC2008/ToLua.vcproj
deleted file mode 100644
index 057a3cf8f..000000000
--- a/VC2008/ToLua.vcproj
+++ /dev/null
@@ -1,372 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/expat.cbp b/VC2008/expat.cbp
deleted file mode 100644
index 6c89eff8d..000000000
--- a/VC2008/expat.cbp
+++ /dev/null
@@ -1,77 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/expat.vcproj b/VC2008/expat.vcproj
deleted file mode 100644
index b92b95737..000000000
--- a/VC2008/expat.vcproj
+++ /dev/null
@@ -1,288 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/tolua.snippet b/VC2008/tolua.snippet
deleted file mode 100644
index 3c9c9cf33..000000000
--- a/VC2008/tolua.snippet
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
- ToLua
- tolua
-
- SurroundsWith
-
- Daniel O'Brien (marmot21)
- Adds the selected lines for Lua export
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2008/zlib.cbp b/VC2008/zlib.cbp
deleted file mode 100644
index 1d24c24ce..000000000
--- a/VC2008/zlib.cbp
+++ /dev/null
@@ -1,121 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2008/zlib.vcproj b/VC2008/zlib.vcproj
deleted file mode 100644
index cdc5bab8c..000000000
--- a/VC2008/zlib.vcproj
+++ /dev/null
@@ -1,448 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/VC2013/.gitignore b/VC2013/.gitignore
deleted file mode 100644
index 8e2fd484d..000000000
--- a/VC2013/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-Debug/**
-Debug profiled/**
-Release/**
-Release profiled/**
-ipch/**
-*.user
-*.ncb
-*.suo
-*.obj
-*.sdf
-*.opensdf
\ No newline at end of file
diff --git a/VC2013/CryptoPP.vcxproj b/VC2013/CryptoPP.vcxproj
deleted file mode 100644
index 6f7ddae0c..000000000
--- a/VC2013/CryptoPP.vcxproj
+++ /dev/null
@@ -1,1039 +0,0 @@
-
-
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug_LuaStatic
- x64
-
-
- Debug
- Win32
-
-
- Debug
- x64
-
-
- DLL-Import Debug
- Win32
-
-
- DLL-Import Debug
- x64
-
-
- DLL-Import Release
- Win32
-
-
- DLL-Import Release
- x64
-
-
- Release
- Win32
-
-
- Release
- x64
-
-
-
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}
- cryptlib
- .
-
-
-
- Application
- v120
-
-
- Application
- v120
-
-
- StaticLibrary
- v120
- false
-
-
- StaticLibrary
- v120
- false
-
-
- StaticLibrary
- v120
- false
- true
-
-
- StaticLibrary
- v120
- false
-
-
- StaticLibrary
- v120
- false
- true
-
-
- Application
- v120
-
-
- StaticLibrary
- v120
- false
-
-
- StaticLibrary
- v120
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- $(SolutionDir)$(Configuration)\CryptoPP\
- $(Configuration)\CryptoPP\
-
-
- $(SolutionDir)$(Configuration)\CryptoPP\
- $(Configuration)\CryptoPP\
-
-
- $(SolutionDir)$(Configuration)\CryptoPP\
- $(Configuration)\CryptoPP\
-
-
- $(Platform)\Output\$(Configuration)\
- $(Platform)\$(ProjectName)\$(Configuration)\
-
-
- $(Platform)\DLL_Output\Release\
- $(Platform)\$(ProjectName)\$(Configuration)\
-
-
- $(Platform)\Output\$(Configuration)\
- $(Platform)\$(ProjectName)\$(Configuration)\
-
-
- $(Platform)\DLL_Output\Debug\
- $(Platform)\$(ProjectName)\$(Configuration)\
-
-
-
- MaxSpeed
- AnySuitable
- true
- true
- NDEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)
- true
- MultiThreaded
- true
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- ProgramDatabase
- 4702;%(DisableSpecificWarnings)
-
-
- 0x0409
-
-
- true
-
-
-
-
- Disabled
- true
- _DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)
- MultiThreadedDebug
- StreamingSIMDExtensions
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- EditAndContinue
-
-
- 0x0409
-
-
- true
-
-
-
-
- Disabled
- true
- _DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)
- MultiThreadedDebug
- StreamingSIMDExtensions
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- EditAndContinue
-
-
- 0x0409
-
-
- true
-
-
-
-
- X64
-
-
- MaxSpeed
- AnySuitable
- true
- true
- NDEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)
- true
- MultiThreaded
- true
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- ProgramDatabase
-
-
- 0x0409
-
-
- true
-
-
-
-
- X64
-
-
- MaxSpeed
- AnySuitable
- true
- true
- true
- NDEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;CRYPTOPP_IMPORTS;%(PreprocessorDefinitions)
- true
- MultiThreaded
- true
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- ProgramDatabase
-
-
- 0x0409
-
-
- true
-
-
-
-
- X64
-
-
- Disabled
- true
- _DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;%(PreprocessorDefinitions)
- MultiThreadedDebug
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- ProgramDatabase
-
-
- 0x0409
-
-
- true
-
-
-
-
- X64
-
-
- Disabled
- true
- _DEBUG;_WINDOWS;USE_PRECOMPILED_HEADERS;WIN32;CRYPTOPP_IMPORTS;%(PreprocessorDefinitions)
- MultiThreadedDebug
- Use
- pch.h
- $(OutDir)vc80.pdb
- Level3
- true
- ProgramDatabase
-
-
- 0x0409
-
-
- true
-
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
-
-
- MaxSpeed
-
-
- Disabled
-
-
- Disabled
-
-
- Disabled
-
-
-
-
-
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- true
- Disabled
- true
- MaxSpeed
- true
- Disabled
- true
- Disabled
- true
- Disabled
- true
- true
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- true
- Disabled
- true
- MaxSpeed
- true
- Disabled
- true
- Disabled
- true
- Disabled
- true
- true
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
-
- Disabled
-
-
- MaxSpeed
-
-
- Disabled
-
-
- Disabled
-
-
- Disabled
-
-
-
-
-
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- Create
- MaxSpeed
- Create
- Disabled
- Create
- Disabled
- Create
- Disabled
- Create
- Create
- Create
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
- Disabled
- MaxSpeed
- Disabled
- Disabled
- Disabled
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/CryptoPP.vcxproj.filters b/VC2013/CryptoPP.vcxproj.filters
deleted file mode 100644
index d47a1c34c..000000000
--- a/VC2013/CryptoPP.vcxproj.filters
+++ /dev/null
@@ -1,600 +0,0 @@
-
-
-
-
- {59bfc075-705c-42cd-adf7-40cef1aed8e1}
- .cpp
-
-
- {407d7f02-df9e-485b-a95f-2f1dad08cbed}
- .;.h
-
-
- {293a01a6-81d1-4272-a7ff-310526bbc77f}
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
- Header Files
-
-
-
-
- Miscellaneous
-
-
- Miscellaneous
-
-
-
-
- Miscellaneous
-
-
- Miscellaneous
-
-
-
\ No newline at end of file
diff --git a/VC2013/GenerateBindings.cmd b/VC2013/GenerateBindings.cmd
deleted file mode 100644
index e247d7f4f..000000000
--- a/VC2013/GenerateBindings.cmd
+++ /dev/null
@@ -1,3 +0,0 @@
-set ALLTOLUA_WAIT=N
-cd ..\src\Bindings
-AllToLua.bat
\ No newline at end of file
diff --git a/VC2013/JsonCpp.vcxproj b/VC2013/JsonCpp.vcxproj
deleted file mode 100644
index c609a3450..000000000
--- a/VC2013/JsonCpp.vcxproj
+++ /dev/null
@@ -1,181 +0,0 @@
-
-
-
-
- Debug profiled
- Win32
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug
- Win32
-
-
- Release profiled
- Win32
-
-
- Release
- Win32
-
-
-
- {5AAA90B9-946D-4034-83F3-676B06A6E326}
- JsonCpp
- Win32Proj
-
-
-
- StaticLibrary
- v120
- Unicode
-
-
- StaticLibrary
- v120
- Unicode
-
-
- StaticLibrary
- v120
- Unicode
- true
-
-
- StaticLibrary
- v120
- Unicode
- true
-
-
- StaticLibrary
- v120
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- $(SolutionDir)$(Configuration)\JsonCpp\
- $(Configuration)\JsonCpp\
-
-
- $(SolutionDir)$(Configuration)\JsonCpp\
- $(Configuration)\JsonCpp\
-
-
- $(SolutionDir)$(Configuration)\JsonCpp\
- $(Configuration)\JsonCpp\
-
-
- $(SolutionDir)$(Configuration)\JsonCpp\
- $(Configuration)\JsonCpp\
-
-
- $(SolutionDir)$(Configuration)\JsonCpp\
- $(Configuration)\JsonCpp\
-
-
-
- Disabled
- ../jsoncpp-src-0.5.0/include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
- MaxSpeed
- true
- ../jsoncpp-src-0.5.0/include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
-
-
- MaxSpeed
- true
- ../jsoncpp-src-0.5.0/include;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
-
-
- Disabled
- ../jsoncpp-src-0.5.0/include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
- Disabled
- ../jsoncpp-src-0.5.0/include;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/JsonCpp.vcxproj.filters b/VC2013/JsonCpp.vcxproj.filters
deleted file mode 100644
index b46dae3fd..000000000
--- a/VC2013/JsonCpp.vcxproj.filters
+++ /dev/null
@@ -1,36 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/VC2013/Lua.vcxproj b/VC2013/Lua.vcxproj
deleted file mode 100644
index 8b330a666..000000000
--- a/VC2013/Lua.vcxproj
+++ /dev/null
@@ -1,234 +0,0 @@
-
-
-
-
- Debug profiled
- Win32
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug
- Win32
-
-
- Release profiled
- Win32
-
-
- Release
- Win32
-
-
-
- {082E8185-7B3A-4945-8C82-9132341A329D}
- Lua
- Win32Proj
-
-
-
- StaticLibrary
- v120
- Unicode
-
-
- DynamicLibrary
- v120
- Unicode
-
-
- DynamicLibrary
- v120
- Unicode
- true
-
-
- DynamicLibrary
- v120
- Unicode
- true
-
-
- DynamicLibrary
- v120
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- $(SolutionDir)$(Configuration)\Lua\
- $(Configuration)\Lua\
-
-
- $(SolutionDir)$(Configuration)\Lua\
- $(Configuration)\Lua\
-
-
- $(SolutionDir)$(Configuration)\Lua\
- $(Configuration)\Lua\
-
-
- $(SolutionDir)$(Configuration)\Lua\
- $(Configuration)\Lua\
-
-
- $(SolutionDir)$(Configuration)\Lua\
- $(Configuration)\Lua\
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
- $(ProjectDir)\..\MCServer\lua5.1.dll
- true
-
-
-
-
- MaxSpeed
- true
- WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
- $(ProjectDir)\..\MCServer\lua5.1.dll
-
-
-
-
- MaxSpeed
- true
- WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
- $(ProjectDir)\..\MCServer\lua5.1.dll
-
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;LUA_BUILD_AS_DLL;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
- $(ProjectDir)\..\MCServer\lua5.1.dll
-
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/Lua.vcxproj.filters b/VC2013/Lua.vcxproj.filters
deleted file mode 100644
index 6d96411ec..000000000
--- a/VC2013/Lua.vcxproj.filters
+++ /dev/null
@@ -1,129 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/MCServer.sln b/VC2013/MCServer.sln
deleted file mode 100644
index 02eef049b..000000000
--- a/VC2013/MCServer.sln
+++ /dev/null
@@ -1,102 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Express 2013 for Windows Desktop
-VisualStudioVersion = 12.0.21005.1
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MCServer", "MCServer.vcxproj", "{32012054-0C96-4C43-AB27-174FF8E72D66}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "zlib.vcxproj", "{EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "JsonCpp", "JsonCpp.vcxproj", "{5AAA90B9-946D-4034-83F3-676B06A6E326}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Lua", "Lua.vcxproj", "{082E8185-7B3A-4945-8C82-9132341A329D}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ToLua", "ToLua.vcxproj", "{EEAB54AD-114C-4AB8-8482-0A52D502BD35}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CryptoPP", "CryptoPP.vcxproj", "{3423EC9A-52E4-4A4D-9753-EDEBC38785EF}"
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "expat", "expat.vcxproj", "{5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug profiled|Win32 = Debug profiled|Win32
- Debug_LuaStatic|Win32 = Debug_LuaStatic|Win32
- Debug|Win32 = Debug|Win32
- Release profiled|Win32 = Release profiled|Win32
- Release|Win32 = Release|Win32
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug|Win32.ActiveCfg = Debug|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Debug|Win32.Build.0 = Debug|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release|Win32.ActiveCfg = Release|Win32
- {32012054-0C96-4C43-AB27-174FF8E72D66}.Release|Win32.Build.0 = Release|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug|Win32.ActiveCfg = Debug|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Debug|Win32.Build.0 = Debug|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release|Win32.ActiveCfg = Release|Win32
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}.Release|Win32.Build.0 = Release|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug|Win32.ActiveCfg = Debug|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Debug|Win32.Build.0 = Debug|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release|Win32.ActiveCfg = Release|Win32
- {5AAA90B9-946D-4034-83F3-676B06A6E326}.Release|Win32.Build.0 = Release|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug|Win32.ActiveCfg = Debug|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Debug|Win32.Build.0 = Debug|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release|Win32.ActiveCfg = Release|Win32
- {082E8185-7B3A-4945-8C82-9132341A329D}.Release|Win32.Build.0 = Release|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug profiled|Win32.ActiveCfg = Debug profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug profiled|Win32.Build.0 = Debug profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug|Win32.ActiveCfg = Debug|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Debug|Win32.Build.0 = Debug|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release profiled|Win32.ActiveCfg = Release profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release profiled|Win32.Build.0 = Release profiled|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release|Win32.ActiveCfg = Release|Win32
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}.Release|Win32.Build.0 = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug profiled|Win32.ActiveCfg = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug profiled|Win32.Build.0 = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.ActiveCfg = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Debug|Win32.Build.0 = Debug|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release profiled|Win32.ActiveCfg = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release profiled|Win32.Build.0 = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.ActiveCfg = Release|Win32
- {3423EC9A-52E4-4A4D-9753-EDEBC38785EF}.Release|Win32.Build.0 = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug profiled|Win32.ActiveCfg = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug profiled|Win32.Build.0 = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug_LuaStatic|Win32.ActiveCfg = Debug_LuaStatic|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug_LuaStatic|Win32.Build.0 = Debug_LuaStatic|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug|Win32.ActiveCfg = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Debug|Win32.Build.0 = Debug|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release profiled|Win32.ActiveCfg = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release profiled|Win32.Build.0 = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release|Win32.ActiveCfg = Release|Win32
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}.Release|Win32.Build.0 = Release|Win32
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
-EndGlobal
diff --git a/VC2013/MCServer.vcxproj b/VC2013/MCServer.vcxproj
deleted file mode 100644
index 36c29bf11..000000000
--- a/VC2013/MCServer.vcxproj
+++ /dev/null
@@ -1,971 +0,0 @@
-
-
-
-
- Debug profiled
- Win32
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug
- Win32
-
-
- Release profiled
- Win32
-
-
- Release
- Win32
-
-
-
- {32012054-0C96-4C43-AB27-174FF8E72D66}
- MCServer
- Win32Proj
-
-
-
- Application
- v120
- MultiByte
-
-
- Application
- v120
- MultiByte
-
-
- Application
- v120
- true
-
-
- Application
- v120
- true
-
-
- Application
- v120
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- Debug\
- Debug\
- true
-
-
- Release\
- Release\
-
-
- $(Configuration)\
- $(Configuration)\
-
-
- $(Configuration)\
- $(Configuration)\
- true
-
-
- $(Configuration)\
- $(Configuration)\
- true
-
-
-
- /MP %(AdditionalOptions)
- Disabled
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)
- false
- EnableFastChecks
- MultiThreadedDebug
- Use
- Globals.h
- Level3
- ProgramDatabase
-
-
- ws2_32.lib;Psapi.lib;%(AdditionalDependencies)
- $(ProjectDir)\..\MCServer\$(ProjectName)_debug.exe
- true
- Console
- MachineX86
-
-
-
-
- /MP %(AdditionalOptions)
- Full
- true
- Speed
- true
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)
- MultiThreaded
- Use
- Globals.h
- Level3
- ProgramDatabase
-
-
- ws2_32.lib;Psapi.lib;%(AdditionalDependencies)
- $(ProjectDir)\..\MCServer\$(ProjectName).exe
- true
- Console
- true
- true
- UseLinkTimeCodeGeneration
- MachineX86
-
-
-
-
- /MP %(AdditionalOptions)
- Full
- true
- Speed
- true
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)
- MultiThreaded
- Use
- Globals.h
- Level3
- ProgramDatabase
-
-
- ws2_32.lib;Psapi.lib;%(AdditionalDependencies)
- $(ProjectDir)\..\MCServer\$(ProjectName)_profiled.exe
- true
- Console
- true
- true
- UseLinkTimeCodeGeneration
- MachineX86
- true
-
-
-
-
- /MP %(AdditionalOptions)
- Disabled
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)
- false
- EnableFastChecks
- MultiThreadedDebug
- Use
- Globals.h
- Level3
- ProgramDatabase
-
-
- ws2_32.lib;Psapi.lib;%(AdditionalDependencies)
- $(ProjectDir)\..\MCServer\$(ProjectName)_dbgprof.exe
- true
- Console
- MachineX86
-
-
-
-
- /MP %(AdditionalOptions)
- Disabled
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_CONSOLE;XML_STATIC;%(PreprocessorDefinitions)
- false
- EnableFastChecks
- MultiThreadedDebug
- Use
- Globals.h
- Level3
- ProgramDatabase
-
-
- ws2_32.lib;Psapi.lib;%(AdditionalDependencies)
- $(ProjectDir)\..\MCServer\$(ProjectName)_debug_luastatic.exe
- true
- Console
- MachineX86
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
-
-
- true
- GenerateBindings.cmd
-
- cTorch.h;cStairs.h;cLadder.h;../lib/inifile/iniFile.h;BlockID.h;PacketID.h;Defines.h;LuaFunctions.h;cStringMap.h;cChatColor.h;cClientHandle.h;cEntity.h;cPawn.h;cPlayer.h;cPluginManager.h;cPlugin.h;cPlugin_NewLua.h;cPlugin_Lua.h;cServer.h;cWorld.h;cInventory.h;cItem.h;cWebAdmin.h;cWebPlugin.h;cWebPlugin_Lua.h;cPickup.h;cRoot.h;cTCPLink.h;Vector3f.h;Vector3d.h;Vector3i.h;Matrix4f.h;cCuboid.h;cMCLogger.h;cTracer.h;cGroup.h;BlockArea.h;packets/cPacket_Login.h;packets/cPacket_BlockDig.h;packets/cPacket_BlockPlace.h;%(AdditionalInputs)
- Bindings.cpp;%(Outputs)
- true
- GenerateBindings.cmd
-
- cTorch.h;cStairs.h;cLadder.h;../lib/inifile/iniFile.h;BlockID.h;PacketID.h;Defines.h;LuaFunctions.h;cStringMap.h;cChatColor.h;cClientHandle.h;cEntity.h;cPawn.h;cPlayer.h;cPluginManager.h;cPlugin.h;cPlugin_NewLua.h;cPlugin_Lua.h;cServer.h;cWorld.h;cInventory.h;cItem.h;cWebAdmin.h;cWebPlugin.h;cWebPlugin_Lua.h;cPickup.h;cRoot.h;cTCPLink.h;Vector3f.h;Vector3d.h;Vector3i.h;Matrix4f.h;cCuboid.h;cMCLogger.h;cTracer.h;cGroup.h;BlockArea.h;packets/cPacket_Login.h;packets/cPacket_BlockDig.h;packets/cPacket_BlockPlace.h;%(AdditionalInputs)
- Bindings.cpp;%(Outputs)
- true
- GenerateBindings.cmd
-
- cTorch.h;cStairs.h;cLadder.h;../lib/inifile/iniFile.h;BlockID.h;PacketID.h;Defines.h;LuaFunctions.h;cStringMap.h;cChatColor.h;cClientHandle.h;cEntity.h;cPawn.h;cPlayer.h;cPluginManager.h;cPlugin.h;cPlugin_NewLua.h;cPlugin_Lua.h;cServer.h;cWorld.h;cInventory.h;cItem.h;cWebAdmin.h;cWebPlugin.h;cWebPlugin_Lua.h;cPickup.h;cRoot.h;cTCPLink.h;Vector3f.h;Vector3d.h;Vector3i.h;Matrix4f.h;cCuboid.h;cMCLogger.h;cTracer.h;cGroup.h;BlockArea.h;packets/cPacket_Login.h;packets/cPacket_BlockDig.h;packets/cPacket_BlockPlace.h;%(AdditionalInputs)
- Bindings.cpp;%(Outputs)
- true
- GenerateBindings.cmd
-
- cTorch.h;cStairs.h;cLadder.h;../lib/inifile/iniFile.h;BlockID.h;PacketID.h;Defines.h;LuaFunctions.h;cStringMap.h;cChatColor.h;cClientHandle.h;cEntity.h;cPawn.h;cPlayer.h;cPluginManager.h;cPlugin.h;cPlugin_NewLua.h;cPlugin_Lua.h;cServer.h;cWorld.h;cInventory.h;cItem.h;cWebAdmin.h;cWebPlugin.h;cWebPlugin_Lua.h;cPickup.h;cRoot.h;cTCPLink.h;Vector3f.h;Vector3d.h;Vector3i.h;Matrix4f.h;cCuboid.h;cMCLogger.h;cTracer.h;cGroup.h;BlockArea.h;packets/cPacket_Login.h;packets/cPacket_BlockDig.h;packets/cPacket_BlockPlace.h;%(AdditionalInputs)
- Bindings.cpp;%(Outputs)
- true
- GenerateBindings.cmd
-
- cTorch.h;cStairs.h;cLadder.h;../lib/inifile/iniFile.h;BlockID.h;PacketID.h;Defines.h;LuaFunctions.h;cStringMap.h;cChatColor.h;cClientHandle.h;cEntity.h;cPawn.h;cPlayer.h;cPluginManager.h;cPlugin.h;cPlugin_NewLua.h;cPlugin_Lua.h;cServer.h;cWorld.h;cInventory.h;cItem.h;cWebAdmin.h;cWebPlugin.h;cWebPlugin_Lua.h;cPickup.h;cRoot.h;cTCPLink.h;Vector3f.h;Vector3d.h;Vector3i.h;Matrix4f.h;cCuboid.h;cMCLogger.h;cTracer.h;cGroup.h;BlockArea.h;packets/cPacket_Login.h;packets/cPacket_BlockDig.h;packets/cPacket_BlockPlace.h;%(AdditionalInputs)
- Bindings.cpp;%(Outputs)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Create
- Create
- Create
- Create
- Create
-
-
-
-
-
-
-
-
-
- Level3
-
-
- Level3
-
-
- Level3
- true
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- MaxSpeed
- true
- Speed
- true
- Default
-
-
- MaxSpeed
- true
- Speed
- true
- Default
-
-
- MaxSpeed
- true
- Speed
- true
- Default
-
-
-
-
-
-
-
-
-
-
-
-
- Level3
-
-
- Level3
-
-
- Level3
- true
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
- true
- true
- true
- true
-
-
- true
- true
- true
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
-
-
- _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
-
-
- _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
-
-
- _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
-
-
- _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {3423ec9a-52e4-4a4d-9753-edebc38785ef}
- false
-
-
- {5fcfaf8d-ff2c-456d-a72c-1d76f913ad96}
- false
-
-
- {5aaa90b9-946d-4034-83f3-676b06a6e326}
- false
-
-
- {082e8185-7b3a-4945-8c82-9132341a329d}
- false
-
-
- {eeab54ad-114c-4ab8-8482-0a52d502bd35}
- false
-
-
- {ea9d50fd-937a-4ef5-8c37-5f4175af4fea}
- false
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/MCServer.vcxproj.filters b/VC2013/MCServer.vcxproj.filters
deleted file mode 100644
index 176afad2e..000000000
--- a/VC2013/MCServer.vcxproj.filters
+++ /dev/null
@@ -1,1698 +0,0 @@
-
-
-
-
- {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
- rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
- {46ffa881-c36b-41b0-85df-90e0f78c6285}
-
-
- {5eb3c155-b618-4232-92a5-52b3ae70ec96}
-
-
- {5f745788-b9aa-4dde-9763-cdfaddb3dfdf}
-
-
- {acb44271-df18-41b2-8a50-656a49c39d3c}
-
-
- {1091cb9f-3d9d-4ed5-9359-fc762be21759}
-
-
- {c40bec86-f173-440a-b07e-bab15c8ce965}
-
-
- {4180990c-1257-4d07-9009-08535fedfbf8}
-
-
- {ffc2297f-c790-4190-a56f-ac6a1f97a30c}
-
-
- {011ff757-845a-4342-862e-44207ec46a94}
-
-
- {7f7a0b8c-4ee6-4a3a-92d6-5ba242a565f3}
-
-
- {07157169-9da7-4998-9f00-4580641cf811}
-
-
- {5b92b198-0a58-4399-9c8e-662bd5062b6c}
-
-
- {16a88457-3862-4ff0-a591-a7160ea956f5}
-
-
- {a3561ecf-a501-4c76-b176-1f214b7a5523}
-
-
- {a35eb320-d10b-4592-92ed-2d2f242dbed7}
-
-
- {1c271d11-30ce-4aef-b8a9-7c8ee560d5d6}
-
-
- {223bdf26-d107-498f-8c42-00c19ef80348}
-
-
- {99140e5f-0287-4601-ad28-bad2533d8876}
-
-
- {beb25b3b-31f3-468e-a721-6d0dc297e4b5}
-
-
- {f848f39d-680d-4f9c-8dcb-da9a0bb871f5}
-
-
- {7c735e41-f3b2-4500-856b-54845f834eb2}
-
-
- {83d5aac9-2975-4334-9acc-b48e96a16b23}
-
-
- {e5167107-9cc8-4e03-b519-c3a13b9b7955}
-
-
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
-
-
- Resource Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\UI
-
-
- Source Files\UI
-
-
- Source Files\UI
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\External
-
-
- Source Files\External
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Items
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\SQLite
-
-
- Source Files\LuaExpat
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
-
-
- Resource Files
-
-
- Config files
-
-
- Config files
-
-
- Config files
-
-
- Config files
-
-
- Config files
-
-
- Config files
-
-
- Config files
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\Core
-
-
- Plugins\ChatLog
-
-
- Plugins\Debuggers
-
-
- Plugins\APIDump
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Mobs
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\Entities
-
-
- Source Files\UI
-
-
- Source Files\UI
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\Simulator
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport
-
-
- Source Files\OSSupport\Android Specific
-
-
- Source Files\OSSupport\Android Specific
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\Bindings
-
-
- Source Files\External
-
-
- Source Files\External
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\WorldStorage
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Generating
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Blocks
-
-
- Source Files\Items
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\Protocol
-
-
- Source Files\SQLite
-
-
- Source Files\SQLite
-
-
- Source Files\LuaExpat
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\BlockEntities
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
- Source Files\HTTPServer
-
-
-
-
- Source Files\SQLite
-
-
- Config files
-
-
- Config files
-
-
-
-
- Source Files\OSSupport\Android Specific
-
-
- Source Files\OSSupport\Android Specific
-
-
- Source Files\OSSupport\Android Specific
-
-
- Source Files\Bindings
-
-
-
\ No newline at end of file
diff --git a/VC2013/ToLua.vcxproj b/VC2013/ToLua.vcxproj
deleted file mode 100644
index 309d9635a..000000000
--- a/VC2013/ToLua.vcxproj
+++ /dev/null
@@ -1,179 +0,0 @@
-
-
-
-
- Debug profiled
- Win32
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug
- Win32
-
-
- Release profiled
- Win32
-
-
- Release
- Win32
-
-
-
- {EEAB54AD-114C-4AB8-8482-0A52D502BD35}
- ToLua
- Win32Proj
-
-
-
- StaticLibrary
- v120
- Unicode
-
-
- StaticLibrary
- v120
- Unicode
-
-
- StaticLibrary
- v120
- Unicode
- true
-
-
- StaticLibrary
- v120
- Unicode
- true
-
-
- StaticLibrary
- v120
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- $(SolutionDir)$(Configuration)\ToLua\
- $(Configuration)\ToLua\
-
-
- $(SolutionDir)$(Configuration)\ToLua\
- $(Configuration)\ToLua\
-
-
- $(SolutionDir)$(Configuration)\tolua\
- $(Configuration)\tolua\
-
-
- $(SolutionDir)$(Configuration)\ToLua\
- $(Configuration)\ToLua\
-
-
- $(SolutionDir)$(Configuration)\ToLua\
- $(Configuration)\ToLua\
-
-
-
- Disabled
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
- MaxSpeed
- true
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
-
-
- MaxSpeed
- true
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
-
-
- Disabled
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
- Disabled
- ../lib/jsoncpp/include;../lib;%(AdditionalIncludeDirectories)
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/ToLua.vcxproj.filters b/VC2013/ToLua.vcxproj.filters
deleted file mode 100644
index 5d104d7d0..000000000
--- a/VC2013/ToLua.vcxproj.filters
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/VC2013/expat.vcxproj b/VC2013/expat.vcxproj
deleted file mode 100644
index 00f9ea3d2..000000000
--- a/VC2013/expat.vcxproj
+++ /dev/null
@@ -1,128 +0,0 @@
-
-
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug
- Win32
-
-
- Release
- Win32
-
-
-
- {5FCFAF8D-FF2C-456D-A72C-1D76F913AD96}
- expat
- Win32Proj
-
-
-
- StaticLibrary
- v120
- MultiByte
-
-
- StaticLibrary
- v120
- MultiByte
- true
-
-
- StaticLibrary
- v120
- MultiByte
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- $(SolutionDir)$(Configuration)/expat\
- $(Configuration)/expat\
-
-
- $(SolutionDir)$(Configuration)\
- $(Configuration)/expat\
-
-
- $(SolutionDir)$(Configuration)\expat\
- $(Configuration)\expat\
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
- MaxSpeed
- true
- WIN32;NDEBUG;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
-
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;COMPILED_FROM_DSP;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/expat.vcxproj.filters b/VC2013/expat.vcxproj.filters
deleted file mode 100644
index 4cb4220c9..000000000
--- a/VC2013/expat.vcxproj.filters
+++ /dev/null
@@ -1,67 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
diff --git a/VC2013/tolua.snippet b/VC2013/tolua.snippet
deleted file mode 100644
index 3c9c9cf33..000000000
--- a/VC2013/tolua.snippet
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
- ToLua
- tolua
-
- SurroundsWith
-
- Daniel O'Brien (marmot21)
- Adds the selected lines for Lua export
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/zlib.vcxproj b/VC2013/zlib.vcxproj
deleted file mode 100644
index 7bb2b743b..000000000
--- a/VC2013/zlib.vcxproj
+++ /dev/null
@@ -1,198 +0,0 @@
-
-
-
-
- Debug profiled
- Win32
-
-
- Debug_LuaStatic
- Win32
-
-
- Debug
- Win32
-
-
- Release profiled
- Win32
-
-
- Release
- Win32
-
-
-
- {EA9D50FD-937A-4EF5-8C37-5F4175AF4FEA}
- zlib
- Win32Proj
-
-
-
- StaticLibrary
- v120
- Unicode
-
-
- StaticLibrary
- v120
- Unicode
-
-
- StaticLibrary
- v120
- Unicode
- true
-
-
- StaticLibrary
- v120
- Unicode
- true
-
-
- StaticLibrary
- v120
- Unicode
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- <_ProjectFileVersion>12.0.21005.1
-
-
- $(SolutionDir)$(Configuration)\zlib\
- $(Configuration)\zlib\
-
-
- $(SolutionDir)$(Configuration)\zlib\
- $(Configuration)\zlib\
-
-
- $(SolutionDir)$(Configuration)\zlib\
- $(Configuration)\zlib\
-
-
- $(SolutionDir)$(Configuration)\zlib\
- $(Configuration)\zlib\
-
-
- $(SolutionDir)$(Configuration)\zlib\
- $(Configuration)\zlib\
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
- 4996;%(DisableSpecificWarnings)
-
-
-
-
- MaxSpeed
- true
- WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
- 4996;%(DisableSpecificWarnings)
-
-
-
-
- MaxSpeed
- true
- WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- MultiThreaded
- true
-
- Level3
- ProgramDatabase
- 4996;%(DisableSpecificWarnings)
-
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
- 4996;%(DisableSpecificWarnings)
-
-
-
-
- Disabled
- WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)
- true
- EnableFastChecks
- MultiThreadedDebug
-
- Level3
- EditAndContinue
- 4996;%(DisableSpecificWarnings)
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/VC2013/zlib.vcxproj.filters b/VC2013/zlib.vcxproj.filters
deleted file mode 100644
index 192806a9f..000000000
--- a/VC2013/zlib.vcxproj.filters
+++ /dev/null
@@ -1,91 +0,0 @@
-
-
-
-
- {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
- cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
- Source Files
-
-
-
\ No newline at end of file
--
cgit v1.2.3
From 1c05831974c827366b2c028b1906320ed1e88f92 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 16:20:38 +0100
Subject: Updated Core.
---
MCServer/Plugins/Core | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MCServer/Plugins/Core b/MCServer/Plugins/Core
index e96955202..759cf48ba 160000
--- a/MCServer/Plugins/Core
+++ b/MCServer/Plugins/Core
@@ -1 +1 @@
-Subproject commit e9695520248ef32f229162ba2b0ee6792749777d
+Subproject commit 759cf48ba3f1409e6d7b60cb821ee17e589bdef8
--
cgit v1.2.3
From cce063b0cdbe92d0425bca780f2f791ac9772edd Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 18:37:20 +0100
Subject: Added graph of SocketThreads state transitions.
This graph has been used for #560.
---
docs/.gitignore | 7 ++++
docs/SocketThreads states.gv | 77 ++++++++++++++++++++++++++++++++++++++++++++
docs/_files.txt | 21 +++++++++---
3 files changed, 101 insertions(+), 4 deletions(-)
create mode 100644 docs/.gitignore
create mode 100644 docs/SocketThreads states.gv
diff --git a/docs/.gitignore b/docs/.gitignore
new file mode 100644
index 000000000..f6caf1c11
--- /dev/null
+++ b/docs/.gitignore
@@ -0,0 +1,7 @@
+# PNG file with no filename is created by the GraphViz's GVEdit when displaying .gv files
+.png
+
+# The PNG files generated from their .gv sources by GraphViz:
+API class inheritance - blockentities.png
+API class inheritance - entities.png
+SocketThreads states.png
diff --git a/docs/SocketThreads states.gv b/docs/SocketThreads states.gv
new file mode 100644
index 000000000..5afaa5370
--- /dev/null
+++ b/docs/SocketThreads states.gv
@@ -0,0 +1,77 @@
+digraph
+{
+ node
+ [
+ shape="box"
+ ]
+
+ edge
+ [
+ d
+ ]
+
+ // Forward-declarations of nodes (so that they are laid out in a specific order:
+ ssNormal
+ ssWritingRestOut
+ ssShuttingDown
+ ssShuttingDown2
+
+ // Nodes with special labels / shapes:
+ ForceClose
+ [
+ label="Force close"
+ shape="ellipse"
+ ]
+ X
+ [
+ label="Socket closed"
+ shape="ellipse"
+ ]
+
+ // Edges:
+ ssNormal -> ssWritingRestOut
+ [
+ label="cSocketThreads::RemoveClient()"
+ ]
+ ssWritingRestOut -> ssShuttingDown
+ [
+ label="All outgoing data written"
+ ]
+ ssShuttingDown -> ssShuttingDown2
+ [
+ label="One thread loop"
+ ]
+ ssShuttingDown2 -> ForceClose
+ [
+ label="One thread loop"
+ ]
+ ssNormal -> ssRemoteClosed
+ [
+ label="Remote closed"
+ color="red"
+ fontcolor="red"
+ ]
+ ssWritingRestOut -> X
+ [
+ label="Remote closed"
+ color="red"
+ fontcolor="red"
+ ]
+ ssShuttingDown -> X
+ [
+ label="Remote closed"
+ color="red"
+ fontcolor="red"
+ ]
+ ssShuttingDown2 -> X
+ [
+ label="Remote closed"
+ color="red"
+ fontcolor="red"
+ ]
+ ssRemoteClosed -> X
+ [
+ label="cSocketThreads::RemoveClient()"
+ ]
+ ForceClose -> X
+}
diff --git a/docs/_files.txt b/docs/_files.txt
index a8e204334..5147c62c8 100644
--- a/docs/_files.txt
+++ b/docs/_files.txt
@@ -1,7 +1,20 @@
Contents of this folder:
-API class inheritance - blockentities.gv - a GraphViz file to visualise inheritance in the API classes in the Wiki for the cBlockEntity class' descendants
-API class inheritance - entities.gv - a GraphViz file to visualise inheritance in the API classes in the Wiki for the cEntity class' descendants
-Object ownership.gv - a GraphViz file to visualise ownership relations in the MCServer code architecture
-Springs.ods - a spreadsheet with collected statistics about the occurrence of lava / water springs based on height.
+API class inheritance - blockentities.gv
+ - a GraphViz file to visualise inheritance in the API classes in the Wiki for the cBlockEntity class' descendants
+
+API class inheritance - entities.gv
+ - a GraphViz file to visualise inheritance in the API classes in the Wiki for the cEntity class' descendants
+
+Login Sequence.txt
+ - Annotated log of packets exchanged between the client and server for login; 1.6.2 protocol
+
+Object ownership.gv
+ - a GraphViz file to visualise ownership relations in the MCServer code architecture
+
+SocketThreads states.gv
+ - a GraphViz file documenting the states for individual sockets in cSocketThreads, and transitions between them
+
+Springs.ods
+ - a spreadsheet with collected statistics about the occurrence of lava / water springs based on height.
--
cgit v1.2.3
From 3c0e8c8da0e397f3fda6b1565e7b2e9eeb4a747b Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 19:31:43 +0100
Subject: Rewritten SocketThreads for proper shutdown scenario.
This fixes #560 and #390.
---
src/ClientHandle.cpp | 6 +-
src/HTTPServer/HTTPConnection.cpp | 2 +-
src/OSSupport/Socket.cpp | 19 +++
src/OSSupport/Socket.h | 6 +-
src/OSSupport/SocketThreads.cpp | 236 +++++++++++++++++++-------------------
src/OSSupport/SocketThreads.h | 79 +++++++------
src/Server.cpp | 11 +-
src/Server.h | 8 +-
8 files changed, 189 insertions(+), 178 deletions(-)
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index faf583fbb..1eec00bc3 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -120,9 +120,6 @@ cClientHandle::~cClientHandle()
LOGD("Deleting client \"%s\" at %p", GetUsername().c_str(), this);
- // Remove from cSocketThreads, we're not to be called anymore:
- cRoot::Get()->GetServer()->ClientDestroying(this);
-
{
cCSLock Lock(m_CSChunkLists);
m_LoadedChunks.clear();
@@ -160,8 +157,7 @@ cClientHandle::~cClientHandle()
cRoot::Get()->GetServer()->WriteToClient(this, Data);
}
- // Queue the socket to close as soon as it sends all outgoing data:
- cRoot::Get()->GetServer()->QueueClientClose(this);
+ // Close the socket as soon as it sends all outgoing data:
cRoot::Get()->GetServer()->RemoveClient(this);
delete m_Protocol;
diff --git a/src/HTTPServer/HTTPConnection.cpp b/src/HTTPServer/HTTPConnection.cpp
index a4af706f2..78b7ce4d9 100644
--- a/src/HTTPServer/HTTPConnection.cpp
+++ b/src/HTTPServer/HTTPConnection.cpp
@@ -26,7 +26,7 @@ cHTTPConnection::cHTTPConnection(cHTTPServer & a_HTTPServer) :
cHTTPConnection::~cHTTPConnection()
{
- // LOGD("HTTP: Del connection at %p", this);
+ delete m_CurrentRequest;
}
diff --git a/src/OSSupport/Socket.cpp b/src/OSSupport/Socket.cpp
index 8ea5d8320..d80c9bb3d 100644
--- a/src/OSSupport/Socket.cpp
+++ b/src/OSSupport/Socket.cpp
@@ -87,6 +87,25 @@ void cSocket::CloseSocket()
+void cSocket::ShutdownReadWrite(void)
+{
+ #ifdef _WIN32
+ int res = shutdown(m_Socket, SD_BOTH);
+ #else
+ int res = shutdown(m_Socket, SHUT_RDWR);
+ #endif
+ if (res != 0)
+ {
+ LOGWARN("%s: Error shutting down socket %d (%s): %d (%s)",
+ __FUNCTION__, m_Socket, m_IPString.c_str(), this->GetLastError(), GetLastErrorString().c_str()
+ );
+ }
+}
+
+
+
+
+
AString cSocket::GetErrorString( int a_ErrNo )
{
char buffer[ 1024 ];
diff --git a/src/OSSupport/Socket.h b/src/OSSupport/Socket.h
index b86560de8..91c9ca5fd 100644
--- a/src/OSSupport/Socket.h
+++ b/src/OSSupport/Socket.h
@@ -39,7 +39,11 @@ public:
bool IsValid(void) const { return IsValidSocket(m_Socket); }
void CloseSocket(void);
-
+
+ /** Notifies the socket that we don't expect any more reads nor writes on it.
+ Most TCPIP implementations use this to send the FIN flag in a packet */
+ void ShutdownReadWrite(void);
+
operator xSocket(void) const;
xSocket GetSocket(void) const;
diff --git a/src/OSSupport/SocketThreads.cpp b/src/OSSupport/SocketThreads.cpp
index b222a2e4e..b8069cf00 100644
--- a/src/OSSupport/SocketThreads.cpp
+++ b/src/OSSupport/SocketThreads.cpp
@@ -132,47 +132,6 @@ void cSocketThreads::Write(const cCallback * a_Client, const AString & a_Data)
-/// Stops reading from the socket - when this call returns, no more calls to the callbacks are made
-void cSocketThreads::StopReading(const cCallback * a_Client)
-{
- cCSLock Lock(m_CS);
- for (cSocketThreadList::iterator itr = m_Threads.begin(); itr != m_Threads.end(); ++itr)
- {
- if ((*itr)->StopReading(a_Client))
- {
- return;
- }
- } // for itr - m_Threads[]
-
- // Cannot assert, this normally happens if the socket is closed before the client deinitializes
- // ASSERT(!"Stopping reading on an unknown client");
-}
-
-
-
-
-
-/// Queues the socket for closing, as soon as its outgoing data is sent
-void cSocketThreads::QueueClose(const cCallback * a_Client)
-{
- LOGD("QueueClose(client %p)", a_Client);
-
- cCSLock Lock(m_CS);
- for (cSocketThreadList::iterator itr = m_Threads.begin(); itr != m_Threads.end(); ++itr)
- {
- if ((*itr)->QueueClose(a_Client))
- {
- return;
- }
- } // for itr - m_Threads[]
-
- ASSERT(!"Queueing close of an unknown client");
-}
-
-
-
-
-
////////////////////////////////////////////////////////////////////////////////
// cSocketThreads::cSocketThread:
@@ -210,13 +169,13 @@ cSocketThreads::cSocketThread::~cSocketThread()
void cSocketThreads::cSocketThread::AddClient(const cSocket & a_Socket, cCallback * a_Client)
{
+ ASSERT(m_Parent->m_CS.IsLockedByCurrentThread());
ASSERT(m_NumSlots < MAX_SLOTS); // Use HasEmptySlot() to check before adding
m_Slots[m_NumSlots].m_Client = a_Client;
m_Slots[m_NumSlots].m_Socket = a_Socket;
m_Slots[m_NumSlots].m_Outgoing.clear();
- m_Slots[m_NumSlots].m_ShouldClose = false;
- m_Slots[m_NumSlots].m_ShouldCallClient = true;
+ m_Slots[m_NumSlots].m_State = sSlot::ssNormal;
m_NumSlots++;
// Notify the thread of the change:
@@ -230,7 +189,7 @@ void cSocketThreads::cSocketThread::AddClient(const cSocket & a_Socket, cCallbac
bool cSocketThreads::cSocketThread::RemoveClient(const cCallback * a_Client)
{
- // Returns true if removed, false if not found
+ ASSERT(m_Parent->m_CS.IsLockedByCurrentThread());
if (m_NumSlots == 0)
{
@@ -244,8 +203,29 @@ bool cSocketThreads::cSocketThread::RemoveClient(const cCallback * a_Client)
continue;
}
- // Found, remove it:
- m_Slots[i] = m_Slots[--m_NumSlots];
+ // Found the slot:
+ if (m_Slots[i].m_State == sSlot::ssRemoteClosed)
+ {
+ // The remote has already closed the socket, remove the slot altogether:
+ m_Slots[i] = m_Slots[--m_NumSlots];
+ }
+ else
+ {
+ // Query and queue the last batch of outgoing data:
+ m_Slots[i].m_Client->GetOutgoingData(m_Slots[i].m_Outgoing);
+ if (m_Slots[i].m_Outgoing.empty())
+ {
+ // No more outgoing data, shut the socket down immediately:
+ m_Slots[i].m_Socket.ShutdownReadWrite();
+ m_Slots[i].m_State = sSlot::ssShuttingDown;
+ }
+ else
+ {
+ // More data to send, shut down reading and wait for the rest to get sent:
+ m_Slots[i].m_State = sSlot::ssWritingRestOut;
+ }
+ m_Slots[i].m_Client = NULL;
+ }
// Notify the thread of the change:
ASSERT(m_ControlSocket2.IsValid());
@@ -263,6 +243,8 @@ bool cSocketThreads::cSocketThread::RemoveClient(const cCallback * a_Client)
bool cSocketThreads::cSocketThread::HasClient(const cCallback * a_Client) const
{
+ ASSERT(m_Parent->m_CS.IsLockedByCurrentThread());
+
for (int i = m_NumSlots - 1; i >= 0; --i)
{
if (m_Slots[i].m_Client == a_Client)
@@ -295,6 +277,8 @@ bool cSocketThreads::cSocketThread::HasSocket(const cSocket * a_Socket) const
bool cSocketThreads::cSocketThread::NotifyWrite(const cCallback * a_Client)
{
+ ASSERT(m_Parent->m_CS.IsLockedByCurrentThread());
+
if (HasClient(a_Client))
{
// Notify the thread that there's another packet in the queue:
@@ -311,7 +295,7 @@ bool cSocketThreads::cSocketThread::NotifyWrite(const cCallback * a_Client)
bool cSocketThreads::cSocketThread::Write(const cCallback * a_Client, const AString & a_Data)
{
- // Returns true if socket handled by this thread
+ ASSERT(m_Parent->m_CS.IsLockedByCurrentThread());
for (int i = m_NumSlots - 1; i >= 0; --i)
{
if (m_Slots[i].m_Client == a_Client)
@@ -332,47 +316,6 @@ bool cSocketThreads::cSocketThread::Write(const cCallback * a_Client, const AStr
-bool cSocketThreads::cSocketThread::StopReading (const cCallback * a_Client)
-{
- // Returns true if client handled by this thread
- for (int i = m_NumSlots - 1; i >= 0; --i)
- {
- if (m_Slots[i].m_Client == a_Client)
- {
- m_Slots[i].m_ShouldCallClient = false;
- return true;
- }
- } // for i - m_Slots[]
- return false;
-}
-
-
-
-
-
-bool cSocketThreads::cSocketThread::QueueClose(const cCallback * a_Client)
-{
- // Returns true if socket handled by this thread
- for (int i = m_NumSlots - 1; i >= 0; --i)
- {
- if (m_Slots[i].m_Client == a_Client)
- {
- m_Slots[i].m_ShouldClose = true;
-
- // Notify the thread that there's a close queued (in case its conditions are already met):
- ASSERT(m_ControlSocket2.IsValid());
- m_ControlSocket2.Send("c", 1);
-
- return true;
- }
- } // for i - m_Slots[]
- return false;
-}
-
-
-
-
-
bool cSocketThreads::cSocketThread::Start(void)
{
// Create the control socket listener
@@ -446,10 +389,13 @@ void cSocketThreads::cSocketThread::Execute(void)
fd_set fdRead;
cSocket::xSocket Highest = m_ControlSocket1.GetSocket();
- PrepareSet(&fdRead, Highest);
+ PrepareSet(&fdRead, Highest, false);
// Wait for the sockets:
- if (select(Highest + 1, &fdRead, NULL, NULL, NULL) == -1)
+ timeval Timeout;
+ Timeout.tv_sec = 5;
+ Timeout.tv_usec = 0;
+ if (select(Highest + 1, &fdRead, NULL, NULL, &Timeout) == -1)
{
LOG("select(R) call failed in cSocketThread: \"%s\"", cSocket::GetLastErrorString().c_str());
continue;
@@ -460,8 +406,7 @@ void cSocketThreads::cSocketThread::Execute(void)
// Test sockets for writing:
fd_set fdWrite;
Highest = m_ControlSocket1.GetSocket();
- PrepareSet(&fdWrite, Highest);
- timeval Timeout;
+ PrepareSet(&fdWrite, Highest, true);
Timeout.tv_sec = 0;
Timeout.tv_usec = 0;
if (select(Highest + 1, NULL, &fdWrite, NULL, &Timeout) == -1)
@@ -471,6 +416,8 @@ void cSocketThreads::cSocketThread::Execute(void)
}
WriteToSockets(&fdWrite);
+
+ CleanUpShutSockets();
} // while (!mShouldTerminate)
}
@@ -478,7 +425,7 @@ void cSocketThreads::cSocketThread::Execute(void)
-void cSocketThreads::cSocketThread::PrepareSet(fd_set * a_Set, cSocket::xSocket & a_Highest)
+void cSocketThreads::cSocketThread::PrepareSet(fd_set * a_Set, cSocket::xSocket & a_Highest, bool a_IsForWriting)
{
FD_ZERO(a_Set);
FD_SET(m_ControlSocket1.GetSocket(), a_Set);
@@ -490,6 +437,11 @@ void cSocketThreads::cSocketThread::PrepareSet(fd_set * a_Set, cSocket::xSocket
{
continue;
}
+ if (m_Slots[i].m_State == sSlot::ssRemoteClosed)
+ {
+ // This socket won't provide nor consume any data anymore, don't put it in the Set
+ continue;
+ }
cSocket::xSocket s = m_Slots[i].m_Socket.GetSocket();
FD_SET(s, a_Set);
if (s > a_Highest)
@@ -525,29 +477,42 @@ void cSocketThreads::cSocketThread::ReadFromSockets(fd_set * a_Read)
}
char Buffer[1024];
int Received = m_Slots[i].m_Socket.Receive(Buffer, ARRAYCOUNT(Buffer), 0);
- if (Received == 0)
+ if (Received <= 0)
{
- // The socket has been closed by the remote party, close our socket and let it be removed after we process all reading
- m_Slots[i].m_Socket.CloseSocket();
- if (m_Slots[i].m_ShouldCallClient)
+ // The socket has been closed by the remote party
+ switch (m_Slots[i].m_State)
{
- m_Slots[i].m_Client->SocketClosed();
- }
- }
- else if (Received > 0)
- {
- if (m_Slots[i].m_ShouldCallClient)
- {
- m_Slots[i].m_Client->DataReceived(Buffer, Received);
- }
+ case sSlot::ssNormal:
+ {
+ // Notify the callback that the remote has closed the socket; keep the slot
+ m_Slots[i].m_Client->SocketClosed();
+ m_Slots[i].m_State = sSlot::ssRemoteClosed;
+ break;
+ }
+ case sSlot::ssWritingRestOut:
+ case sSlot::ssShuttingDown:
+ case sSlot::ssShuttingDown2:
+ {
+ // Force-close the socket and remove the slot:
+ m_Slots[i].m_Socket.CloseSocket();
+ m_Slots[i] = m_Slots[--m_NumSlots];
+ break;
+ }
+ default:
+ {
+ LOG("%s: Unexpected socket state: %d (%s)",
+ __FUNCTION__, m_Slots[i].m_Socket.GetSocket(), m_Slots[i].m_Socket.GetIPString().c_str()
+ );
+ ASSERT(!"Unexpected socket state");
+ break;
+ }
+ } // switch (m_Slots[i].m_State)
}
else
{
- // The socket has encountered an error, close it and let it be removed after we process all reading
- m_Slots[i].m_Socket.CloseSocket();
- if (m_Slots[i].m_ShouldCallClient)
+ if (m_Slots[i].m_Client != NULL)
{
- m_Slots[i].m_Client->SocketClosed();
+ m_Slots[i].m_Client->DataReceived(Buffer, Received);
}
}
} // for i - m_Slots[]
@@ -571,22 +536,17 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
if (m_Slots[i].m_Outgoing.empty())
{
// Request another chunk of outgoing data:
- if (m_Slots[i].m_ShouldCallClient)
+ if (m_Slots[i].m_Client != NULL)
{
m_Slots[i].m_Client->GetOutgoingData(m_Slots[i].m_Outgoing);
}
if (m_Slots[i].m_Outgoing.empty())
{
- // Nothing ready
- if (m_Slots[i].m_ShouldClose)
+ // No outgoing data is ready
+ if (m_Slots[i].m_State == sSlot::ssWritingRestOut)
{
- // Socket was queued for closing and there's no more data to send, close it now:
-
- // DEBUG
- LOGD("Socket was queued for closing, closing now. Slot %d, client %p, socket %d", i, m_Slots[i].m_Client, m_Slots[i].m_Socket.GetSocket());
-
- m_Slots[i].m_Socket.CloseSocket();
- // The slot must be freed actively by the client, using RemoveClient()
+ m_Slots[i].m_State = sSlot::ssShuttingDown;
+ m_Slots[i].m_Socket.ShutdownReadWrite();
}
continue;
}
@@ -598,7 +558,7 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
int Err = cSocket::GetLastError();
LOGWARNING("Error %d while writing to client \"%s\", disconnecting. \"%s\"", Err, m_Slots[i].m_Socket.GetIPString().c_str(), cSocket::GetErrorString(Err).c_str());
m_Slots[i].m_Socket.CloseSocket();
- if (m_Slots[i].m_ShouldCallClient)
+ if (m_Slots[i].m_Client != NULL)
{
m_Slots[i].m_Client->SocketClosed();
}
@@ -606,6 +566,12 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
}
m_Slots[i].m_Outgoing.erase(0, Sent);
+ if (m_Slots[i].m_Outgoing.empty() && (m_Slots[i].m_State == sSlot::ssWritingRestOut))
+ {
+ m_Slots[i].m_State = sSlot::ssShuttingDown;
+ m_Slots[i].m_Socket.ShutdownReadWrite();
+ }
+
// _X: If there's data left, it means the client is not reading fast enough, the server would unnecessarily spin in the main loop with zero actions taken; so signalling is disabled
// This means that if there's data left, it will be sent only when there's incoming data or someone queues another packet (for any socket handled by this thread)
/*
@@ -622,3 +588,31 @@ void cSocketThreads::cSocketThread::WriteToSockets(fd_set * a_Write)
+
+void cSocketThreads::cSocketThread::CleanUpShutSockets(void)
+{
+ for (int i = m_NumSlots - 1; i >= 0; i--)
+ {
+ switch (m_Slots[i].m_State)
+ {
+ case sSlot::ssShuttingDown2:
+ {
+ // The socket has reached the shutdown timeout, close it and clear its slot:
+ m_Slots[i].m_Socket.CloseSocket();
+ m_Slots[i] = m_Slots[--m_NumSlots];
+ break;
+ }
+ case sSlot::ssShuttingDown:
+ {
+ // The socket has been shut down for a single thread loop, let it loop once more before closing:
+ m_Slots[i].m_State = sSlot::ssShuttingDown2;
+ break;
+ }
+ default: break;
+ }
+ } // for i - m_Slots[]
+}
+
+
+
+
diff --git a/src/OSSupport/SocketThreads.h b/src/OSSupport/SocketThreads.h
index e16ae69fb..9e1947ab6 100644
--- a/src/OSSupport/SocketThreads.h
+++ b/src/OSSupport/SocketThreads.h
@@ -7,19 +7,20 @@
/*
Additional details:
-When a client is terminating a connection:
-- they call the StopReading() method to disable callbacks for the incoming data
-- they call the Write() method to queue any outstanding outgoing data
-- they call the QueueClose() method to queue the socket to close after outgoing data has been sent.
-When a socket slot is marked as having no callback, it is kept alive until its outgoing data queue is empty and its m_ShouldClose flag is set.
-This means that the socket can be written to several times before finally closing it via QueueClose()
+When a client wants to terminate the connection, they call the RemoveClient() function. This calls the
+callback one last time to read all the available outgoing data, putting it in the slot's m_OutgoingData
+buffer. Then it marks the slot as having no callback. The socket is kept alive until its outgoing data
+queue is empty, then shutdown is called on it and finally the socket is closed after a timeout.
+If at any time within this the remote end closes the socket, then the socket is closed directly.
+As soon as the socket is closed, the slot is finally removed from the SocketThread.
+The graph in $/docs/SocketThreads States.gv shows the state-machine transitions of the slot.
*/
-/// How many clients should one thread handle? (must be less than FD_SETSIZE for your platform)
+/** How many clients should one thread handle? (must be less than FD_SETSIZE for your platform) */
#define MAX_SLOTS 63
@@ -27,8 +28,6 @@ This means that the socket can be written to several times before finally closin
#pragma once
-#ifndef CSOCKETTHREADS_H_INCLUDED
-#define CSOCKETTHREADS_H_INCLUDED
#include "Socket.h"
#include "IsThread.h"
@@ -64,13 +63,13 @@ public:
// Force a virtual destructor in all subclasses:
virtual ~cCallback() {}
- /// Called when data is received from the remote party
+ /** Called when data is received from the remote party */
virtual void DataReceived(const char * a_Data, int a_Size) = 0;
- /// Called when data can be sent to remote party; the function is supposed to append outgoing data to a_Data
+ /** Called when data can be sent to remote party; the function is supposed to *append* outgoing data to a_Data */
virtual void GetOutgoingData(AString & a_Data) = 0;
- /// Called when the socket has been closed for any reason
+ /** Called when the socket has been closed for any reason */
virtual void SocketClosed(void) = 0;
} ;
@@ -78,26 +77,21 @@ public:
cSocketThreads(void);
~cSocketThreads();
- /// Add a (socket, client) pair for processing, data from a_Socket is to be sent to a_Client; returns true if successful
+ /** Add a (socket, client) pair for processing, data from a_Socket is to be sent to a_Client; returns true if successful */
bool AddClient(const cSocket & a_Socket, cCallback * a_Client);
/** Remove the associated socket and the client from processing.
- The socket is left to send its data and is removed only after all its m_OutgoingData is sent
+ The socket is left to send its last outgoing data and is removed only after all its m_Outgoing is sent
+ and after the socket is properly shutdown (unless the remote disconnects before that)
*/
void RemoveClient(const cCallback * a_Client);
- /// Notify the thread responsible for a_Client that the client has something to write
+ /** Notify the thread responsible for a_Client that the client has something to write */
void NotifyWrite(const cCallback * a_Client);
- /// Puts a_Data into outgoing data queue for a_Client
+ /** Puts a_Data into outgoing data queue for a_Client */
void Write(const cCallback * a_Client, const AString & a_Data);
- /// Stops reading from the client - when this call returns, no more calls to the callbacks are made
- void StopReading(const cCallback * a_Client);
-
- /// Queues the client for closing, as soon as its outgoing data is sent
- void QueueClose(const cCallback * a_Client);
-
private:
class cSocketThread :
@@ -120,8 +114,6 @@ private:
bool HasSocket (const cSocket * a_Socket) const;
bool NotifyWrite (const cCallback * a_Client); // Returns true if client handled by this thread
bool Write (const cCallback * a_Client, const AString & a_Data); // Returns true if client handled by this thread
- bool StopReading (const cCallback * a_Client); // Returns true if client handled by this thread
- bool QueueClose (const cCallback * a_Client); // Returns true if client handled by this thread
bool Start(void); // Hide the cIsThread's Start method, we need to provide our own startup to create the control socket
@@ -135,24 +127,45 @@ private:
cSocket m_ControlSocket1;
cSocket m_ControlSocket2;
- // Socket-client-packetqueues triplets.
+ // Socket-client-dataqueues-state quadruplets.
// Manipulation with these assumes that the parent's m_CS is locked
struct sSlot
{
- cSocket m_Socket; // The socket is primarily owned by this
+ /** The socket is primarily owned by this object */
+ cSocket m_Socket;
+
+ /** The callback to call for events. May be NULL */
cCallback * m_Client;
- AString m_Outgoing; // If sending writes only partial data, the rest is stored here for another send
- bool m_ShouldClose; // If true, the socket is to be closed after sending all outgoing data
- bool m_ShouldCallClient; // If true, the client callbacks are called. Set to false in StopReading()
+
+ /** If sending writes only partial data, the rest is stored here for another send.
+ Also used when the slot is being removed to store the last batch of outgoing data. */
+ AString m_Outgoing;
+
+ enum eState
+ {
+ ssNormal, ///< Normal read / write operations
+ ssWritingRestOut, ///< The client callback was removed, continue to send outgoing data
+ ssShuttingDown, ///< The last outgoing data has been sent, the socket has called shutdown()
+ ssShuttingDown2, ///< The shutdown has been done at least 1 thread loop ago (timeout detection)
+ ssRemoteClosed, ///< The remote end has closed the connection (and we still have a client callback)
+ } m_State;
} ;
+
sSlot m_Slots[MAX_SLOTS];
int m_NumSlots; // Number of slots actually used
virtual void Execute(void) override;
- void PrepareSet (fd_set * a_Set, cSocket::xSocket & a_Highest); // Puts all sockets into the set, along with m_ControlSocket1
+ /** Puts all sockets into the set, along with m_ControlSocket1.
+ Only sockets that are able to send and receive data are put in the Set.
+ Is a_IsForWriting is true, the ssWritingRestOut sockets are added as well. */
+ void PrepareSet(fd_set * a_Set, cSocket::xSocket & a_Highest, bool a_IsForWriting);
+
void ReadFromSockets(fd_set * a_Read); // Reads from sockets indicated in a_Read
void WriteToSockets (fd_set * a_Write); // Writes to sockets indicated in a_Write
+
+ /** Removes those slots in ssShuttingDown2 state, sets those with ssShuttingDown state to ssShuttingDown2 */
+ void CleanUpShutSockets(void);
} ;
typedef std::list cSocketThreadList;
@@ -165,9 +178,3 @@ private:
-
-#endif // CSOCKETTHREADS_H_INCLUDED
-
-
-
-
diff --git a/src/Server.cpp b/src/Server.cpp
index 5280270b9..4d551e164 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -118,7 +118,7 @@ cServer::cServer(void) :
void cServer::ClientDestroying(const cClientHandle * a_Client)
{
- m_SocketThreads.StopReading(a_Client);
+ m_SocketThreads.RemoveClient(a_Client);
}
@@ -143,15 +143,6 @@ void cServer::WriteToClient(const cClientHandle * a_Client, const AString & a_Da
-void cServer::QueueClientClose(const cClientHandle * a_Client)
-{
- m_SocketThreads.QueueClose(a_Client);
-}
-
-
-
-
-
void cServer::RemoveClient(const cClientHandle * a_Client)
{
m_SocketThreads.RemoveClient(a_Client);
diff --git a/src/Server.h b/src/Server.h
index 703a7077e..bb55e81b6 100644
--- a/src/Server.h
+++ b/src/Server.h
@@ -88,14 +88,14 @@ public: // tolua_export
const AString & GetServerID(void) const { return m_ServerID; } // tolua_export
- void ClientDestroying(const cClientHandle * a_Client); // Called by cClientHandle::Destroy(); stop m_SocketThreads from calling back into a_Client
+ /** Called by cClientHandle's destructor; stop m_SocketThreads from calling back into a_Client */
+ void ClientDestroying(const cClientHandle * a_Client);
- void NotifyClientWrite(const cClientHandle * a_Client); // Notifies m_SocketThreads that client has something to be written
+ /** Notifies m_SocketThreads that client has something to be written */
+ void NotifyClientWrite(const cClientHandle * a_Client);
void WriteToClient(const cClientHandle * a_Client, const AString & a_Data); // Queues outgoing data for the client through m_SocketThreads
- void QueueClientClose(const cClientHandle * a_Client); // Queues the clienthandle to close when all its outgoing data is sent
-
void RemoveClient(const cClientHandle * a_Client); // Removes the clienthandle from m_SocketThreads
/// Don't tick a_Client anymore, it will be ticked from its cPlayer instead
--
cgit v1.2.3
From e4c3d799ffddb93c658062f9663ec027fc2f1d5a Mon Sep 17 00:00:00 2001
From: Tiger Wang
Date: Sun, 19 Jan 2014 19:42:25 +0000
Subject: Removed unneeded paramters
---
src/BlockEntities/CommandBlockEntity.cpp | 2 +-
src/ClientHandle.cpp | 4 ++--
src/ClientHandle.h | 2 +-
src/Protocol/Protocol.h | 2 +-
src/Protocol/Protocol125.h | 2 +-
src/Protocol/Protocol17x.cpp | 18 +++++++++++++-----
src/Protocol/Protocol17x.h | 2 +-
src/Protocol/ProtocolRecognizer.cpp | 4 ++--
src/Protocol/ProtocolRecognizer.h | 2 +-
9 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/src/BlockEntities/CommandBlockEntity.cpp b/src/BlockEntities/CommandBlockEntity.cpp
index 38737d619..7e9015d33 100644
--- a/src/BlockEntities/CommandBlockEntity.cpp
+++ b/src/BlockEntities/CommandBlockEntity.cpp
@@ -142,7 +142,7 @@ bool cCommandBlockEntity::Tick(float a_Dt, cChunk & a_Chunk)
void cCommandBlockEntity::SendTo(cClientHandle & a_Client)
{
- a_Client.SendUpdateBlockEntity(GetPosX(), GetPosY(), GetPosZ(), 2, *this);
+ a_Client.SendUpdateBlockEntity(*this);
}
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 327fc0358..ec71f8fe8 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -2213,9 +2213,9 @@ void cClientHandle::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
-void cClientHandle::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity)
+void cClientHandle::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
- m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_BlockEntity);
+ m_Protocol->SendUpdateBlockEntity(a_BlockEntity);
}
diff --git a/src/ClientHandle.h b/src/ClientHandle.h
index daa185ca0..4add022a6 100644
--- a/src/ClientHandle.h
+++ b/src/ClientHandle.h
@@ -136,7 +136,7 @@ public:
void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ);
void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay);
void SendUnloadChunk (int a_ChunkX, int a_ChunkZ);
- void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity);
+ void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity);
void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4);
void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ );
void SendWeather (eWeather a_Weather);
diff --git a/src/Protocol/Protocol.h b/src/Protocol/Protocol.h
index ac925e382..1bc5d528e 100644
--- a/src/Protocol/Protocol.h
+++ b/src/Protocol/Protocol.h
@@ -103,7 +103,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) = 0;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) = 0;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) = 0;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) = 0;
+ virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) = 0;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) = 0;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) = 0;
virtual void SendWeather (eWeather a_Weather) = 0;
diff --git a/src/Protocol/Protocol125.h b/src/Protocol/Protocol125.h
index ec72ddd01..310f9dd78 100644
--- a/src/Protocol/Protocol125.h
+++ b/src/Protocol/Protocol125.h
@@ -79,7 +79,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) override {};
+ virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override {};
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp
index c85641ca8..293f96186 100644
--- a/src/Protocol/Protocol17x.cpp
+++ b/src/Protocol/Protocol17x.cpp
@@ -893,13 +893,21 @@ void cProtocol172::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
-void cProtocol172::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity)
+void cProtocol172::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
cPacketizer Pkt(*this, 0x35); // Update tile entity packet
- Pkt.WriteInt(a_BlockX);
- Pkt.WriteShort(a_BlockY);
- Pkt.WriteInt(a_BlockZ);
- Pkt.WriteByte(a_Action);
+ Pkt.WriteInt(a_BlockEntity.GetPosX());
+ Pkt.WriteShort(a_BlockEntity.GetPosY());
+ Pkt.WriteInt(a_BlockEntity.GetPosZ());
+
+ Byte Action = 0;
+ switch (a_BlockEntity.GetBlockType())
+ {
+ case E_BLOCK_MOB_SPAWNER: Action = 1; break; // Update mob spawner spinny mob thing
+ case E_BLOCK_COMMAND_BLOCK: Action = 2; break; // Update command block text
+ default: ASSERT(!"Unhandled or unimplemented BlockEntity update request!"); break;
+ }
+ Pkt.WriteByte(Action);
Pkt.WriteBlockEntity(a_BlockEntity);
}
diff --git a/src/Protocol/Protocol17x.h b/src/Protocol/Protocol17x.h
index b1d902507..3ae774c18 100644
--- a/src/Protocol/Protocol17x.h
+++ b/src/Protocol/Protocol17x.h
@@ -102,7 +102,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) override;
+ virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
diff --git a/src/Protocol/ProtocolRecognizer.cpp b/src/Protocol/ProtocolRecognizer.cpp
index 86f46f02f..5524af136 100644
--- a/src/Protocol/ProtocolRecognizer.cpp
+++ b/src/Protocol/ProtocolRecognizer.cpp
@@ -636,10 +636,10 @@ void cProtocolRecognizer::SendUnloadChunk(int a_ChunkX, int a_ChunkZ)
-void cProtocolRecognizer::SendUpdateBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity)
+void cProtocolRecognizer::SendUpdateBlockEntity(cBlockEntity & a_BlockEntity)
{
ASSERT(m_Protocol != NULL);
- m_Protocol->SendUpdateBlockEntity(a_BlockX, a_BlockY, a_BlockZ, a_Action, a_BlockEntity);
+ m_Protocol->SendUpdateBlockEntity(a_BlockEntity);
}
diff --git a/src/Protocol/ProtocolRecognizer.h b/src/Protocol/ProtocolRecognizer.h
index c1c8abdd5..2dccace6e 100644
--- a/src/Protocol/ProtocolRecognizer.h
+++ b/src/Protocol/ProtocolRecognizer.h
@@ -114,7 +114,7 @@ public:
virtual void SendThunderbolt (int a_BlockX, int a_BlockY, int a_BlockZ) override;
virtual void SendTimeUpdate (Int64 a_WorldAge, Int64 a_TimeOfDay) override;
virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendUpdateBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, Byte a_Action, cBlockEntity & a_BlockEntity) override;
+ virtual void SendUpdateBlockEntity (cBlockEntity & a_BlockEntity) override;
virtual void SendUpdateSign (int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4) override;
virtual void SendUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ ) override;
virtual void SendWeather (eWeather a_Weather) override;
--
cgit v1.2.3
From 4a01879911c5673612693531c4f8970c1644947b Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 23:45:26 +0100
Subject: cLuaState can now check function params.
---
src/Bindings/LuaState.cpp | 34 ++++++++++++++++++++++++++++++++++
src/Bindings/LuaState.h | 3 +++
2 files changed, 37 insertions(+)
diff --git a/src/Bindings/LuaState.cpp b/src/Bindings/LuaState.cpp
index 00e62fcf6..bfee1d037 100644
--- a/src/Bindings/LuaState.cpp
+++ b/src/Bindings/LuaState.cpp
@@ -914,6 +914,40 @@ bool cLuaState::CheckParamString(int a_StartParam, int a_EndParam)
+bool cLuaState::CheckParamFunction(int a_StartParam, int a_EndParam)
+{
+ ASSERT(IsValid());
+
+ if (a_EndParam < 0)
+ {
+ a_EndParam = a_StartParam;
+ }
+
+ for (int i = a_StartParam; i <= a_EndParam; i++)
+ {
+ if (lua_isfunction(m_LuaState, i))
+ {
+ continue;
+ }
+ // Not the correct parameter
+ lua_Debug entry;
+ VERIFY(lua_getstack(m_LuaState, 0, &entry));
+ VERIFY(lua_getinfo (m_LuaState, "n", &entry));
+ AString ErrMsg = Printf("Error in function '%s' parameter #%d. Function expected, got %s",
+ (entry.name != NULL) ? entry.name : "?", i, GetTypeText(i).c_str()
+ );
+ LogStackTrace();
+ return false;
+ } // for i - Param
+
+ // All params checked ok
+ return true;
+}
+
+
+
+
+
bool cLuaState::CheckParamEnd(int a_Param)
{
tolua_Error tolua_err;
diff --git a/src/Bindings/LuaState.h b/src/Bindings/LuaState.h
index 414e5e4b2..f8b67f5cd 100644
--- a/src/Bindings/LuaState.h
+++ b/src/Bindings/LuaState.h
@@ -815,6 +815,9 @@ public:
/// Returns true if the specified parameters on the stack are strings; also logs warning if not
bool CheckParamString(int a_StartParam, int a_EndParam = -1);
+ /// Returns true if the specified parameters on the stack are functions; also logs warning if not
+ bool CheckParamFunction(int a_StartParam, int a_EndParam = -1);
+
/// Returns true if the specified parameter on the stack is nil (indicating an end-of-parameters)
bool CheckParamEnd(int a_Param);
--
cgit v1.2.3
From 41618bf242e66744431a1d28e0409f543fb240e4 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 23:49:19 +0100
Subject: Changed the cWorld::ScheduleTask() signature.
Now it takes the delay in ticks as an argument, and a cTask descendant as the task to run. Lua API has been updated similarly.
---
MCServer/Plugins/Debuggers/Debuggers.lua | 40 +++++
src/Bindings/ManualBindings.cpp | 24 +--
src/World.cpp | 32 ++--
src/World.h | 276 ++++++++++++++++---------------
4 files changed, 221 insertions(+), 151 deletions(-)
diff --git a/MCServer/Plugins/Debuggers/Debuggers.lua b/MCServer/Plugins/Debuggers/Debuggers.lua
index 8512fbd5f..2d2d2736d 100644
--- a/MCServer/Plugins/Debuggers/Debuggers.lua
+++ b/MCServer/Plugins/Debuggers/Debuggers.lua
@@ -52,6 +52,7 @@ function Initialize(Plugin)
PM:BindCommand("/fill", "debuggers", HandleFill, "- Fills all block entities in current chunk with junk");
PM:BindCommand("/fr", "debuggers", HandleFurnaceRecipe, "- Shows the furnace recipe for the currently held item");
PM:BindCommand("/ff", "debuggers", HandleFurnaceFuel, "- Shows how long the currently held item would burn in a furnace");
+ PM:BindCommand("/sched", "debuggers", HandleSched, "- Schedules a simple countdown using cWorld:ScheduleTask()");
Plugin:AddWebTab("Debuggers", HandleRequest_Debuggers);
@@ -955,6 +956,45 @@ end
+function HandleSched(a_Split, a_Player)
+ local World = a_Player:GetWorld()
+
+ -- Schedule a broadcast of a countdown message:
+ for i = 1, 10 do
+ World:ScheduleTask(i * 20,
+ function(a_World)
+ a_World:BroadcastChat("Countdown: " .. 11 - i)
+ end
+ )
+ end
+
+ -- Schedule a broadcast of the final message and a note to the originating player
+ -- Note that we CANNOT us the a_Player in the callback - what if the player disconnected?
+ -- Therefore we store the player's EntityID
+ local PlayerID = a_Player:GetUniqueID()
+ World:ScheduleTask(220,
+ function(a_World)
+ a_World:BroadcastChat("Countdown: BOOM")
+ a_World:DoWithEntityByID(PlayerID,
+ function(a_Entity)
+ if (a_Entity:IsPlayer()) then
+ -- Although unlikely, it is possible that this player is not the originating player
+ -- However, I leave this as an excercise to you to fix this "bug"
+ local Player = tolua.cast(a_Entity, "cPlayer")
+ Player:SendMessage("Countdown finished")
+ end
+ end
+ )
+ end
+ )
+
+ return true
+end
+
+
+
+
+
function HandleRequest_Debuggers(a_Request)
local FolderContents = cFile:GetFolderContents("./");
return "The following objects have been returned by cFile:GetFolderContents():
" .. table.concat(FolderContents, " ") .. "
";
diff --git a/src/Bindings/ManualBindings.cpp b/src/Bindings/ManualBindings.cpp
index 3ebe7b294..2206dd371 100644
--- a/src/Bindings/ManualBindings.cpp
+++ b/src/Bindings/ManualBindings.cpp
@@ -986,11 +986,10 @@ static int tolua_cWorld_QueueTask(lua_State * tolua_S)
class cLuaScheduledWorldTask :
- public cWorld::cScheduledTask
+ public cWorld::cTask
{
public:
- cLuaScheduledWorldTask(cPluginLua & a_Plugin, int a_FnRef, int a_Ticks) :
- cScheduledTask(a_Ticks),
+ cLuaScheduledWorldTask(cPluginLua & a_Plugin, int a_FnRef) :
m_Plugin(a_Plugin),
m_FnRef(a_FnRef)
{
@@ -1025,14 +1024,19 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S)
}
// Retrieve the args:
- cWorld * self = (cWorld *)tolua_tousertype(tolua_S, 1, 0);
- if (self == NULL)
+ cLuaState L(tolua_S);
+ if (
+ !L.CheckParamUserType(1, "cWorld") ||
+ !L.CheckParamNumber (2) ||
+ !L.CheckParamFunction(3)
+ )
{
- return lua_do_error(tolua_S, "Error in function call '#funcname#': Not called on an object instance");
+ return 0;
}
- if (!lua_isfunction(tolua_S, 2))
+ cWorld * World = (cWorld *)tolua_tousertype(tolua_S, 1, NULL);
+ if (World == NULL)
{
- return lua_do_error(tolua_S, "Error in function call '#funcname#': Expected a function for parameter #1");
+ return lua_do_error(tolua_S, "Error in function call '#funcname#': Not called on an object instance");
}
// Create a reference to the function:
@@ -1042,9 +1046,9 @@ static int tolua_cWorld_ScheduleTask(lua_State * tolua_S)
return lua_do_error(tolua_S, "Error in function call '#funcname#': Could not get function reference of parameter #1");
}
- int Ticks = (int) tolua_tonumber (tolua_S, 3, 0);
+ int DelayTicks = (int)tolua_tonumber(tolua_S, 2, 0);
- self->ScheduleTask(new cLuaScheduledWorldTask(*Plugin, FnRef, Ticks));
+ World->ScheduleTask(DelayTicks, new cLuaScheduledWorldTask(*Plugin, FnRef));
return 0;
}
diff --git a/src/World.cpp b/src/World.cpp
index 6520702c7..5e9f4a38a 100644
--- a/src/World.cpp
+++ b/src/World.cpp
@@ -865,13 +865,17 @@ void cWorld::TickQueuedTasks(void)
} // for itr - m_Tasks[]
}
-void cWorld::TickScheduledTasks()
+
+
+
+
+void cWorld::TickScheduledTasks(void)
{
- ScheduledTaskList Tasks;
// Make a copy of the tasks to avoid deadlocks on accessing m_Tasks
+ cScheduledTasks Tasks;
{
cCSLock Lock(m_CSScheduledTasks);
- while (!m_ScheduledTasks.empty() && m_ScheduledTasks.front()->Ticks < m_WorldAge)
+ while (!m_ScheduledTasks.empty() && (m_ScheduledTasks.front()->m_TargetTick < m_WorldAge))
{
Tasks.push_back(m_ScheduledTasks.front());
m_ScheduledTasks.pop_front();
@@ -879,9 +883,9 @@ void cWorld::TickScheduledTasks()
}
// Execute and delete each task:
- for (ScheduledTaskList::iterator itr = Tasks.begin(), end = Tasks.end(); itr != end; ++itr)
+ for (cScheduledTasks::iterator itr = Tasks.begin(), end = Tasks.end(); itr != end; ++itr)
{
- (*itr)->Run(*this);
+ (*itr)->m_Task->Run(*this);
delete *itr;
} // for itr - m_Tasks[]
}
@@ -2627,19 +2631,25 @@ void cWorld::QueueTask(cTask * a_Task)
m_Tasks.push_back(a_Task);
}
-void cWorld::ScheduleTask(cScheduledTask * a_Task)
+
+
+
+
+void cWorld::ScheduleTask(int a_DelayTicks, cTask * a_Task)
{
- a_Task->Ticks = a_Task->Ticks + m_WorldAge;
+ Int64 TargetTick = a_DelayTicks + m_WorldAge;
+
+ // Insert the task into the list of scheduled tasks, ordered by its target tick
cCSLock Lock(m_CSScheduledTasks);
- for(ScheduledTaskList::iterator itr = m_ScheduledTasks.begin(); itr != m_ScheduledTasks.end(); itr++)
+ for (cScheduledTasks::iterator itr = m_ScheduledTasks.begin(), end = m_ScheduledTasks.end(); itr != end; ++itr)
{
- if((*itr)->Ticks >= a_Task->Ticks)
+ if ((*itr)->m_TargetTick >= TargetTick)
{
- m_ScheduledTasks.insert(itr, a_Task);
+ m_ScheduledTasks.insert(itr, new cScheduledTask(TargetTick, a_Task));
return;
}
}
- m_ScheduledTasks.push_back(a_Task);
+ m_ScheduledTasks.push_back(new cScheduledTask(TargetTick, a_Task));
}
diff --git a/src/World.h b/src/World.h
index 1a7ad0cb1..930d9d421 100644
--- a/src/World.h
+++ b/src/World.h
@@ -66,7 +66,7 @@ public:
// tolua_end
- /// A simple RAII locker for the chunkmap - locks the chunkmap in its constructor, unlocks it in the destructor
+ /** A simple RAII locker for the chunkmap - locks the chunkmap in its constructor, unlocks it in the destructor */
class cLock :
public cCSLock
{
@@ -74,8 +74,9 @@ public:
public:
cLock(cWorld & a_World);
} ;
+
- /// A common ancestor for all tasks queued onto the tick thread
+ /** A common ancestor for all tasks queued onto the tick thread */
class cTask
{
public:
@@ -83,18 +84,8 @@ public:
virtual void Run(cWorld & a_World) = 0;
} ;
- /// A common ancestor for all scheduled tasks queued onto the tick thread
- class cScheduledTask
- {
- public:
- cScheduledTask(const int a_Ticks) : Ticks(a_Ticks) {};
- virtual ~cScheduledTask() {};
- virtual void Run(cWorld & a_World) = 0;
- int Ticks;
- };
-
typedef std::vector cTasks;
- typedef std::list ScheduledTaskList;
+
class cTaskSaveAllChunks :
public cTask
@@ -128,16 +119,16 @@ public:
BroadcastTimeUpdate();
}
- /// Returns the current game mode. Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable
+ /** Returns the current game mode. Partly OBSOLETE, you should use IsGameModeXXX() functions wherever applicable */
eGameMode GetGameMode(void) const { return m_GameMode; }
- /// Returns true if the world is in Creative mode
+ /** Returns true if the world is in Creative mode */
bool IsGameModeCreative(void) const { return (m_GameMode == gmCreative); }
- /// Returns true if the world is in Survival mode
+ /** Returns true if the world is in Survival mode */
bool IsGameModeSurvival(void) const { return (m_GameMode == gmSurvival); }
- /// Returns true if the world is in Adventure mode
+ /** Returns true if the world is in Adventure mode */
bool IsGameModeAdventure(void) const { return (m_GameMode == gmAdventure); }
bool IsPVPEnabled(void) const { return m_bEnabledPVP; }
@@ -147,12 +138,12 @@ public:
eDimension GetDimension(void) const { return m_Dimension; }
- /// Returns the world height at the specified coords; waits for the chunk to get loaded / generated
+ /** Returns the world height at the specified coords; waits for the chunk to get loaded / generated */
int GetHeight(int a_BlockX, int a_BlockZ);
// tolua_end
- /// Retrieves the world height at the specified coords; returns false if chunk not loaded / generated
+ /** Retrieves the world height at the specified coords; returns false if chunk not loaded / generated */
bool TryGetHeight(int a_BlockX, int a_BlockZ, int & a_Height); // Exported in ManualBindings.cpp
// Broadcast respective packets to all clients of the chunk where the event is taking place
@@ -187,7 +178,7 @@ public:
void BroadcastUseBed (const cEntity & a_Entity, int a_BlockX, int a_BlockY, int a_BlockZ );
void BroadcastWeather (eWeather a_Weather, const cClientHandle * a_Exclude = NULL);
- /// If there is a block entity at the specified coords, sends it to the client specified
+ /** If there is a block entity at the specified coords, sends it to the client specified */
void SendBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle & a_Client);
void MarkChunkDirty (int a_ChunkX, int a_ChunkZ);
@@ -221,7 +212,7 @@ public:
bool GetChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataCallback & a_Callback);
- /// Gets the chunk's blocks, only the block types
+ /** Gets the chunk's blocks, only the block types */
bool GetChunkBlockTypes(int a_ChunkX, int a_ChunkZ, BLOCKTYPE * a_BlockTypes);
bool IsChunkValid (int a_ChunkX, int a_ChunkZ) const;
@@ -234,13 +225,13 @@ public:
void AddPlayer( cPlayer* a_Player );
void RemovePlayer( cPlayer* a_Player );
- /// Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true
- bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
-
- /// Calls the callback for the player of the given name; returns true if the player was found and the callback called, false if player not found. Callback return ignored
- bool DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
+ /** Calls the callback for each player in the list; returns true if all players processed, false if the callback aborted by returning true */
+ bool ForEachPlayer(cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
+
+ /** Calls the callback for the player of the given name; returns true if the player was found and the callback called, false if player not found. Callback return ignored */
+ bool DoWithPlayer(const AString & a_PlayerName, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
- /// Finds a player from a partial or complete player name and calls the callback - case-insensitive
+ /** Finds a player from a partial or complete player name and calls the callback - case-insensitive */
bool FindAndDoWithPlayer(const AString & a_PlayerNameHint, cPlayerListCallback & a_Callback); // >> EXPORTED IN MANUALBINDINGS <<
// TODO: This interface is dangerous - rewrite to DoWithClosestPlayer(pos, sight, action)
@@ -248,74 +239,74 @@ public:
void SendPlayerList(cPlayer * a_DestPlayer); // Sends playerlist to the player
- /// Adds the entity into its appropriate chunk; takes ownership of the entity ptr
+ /** Adds the entity into its appropriate chunk; takes ownership of the entity ptr */
void AddEntity(cEntity * a_Entity);
bool HasEntity(int a_UniqueID);
- /// Removes the entity, the entity ptr ownership is assumed taken by the caller
+ /** Removes the entity, the entity ptr ownership is assumed taken by the caller */
void RemoveEntity(cEntity * a_Entity);
- /// Calls the callback for each entity in the entire world; returns true if all entities processed, false if the callback aborted by returning true
+ /** Calls the callback for each entity in the entire world; returns true if all entities processed, false if the callback aborted by returning true */
bool ForEachEntity(cEntityCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for each entity in the specified chunk; returns true if all entities processed, false if the callback aborted by returning true
+ /** Calls the callback for each entity in the specified chunk; returns true if all entities processed, false if the callback aborted by returning true */
bool ForEachEntityInChunk(int a_ChunkX, int a_ChunkZ, cEntityCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback if the entity with the specified ID is found, with the entity object as the callback param. Returns true if entity found and callback returned false.
+ /** Calls the callback if the entity with the specified ID is found, with the entity object as the callback param. Returns true if entity found and callback returned false. */
bool DoWithEntityByID(int a_UniqueID, cEntityCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Compares clients of two chunks, calls the callback accordingly
+ /** Compares clients of two chunks, calls the callback accordingly */
void CompareChunkClients(int a_ChunkX1, int a_ChunkZ1, int a_ChunkX2, int a_ChunkZ2, cClientDiffCallback & a_Callback);
- /// Adds client to a chunk, if not already present; returns true if added, false if present
+ /** Adds client to a chunk, if not already present; returns true if added, false if present */
bool AddChunkClient(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client);
- /// Removes client from the chunk specified
+ /** Removes client from the chunk specified */
void RemoveChunkClient(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client);
- /// Removes the client from all chunks it is present in
+ /** Removes the client from all chunks it is present in */
void RemoveClientFromChunks(cClientHandle * a_Client);
- /// Sends the chunk to the client specified, if the chunk is valid. If not valid, the request is postponed (ChunkSender will send that chunk when it becomes valid+lighted)
+ /** Sends the chunk to the client specified, if the chunk is valid. If not valid, the request is postponed (ChunkSender will send that chunk when it becomes valid+lighted) */
void SendChunkTo(int a_ChunkX, int a_ChunkZ, cClientHandle * a_Client);
- /// Removes client from ChunkSender's queue of chunks to be sent
+ /** Removes client from ChunkSender's queue of chunks to be sent */
void RemoveClientFromChunkSender(cClientHandle * a_Client);
- /// Touches the chunk, causing it to be loaded or generated
+ /** Touches the chunk, causing it to be loaded or generated */
void TouchChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
- /// Loads the chunk, if not already loaded. Doesn't generate. Returns true if chunk valid (even if already loaded before)
+ /** Loads the chunk, if not already loaded. Doesn't generate. Returns true if chunk valid (even if already loaded before) */
bool LoadChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
- /// Loads the chunks specified. Doesn't report failure, other than chunks being !IsValid()
+ /** Loads the chunks specified. Doesn't report failure, other than chunks being !IsValid() */
void LoadChunks(const cChunkCoordsList & a_Chunks);
- /// Marks the chunk as failed-to-load:
+ /** Marks the chunk as failed-to-load: */
void ChunkLoadFailed(int a_ChunkX, int a_ChunkY, int a_ChunkZ);
- /// Sets the sign text, asking plugins for permission first. a_Player is the player who this change belongs to, may be NULL. Returns true if sign text changed. Same as UpdateSign()
+ /** Sets the sign text, asking plugins for permission first. a_Player is the player who this change belongs to, may be NULL. Returns true if sign text changed. Same as UpdateSign() */
bool SetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4, cPlayer * a_Player = NULL); // Exported in ManualBindings.cpp
- /// Sets the sign text, asking plugins for permission first. a_Player is the player who this change belongs to, may be NULL. Returns true if sign text changed. Same as SetSignLines()
+ /** Sets the sign text, asking plugins for permission first. a_Player is the player who this change belongs to, may be NULL. Returns true if sign text changed. Same as SetSignLines() */
bool UpdateSign(int a_X, int a_Y, int a_Z, const AString & a_Line1, const AString & a_Line2, const AString & a_Line3, const AString & a_Line4, cPlayer * a_Player = NULL); // Exported in ManualBindings.cpp
- /// Marks (a_Stay == true) or unmarks (a_Stay == false) chunks as non-unloadable. To be used only by cChunkStay!
+ /** Marks (a_Stay == true) or unmarks (a_Stay == false) chunks as non-unloadable. To be used only by cChunkStay! */
void ChunksStay(const cChunkCoordsList & a_Chunks, bool a_Stay = true);
- /// Regenerate the given chunk:
+ /** Regenerate the given chunk: */
void RegenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
- /// Generates the given chunk, if not already generated
+ /** Generates the given chunk, if not already generated */
void GenerateChunk(int a_ChunkX, int a_ChunkZ); // tolua_export
- /// Queues a chunk for lighting; a_Callback is called after the chunk is lighted
+ /** Queues a chunk for lighting; a_Callback is called after the chunk is lighted */
void QueueLightChunk(int a_ChunkX, int a_ChunkZ, cChunkCoordCallback * a_Callback = NULL);
bool IsChunkLighted(int a_ChunkX, int a_ChunkZ);
- /// Calls the callback for each chunk in the coords specified (all cords are inclusive). Returns true if all chunks have been processed successfully
+ /** Calls the callback for each chunk in the coords specified (all cords are inclusive). Returns true if all chunks have been processed successfully */
bool ForEachChunkInRect(int a_MinChunkX, int a_MaxChunkX, int a_MinChunkZ, int a_MaxChunkZ, cChunkDataCallback & a_Callback);
// tolua_begin
@@ -366,30 +357,30 @@ public:
// tolua_begin
- /// Spawns item pickups for each item in the list. May compress pickups if too many entities:
+ /** Spawns item pickups for each item in the list. May compress pickups if too many entities: */
void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_FlyAwaySpeed = 1.0, bool IsPlayerCreated = false);
- /// Spawns item pickups for each item in the list. May compress pickups if too many entities. All pickups get the speed specified:
+ /** Spawns item pickups for each item in the list. May compress pickups if too many entities. All pickups get the speed specified: */
void SpawnItemPickups(const cItems & a_Pickups, double a_BlockX, double a_BlockY, double a_BlockZ, double a_SpeedX, double a_SpeedY, double a_SpeedZ, bool IsPlayerCreated = false);
- /// Spawns an falling block entity at the given position. It returns the UniqueID of the spawned falling block.
+ /** Spawns an falling block entity at the given position. It returns the UniqueID of the spawned falling block. */
int SpawnFallingBlock(int a_X, int a_Y, int a_Z, BLOCKTYPE BlockType, NIBBLETYPE BlockMeta);
- /// Spawns an minecart at the given coordinates.
+ /** Spawns an minecart at the given coordinates. */
int SpawnMinecart(double a_X, double a_Y, double a_Z, int a_MinecartType, const cItem & a_Content = cItem(), int a_BlockHeight = 1);
- /// Spawns an experience orb at the given location with the given reward. It returns the UniqueID of the spawned experience orb.
+ /** Spawns an experience orb at the given location with the given reward. It returns the UniqueID of the spawned experience orb. */
int SpawnExperienceOrb(double a_X, double a_Y, double a_Z, int a_Reward);
- /// Spawns a new primed TNT entity at the specified block coords and specified fuse duration. Initial velocity is given based on the relative coefficient provided
+ /** Spawns a new primed TNT entity at the specified block coords and specified fuse duration. Initial velocity is given based on the relative coefficient provided */
void SpawnPrimedTNT(double a_X, double a_Y, double a_Z, double a_FuseTimeInSec, double a_InitialVelocityCoeff = 1);
// tolua_end
- /// Replaces world blocks with a_Blocks, if they are of type a_FilterBlockType
+ /** Replaces world blocks with a_Blocks, if they are of type a_FilterBlockType */
void ReplaceBlocks(const sSetBlockVector & a_Blocks, BLOCKTYPE a_FilterBlockType);
- /// Retrieves block types of the specified blocks. If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read.
+ /** Retrieves block types of the specified blocks. If a chunk is not loaded, doesn't modify the block. Returns true if all blocks were read. */
bool GetBlocks(sSetBlockVector & a_Blocks, bool a_ContinueOnFailure);
// tolua_begin
@@ -400,10 +391,10 @@ public:
double GetSpawnY(void) const { return m_SpawnY; }
double GetSpawnZ(void) const { return m_SpawnZ; }
- /// Wakes up the simulators for the specified block
+ /** Wakes up the simulators for the specified block */
void WakeUpSimulators(int a_BlockX, int a_BlockY, int a_BlockZ);
- /// Wakes up the simulators for the specified area of blocks
+ /** Wakes up the simulators for the specified area of blocks */
void WakeUpSimulatorsInArea(int a_MinBlockX, int a_MaxBlockX, int a_MinBlockY, int a_MaxBlockY, int a_MinBlockZ, int a_MaxBlockZ);
// tolua_end
@@ -414,22 +405,22 @@ public:
inline cFluidSimulator * GetLavaSimulator (void) { return m_LavaSimulator; }
inline cRedstoneSimulator * GetRedstoneSimulator(void) { return m_RedstoneSimulator; }
- /// Calls the callback for each block entity in the specified chunk; returns true if all block entities processed, false if the callback aborted by returning true
+ /** Calls the callback for each block entity in the specified chunk; returns true if all block entities processed, false if the callback aborted by returning true */
bool ForEachBlockEntityInChunk(int a_ChunkX, int a_ChunkZ, cBlockEntityCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for each chest in the specified chunk; returns true if all chests processed, false if the callback aborted by returning true
+ /** Calls the callback for each chest in the specified chunk; returns true if all chests processed, false if the callback aborted by returning true */
bool ForEachChestInChunk(int a_ChunkX, int a_ChunkZ, cChestCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for each dispenser in the specified chunk; returns true if all dispensers processed, false if the callback aborted by returning true
+ /** Calls the callback for each dispenser in the specified chunk; returns true if all dispensers processed, false if the callback aborted by returning true */
bool ForEachDispenserInChunk(int a_ChunkX, int a_ChunkZ, cDispenserCallback & a_Callback);
- /// Calls the callback for each dropper in the specified chunk; returns true if all droppers processed, false if the callback aborted by returning true
+ /** Calls the callback for each dropper in the specified chunk; returns true if all droppers processed, false if the callback aborted by returning true */
bool ForEachDropperInChunk(int a_ChunkX, int a_ChunkZ, cDropperCallback & a_Callback);
- /// Calls the callback for each dropspenser in the specified chunk; returns true if all dropspensers processed, false if the callback aborted by returning true
+ /** Calls the callback for each dropspenser in the specified chunk; returns true if all dropspensers processed, false if the callback aborted by returning true */
bool ForEachDropSpenserInChunk(int a_ChunkX, int a_ChunkZ, cDropSpenserCallback & a_Callback);
- /// Calls the callback for each furnace in the specified chunk; returns true if all furnaces processed, false if the callback aborted by returning true
+ /** Calls the callback for each furnace in the specified chunk; returns true if all furnaces processed, false if the callback aborted by returning true */
bool ForEachFurnaceInChunk(int a_ChunkX, int a_ChunkZ, cFurnaceCallback & a_Callback); // Exported in ManualBindings.cpp
/** Does an explosion with the specified strength at the specified coordinate
@@ -447,71 +438,71 @@ public:
*/
void DoExplosionAt(double a_ExplosionSize, double a_BlockX, double a_BlockY, double a_BlockZ, bool a_CanCauseFire, eExplosionSource a_Source, void * a_SourceData); // tolua_export
- /// Calls the callback for the block entity at the specified coords; returns false if there's no block entity at those coords, true if found
+ /** Calls the callback for the block entity at the specified coords; returns false if there's no block entity at those coords, true if found */
bool DoWithBlockEntityAt(int a_BlockX, int a_BlockY, int a_BlockZ, cBlockEntityCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the chest at the specified coords; returns false if there's no chest at those coords, true if found
+ /** Calls the callback for the chest at the specified coords; returns false if there's no chest at those coords, true if found */
bool DoWithChestAt(int a_BlockX, int a_BlockY, int a_BlockZ, cChestCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the dispenser at the specified coords; returns false if there's no dispenser at those coords or callback returns true, returns true if found
+ /** Calls the callback for the dispenser at the specified coords; returns false if there's no dispenser at those coords or callback returns true, returns true if found */
bool DoWithDispenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDispenserCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the dropper at the specified coords; returns false if there's no dropper at those coords or callback returns true, returns true if found
+ /** Calls the callback for the dropper at the specified coords; returns false if there's no dropper at those coords or callback returns true, returns true if found */
bool DoWithDropperAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropperCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the dropspenser at the specified coords; returns false if there's no dropspenser at those coords or callback returns true, returns true if found
+ /** Calls the callback for the dropspenser at the specified coords; returns false if there's no dropspenser at those coords or callback returns true, returns true if found */
bool DoWithDropSpenserAt(int a_BlockX, int a_BlockY, int a_BlockZ, cDropSpenserCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the furnace at the specified coords; returns false if there's no furnace at those coords or callback returns true, returns true if found
+ /** Calls the callback for the furnace at the specified coords; returns false if there's no furnace at those coords or callback returns true, returns true if found */
bool DoWithFurnaceAt(int a_BlockX, int a_BlockY, int a_BlockZ, cFurnaceCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the noteblock at the specified coords; returns false if there's no noteblock at those coords or callback returns true, returns true if found
+ /** Calls the callback for the noteblock at the specified coords; returns false if there's no noteblock at those coords or callback returns true, returns true if found */
bool DoWithNoteBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cNoteBlockCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Calls the callback for the command block at the specified coords; returns false if there's no command block at those coords or callback returns true, returns true if found
+ /** Calls the callback for the command block at the specified coords; returns false if there's no command block at those coords or callback returns true, returns true if found */
bool DoWithCommandBlockAt(int a_BlockX, int a_BlockY, int a_BlockZ, cCommandBlockCallback & a_Callback); // Exported in ManualBindings.cpp
- /// Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found
+ /** Retrieves the test on the sign at the specified coords; returns false if there's no sign at those coords, true if found */
bool GetSignLines (int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_Line1, AString & a_Line2, AString & a_Line3, AString & a_Line4); // Exported in ManualBindings.cpp
- /// a_Player is using block entity at [x, y, z], handle that:
+ /** a_Player is using block entity at [x, y, z], handle that: */
void UseBlockEntity(cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ) {m_ChunkMap->UseBlockEntity(a_Player, a_BlockX, a_BlockY, a_BlockZ); } // tolua_export
- /// Calls the callback for the chunk specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback
+ /** Calls the callback for the chunk specified, with ChunkMapCS locked; returns false if the chunk doesn't exist, otherwise returns the same value as the callback */
bool DoWithChunk(int a_ChunkX, int a_ChunkZ, cChunkCallback & a_Callback);
void GrowTreeImage(const sSetBlockVector & a_Blocks);
// tolua_begin
- /// Grows a tree at the specified coords, either from a sapling there, or based on the biome
+ /** Grows a tree at the specified coords, either from a sapling there, or based on the biome */
void GrowTree (int a_BlockX, int a_BlockY, int a_BlockZ);
- /// Grows a tree at the specified coords, based on the sapling meta provided
+ /** Grows a tree at the specified coords, based on the sapling meta provided */
void GrowTreeFromSapling(int a_BlockX, int a_BlockY, int a_BlockZ, NIBBLETYPE a_SaplingMeta);
- /// Grows a tree at the specified coords, based on the biome in the place
+ /** Grows a tree at the specified coords, based on the biome in the place */
void GrowTreeByBiome (int a_BlockX, int a_BlockY, int a_BlockZ);
- /// Grows the plant at the specified block to its ripe stage (bonemeal used); returns false if the block is not growable. If a_IsBonemeal is true, block is not grown if not allowed in world.ini
+ /** Grows the plant at the specified block to its ripe stage (bonemeal used); returns false if the block is not growable. If a_IsBonemeal is true, block is not grown if not allowed in world.ini */
bool GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsByBonemeal = false);
- /// Grows a cactus present at the block specified by the amount of blocks specified, up to the max height specified in the config
+ /** Grows a cactus present at the block specified by the amount of blocks specified, up to the max height specified in the config */
void GrowCactus(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow);
- /// Grows a melon or a pumpkin next to the block specified (assumed to be the stem)
+ /** Grows a melon or a pumpkin next to the block specified (assumed to be the stem) */
void GrowMelonPumpkin(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType);
- /// Grows a sugarcane present at the block specified by the amount of blocks specified, up to the max height specified in the config
+ /** Grows a sugarcane present at the block specified by the amount of blocks specified, up to the max height specified in the config */
void GrowSugarcane(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow);
- /// Returns the biome at the specified coords. Reads the biome from the chunk, if loaded, otherwise uses the world generator to provide the biome value
+ /** Returns the biome at the specified coords. Reads the biome from the chunk, if loaded, otherwise uses the world generator to provide the biome value */
int GetBiomeAt(int a_BlockX, int a_BlockZ);
- /// Returns the name of the world
+ /** Returns the name of the world */
const AString & GetName(void) const { return m_WorldName; }
- /// Returns the name of the world.ini file used by this world
+ /** Returns the name of the world.ini file used by this world */
const AString & GetIniFileName(void) const {return m_IniFileName; }
// tolua_end
@@ -543,22 +534,23 @@ public:
if(a_Z < 0 && a_Z % cChunkDef::Width != 0) a_ChunkZ--;
}
- /// Saves all chunks immediately. Dangerous interface, may deadlock, use QueueSaveAllChunks() instead
+ /** Saves all chunks immediately. Dangerous interface, may deadlock, use QueueSaveAllChunks() instead */
void SaveAllChunks(void);
- /// Queues a task to save all chunks onto the tick thread. The prefferred way of saving chunks from external sources
+ /** Queues a task to save all chunks onto the tick thread. The prefferred way of saving chunks from external sources */
void QueueSaveAllChunks(void); // tolua_export
- /// Queues a task onto the tick thread. The task object will be deleted once the task is finished
+ /** Queues a task onto the tick thread. The task object will be deleted once the task is finished */
void QueueTask(cTask * a_Task); // Exported in ManualBindings.cpp
- // Queues a task onto the tick thread. The task object will be deleted once the task is finished
- void ScheduleTask(cScheduledTask * a_Task);
+ /** Queues a task onto the tick thread, with the specified delay.
+ The task object will be deleted once the task is finished */
+ void ScheduleTask(int a_DelayTicks, cTask * a_Task);
- /// Returns the number of chunks loaded
+ /** Returns the number of chunks loaded */
int GetNumChunks() const; // tolua_export
- /// Returns the number of chunks loaded and dirty, and in the lighting queue
+ /** Returns the number of chunks loaded and dirty, and in the lighting queue */
void GetChunkStats(int & a_NumValid, int & a_NumDirty, int & a_NumInLightingQueue);
// Various queues length queries (cannot be const, they lock their CS):
@@ -569,13 +561,13 @@ public:
void InitializeSpawn(void);
- /// Starts threads that belong to this world
+ /** Starts threads that belong to this world */
void Start(void);
- /// Stops threads that belong to this world (part of deinit)
+ /** Stops threads that belong to this world (part of deinit) */
void Stop(void);
- /// Processes the blocks queued for ticking with a delay (m_BlockTickQueue[])
+ /** Processes the blocks queued for ticking with a delay (m_BlockTickQueue[]) */
void TickQueuedBlocks(void);
struct BlockTickQueueItem
@@ -586,27 +578,27 @@ public:
int TicksToWait;
};
- /// Queues the block to be ticked after the specified number of game ticks
+ /** Queues the block to be ticked after the specified number of game ticks */
void QueueBlockForTick(int a_BlockX, int a_BlockY, int a_BlockZ, int a_TicksToWait); // tolua_export
// tolua_begin
- /// Casts a thunderbolt at the specified coords
+ /** Casts a thunderbolt at the specified coords */
void CastThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ);
- /// Sets the specified weather; resets weather interval; asks and notifies plugins of the change
+ /** Sets the specified weather; resets weather interval; asks and notifies plugins of the change */
void SetWeather (eWeather a_NewWeather);
- /// Forces a weather change in the next game tick
+ /** Forces a weather change in the next game tick */
void ChangeWeather (void);
- /// Returns the current weather. Instead of comparing values directly to the weather constants, use IsWeatherXXX() functions, if possible
+ /** Returns the current weather. Instead of comparing values directly to the weather constants, use IsWeatherXXX() functions, if possible */
eWeather GetWeather (void) const { return m_Weather; };
bool IsWeatherSunny(void) const { return (m_Weather == wSunny); }
bool IsWeatherRain (void) const { return (m_Weather == wRain); }
bool IsWeatherStorm(void) const { return (m_Weather == wStorm); }
- /// Returns true if the current weather has any precipitation - rain or storm
+ /** Returns true if the current weather has any precipitation - rain or storm */
bool IsWeatherWet (void) const { return (m_Weather != wSunny); }
// tolua_end
@@ -615,7 +607,7 @@ public:
cWorldStorage & GetStorage (void) { return m_Storage; }
cChunkMap * GetChunkMap (void) { return m_ChunkMap; }
- /// Sets the blockticking to start at the specified block. Only one blocktick per chunk may be set, second call overwrites the first call
+ /** Sets the blockticking to start at the specified block. Only one blocktick per chunk may be set, second call overwrites the first call */
void SetNextBlockTick(int a_BlockX, int a_BlockY, int a_BlockZ); // tolua_export
int GetMaxSugarcaneHeight(void) const { return m_MaxSugarcaneHeight; } // tolua_export
@@ -623,20 +615,20 @@ public:
bool IsBlockDirectlyWatered(int a_BlockX, int a_BlockY, int a_BlockZ); // tolua_export
- /// Spawns a mob of the specified type. Returns the mob's EntityID if recognized and spawned, <0 otherwise
+ /** Spawns a mob of the specified type. Returns the mob's EntityID if recognized and spawned, <0 otherwise */
int SpawnMob(double a_PosX, double a_PosY, double a_PosZ, cMonster::eType a_MonsterType); // tolua_export
int SpawnMobFinalize(cMonster* a_Monster);
- /// Creates a projectile of the specified type. Returns the projectile's EntityID if successful, <0 otherwise
+ /** Creates a projectile of the specified type. Returns the projectile's EntityID if successful, <0 otherwise */
int CreateProjectile(double a_PosX, double a_PosY, double a_PosZ, cProjectileEntity::eKind a_Kind, cEntity * a_Creator, const Vector3d * a_Speed = NULL); // tolua_export
- /// Returns a random number from the m_TickRand in range [0 .. a_Range]. To be used only in the tick thread!
+ /** Returns a random number from the m_TickRand in range [0 .. a_Range]. To be used only in the tick thread! */
int GetTickRandomNumber(unsigned a_Range) { return (int)(m_TickRand.randInt(a_Range)); }
- /// Appends all usernames starting with a_Text (case-insensitive) into Results
+ /** Appends all usernames starting with a_Text (case-insensitive) into Results */
void TabCompleteUserName(const AString & a_Text, AStringVector & a_Results);
- /// Get the current darkness level based on the time
+ /** Get the current darkness level based on the time */
NIBBLETYPE GetSkyDarkness() { return m_SkyDarkness; }
private:
@@ -679,18 +671,41 @@ private:
} ;
+ /** A container for tasks that have been scheduled for a specific game tick */
+ class cScheduledTask
+ {
+ public:
+ Int64 m_TargetTick;
+ cTask * m_Task;
+
+ /** Creates a new scheduled task; takes ownership of the task object passed to it. */
+ cScheduledTask(Int64 a_TargetTick, cTask * a_Task) :
+ m_TargetTick(a_TargetTick),
+ m_Task(a_Task)
+ {
+ }
+
+ virtual ~cScheduledTask()
+ {
+ delete m_Task;
+ }
+ };
+
+ typedef std::list cScheduledTasks;
+
+
AString m_WorldName;
AString m_IniFileName;
- /// Name of the storage schema used to load and save chunks
+ /** Name of the storage schema used to load and save chunks */
AString m_StorageSchema;
int m_StorageCompressionFactor;
- /// The dimension of the world, used by the client to provide correct lighting scheme
+ /** The dimension of the world, used by the client to provide correct lighting scheme */
eDimension m_Dimension;
- /// This random generator is to be used only in the Tick() method, and thus only in the World-Tick-thread (MTRand is not exactly thread-safe)
+ /** This random generator is to be used only in the Tick() method, and thus only in the World-Tick-thread (MTRand is not exactly thread-safe) */
MTRand m_TickRand;
bool m_IsSpawnExplicitlySet;
@@ -765,29 +780,30 @@ private:
cLightingThread m_Lighting;
cTickThread m_TickThread;
- /// Guards the m_Tasks
+ /** Guards the m_Tasks */
cCriticalSection m_CSTasks;
- /// Guards the m_ScheduledTasks
- cCriticalSection m_CSScheduledTasks;
-
- /// Tasks that have been queued onto the tick thread; guarded by m_CSTasks
+ /** Tasks that have been queued onto the tick thread; guarded by m_CSTasks */
cTasks m_Tasks;
- /// Tasks that have been queued to be executed on the tick thread at some number of ticks in
- /// the future; guarded by m_CSScheduledTasks
- ScheduledTaskList m_ScheduledTasks;
+ /** Guards the m_ScheduledTasks */
+ cCriticalSection m_CSScheduledTasks;
+
+ /** Tasks that have been queued to be executed on the tick thread at target tick in the future.
+ Ordered by increasing m_TargetTick.
+ Guarded by m_CSScheduledTasks */
+ cScheduledTasks m_ScheduledTasks;
- /// Guards m_Clients
+ /** Guards m_Clients */
cCriticalSection m_CSClients;
- /// List of clients in this world, these will be ticked by this world
+ /** List of clients in this world, these will be ticked by this world */
cClientHandleList m_Clients;
- /// Clients that are scheduled for removal (ticked in another world), waiting for TickClients() to remove them
+ /** Clients that are scheduled for removal (ticked in another world), waiting for TickClients() to remove them */
cClientHandleList m_ClientsToRemove;
- /// Clients that are scheduled for adding, waiting for TickClients to add them
+ /** Clients that are scheduled for adding, waiting for TickClients to add them */
cClientHandleList m_ClientsToAdd;
@@ -796,27 +812,27 @@ private:
void Tick(float a_Dt, int a_LastTickDurationMSec);
- /// Handles the weather in each tick
+ /** Handles the weather in each tick */
void TickWeather(float a_Dt);
- /// Handles the mob spawning/moving/destroying each tick
+ /** Handles the mob spawning/moving/destroying each tick */
void TickMobs(float a_Dt);
- /// Executes all tasks queued onto the tick thread
+ /** Executes all tasks queued onto the tick thread */
void TickQueuedTasks(void);
- /// Executes all tasks queued onto the tick thread
+ /** Executes all tasks queued onto the tick thread */
void TickScheduledTasks(void);
- /// Ticks all clients that are in this world
+ /** Ticks all clients that are in this world */
void TickClients(float a_Dt);
void UpdateSkyDarkness(void);
- /// Generates a random spawnpoint on solid land by walking chunks and finding their biomes
+ /** Generates a random spawnpoint on solid land by walking chunks and finding their biomes */
void GenerateRandomSpawn(void);
- /// Creates a new fluid simulator, loads its settings from the inifile (a_FluidName section)
+ /** Creates a new fluid simulator, loads its settings from the inifile (a_FluidName section) */
cFluidSimulator * InitializeFluidSimulator(cIniFile & a_IniFile, const char * a_FluidName, BLOCKTYPE a_SimulateBlock, BLOCKTYPE a_StationaryBlock);
}; // tolua_export
--
cgit v1.2.3
From e9e9593e6d2d7bfc89e9e56f834fb006481f18e0 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 23:50:49 +0100
Subject: APIDump: Updated cWorld:ScheduleTask()'s description.
---
MCServer/Plugins/APIDump/APIDesc.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index bf32ea8c2..c548b620c 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2087,7 +2087,7 @@ end
QueueSetBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta, TickDelay", Return = "", Notes = "Queues the block to be set to the specified blocktype and meta after the specified amount of game ticks. Uses SetBlock() for the actual setting, so simulators are woken up and block entities are handled correctly." },
QueueTask = { Params = "TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the tick thread. This is the primary means of interaction with a cWorld from the WebAdmin page handlers (see {{WebWorldThreads}}). The function signature is function() All return values from the function are ignored. Note that this function is actually called *after* the QueueTask() function returns." },
RegenerateChunk = { Params = "ChunkX, ChunkZ", Return = "", Notes = "Queues the specified chunk to be re-generated, overwriting the current data. To queue a chunk for generating only if it doesn't exist, use the GenerateChunk() instead." },
- ScheduleTask = { Params = "TaskFunction, Ticks", Return = "", Notes = "Queues the specified function to be executed in the world's tick thread after a number of ticks. This enables operations to be queued for execution in the future. The function signature is function({{cWorld|World}}) All return values from the function are ignored." },
+ ScheduleTask = { Params = "DelayTicks, TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the world's tick thread after a the specified number of ticks. This enables operations to be queued for execution in the future. The function signature is function({{cWorld|World}}) All return values from the function are ignored." },
SendBlockTo = { Params = "BlockX, BlockY, BlockZ, {{cPlayer|Player}}", Return = "", Notes = "Sends the block at the specified coords to the specified player's client, as an UpdateBlock packet." },
SetBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block at the specified coords, replaces the block entities for the previous block type, creates a new block entity for the new block, if appropriate, and wakes up the simulators. This is the preferred way to set blocks, as opposed to FastSetBlock(), which is only to be used under special circumstances." },
SetBlockMeta =
--
cgit v1.2.3
From 2407a67906c408013f05cd5878e1761608fe24f0 Mon Sep 17 00:00:00 2001
From: madmaxoft
Date: Sun, 19 Jan 2014 23:56:49 +0100
Subject: APIDump: Added notes about objects across cWorld's task execution.
---
MCServer/Plugins/APIDump/APIDesc.lua | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/MCServer/Plugins/APIDump/APIDesc.lua b/MCServer/Plugins/APIDump/APIDesc.lua
index c548b620c..347299a50 100644
--- a/MCServer/Plugins/APIDump/APIDesc.lua
+++ b/MCServer/Plugins/APIDump/APIDesc.lua
@@ -2085,9 +2085,9 @@ end
QueueBlockForTick = { Params = "BlockX, BlockY, BlockZ, TicksToWait", Return = "", Notes = "Queues the specified block to be ticked after the specified number of gameticks." },
QueueSaveAllChunks = { Params = "", Return = "", Notes = "Queues all chunks to be saved in the world storage thread" },
QueueSetBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta, TickDelay", Return = "", Notes = "Queues the block to be set to the specified blocktype and meta after the specified amount of game ticks. Uses SetBlock() for the actual setting, so simulators are woken up and block entities are handled correctly." },
- QueueTask = { Params = "TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the tick thread. This is the primary means of interaction with a cWorld from the WebAdmin page handlers (see {{WebWorldThreads}}). The function signature is function() All return values from the function are ignored. Note that this function is actually called *after* the QueueTask() function returns." },
+ QueueTask = { Params = "TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the tick thread. This is the primary means of interaction with a cWorld from the WebAdmin page handlers (see {{WebWorldThreads}}). The function signature is function() All return values from the function are ignored. Note that this function is actually called *after* the QueueTask() function returns. Note that it is unsafe to store references to MCServer objects, such as entities, across from the caller to the task handler function; store the EntityID instead." },
RegenerateChunk = { Params = "ChunkX, ChunkZ", Return = "", Notes = "Queues the specified chunk to be re-generated, overwriting the current data. To queue a chunk for generating only if it doesn't exist, use the GenerateChunk() instead." },
- ScheduleTask = { Params = "DelayTicks, TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the world's tick thread after a the specified number of ticks. This enables operations to be queued for execution in the future. The function signature is function({{cWorld|World}}) All return values from the function are ignored." },
+ ScheduleTask = { Params = "DelayTicks, TaskFunction", Return = "", Notes = "Queues the specified function to be executed in the world's tick thread after a the specified number of ticks. This enables operations to be queued for execution in the future. The function signature is function({{cWorld|World}}) All return values from the function are ignored. Note that it is unsafe to store references to MCServer objects, such as entities, across from the caller to the task handler function; store the EntityID instead." },
SendBlockTo = { Params = "BlockX, BlockY, BlockZ, {{cPlayer|Player}}", Return = "", Notes = "Sends the block at the specified coords to the specified player's client, as an UpdateBlock packet." },
SetBlock = { Params = "BlockX, BlockY, BlockZ, BlockType, BlockMeta", Return = "", Notes = "Sets the block at the specified coords, replaces the block entities for the previous block type, creates a new block entity for the new block, if appropriate, and wakes up the simulators. This is the preferred way to set blocks, as opposed to FastSetBlock(), which is only to be used under special circumstances." },
SetBlockMeta =
--
cgit v1.2.3