summaryrefslogtreecommitdiffstats
path: root/jni
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-16 22:28:14 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-16 22:28:14 +0200
commit33ca4d5003059d7d1f4b9e29649693ec0e5be262 (patch)
tree7bfb4ec7c1d3fcc46c341406667033ec051f010c /jni
parentWindows compilation fix after Android changes (diff)
downloadcuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.gz
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.bz2
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.lz
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.xz
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.zst
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.zip
Diffstat (limited to 'jni')
-rw-r--r--jni/app-android.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/jni/app-android.cpp b/jni/app-android.cpp
index d874f0fb0..d02947440 100644
--- a/jni/app-android.cpp
+++ b/jni/app-android.cpp
@@ -12,6 +12,7 @@
#include "cCriticalSection.h"
#include "cRoot.h"
+#include "cMakeDir.h"
#include <android/log.h>
@@ -20,17 +21,22 @@ cCriticalSection g_CriticalSection;
JNIEnv* g_CurrentJNIEnv = 0;
jobject g_JavaRenderer = 0;
+cRoot * pRoot = NULL;
+
/* Called when program/activity is created */
extern "C" void Java_com_mcserver_MainThread_NativeOnCreate( JNIEnv* env )
{
g_CriticalSection.Lock();
g_CurrentJNIEnv = env;
//if( !cLogger::GetSingletonPtr() ) new cLogger();
- __android_log_print(ANDROID_LOG_ERROR,"Arashi", "%s", "Logging from C++!");
+ __android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "Logging from C++!");
g_CriticalSection.Unlock();
- cRoot Root;
- Root.Start();
+ mkdir("/sdcard/mcserver", S_IRWXU | S_IRWXG | S_IRWXO);
+
+ pRoot = new cRoot();
+ pRoot->Start();
+ delete pRoot;
}
extern "C" void Java_com_mcserver_MCServerActivity_NativeCleanUp( JNIEnv* env )
@@ -39,6 +45,8 @@ extern "C" void Java_com_mcserver_MCServerActivity_NativeCleanUp( JNIEnv* env )
g_CurrentJNIEnv = env;
g_CriticalSection.Unlock();
+
+ pRoot->ServerCommand("stop");
}
/* Call to initialize the graphics state */