Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve: convert NetworkMessage and Combat to shared_ptr #1627

Merged
merged 71 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
4a31b83
improve: migrate Thing and derivatives to shared_ptr
luan Sep 11, 2023
f3b06f8
improve: remove manual ref counts
luan Sep 12, 2023
d5c4f58
fix: cylinder parent circular reference
luan Sep 12, 2023
60e4ffe
fix: weak ptrs for creature factions
luan Sep 13, 2023
9e2c591
fix: registerSharedClass
luan Sep 13, 2023
c40b919
improve: remove spurious helper function
luan Sep 13, 2023
191e655
fix: push shared pointer to lua correctly
luan Sep 13, 2023
f1b6ac8
fix: copy args before invoking callbacks
luan Sep 13, 2023
6367f1d
fix: pass itemvector to const reference
dudantas Sep 14, 2023
19f57a3
fix: house door text
luan Sep 15, 2023
f8709b1
improve: correctly handle ptrs in Creature
luan Sep 16, 2023
7c4f78c
improve: turn summons into weak_ptr
luan Sep 16, 2023
088bc83
improve: more weak_ptrs
luan Sep 16, 2023
c730714
fix: missing tile
luan Sep 16, 2023
617e4bb
improve: check parent on decay
luan Sep 17, 2023
0313923
improve: only decay valid items
luan Sep 17, 2023
5fabf2e
fix: spell combats
luan Sep 17, 2023
bbe1f90
improve: move summons back to shared with more efficient data strctures
luan Sep 17, 2023
acd4cd4
improve: zone ptrs
luan Sep 17, 2023
e4bd0cf
improve: revert decay to shared_ptr
luan Sep 17, 2023
abdff84
improve: revert party to shared_ptr
luan Sep 17, 2023
3e729b2
improve: more careful weak_ptrs in npc
luan Sep 17, 2023
f60e286
improve: use const refs for player where appropriate
luan Sep 17, 2023
b882ae7
Code format - (Clang-format)
github-actions[bot] Sep 17, 2023
499c7a2
fix: check if summon exists
luan Sep 17, 2023
239a7c8
fix: check if summon exists
luan Sep 17, 2023
1496737
fix: decay semantics
luan Sep 18, 2023
474903d
fix: cancel decay properly
luan Sep 19, 2023
16295ee
fix: track summons properly
luan Sep 19, 2023
760fb2d
Revert "improve: use const refs for player where appropriate"
luan Sep 19, 2023
bc417b1
fix: use fewer auto refs
luan Sep 19, 2023
799c943
fix: bank ptr
luan Sep 19, 2023
2af0824
fix: check nullptr pointer "Party::getLeader()"
dudantas Sep 20, 2023
adb6978
fix: compilation (conflict error)
dudantas Sep 20, 2023
2c79115
feat: collectGarbage method
mehah Sep 20, 2023
f96aa56
collectGarbage on shutdown
mehah Sep 20, 2023
46761c5
feat: call LUA_GC every 10min
mehah Sep 21, 2023
5df0b04
free child ptr when destroying qtreenode
luan Sep 21, 2023
60fd43f
improve: move Party/PartyAnalyzer to smart ptrs
luan Sep 21, 2023
ff4321a
improve: move Condition to smart ptrs
luan Sep 21, 2023
2bbb58b
rewrite enableCompression
mehah Sep 21, 2023
74ec60d
operator new to make_unique
mehah Sep 21, 2023
44c4a5b
AreaCombat to unique_ptr
mehah Sep 21, 2023
f8914e5
AreaCombat and MatrixArea to unique_ptr
mehah Sep 22, 2023
aad6e20
PreySlot to unique_ptr
mehah Sep 22, 2023
b2c1821
Code format - (Clang-format)
github-actions[bot] Sep 22, 2023
89b12a6
fix: crash when starting a party
luan Sep 22, 2023
3d55d1b
TaskHuntingSlot and TaskHuntingOption to unique_ptr
mehah Sep 22, 2023
859b7ef
Merge branch 'luan/main/shared-ptr-thing' of https://github.com/luan/…
mehah Sep 22, 2023
87cf03e
TeamFinder to unique_ptr
mehah Sep 22, 2023
acc87b3
smallfix
mehah Sep 22, 2023
0191a3d
fix: check spectator get player nullptr
dudantas Sep 22, 2023
88a5f47
fix: z_stream memory leak
mehah Sep 22, 2023
638a7ad
Merge branch 'luan/main/shared-ptr-thing' of https://github.com/luan/…
mehah Sep 22, 2023
d28646d
SpawnNpc to smart pointer
mehah Sep 22, 2023
d2ab35f
SpawnNpc to smart pointer
mehah Sep 22, 2023
d40ee19
Update npc_type_functions.hpp
mehah Sep 22, 2023
363e902
shop to smart pointer
mehah Sep 22, 2023
4bd1f43
town to smart pointer
mehah Sep 22, 2023
0d5365a
registerSharedClass combat
mehah Sep 22, 2023
2aaf42f
house to smart pointer
mehah Sep 22, 2023
fdbc918
NetworkMessage to smart pointer
mehah Sep 22, 2023
c084e22
Revert "NetworkMessage to smart pointer"
mehah Sep 22, 2023
6cb2332
ModalWindow to smart pointer
mehah Sep 22, 2023
16e8c77
Update combat_functions.hpp
mehah Sep 22, 2023
294263b
Update npc.cpp
mehah Sep 22, 2023
1aec309
Merge branch 'main' into shared-ptr-classes
mehah Sep 23, 2023
50eabe8
combat
mehah Sep 23, 2023
e1ee00d
NetworkMessage smart pointer
mehah Sep 23, 2023
215d20e
fix network
mehah Sep 23, 2023
240a864
Merge branch 'main' into shared-ptr-classes
dudantas Sep 23, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 24 additions & 33 deletions src/lua/functions/core/network/network_message_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,14 @@

