Skip to content

Commit

Permalink
tweak(onesync): use event names in NetEventError
Browse files Browse the repository at this point in the history
Instead of using vtable names and rely on RTTI (which doesn't exist in RDR3 and newest GTA5 builds).
  • Loading branch information
Disquse committed Dec 6, 2023
1 parent 1c9ee67 commit 03fdc4a
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions code/components/gta-net-five/src/CloneExperiments.cpp
Expand Up @@ -3315,8 +3315,6 @@ static void SendAlterWantedLevelEvent2Hook(void* a1, void* a2, void* a3, void* a
}
#endif

std::string GetType(void* d);

static void NetEventError()
{
auto pool = rage::GetPoolBase("netGameEvent");
Expand All @@ -3325,11 +3323,9 @@ static void NetEventError()

for (int i = 0; i < pool->GetSize(); i++)
{
auto e = pool->GetAt<void>(i);

if (e)
if (const auto netGameEvent = pool->GetAt<rage::netGameEvent>(i))
{
poolCount[GetType(e)]++;
poolCount[netGameEvent->GetName()]++;

This comment has been minimized.

Copy link
@blattersturm

blattersturm Dec 6, 2023

Contributor

Could this have been renamed to GetEventName to match now-known type information?

This comment has been minimized.

Copy link
@Disquse

Disquse Dec 6, 2023

Author Contributor

Yeah somewhere in the future, there's lots of things that needs to be renamed/fixed/tweaked given the recent 'gained' knowledge.

This comment has been minimized.

Copy link
@blattersturm

blattersturm Dec 6, 2023

Contributor

Right, would make sense to put this in a single batch of renaming of types/fields/functions.

}
}

Expand Down

0 comments on commit 03fdc4a

Please sign in to comment.