RDV Bus Events - zeroKilo/GROBackendWV GitHub Wiki
Bus events are used to update RDV models and AI managers. On a event dispatch, a cascade of processors is called in a loop, where the event's model ID is checked for applicability and then can be further processed:
The typical use case is:
- After receiving RMC response, an
RDV_cl_ManagerEvent
is created and queued by a manager for dispatcher (RDV_cl_Manager::SendBusEvent
andRDV_cl_EventDispatcher::AddEvent
). - The event is processed by a model's event listener (
::OnManagerEvent
functions) where it's layout is changed intoRDV_cl_BusEvent
:
int __thiscall RDV_cl_FriendsModel::OnManagerEvent(int this, RDV_cl_ManagerEvent *manEvent)
{
id = manEvent->onManagerEventId;
param1 = manEvent->param1;
param2 = manEvent->param2;
result = id;
switch ( id )
{
case 49: // insert new friendData
event0.modelId = *(this + 4);
event0.eventId = 0;
event0.dataParam1 = param2; // friendData index
event0.dataParam2 = 0;
event0.dword10 = 0;
result = j_RDV_cl_Model::DispatchEvent(this - 4, &mevent0);
break;
...
- Event is passed to
RDV_cl_Model::DispatchEvent
andRDV_cl_EventBus__DispatchEvent
where both RDV and AI processors are called as a cascade of updates.
__int64 __thiscall RDV_cl_EventBus::DispatchEvent(RDV::EventBus *this, RDV_cl_ModelEvent *event)
{
for ( i = this->gearMapItem.dword0; ; i = sub_1000D07B(i) )
{
LODWORD(result) = i;
HIDWORD(result) = i != &this->gearMapItem;
if ( i == &this->gearMapItem )
break;
(**i->j_unknown_libname_214)(i->j_unknown_libname_214, event);
}
return result;
- Event is processed in applicable processors:
char __userpurge AI_GameSessionModel::OnBusEvent@<al>(int this@<ecx>, double a2@<st0>, double st6_0@<st1>, double a4@<st3>, double a5@<st2>, double a6@<st4>, double a7@<st5>, double a8@<st6>, double a9@<st7>, RDV_cl_BusEvent *busEvent)
{
// [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]
eventId = busEvent->eventId;
gameType = busEvent->dataParam2;
v64 = busEvent->eventId;
if ( busEvent->modelId == 1 ) // user model
{
if ( eventId == 6 )
AI_GameSessionModel::HandleLostConnectionToRDV((this - 8));
v60 = RDV::Proxy::pUserModel();
v61 = (v60->pVMT->pRDV_DLL_sub_1000F5E7_CheckPlayerID)(v60);
LOBYTE(v13) = Yeti::SendClientLoginLogEvent(v61, eventId, gameType);
}
else if ( busEvent->modelId == 9 ) // party model
{
if ( eventId == 16 )
{
v59 = RDV::Proxy::pPartyModel();
LOBYTE(v13) = (v59->pVMT->p_RDV_sub_1000C0B8_IsPlayerPartyOwner)(v59);
if ( !v13 )
LOBYTE(v13) = AI_UIModel::DispatchEvent((this - 8), 27, 0, 0);
}
else
{
...
struct RDV_cl_ManagerEvent
{
_DWORD onManagerEventId;
_DWORD param1;
_DWORD param2;
_DWORD eventId;
};
struct RDV_cl_BusEvent
{
DWORD modelId;
DWORD eventId;
DWORD dataParam1;
DWORD dataParam2;
DWORD dword10;
};
Menu UI events are processed by RDV_cl_RDVUIModel::OnBusEvent
, updates are called via RDV_cl_RDVUIModel::UpdateUIOnEvent
.
-
RDV_cl_CacheManager::OnBusEvent
-
RDV_cl_AchievementsHostModel
(dispatcher) -
RDV_cl_StatisticsModel
(dispatcher) -
RDV_cl_UserModel
(dispatcher) -
RDV_cl_ChatModel
(dispatcher) -
RDV_cl_AchievementsModel
(dispatcher) -
RDV_cl_FriendsModel
(dispatcher) -
RDV_cl_PartyModel
(dispatcher) -
RDV_cl_AMMModel
(dispatcher) -
RDV_cl_AMMHostModel
(dispatcher) -
RDV_cl_ProfileModel
(dispatcher) -
RDV_cl_InventoryModel
(dispatcher) -
RDV_cl_LootModel
(dispatcher) -
RDV_cl_WeaponsModel
(dispatcher) -
RDV_cl_ProtocolPrototypeModel
(dispatcher) -
RDV_cl_StoreModel
(dispatcher) -
RDV_cl_AdvertisementModel
(dispatcher) -
RDV_cl_SkillsModel
(dispatcher) -
RDV_cl_LoadoutModel
(dispatcher) -
RDV_cl_TrackingModel
(dispatcher) -
RDV_cl_UnlockModel
(dispatcher) -
RDV_cl_UnitTestModel
(dispatcher) -
RDV_cl_AvatarModel
(dispatcher) -
RDV_cl_RewardModel
(dispatcher) -
RDV_cl_ErrorModel
(dispatcher) -
RDV_cl_ConsumableModel
(dispatcher) -
RDV_cl_BoostModel
(dispatcher) -
RDV_cl_ArmorModel
(dispatcher) -
RDV_cl_MissionModel
(dispatcher) -
RDV_cl_LeaderboardModel
(dispatcher) -
RDV_cl_ApplyItemModel
(dispatcher) -
RDV_cl_OperatorVariablesModel
(dispatcher) -
RDV_cl_ProfanityFilterModel
(dispatcher) -
RDV_cl_WeaponProficiencyModel
(dispatcher) -
RDV_cl_ProfilerModel
(dispatcher) -
RDV_cl_AnnouncementModel
(dispatcher) -
RDV_cl_ServerInfoModel
(dispatcher) -
RDV_cl_LocaleModel
(dispatcher) -
RDV_cl_ProgressionModel
(dispatcher) -
RDV_cl_RDVUIModel::OnBusEvent
-
RDV_cl_PveArchetypeModel
(dispatcher) -
RDV_cl_InboxMessageModel
(dispatcher) -
RDV_cl_InspectPlayerModel
(dispatcher) -
RDV_cl_AbilityModel
(dispatcher) -
RDV_cl_NewsModel
(dispatcher) -
RDV_cl_SurveyModel
(dispatcher) -
cArmorVisualManager::OnBusEvent
-
cRDVStatisticsManager::OnBusEvent
-
AI_ClientErrorManager::OnBusEvent
-
ClassInfoRdvPC::FetchPlayerData
-
AI_RDVTransactionModel::OnBusEvent
-
AI_UI3DObjectWindowManager::OnBusEvent
-
cUIMissionManager::OnBusEvent
-
AI_GlobalUI__OnBusEvent
-
AI_SocialMenuWidget
(nullsub) -
AI_Inbox::OnBusEvent
-
AI_ProfileWidget::OnBusEvent
-
AI_FriendList::OnBusEvent
-
AI_IgnoreList::OnBusEvent
-
AI_PartyWidget::OnBusEvent
-
AI_TutorialLobby::OnBusEvent
-
AI_HomePage::OnBusEvent
-
AI_RoomList::OnBusEvent
-
AI_ChatPanel::OnBusEvent
-
AI_HudChatPanel::OnBusEvent
-
AI_InGameScore::OnBusEvent
-
AI_InGameAchievement::OnBusEvent
-
AI_Login::OnBusEvent
-
AI_StorePage::OnBusEvent
-
AI_InventoryPage::OnBusEvent
-
cUIVivoxManager::OnBusEvent
-
AI_GameSessionModel::OnBusEvent
-
cUISocialManager::OnBusEvent
-
cUINotificationCounter::OnBusEvent
-
cUIInboxManager::OnBusEvent
-
cUIHomePageManager::OnBusEvent
-
cRDVAchievementsManager::OnBusEvent
-
cRDVMissionsManager::OnBusEvent
-
cNetRulesManager::OnBusEvent
-
cGameStatsStore::OnBusEvent
-
WebBrowserManager::OnBusEvent
-
cUIPostGameManager
(nullsub) -
cVivoxManager::OnBusEvent
-
AI_CharacterSelectionModel::OnBusEvent
-
AI_UICoreManager::OnBusEvent
-
AI_NetworkManager::OnBusEvent
-
cPlayerHUD::OnBusEvent
-
AI_StressClientManager::OnBusEvent
These are processed by ::OnBusEvent
and other processors:
Model ID | Model name |
---|---|
0 | UnknownModel0 |
1 | UserModel |
2 | ChatModel |
3 | GameSessionModel |
4 | InGameSessionModel |
5 | GameStatsStore |
6 | AchievementsModel |
7 | ProfileModel |
8 | FriendsModel |
9 | PartyModel |
10 | AMMModel |
11 | AMMHostModel |
12 | StatisticsModel |
13 | AchievementsHostModel |
14 | InventoryModel |
15 | LootModel |
16 | WeaponsModel |
17 | StoreModel |
18 | AdvertisementModel |
19 | SkillsModel |
20 | LoadoutModel |
21 | TrackingModel |
22 | UnlockModel |
23 | UnitTestModel |
24 | AvatarModel |
25 | RewardModel |
26 | ErrorModel |
27 | ConsumableModel |
28 | BoostModel |
29 | ArmorModel |
30 | MissionModel |
31 | InGameMenuManager |
32 | CharacterSelectionModel |
33 | WeaponCustomizeHelper |
34 | ArmorCustomizeHelper |
35 | AbilityCustomizeHelper |
36 | DataProviderModel |
37 | ProtocolPrototypeModel |
38 | ChatStatsStore |
39 | UISocialManager |
40 | ApplyItemModel |
41 | OperatorVariablesModel |
42 | LeaderboardModel |
43 | WeaponProficiencyModel |
44 | ProfilerModel |
45 | ProgressionModel |
46 | UnknownModel46 |
47 | AnnouncementModel |
48 | ServerInfoModel |
49 | RDVUIModel |
50 | RDVTransactionModel |
51 | PveArchetypeModel |
52 | UIMissionManager |
53 | UIVivoxManager |
54 | UINotificationCounter |
55 | InboxMessageModel |
56 | UIInboxManager |
57 | ProfanityFilterModel/SurveyModel |
58 | InspectPlayerModel |
59 | AbilityModel |
60 | UIHomePageManager |
61 | ClientErrorManager |
62 | UnknownModel62 |
63 | NewsModel |