mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-11-21 01:49:44 +00:00
Merge branch 'main' into dev
This commit is contained in:
commit
b14fa9bde8
11 changed files with 84 additions and 9 deletions
|
|
@ -266,8 +266,10 @@ static int l_peek(lua::State* L, network::Network& network) {
|
|||
static int l_available(lua::State* L, network::Network& network) {
|
||||
u64id_t id = lua::tointeger(L, 1);
|
||||
|
||||
if (auto connection = network.getConnection(id, false)) {
|
||||
return lua::pushinteger(L, dynamic_cast<network::TcpConnection*>(connection)->available());
|
||||
if (auto connection = dynamic_cast<network::ReadableConnection*>(
|
||||
network.getConnection(id, false)
|
||||
)) {
|
||||
return lua::pushinteger(L, connection->available());
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -196,6 +196,10 @@ void lua::init_state(State* L, StateType stateType) {
|
|||
if (stateType == StateType::GENERATOR) {
|
||||
pushnil(L);
|
||||
setglobal(L, "ffi");
|
||||
|
||||
static const char* removed_debug[] {
|
||||
"getregistry", "getupvalue", "setupvalue", "getinfo", nullptr};
|
||||
remove_lib_funcs(L, "debug", removed_debug);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue