summaryrefslogtreecommitdiffstats
path: root/Android/jni/app-android.cpp
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-30 18:37:44 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-09-30 18:37:44 +0200
commitba2a9b6b2c1519563662a6a1147a82f96afb36dc (patch)
treef176e14fa7afa14a3e598350779bcb755b9d0339 /Android/jni/app-android.cpp
parentFixed initial player head rotation when a player is being spawned on another client (diff)
downloadcuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.tar
cuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.tar.gz
cuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.tar.bz2
cuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.tar.lz
cuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.tar.xz
cuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.tar.zst
cuberite-ba2a9b6b2c1519563662a6a1147a82f96afb36dc.zip
Diffstat (limited to '')
-rw-r--r--Android/jni/app-android.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/Android/jni/app-android.cpp b/Android/jni/app-android.cpp
index d90374225..0e288a2b2 100644
--- a/Android/jni/app-android.cpp
+++ b/Android/jni/app-android.cpp
@@ -15,9 +15,18 @@
#include "ToJava.h"
#include "Root.h"
+#include "WebAdmin.h"
#include <android/log.h>
+#ifdef _WIN32 // For IntelliSense parsing
+typedef void jobject;
+typedef int jint;
+typedef bool jboolean;
+typedef void JavaVM;
+typedef void JNIEnv;
+#endif
+
cCriticalSection g_CriticalSection;
JNIEnv* g_CurrentJNIEnv = 0;
@@ -61,7 +70,7 @@ cMainThread * pMainThread = NULL;
jint JNI_OnLoad(JavaVM* vm, void* reserved)
{
- __android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "JNI_OnLoad JNI_OnLoad JNI_OnLoad JNI_OnLoad");
+ //__android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "JNI_OnLoad JNI_OnLoad JNI_OnLoad JNI_OnLoad");
g_JavaVM = vm;
return JNI_VERSION_1_4;
}
@@ -72,20 +81,11 @@ extern "C" void Java_com_mcserver_MCServerActivity_NativeOnCreate( JNIEnv* env,
g_CriticalSection.Lock();
g_CurrentJNIEnv = env;
g_JavaThread = thiz;
- //if( !cLogger::GetSingletonPtr() ) new cLogger();
- __android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "Logging from C++!");
+ //__android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "Logging from C++!");
g_CriticalSection.Unlock();
-
- //CallJavaFunction_Void_Void(g_JavaActivity, "TestTest" );
- //CallJavaFunction_Void_String(g_JavaThread, "AddToLog", "herpderpderp!!" );
mkdir("/sdcard/mcserver", S_IRWXU | S_IRWXG | S_IRWXO);
-// __android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "Before mainthread");
-// pMainThread = new cMainThread();
-// pMainThread->Start();
-// __android_log_print(ANDROID_LOG_ERROR,"MCServer", "%s", "AFter mainthread");
-
pRoot = new cRoot();
pRoot->Start();
delete pRoot; pRoot = NULL;
@@ -107,8 +107,6 @@ extern "C" void Java_com_mcserver_MCServerActivity_NativeCleanUp( JNIEnv* env,
{
pRoot->ServerCommand("stop");
}
-// pMainThread->Stop();
-// delete pMainThread; pMainThread = NULL;
}
@@ -117,4 +115,16 @@ extern "C" void Java_com_mcserver_MCServerActivity_NativeCleanUp( JNIEnv* env,
extern "C" jboolean Java_com_mcserver_MCServerActivity_NativeIsServerRunning( JNIEnv* env, jobject thiz )
{
return pRoot != NULL;
+}
+
+
+
+
+extern "C" jint Java_com_mcserver_MCServerActivity_NativeGetWebAdminPort( JNIEnv* env, jobject thiz )
+{
+ if( pRoot != NULL && pRoot->GetWebAdmin() != NULL )
+ {
+ return pRoot->GetWebAdmin()->GetPort();
+ }
+ return 0;
} \ No newline at end of file