Skip to content

Commit

Permalink
近期BUG修复
Browse files Browse the repository at this point in the history
1、lua回退5.4.6
2、修复sqlite的BUG
3、支持windows下控制显示中文
  • Loading branch information
xiyoo0812 committed Apr 19, 2024
1 parent 2b61945 commit e6fa075
Show file tree
Hide file tree
Showing 57 changed files with 1,494 additions and 2,418 deletions.
1 change: 1 addition & 0 deletions core/luabus/src/socket_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ int derive_port(int port){
while (try_cnt-- > 0) {
addr.sin_port = htons(port);
if (::bind(fd, (sockaddr*)&addr, sizeof(sockaddr_in)) != SOCKET_ERROR) {
closesocket(fd);
return port;
}
port++;
Expand Down
2 changes: 0 additions & 2 deletions core/quanta/src/execute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
int main(int argc, const char* argv[])
{
init_quanta(argv[1], argv[2]);
const char* data = call_quanta("get_world_addr");
printf("============================: %s\n", data);
while (true) {
if(run_quanta() != 0) break;
}
Expand Down
7 changes: 7 additions & 0 deletions core/quanta/src/mainlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,13 @@ QUANTA_API const char* call_quanta(const char* func) {
return "";
}

QUANTA_API void stop_quanta() {
if (q_app) {
delete q_app;
q_app = nullptr;
}
}

QUANTA_API int run_quanta() {
if (q_app) {;
if (!q_app->step()) {
Expand Down
1 change: 1 addition & 0 deletions core/quanta/src/mainlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ extern "C" {
#endif

QUANTA_API int run_quanta();
QUANTA_API void stop_quanta();
QUANTA_API int init_quanta(const char* zfile, const char* fconf);
QUANTA_API const char* call_quanta(const char* func);

Expand Down
3 changes: 3 additions & 0 deletions core/quanta/src/quanta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,9 @@ luakit::lua_table quanta_app::init() {
const char* env_service = get_env("QUANTA_SERVICE");
logger::get_logger()->option(env_log_path, env_service, env_index);
}
#ifdef WIN32
m_lua.run_script("os.setlocale('.UTF8')");
#endif
m_lua.run_script(fmt::format("require '{}'", get_env("QUANTA_SANDBOX")), [&](std::string_view err) {
exception_handler("load sandbox err: {}", err);
});
Expand Down
Loading

0 comments on commit e6fa075

Please sign in to comment.