From 5380234aaab763cb7de3b16e760f749315a3aab3 Mon Sep 17 00:00:00 2001 From: salix5 Date: Fri, 18 Oct 2024 19:41:52 +0800 Subject: [PATCH] ocgapi change: preload_script (#642) --- README.md | 2 +- ocgapi.cpp | 4 ++-- ocgapi.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 69e6f9eb5..0afcf745f 100644 --- a/README.md +++ b/README.md @@ -60,7 +60,7 @@ Get all cards in some location. - `void set_responseb(intptr_t pduel, byte* buf);` -- `int32 preload_script(intptr_t pduel, const char* script, int32 len);` +- `int32 preload_script(intptr_t pduel, const char* script_name);` # Lua functions diff --git a/ocgapi.cpp b/ocgapi.cpp index 56be88c2d..e079fe2f6 100644 --- a/ocgapi.cpp +++ b/ocgapi.cpp @@ -347,6 +347,6 @@ extern "C" DECL_DLLEXPORT void set_responsei(intptr_t pduel, int32 value) { extern "C" DECL_DLLEXPORT void set_responseb(intptr_t pduel, byte* buf) { ((duel*)pduel)->set_responseb(buf); } -extern "C" DECL_DLLEXPORT int32 preload_script(intptr_t pduel, const char* script, int32 len) { - return ((duel*)pduel)->lua->load_script(script); +extern "C" DECL_DLLEXPORT int32 preload_script(intptr_t pduel, const char* script_name) { + return ((duel*)pduel)->lua->load_script(script_name); } diff --git a/ocgapi.h b/ocgapi.h index db2302890..6d58eafd3 100644 --- a/ocgapi.h +++ b/ocgapi.h @@ -53,7 +53,7 @@ extern "C" DECL_DLLEXPORT int32 query_field_card(intptr_t pduel, uint8 playerid, extern "C" DECL_DLLEXPORT int32 query_field_info(intptr_t pduel, byte* buf); extern "C" DECL_DLLEXPORT void set_responsei(intptr_t pduel, int32 value); extern "C" DECL_DLLEXPORT void set_responseb(intptr_t pduel, byte* buf); -extern "C" DECL_DLLEXPORT int32 preload_script(intptr_t pduel, const char* script, int32 len); +extern "C" DECL_DLLEXPORT int32 preload_script(intptr_t pduel, const char* script_name); byte* default_script_reader(const char* script_name, int* len); uint32 default_card_reader(uint32 code, card_data* data); uint32 default_message_handler(intptr_t pduel, uint32 msg_type);