3 static void RegisterEvents()
5 DayZGame dz_game = DayZGame.Cast(
GetGame() );
7 dz_game.Event_OnRPC.Insert( Event_OnRPC );
8 Print(
"SyncEvents -> RegisterEvents");
17 if ( ctx.Read( event_data ) )
19 OnSyncEvent( event_data.param1, event_data.param2, target );
30 ClientData.SyncEvent_PreprocessPlayerList(data.m_ServerPlayerList);
31 ClientData.SyncEvent_OnRecievedPlayerList(data.m_ServerPlayerList);
36 ClientData.SyncEvent_OnEntityKilled( data.m_EntityKill );
41 ClientData.SyncEvent_OnPlayerIgnitedFireplace( data.m_SyncInt );
47 static void SendPlayerList()
51 data.m_ServerPlayerList.CreatePlayerList();
53 SendSyncEvent(
ERPCs.RPC_SYNC_EVENT,
ESyncEvent.PlayerList, data,
true );
58 if ( (victim && victim.IsPlayer()) || (killer && killer.IsPlayer()) )
63 data.m_EntityKill.m_EntityVictim = victim;
64 data.m_EntityKill.m_EntityKiller = killer;
65 data.m_EntityKill.m_EntitySource = source;
66 data.m_EntityKill.m_IsHeadShot = is_headshot;
70 if ( killer && killer.IsPlayer() && victim.GetID() != killer.GetID() )
72 recipient = Man.Cast(killer);
74 else if ( victim && victim.IsPlayer() )
76 recipient = Man.Cast(victim);
79 SendSyncEventEx(
ERPCs.RPC_SYNC_EVENT,
ESyncEvent.EntityKill, data,
true, recipient );
83 static void SendPlayerIgnatedFireplace( Man player,
EFireIgniteType ignite_type )
86 data.m_SyncInt = ignite_type;
88 SendSyncEvent(
ERPCs.RPC_SYNC_EVENT,
ESyncEvent.PlayerIgnateFireplayce, data,
true, player.GetIdentity() );
96 GetGame().RPCSingleParam(
null, rpc_event_id, event_data, guaranteed );
100 GetGame().RPCSingleParam(
null, rpc_event_id, event_data, guaranteed, player_target );
104 private static void SendSyncEventEx(
ERPCs rpc_event_id,
ESyncEvent sync_event_type,
SyncData data =
null,
bool guaranteed =
true, Man recipient =
null )
106 SendSyncEvent(rpc_event_id, sync_event_type, data, guaranteed, recipient.GetIdentity());