int NetworkMessageFunctions::luaNetworkMessageCreate(lua_State* L) {
// NetworkMessage()
pushUserdata<NetworkMessage>(L, new NetworkMessage);
pushUserdata<NetworkMessage>(L, std::make_shared<NetworkMessage>());
setMetatable(L, -1, "NetworkMessage");
return 1;
}

int NetworkMessageFunctions::luaNetworkMessageDelete(lua_State* L) {
NetworkMessage** messagePtr = getRawUserdata<NetworkMessage>(L, 1);
if (messagePtr && *messagePtr) {
delete *messagePtr;
*messagePtr = nullptr;
}
return 0;
}

int NetworkMessageFunctions::luaNetworkMessageGetByte(lua_State* L) {
// networkMessage:getByte()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
lua_pushnumber(L, message->getByte());
} else {
Expand All @@ -42,7 +33,7 @@ int NetworkMessageFunctions::luaNetworkMessageGetByte(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageGetU16(lua_State* L) {
// networkMessage:getU16()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
lua_pushnumber(L, message->get<uint16_t>());
} else {
Expand All @@ -53,7 +44,7 @@ int NetworkMessageFunctions::luaNetworkMessageGetU16(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageGetU32(lua_State* L) {
// networkMessage:getU32()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
lua_pushnumber(L, message->get<uint32_t>());
} else {
Expand All @@ -64,7 +55,7 @@ int NetworkMessageFunctions::luaNetworkMessageGetU32(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageGetU64(lua_State* L) {
// networkMessage:getU64()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
lua_pushnumber(L, message->get<uint64_t>());
} else {
Expand All @@ -75,7 +66,7 @@ int NetworkMessageFunctions::luaNetworkMessageGetU64(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageGetString(lua_State* L) {
// networkMessage:getString()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
pushString(L, message->getString());
} else {
Expand All @@ -86,7 +77,7 @@ int NetworkMessageFunctions::luaNetworkMessageGetString(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageGetPosition(lua_State* L) {
// networkMessage:getPosition()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
pushPosition(L, message->getPosition());
} else {
Expand All @@ -98,7 +89,7 @@ int NetworkMessageFunctions::luaNetworkMessageGetPosition(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddByte(lua_State* L) {
// networkMessage:addByte(number)
uint8_t number = getNumber<uint8_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->addByte(number);
pushBoolean(L, true);
Expand All @@ -111,7 +102,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddByte(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddU16(lua_State* L) {
// networkMessage:addU16(number)
uint16_t number = getNumber<uint16_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<uint16_t>(number);
pushBoolean(L, true);
Expand All @@ -124,7 +115,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddU16(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddU32(lua_State* L) {
// networkMessage:addU32(number)
uint32_t number = getNumber<uint32_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<uint32_t>(number);
pushBoolean(L, true);
Expand All @@ -137,7 +128,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddU32(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddU64(lua_State* L) {
// networkMessage:addU64(number)
uint64_t number = getNumber<uint64_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<uint64_t>(number);
pushBoolean(L, true);
Expand All @@ -150,7 +141,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddU64(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAdd8(lua_State* L) {
// networkMessage:add8(number)
auto number = getNumber<int8_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<int8_t>(number);
pushBoolean(L, true);
Expand All @@ -163,7 +154,7 @@ int NetworkMessageFunctions::luaNetworkMessageAdd8(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAdd16(lua_State* L) {
// networkMessage:add16(number)
auto number = getNumber<int16_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<int16_t>(number);
pushBoolean(L, true);
Expand All @@ -176,7 +167,7 @@ int NetworkMessageFunctions::luaNetworkMessageAdd16(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAdd32(lua_State* L) {
// networkMessage:add32(number)
auto number = getNumber<int32_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<int32_t>(number);
pushBoolean(L, true);
Expand All @@ -189,7 +180,7 @@ int NetworkMessageFunctions::luaNetworkMessageAdd32(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAdd64(lua_State* L) {
// networkMessage:add64(number)
auto number = getNumber<int64_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->add<int64_t>(number);
pushBoolean(L, true);
Expand All @@ -202,7 +193,7 @@ int NetworkMessageFunctions::luaNetworkMessageAdd64(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddString(lua_State* L) {
// networkMessage:addString(string)
const std::string &string = getString(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->addString(string);
pushBoolean(L, true);
Expand All @@ -215,7 +206,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddString(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddPosition(lua_State* L) {
// networkMessage:addPosition(position)
const Position &position = getPosition(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->addPosition(position);
pushBoolean(L, true);
Expand All @@ -228,7 +219,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddPosition(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageAddDouble(lua_State* L) {
// networkMessage:addDouble(number)
double number = getNumber<double>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->addDouble(number);
pushBoolean(L, true);
Expand All @@ -240,7 +231,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddDouble(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageAddItem(lua_State* L) {
// networkMessage:addItem(item, player)
std::shared_ptr<Item> item = getUserdataShared<Item>(L, 2);
const auto &item = getUserdataShared<Item>(L, 2);
if (!item) {
reportErrorFunc(getErrorDesc(LUA_ERROR_ITEM_NOT_FOUND));
lua_pushnil(L);
Expand All @@ -254,7 +245,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddItem(lua_State* L) {
return 1;
}

NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message && player->client) {
player->client->AddItem(*message, item);
pushBoolean(L, true);
Expand All @@ -266,7 +257,7 @@ int NetworkMessageFunctions::luaNetworkMessageAddItem(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageReset(lua_State* L) {
// networkMessage:reset()
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->reset();
pushBoolean(L, true);
Expand All @@ -279,7 +270,7 @@ int NetworkMessageFunctions::luaNetworkMessageReset(lua_State* L) {
int NetworkMessageFunctions::luaNetworkMessageSkipBytes(lua_State* L) {
// networkMessage:skipBytes(number)
int16_t number = getNumber<int16_t>(L, 2);
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (message) {
message->skipBytes(number);
pushBoolean(L, true);
Expand All @@ -291,13 +282,13 @@ int NetworkMessageFunctions::luaNetworkMessageSkipBytes(lua_State* L) {

int NetworkMessageFunctions::luaNetworkMessageSendToPlayer(lua_State* L) {
// networkMessage:sendToPlayer(player)
NetworkMessage* message = getUserdata<NetworkMessage>(L, 1);
const auto &message = getUserdataShared<NetworkMessage>(L, 1);
if (!message) {
lua_pushnil(L);
return 1;
}

std::shared_ptr<Player> player = getPlayer(L, 2);
const auto &player = getPlayer(L, 2);
if (player) {
player->sendNetworkMessage(*message);
pushBoolean(L, true);
Expand Down
6 changes: 2 additions & 4 deletions src/lua/functions/core/network/network_message_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
class NetworkMessageFunctions final : LuaScriptInterface {
public:
static void init(lua_State* L) {
registerClass(L, "NetworkMessage", "", NetworkMessageFunctions::luaNetworkMessageCreate);
registerSharedClass(L, "NetworkMessage", "", NetworkMessageFunctions::luaNetworkMessageCreate);
registerMetaMethod(L, "NetworkMessage", "__eq", NetworkMessageFunctions::luaUserdataCompare);
registerMetaMethod(L, "NetworkMessage", "__gc", NetworkMessageFunctions::luaNetworkMessageDelete);
registerMethod(L, "NetworkMessage", "delete", NetworkMessageFunctions::luaNetworkMessageDelete);
registerMethod(L, "NetworkMessage", "delete", luaGarbageCollection);

registerMethod(L, "NetworkMessage", "getByte", NetworkMessageFunctions::luaNetworkMessageGetByte);
registerMethod(L, "NetworkMessage", "getU16", NetworkMessageFunctions::luaNetworkMessageGetU16);
Expand Down Expand Up @@ -46,7 +45,6 @@ class NetworkMessageFunctions final : LuaScriptInterface {

private:
static int luaNetworkMessageCreate(lua_State* L);
static int luaNetworkMessageDelete(lua_State* L);

static int luaNetworkMessageGetByte(lua_State* L);
static int luaNetworkMessageGetU16(lua_State* L);
Expand Down
16 changes: 8 additions & 8 deletions src/lua/functions/creatures/combat/combat_functions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@

int CombatFunctions::luaCombatCreate(lua_State* L) {
// Combat()
pushUserdata<Combat>(L, g_luaEnvironment().createCombatObject(getScriptEnv()->getScriptInterface()).get());
pushUserdata<Combat>(L, g_luaEnvironment().createCombatObject(getScriptEnv()->getScriptInterface()));
setMetatable(L, -1, "Combat");
return 1;
}

int CombatFunctions::luaCombatSetParameter(lua_State* L) {
// combat:setParameter(key, value)
Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (!combat) {
lua_pushnil(L);
return 1;
Expand All @@ -43,7 +43,7 @@ int CombatFunctions::luaCombatSetParameter(lua_State* L) {

int CombatFunctions::luaCombatSetFormula(lua_State* L) {
// combat:setFormula(type, mina, minb, maxa, maxb)
Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (!combat) {
lua_pushnil(L);
return 1;
Expand Down Expand Up @@ -74,7 +74,7 @@ int CombatFunctions::luaCombatSetArea(lua_State* L) {
return 1;
}

Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (combat) {
auto areaClone = area->clone();
combat->setArea(areaClone);
Expand All @@ -88,7 +88,7 @@ int CombatFunctions::luaCombatSetArea(lua_State* L) {
int CombatFunctions::luaCombatSetCondition(lua_State* L) {
// combat:addCondition(condition)
std::shared_ptr<Condition> condition = getUserdataShared<Condition>(L, 2);
Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (combat && condition) {
combat->addCondition(condition->clone());
pushBoolean(L, true);
Expand All @@ -100,7 +100,7 @@ int CombatFunctions::luaCombatSetCondition(lua_State* L) {

int CombatFunctions::luaCombatSetCallback(lua_State* L) {
// combat:setCallback(key, function)
Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (!combat) {
lua_pushnil(L);
return 1;
Expand All @@ -125,7 +125,7 @@ int CombatFunctions::luaCombatSetCallback(lua_State* L) {

int CombatFunctions::luaCombatSetOrigin(lua_State* L) {
// combat:setOrigin(origin)
Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (combat) {
combat->setOrigin(getNumber<CombatOrigin>(L, 2));
pushBoolean(L, true);
Expand All @@ -137,7 +137,7 @@ int CombatFunctions::luaCombatSetOrigin(lua_State* L) {

int CombatFunctions::luaCombatExecute(lua_State* L) {
// combat:execute(creature, variant)
Combat* combat = getUserdata<Combat>(L, 1);
const auto &combat = getUserdataShared<Combat>(L, 1);
if (!combat) {
pushBoolean(L, false);
return 1;
Expand Down
2 changes: 1 addition & 1 deletion src/lua/functions/creatures/combat/combat_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class CombatFunctions final : LuaScriptInterface {
public:
static void init(lua_State* L) {
registerClass(L, "Combat", "", CombatFunctions::luaCombatCreate);
registerSharedClass(L, "Combat", "", CombatFunctions::luaCombatCreate);
registerMetaMethod(L, "Combat", "__eq", CombatFunctions::luaUserdataCompare);

registerMethod(L, "Combat", "setParameter", CombatFunctions::luaCombatSetParameter);
Expand Down
4 changes: 1 addition & 3 deletions src/lua/functions/lua_functions_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -215,10 +215,8 @@ class LuaFunctionsLoader {
static void registerGlobalString(lua_State* L, const std::string &variable, const std::string &name);

static int luaUserdataCompare(lua_State* L);
static int luaGarbageCollection(lua_State* L);

static ScriptEnvironment scriptEnv[16];
static int32_t scriptEnvIndex;

private:
static int luaGarbageCollection(lua_State* L);
};
2 changes: 1 addition & 1 deletion src/lua/modules/modules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void Module::executeOnRecvbyte(std::shared_ptr<Player> player, NetworkMessage &m
LuaScriptInterface::pushUserdata<Player>(L, player);
LuaScriptInterface::setMetatable(L, -1, "Player");

LuaScriptInterface::pushUserdata<NetworkMessage>(L, &msg);
LuaScriptInterface::pushUserdata<NetworkMessage>(L, std::shared_ptr<NetworkMessage>(&msg));
LuaScriptInterface::setWeakMetatable(L, -1, "NetworkMessage");

lua_pushnumber(L, recvbyte);
Expand Down
Loading