parent
2f0b47dbdd
commit
ea2ddf2be7
|
@ -207,6 +207,7 @@ endif()
|
||||||
find_package(GMP REQUIRED)
|
find_package(GMP REQUIRED)
|
||||||
find_package(Json REQUIRED)
|
find_package(Json REQUIRED)
|
||||||
find_package(Lua REQUIRED)
|
find_package(Lua REQUIRED)
|
||||||
|
add_subdirectory(lib/luautf8)
|
||||||
|
|
||||||
# JsonCPP doesn't compile well on GCC 4.8
|
# JsonCPP doesn't compile well on GCC 4.8
|
||||||
if(NOT ENABLE_SYSTEM_JSONCPP)
|
if(NOT ENABLE_SYSTEM_JSONCPP)
|
||||||
|
|
22
LICENSE.txt
22
LICENSE.txt
|
@ -145,6 +145,28 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
THE SOFTWARE.
|
THE SOFTWARE.
|
||||||
|
|
||||||
|
luautf8
|
||||||
|
---------------
|
||||||
|
Copyright (c) 2018 Xavier Wang
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
|
|
||||||
Fonts
|
Fonts
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
|
|
|
@ -231,6 +231,9 @@ LOCAL_SRC_FILES += ../../../lib/gmp/mini-gmp.c
|
||||||
# JSONCPP
|
# JSONCPP
|
||||||
LOCAL_SRC_FILES += ../../../lib/jsoncpp/jsoncpp.cpp
|
LOCAL_SRC_FILES += ../../../lib/jsoncpp/jsoncpp.cpp
|
||||||
|
|
||||||
|
# Lua UTF-8 Lib
|
||||||
|
LOCAL_SRC_FILES += ../../../lib/luautf8/lutf8lib.c
|
||||||
|
|
||||||
LOCAL_STATIC_LIBRARIES += Curl Gettext Freetype Irrlicht LevelDB OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT android_native_app_glue $(PROFILER_LIBS)
|
LOCAL_STATIC_LIBRARIES += Curl Gettext Freetype Irrlicht LevelDB OpenAL mbedTLS mbedx509 mbedcrypto Vorbis LuaJIT android_native_app_glue $(PROFILER_LIBS)
|
||||||
|
|
||||||
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
|
LOCAL_LDLIBS := -lEGL -lGLESv1_CM -lGLESv2 -landroid -lOpenSLES
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
add_library(luautf8 STATIC lutf8lib.c)
|
||||||
|
target_include_directories(luautf8 PUBLIC ${LUA_INCLUDE_DIR})
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -568,6 +568,7 @@ if(BUILD_CLIENT)
|
||||||
${JSON_LIBRARY}
|
${JSON_LIBRARY}
|
||||||
${PLATFORM_LIBS}
|
${PLATFORM_LIBS}
|
||||||
${CLIENT_PLATFORM_LIBS}
|
${CLIENT_PLATFORM_LIBS}
|
||||||
|
luautf8
|
||||||
)
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
${client_LIBS}
|
${client_LIBS}
|
||||||
|
@ -640,6 +641,7 @@ if(BUILD_SERVER)
|
||||||
${LUA_LIBRARY}
|
${LUA_LIBRARY}
|
||||||
${GMP_LIBRARY}
|
${GMP_LIBRARY}
|
||||||
${PLATFORM_LIBS}
|
${PLATFORM_LIBS}
|
||||||
|
luautf8
|
||||||
)
|
)
|
||||||
set_target_properties(${PROJECT_NAME}server PROPERTIES
|
set_target_properties(${PROJECT_NAME}server PROPERTIES
|
||||||
COMPILE_DEFINITIONS "SERVER")
|
COMPILE_DEFINITIONS "SERVER")
|
||||||
|
|
|
@ -38,6 +38,7 @@ extern "C" {
|
||||||
#if USE_LUAJIT
|
#if USE_LUAJIT
|
||||||
#include "luajit.h"
|
#include "luajit.h"
|
||||||
#endif
|
#endif
|
||||||
|
LUALIB_API int luaopen_utf8(lua_State *L);
|
||||||
}
|
}
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
@ -88,6 +89,9 @@ ScriptApiBase::ScriptApiBase(ScriptingType type):
|
||||||
else
|
else
|
||||||
luaL_openlibs(m_luastack);
|
luaL_openlibs(m_luastack);
|
||||||
|
|
||||||
|
lua_pushcfunction(m_luastack, luaopen_utf8);
|
||||||
|
lua_call(m_luastack, 0, 0);
|
||||||
|
|
||||||
// Make the ScriptApiBase* accessible to ModApiBase
|
// Make the ScriptApiBase* accessible to ModApiBase
|
||||||
#if INDIRECT_SCRIPTAPI_RIDX
|
#if INDIRECT_SCRIPTAPI_RIDX
|
||||||
*(void **)(lua_newuserdata(m_luastack, sizeof(void *))) = this;
|
*(void **)(lua_newuserdata(m_luastack, sizeof(void *))) = this;
|
||||||
|
|
|
@ -89,6 +89,7 @@ void ScriptApiSecurity::initializeSecurity()
|
||||||
"string",
|
"string",
|
||||||
"table",
|
"table",
|
||||||
"math",
|
"math",
|
||||||
|
"utf8",
|
||||||
};
|
};
|
||||||
static const char *io_whitelist[] = {
|
static const char *io_whitelist[] = {
|
||||||
"close",
|
"close",
|
||||||
|
@ -258,6 +259,7 @@ void ScriptApiSecurity::initializeSecurityClient()
|
||||||
"string",
|
"string",
|
||||||
"table",
|
"table",
|
||||||
"math",
|
"math",
|
||||||
|
"utf8",
|
||||||
};
|
};
|
||||||
static const char *os_whitelist[] = {
|
static const char *os_whitelist[] = {
|
||||||
"clock",
|
"clock",
|
||||||
|
@ -808,4 +810,3 @@ int ScriptApiSecurity::sl_os_remove(lua_State *L)
|
||||||
lua_call(L, 1, 2);
|
lua_call(L, 1, 2);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue