Skip to content

Commit

Permalink
add event to PlayerRequestControlDelegate_t
Browse files Browse the repository at this point in the history
  • Loading branch information
Doxoh committed Nov 2, 2023
1 parent 077779e commit fc55ff6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion server/include/CSharpResourceImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ typedef void (* ConnectionQueueRemoveDelegate_t)(alt::IConnectionInfo* connectio

typedef void (* ServerStartedDelegate_t)();

typedef void (* PlayerRequestControlDelegate_t)(void* target, alt::IBaseObject::Type targetBaseObjectType, alt::IPlayer* player);
typedef void (* PlayerRequestControlDelegate_t)(const alt::CEvent* event, void* target, alt::IBaseObject::Type targetBaseObjectType, alt::IPlayer* player);

typedef void (* PlayerDimensionChangeDelegate_t)(alt::IPlayer* player, int32_t oldDimension, int32_t newDimension);

Expand Down
5 changes: 3 additions & 2 deletions server/src/CSharpResourceImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void CSharpResourceImpl::ResetDelegates()
OnConnectionQueueAddDelegate = [](auto var){};
OnConnectionQueueRemoveDelegate = [](auto var){};
OnServerStartedDelegate = []() {};
OnPlayerRequestControlDelegate = [](auto var, auto var2, auto var3) {};
OnPlayerRequestControlDelegate = [](auto var, auto var2, auto var3, auto var4) {};
OnPlayerDimensionChangeDelegate = [](auto var, auto var2, auto var3) {};
OnPlayerSpawnDelegate = [](auto var) {};

Expand Down Expand Up @@ -632,7 +632,8 @@ case alt::CEvent::Type::SYNCED_META_CHANGE:
{
auto playerRequestControlEvent = dynamic_cast<const alt::CPlayerRequestControlEvent*>(ev);
auto targetPtr = GetEntityPointer(playerRequestControlEvent->GetTarget());
OnPlayerRequestControlDelegate(targetPtr,
OnPlayerRequestControlDelegate(playerRequestControlEvent,
targetPtr,
playerRequestControlEvent->GetTarget()->GetType(),
playerRequestControlEvent->GetPlayer());
break;
Expand Down

0 comments on commit fc55ff6

Please sign in to comment.