summaryrefslogtreecommitdiffstats
path: root/Android/jni/app-android.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2013-12-23 16:56:21 +0100
committerSTRWarrior <niels.breuker@hotmail.nl>2013-12-23 16:56:21 +0100
commit1bd1696cebd6157261f32c3e8bdecf5914312c22 (patch)
tree20c6d72172aa406ffbf722dc03caff155cd65ada /Android/jni/app-android.cpp
parentFixed bug where snowgolems could replace non-solid blocks to snow blocks. (diff)
downloadcuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.tar
cuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.tar.gz
cuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.tar.bz2
cuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.tar.lz
cuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.tar.xz
cuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.tar.zst
cuberite-1bd1696cebd6157261f32c3e8bdecf5914312c22.zip
Diffstat (limited to '')
-rw-r--r--Android/jni/app-android.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/Android/jni/app-android.cpp b/Android/jni/app-android.cpp
index 197df29c4..40009c77c 100644
--- a/Android/jni/app-android.cpp
+++ b/Android/jni/app-android.cpp
@@ -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;
} \ No newline at end of file