Android: Made the initial pre-calculated spawn area smaller
Android: Fixed FastNBT Android: Fixed level.dat reading/writing GroupManager uses groups.example.ini as default WebAdmin uses webadmin.example.ini as default git-svn-id: http://mc-server.googlecode.com/svn/trunk@1049 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
b65a22fc1f
commit
8ad7747902
@ -39,8 +39,15 @@ cGroupManager::cGroupManager()
|
|||||||
{
|
{
|
||||||
LOG("-- Loading Groups --");
|
LOG("-- Loading Groups --");
|
||||||
cIniFile IniFile("groups.ini");
|
cIniFile IniFile("groups.ini");
|
||||||
if( IniFile.ReadFile() )
|
if (!IniFile.ReadFile())
|
||||||
{
|
{
|
||||||
|
LOGINFO("groups.ini inaccessible, using groups.example.ini for defaults!");
|
||||||
|
IniFile.Path("groups.example.ini");
|
||||||
|
IniFile.ReadFile();
|
||||||
|
IniFile.Path("groups.ini");
|
||||||
|
IniFile.WriteFile();
|
||||||
|
}
|
||||||
|
|
||||||
unsigned int NumKeys = IniFile.GetNumKeys();
|
unsigned int NumKeys = IniFile.GetNumKeys();
|
||||||
for( unsigned int i = 0; i < NumKeys; i++ )
|
for( unsigned int i = 0; i < NumKeys; i++ )
|
||||||
{
|
{
|
||||||
@ -88,7 +95,6 @@ cGroupManager::cGroupManager()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
LOG("-- Done Loading Groups --");
|
LOG("-- Done Loading Groups --");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,14 +125,20 @@ void cRoot::Start(void)
|
|||||||
IniFile.WriteFile();
|
IniFile.WriteFile();
|
||||||
|
|
||||||
cIniFile WebIniFile("webadmin.ini");
|
cIniFile WebIniFile("webadmin.ini");
|
||||||
if( WebIniFile.ReadFile() )
|
if (!WebIniFile.ReadFile())
|
||||||
{
|
{
|
||||||
|
LOGINFO("webadmin.ini inaccessible, using webadmin.example.ini for defaults!");
|
||||||
|
WebIniFile.Path("webadmin.example.ini");
|
||||||
|
WebIniFile.ReadFile();
|
||||||
|
WebIniFile.Path("webadmin.ini");
|
||||||
|
WebIniFile.WriteFile();
|
||||||
|
}
|
||||||
|
|
||||||
if (WebIniFile.GetValueB("WebAdmin", "Enabled", false ))
|
if (WebIniFile.GetValueB("WebAdmin", "Enabled", false ))
|
||||||
{
|
{
|
||||||
LOG("Creating WebAdmin...");
|
LOG("Creating WebAdmin...");
|
||||||
m_WebAdmin = new cWebAdmin(8080);
|
m_WebAdmin = new cWebAdmin(8080);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
LOG("Loading settings...");
|
LOG("Loading settings...");
|
||||||
m_GroupManager = new cGroupManager();
|
m_GroupManager = new cGroupManager();
|
||||||
|
@ -366,7 +366,7 @@ void cWorld::InitializeSpawn(void)
|
|||||||
BlockToChunk( (int)m_SpawnX, (int)m_SpawnY, (int)m_SpawnZ, ChunkX, ChunkY, ChunkZ );
|
BlockToChunk( (int)m_SpawnX, (int)m_SpawnY, (int)m_SpawnZ, ChunkX, ChunkY, ChunkZ );
|
||||||
|
|
||||||
// For the debugging builds, don't make the server build too much world upon start:
|
// For the debugging builds, don't make the server build too much world upon start:
|
||||||
#ifdef _DEBUG
|
#if defined(_DEBUG) || defined(ANDROID_NDK)
|
||||||
int ViewDist = 9;
|
int ViewDist = 9;
|
||||||
#else
|
#else
|
||||||
int ViewDist = 20; // Always prepare an area 20 chunks across, no matter what the actual cClientHandle::VIEWDISTANCE is
|
int ViewDist = 20; // Always prepare an area 20 chunks across, no matter what the actual cClientHandle::VIEWDISTANCE is
|
||||||
|
@ -503,17 +503,26 @@ void cFastNBTWriter::AddIntArray(const AString & a_Name, const int * a_Value, si
|
|||||||
TagCommon(a_Name, TAG_IntArray);
|
TagCommon(a_Name, TAG_IntArray);
|
||||||
Int32 len = htonl(a_NumElements);
|
Int32 len = htonl(a_NumElements);
|
||||||
m_Result.append((const char *)&len, 4);
|
m_Result.append((const char *)&len, 4);
|
||||||
|
#if defined(ANDROID_NDK)
|
||||||
|
for (size_t i = 0; i < a_NumElements; i++)
|
||||||
|
{
|
||||||
|
int Element = htonl(a_Value[i]);
|
||||||
|
m_Result.append((const char *)&Element, 4);
|
||||||
|
}
|
||||||
|
#else
|
||||||
int * Elements = (int *)(m_Result.data() + m_Result.size());
|
int * Elements = (int *)(m_Result.data() + m_Result.size());
|
||||||
m_Result.append(a_NumElements * 4, (char)0);
|
m_Result.append(a_NumElements * 4, (char)0);
|
||||||
for (size_t i = 0; i < a_NumElements; i++)
|
for (size_t i = 0; i < a_NumElements; i++)
|
||||||
{
|
{
|
||||||
Elements[i] = htonl(a_Value[i]);
|
Elements[i] = htonl(a_Value[i]);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cFastNBTWriter::Finish(void)
|
void cFastNBTWriter::Finish(void)
|
||||||
{
|
{
|
||||||
ASSERT(m_CurrentStack == 0);
|
ASSERT(m_CurrentStack == 0);
|
||||||
|
@ -272,7 +272,7 @@ cWSSAnvil::cWSSAnvil(cWorld * a_World) :
|
|||||||
ASSERT(TestParse.IsValid());
|
ASSERT(TestParse.IsValid());
|
||||||
#endif // _DEBUG
|
#endif // _DEBUG
|
||||||
|
|
||||||
gzFile gz = gzopen(fnam.c_str(), "wb");
|
gzFile gz = gzopen((FILE_IO_PREFIX + fnam).c_str(), "wb");
|
||||||
if (gz != NULL)
|
if (gz != NULL)
|
||||||
{
|
{
|
||||||
gzwrite(gz, Writer.GetResult().data(), Writer.GetResult().size());
|
gzwrite(gz, Writer.GetResult().data(), Writer.GetResult().size());
|
||||||
|
Loading…
Reference in New Issue
Block a user