Skip to content

Commit

Permalink
Add websocket luabindings
Browse files Browse the repository at this point in the history
  • Loading branch information
halx99 committed Dec 31, 2023
1 parent a85ef10 commit e186067
Show file tree
Hide file tree
Showing 5 changed files with 523 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/network/WebSocket.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
# include <memory> // for std::shared_ptr
# include <atomic>
# include <condition_variable>
# include <future>

# include "platform/PlatformMacros.h"
# include "platform/StdC.h"
Expand Down Expand Up @@ -250,7 +251,7 @@ class AX_DLL WebSocket
bool open(Delegate* delegate,
std::string_view url,
std::string_view caFilePath = "",
const char* protocols = nullptr);
const char* protocols = nullptr);

/**
* @brief Sends string data to websocket server.
Expand Down
1 change: 1 addition & 0 deletions extensions/scripting/lua-bindings/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ set(lua_bindings_manual_files
manual/network/axlua_network_manual.cpp
manual/network/lua_xml_http_request.cpp
manual/network/lua_downloader.cpp
manual/network/lua_websocket.cpp
manual/spine/axlua_spine_manual.cpp
manual/spine/LuaSkeletonAnimation.cpp
manual/ui/axlua_ui_manual.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
****************************************************************************/
#include "scripting/lua-bindings/manual/network/axlua_network_manual.h"
#include "scripting/lua-bindings/manual/network/lua_xml_http_request.h"
#include "scripting/lua-bindings/manual/network/lua_websocket.h"
#include "scripting/lua-bindings/manual/network/lua_downloader.h"
#include "scripting/lua-bindings/manual/LuaEngine.h"

Expand All @@ -32,6 +33,9 @@ int register_network_module(lua_State* L)
lua_getglobal(L, "_G");
if (lua_istable(L, -1)) // stack:...,_G,
{
tolua_web_socket_open(L);
register_web_socket_manual(L);

register_xml_http_request(L);
register_downloader(L);
}
Expand Down
Loading

0 comments on commit e186067

Please sign in to comment.