Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] I don't know a single thing about eluna but have you checked that hook is even called?

[DiscordArchive] I don't know a single thing about eluna but have you checked that hook is even called?

[DiscordArchive] I don't know a single thing about eluna but have you checked that hook is even called?

rektbyfaith
Administrator
0
02-04-2025, 08:44 AM
#1
Archived author: Takenbacon • Posted: 2025-02-04T08:44:13.395000+00:00
Original source

I don't know a single thing about eluna but have you checked that hook is even called?
rektbyfaith
02-04-2025, 08:44 AM #1

Archived author: Takenbacon • Posted: 2025-02-04T08:44:13.395000+00:00
Original source

I don't know a single thing about eluna but have you checked that hook is even called?

rektbyfaith
Administrator
0
02-04-2025, 08:44 AM
#2
Archived author: Takenbacon • Posted: 2025-02-04T08:44:55.331000+00:00
Original source

I assume the "cleanup" functionality is in the deconstructor of elunaEvents. Because otherwise simply deleting that object isn't going to clean anything up
rektbyfaith
02-04-2025, 08:44 AM #2

Archived author: Takenbacon • Posted: 2025-02-04T08:44:55.331000+00:00
Original source

I assume the "cleanup" functionality is in the deconstructor of elunaEvents. Because otherwise simply deleting that object isn't going to clean anything up

rektbyfaith
Administrator
0
02-04-2025, 08:50 AM
#3
Archived author: iThorgrim • Posted: 2025-02-04T08:50:41.197000+00:00
Original source

Yes ^^
rektbyfaith
02-04-2025, 08:50 AM #3

Archived author: iThorgrim • Posted: 2025-02-04T08:50:41.197000+00:00
Original source

Yes ^^

rektbyfaith
Administrator
0
02-04-2025, 08:52 AM
#4
Archived author: iThorgrim • Posted: 2025-02-04T08:52:14.946000+00:00
Original source

Yes, I know, that's why I've added a few methods to clean things up, but it doesn't change anything, it looks like the “update” goes before the destruction of the WorldObject is taken into account and so we get the error :
```
#----------------------------------------------------------------------#

>> ASSERTION FAILED

# Location: AzerothCore\modules\mod-eluna\src\LuaEngine\hooks\HookHelpers.h:32
# Function: Eluna::SetupStack
# Condition: arguments_top >= number_of_arguments

#----------------------------------------------------------------------#
```
rektbyfaith
02-04-2025, 08:52 AM #4

Archived author: iThorgrim • Posted: 2025-02-04T08:52:14.946000+00:00
Original source

Yes, I know, that's why I've added a few methods to clean things up, but it doesn't change anything, it looks like the “update” goes before the destruction of the WorldObject is taken into account and so we get the error :
```
#----------------------------------------------------------------------#

>> ASSERTION FAILED

# Location: AzerothCore\modules\mod-eluna\src\LuaEngine\hooks\HookHelpers.h:32
# Function: Eluna::SetupStack
# Condition: arguments_top >= number_of_arguments

#----------------------------------------------------------------------#
```

rektbyfaith
Administrator
0
02-04-2025, 08:53 AM
#5
Archived author: iThorgrim • Posted: 2025-02-04T08:53:13.518000+00:00
Original source

This is what OnWorldObjectDestroy looks like on my version:
```cpp
void OnWorldObjectDestroy(WorldObject* object) override
{
if (object->elunaEvents)
{
object->elunaEvents->SetStates(LUAEVENT_STATE_ABORT);
object->elunaEvents->RemoveAllEvents();
delete object->elunaEvents;
object->elunaEvents = NULL;
}
}
```
rektbyfaith
02-04-2025, 08:53 AM #5

Archived author: iThorgrim • Posted: 2025-02-04T08:53:13.518000+00:00
Original source

This is what OnWorldObjectDestroy looks like on my version:
```cpp
void OnWorldObjectDestroy(WorldObject* object) override
{
if (object->elunaEvents)
{
object->elunaEvents->SetStates(LUAEVENT_STATE_ABORT);
object->elunaEvents->RemoveAllEvents();
delete object->elunaEvents;
object->elunaEvents = NULL;
}
}
```

rektbyfaith
Administrator
0
02-04-2025, 08:55 AM
#6
Archived author: iThorgrim • Posted: 2025-02-04T08:55:12.436000+00:00
Original source

I've also added some "security guards", but the server still crashes with the same error:
```cpp
void Eluna::OnTimedEvent(int funcRef, uint32 delay, uint32 calls, WorldObject* obj)
{
if (!obj)
{
luaL_unref(L, LUA_REGISTRYINDEX, funcRef);
return;
}

ASSERT(!event_level);

// Get function
lua_rawgeti(L, LUA_REGISTRYINDEX, funcRef);

// HookPush parameters
HookPush(funcRef);
HookPush(delay);
HookPush(calls);
HookPush(obj);

// Call function
ExecuteCall(4, 0);

ASSERT(!event_level);
InvalidateObjects();
}
```
rektbyfaith
02-04-2025, 08:55 AM #6

Archived author: iThorgrim • Posted: 2025-02-04T08:55:12.436000+00:00
Original source

I've also added some "security guards", but the server still crashes with the same error:
```cpp
void Eluna::OnTimedEvent(int funcRef, uint32 delay, uint32 calls, WorldObject* obj)
{
if (!obj)
{
luaL_unref(L, LUA_REGISTRYINDEX, funcRef);
return;
}

ASSERT(!event_level);

// Get function
lua_rawgeti(L, LUA_REGISTRYINDEX, funcRef);

// HookPush parameters
HookPush(funcRef);
HookPush(delay);
HookPush(calls);
HookPush(obj);

// Call function
ExecuteCall(4, 0);

ASSERT(!event_level);
InvalidateObjects();
}
```

rektbyfaith
Administrator
0
02-04-2025, 09:19 AM
#7
Archived author: metallinos • Posted: 2025-02-04T09:19:46.937000+00:00
Original source

Pretty sure I reproduced it last night both while staying connected and while disconnecting during a running event
rektbyfaith
02-04-2025, 09:19 AM #7

Archived author: metallinos • Posted: 2025-02-04T09:19:46.937000+00:00
Original source

Pretty sure I reproduced it last night both while staying connected and while disconnecting during a running event

rektbyfaith
Administrator
0
02-04-2025, 09:20 AM
#8
Archived author: iThorgrim • Posted: 2025-02-04T09:20:35.276000+00:00
Original source

Ah yes it's possible, at least I know we have a way to track the error if we disconnect
rektbyfaith
02-04-2025, 09:20 AM #8

Archived author: iThorgrim • Posted: 2025-02-04T09:20:35.276000+00:00
Original source

Ah yes it's possible, at least I know we have a way to track the error if we disconnect

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)