1
0
Fork 0

Just a quick update for the files you need to compile for Android.

This commit is contained in:
STRWarrior 2013-12-23 16:56:21 +01:00
parent 5af74fe77c
commit 1bd1696ceb
2 changed files with 20 additions and 20 deletions

View File

@ -5,7 +5,7 @@ LOCAL_MODULE := mcserver
LOCAL_SRC_FILES := $(shell find ../CryptoPP ../lua-5.1.4 ../jsoncpp-src-0.5.0 ../zlib-1.2.7 ../source ../squirrel_3_0_1_stable ../tolua++-1.0.93 ../iniFile ../WebServer ../expat '(' -name '*.cpp' -o -name '*.c' ')')
LOCAL_SRC_FILES := $(shell find ../CryptoPP ../lua ../jsoncpp ../zlib ../src ../tolua++ ../iniFile ../expat ../md5 ../sqlite ../luaexpat '(' -name '*.cpp' -o -name '*.c' ')')
LOCAL_SRC_FILES := $(filter-out %SquirrelFunctions.cpp %SquirrelBindings.cpp %cPlugin_Squirrel.cpp %cSquirrelCommandBinder.cpp %minigzip.c %lua.c %tolua.c %toluabind.c %LeakFinder.cpp %StackWalker.cpp %example.c,$(LOCAL_SRC_FILES))
LOCAL_SRC_FILES := $(patsubst %.cpp,../%.cpp,$(LOCAL_SRC_FILES))
LOCAL_SRC_FILES := $(patsubst %.c,../%.c,$(LOCAL_SRC_FILES))
@ -20,23 +20,21 @@ LOCAL_CFLAGS := -DANDROID_NDK \
LOCAL_STATIC_LIBRARIES := cpufeatures
LOCAL_C_INCLUDES := ../source \
../source/md5 \
../WebServer \
../source/packets \
../source/items \
../source/blocks \
../tolua++-1.0.93/src/lib \
../lua-5.1.4/src \
LOCAL_C_INCLUDES := ../src \
../src/packets \
../src/items \
../src/blocks \
../tolua++/src/lib \
../lua/src \
../zlib-1.2.7 \
../iniFile \
../tolua++-1.0.93/include \
../jsoncpp-src-0.5.0/include \
../jsoncpp-src-0.5.0/src/lib_json \
../squirrel_3_0_1_stable/include \
../squirrel_3_0_1_stable \
../squirrel_3_0_1_stable/sqrat \
../tolua++/include \
../jsoncpp/include \
../jsoncpp/src/lib_json \
../expat/ \
../md5/ \
../sqlite/ \
../luaexpat/ \
.. \

View File

@ -11,8 +11,9 @@
#include <assert.h>
#include "OSSupport/CriticalSection.h"
#include "OSSupport/MakeDir.h"
#include "OSSupport/File.h"
#include "ToJava.h"
#include "inifile/iniFile.h"
#include "Root.h"
#include "WebAdmin.h"
@ -84,7 +85,7 @@ extern "C" void Java_com_mcserver_MCServerActivity_NativeOnCreate( JNIEnv* env,
//__android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "Logging from C++!");
g_CriticalSection.Unlock();
mkdir("/sdcard/mcserver", S_IRWXU | S_IRWXG | S_IRWXO);
cFile::CreateFolder("/sdcard/mcserver");
pRoot = new cRoot();
pRoot->Start();
@ -105,7 +106,7 @@ extern "C" void Java_com_mcserver_MCServerActivity_NativeCleanUp( JNIEnv* env,
__android_log_print(ANDROID_LOG_ERROR,"MCServer", "pRoot: %p", pRoot);
if( pRoot != NULL )
{
pRoot->ExecuteConsoleCommand("stop");
pRoot->QueueExecuteConsoleCommand("stop");
}
}
@ -122,9 +123,10 @@ extern "C" jboolean Java_com_mcserver_MCServerActivity_NativeIsServerRunning( JN
extern "C" jint Java_com_mcserver_MCServerActivity_NativeGetWebAdminPort( JNIEnv* env, jobject thiz )
{
if( pRoot != NULL && pRoot->GetWebAdmin() != NULL )
cIniFile IniFile;
if (IniFile.ReadFile("/sdcard/mcserver/webadmin.ini"))
{
return pRoot->GetWebAdmin()->GetPort();
return IniFile.GetValueI("WebAdmin", "Port");
}
return 0;
}