DayZ 1.24
Loading...
Searching...
No Matches
SyncEvents Class Reference

Static Private Member Functions

static void RegisterEvents ()
 
static void Event_OnRPC (PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
 
static void OnSyncEvent (ESyncEvent event_type, SyncData data, Object target)
 
static void SendPlayerList ()
 
static void SendEntityKilled (EntityAI victim, EntityAI killer, EntityAI source, bool is_headshot)
 
static void SendPlayerIgnatedFireplace (Man player, EFireIgniteType ignite_type)
 
static void SendSyncEvent (ERPCs rpc_event_id, ESyncEvent sync_event_type, SyncData data=null, bool guaranteed=true, PlayerIdentity player_target=null)
 
static void SendSyncEventEx (ERPCs rpc_event_id, ESyncEvent sync_event_type, SyncData data=null, bool guaranteed=true, Man recipient=null)
 

Detailed Description

Definition at line 1 of file SyncEvents.c.

Member Function Documentation

◆ Event_OnRPC()

static void SyncEvents::Event_OnRPC ( PlayerIdentity sender,
Object target,
int rpc_type,
ParamsReadContext ctx )
inlinestaticprivate

Definition at line 11 of file SyncEvents.c.

12 {
13 if (rpc_type == ERPCs.RPC_SYNC_EVENT && GetGame() && GetGame().IsMultiplayer() && GetGame().IsClient())
14 {
16
17 if (ctx.Read(event_data))
18 OnSyncEvent(event_data.param1, event_data.param2, target);
19 }
20 }
ERPCs
Definition ERPCs.c:2
static void OnSyncEvent(ESyncEvent event_type, SyncData data, Object target)
Definition SyncEvents.c:22
proto native CGame GetGame()

References GetGame(), and OnSyncEvent().

Referenced by RegisterEvents().

◆ OnSyncEvent()

static void SyncEvents::OnSyncEvent ( ESyncEvent event_type,
SyncData data,
Object target )
inlinestaticprivate

Definition at line 22 of file SyncEvents.c.

23 {
24 switch (event_type)
25 {
26 case ESyncEvent.PlayerList:
27 {
30 break;
31 }
32 case ESyncEvent.EntityKill:
33 {
35 break;
36 }
37 case ESyncEvent.PlayerIgnateFireplayce:
38 {
40 break;
41 }
42 }
43 }
ESyncEvent
Definition ESyncEvent.c:2
static void SyncEvent_PreprocessPlayerList(SyncPlayerList player_list)
Definition ClientData.c:35
static void SyncEvent_OnRecievedPlayerList(SyncPlayerList player_list)
Definition ClientData.c:51
static ref ScriptInvoker SyncEvent_OnPlayerIgnitedFireplace
Definition ClientData.c:5
static ref ScriptInvoker SyncEvent_OnEntityKilled
Definition ClientData.c:4

References ClientData::SyncEvent_OnEntityKilled, ClientData::SyncEvent_OnPlayerIgnitedFireplace, ClientData::SyncEvent_OnRecievedPlayerList(), and ClientData::SyncEvent_PreprocessPlayerList().

Referenced by Event_OnRPC().

◆ RegisterEvents()

static void SyncEvents::RegisterEvents ( )
inlinestaticprivate

Definition at line 3 of file SyncEvents.c.

4 {
5 DayZGame dz_game = DayZGame.Cast(GetGame());
6
7 dz_game.Event_OnRPC.Insert(Event_OnRPC);
8 Print("SyncEvents -> RegisterEvents");
9 }
static void Event_OnRPC(PlayerIdentity sender, Object target, int rpc_type, ParamsReadContext ctx)
Definition SyncEvents.c:11
proto void Print(void var)
Prints content of variable to console/log.

References Event_OnRPC(), GetGame(), and Print().

Referenced by MissionBase::MissionGameplay().

◆ SendEntityKilled()

static void SyncEvents::SendEntityKilled ( EntityAI victim,
EntityAI killer,
EntityAI source,
bool is_headshot )
inlinestaticprivate

Definition at line 54 of file SyncEvents.c.

55 {
56 if ((victim && victim.IsPlayer()) || (killer && killer.IsPlayer()))
57 {
59 data.m_EntityKill = new SyncEntityKillInfo;
60
61 data.m_EntityKill.m_EntityVictim = victim;
62 data.m_EntityKill.m_EntityKiller = killer;
63 data.m_EntityKill.m_EntitySource = source;
64 data.m_EntityKill.m_IsHeadShot = is_headshot;
65
66 Man recipient;
67
68 if (killer && killer.IsPlayer() && victim.GetID() != killer.GetID())
69 recipient = Man.Cast(killer);
70 else if (victim && victim.IsPlayer())
71 recipient = Man.Cast(victim);
72
73 SendSyncEventEx(ERPCs.RPC_SYNC_EVENT, ESyncEvent.EntityKill, data, true, recipient);
74 }
75 }
static void SendSyncEventEx(ERPCs rpc_event_id, ESyncEvent sync_event_type, SyncData data=null, bool guaranteed=true, Man recipient=null)
Definition SyncEvents.c:94

References SendSyncEventEx().

Referenced by ManBase::OnCommandHandlerTick().

◆ SendPlayerIgnatedFireplace()

static void SyncEvents::SendPlayerIgnatedFireplace ( Man player,
EFireIgniteType ignite_type )
inlinestaticprivate

Definition at line 77 of file SyncEvents.c.

78 {
80 data.m_SyncInt = ignite_type;
81
82 SendSyncEvent(ERPCs.RPC_SYNC_EVENT, ESyncEvent.PlayerIgnateFireplayce, data, true, player.GetIdentity());
83 }
static void SendSyncEvent(ERPCs rpc_event_id, ESyncEvent sync_event_type, SyncData data=null, bool guaranteed=true, PlayerIdentity player_target=null)
Definition SyncEvents.c:85

References SendSyncEvent().

Referenced by FireplaceBase::OnIgnitedThis().

◆ SendPlayerList()

static void SyncEvents::SendPlayerList ( )
inlinestaticprivate

Definition at line 45 of file SyncEvents.c.

46 {
48 data.m_ServerPlayerList = new SyncPlayerList;
49 data.m_ServerPlayerList.CreatePlayerList();
50
51 SendSyncEvent(ERPCs.RPC_SYNC_EVENT, ESyncEvent.PlayerList, data, true);
52 }

References SendSyncEvent().

Referenced by MissionBase::OnEvent(), and MissionBase::PlayerDisconnected().

◆ SendSyncEvent()

static void SyncEvents::SendSyncEvent ( ERPCs rpc_event_id,
ESyncEvent sync_event_type,
SyncData data = null,
bool guaranteed = true,
PlayerIdentity player_target = null )
inlinestaticprivate

◆ SendSyncEventEx()

static void SyncEvents::SendSyncEventEx ( ERPCs rpc_event_id,
ESyncEvent sync_event_type,
SyncData data = null,
bool guaranteed = true,
Man recipient = null )
inlinestaticprivate

Definition at line 94 of file SyncEvents.c.

References SendSyncEvent().

Referenced by SendEntityKilled().


The documentation for this class was generated from the following file: