Skip to content

Commit

Permalink
Merge branch 'main' into release-0.25
Browse files Browse the repository at this point in the history
  • Loading branch information
MihailRis committed Dec 4, 2024
2 parents f0a07cb + 36edad0 commit 93bf360
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/en/scripting/builtins/libnetwork.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The Socket class has the following methods:

```lua
-- Sends a byte array
socket:send(table|ByteArray)
socket:send(table|ByteArray|str)

-- Reads the received data
socket:recv(
Expand Down
2 changes: 1 addition & 1 deletion doc/ru/scripting/builtins/libnetwork.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ network.tcp_connect(

```lua
-- Отправляет массив байт
socket:send(table|ByteArray)
socket:send(table|ByteArray|str)

-- Читает полученные данные
socket:recv(
Expand Down
3 changes: 3 additions & 0 deletions src/logic/scripting/lua/libs/libnetwork.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ static int l_send(lua::State* L) {
connection->send(
reinterpret_cast<char*>(bytes->data().data()), bytes->data().size()
);
} else if (lua::isstring(L, 2)) {
auto string = lua::tolstring(L, 2);
connection->send(string.data(), string.length());
}
return 0;
}
Expand Down

0 comments on commit 93bf360

Please sign in to comment.