DayZ 1.30
DayZ Explorer by KGB
 
Загрузка...
Поиск...
Не найдено

◆ OnRPC()

override void OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
protected

См. определение в файле ItemBase.c строка 2755

2756 {
2757 //Debug.Log("OnRPC called");
2758 super.OnRPC(sender, rpc_type,ctx);
2759
2760 //Play soundset for attachment locking (ActionLockAttachment.c)
2761 switch (rpc_type)
2762 {
2763 #ifndef SERVER
2764 #ifndef NO_GUI
2765 case ERPCs.RPC_SOUND_LOCK_ATTACH:
2766 {
2767 Param2<bool, string> p = new Param2<bool, string>(false, "");
2768
2769 if (!ctx.Read(p))
2770 return;
2771
2772 bool play = p.param1;
2773 string soundSet = p.param2;
2774
2775 if (play)
2776 {
2777 if (m_LockingSound)
2778 {
2779 if (!m_LockingSound.IsSoundPlaying())
2780 {
2781 m_LockingSound = SEffectManager.PlaySound(soundSet, GetPosition(), 0, 0, true);
2782 }
2783 }
2784 else
2785 {
2786 m_LockingSound = SEffectManager.PlaySound(soundSet, GetPosition(), 0, 0, true);
2787 }
2788 }
2789 else
2790 {
2792 }
2793
2794 break;
2795 }
2796 case ERPCs.RPC_ITEM_SOUND_PLAY:
2797 {
2798 int count;
2799 if (!ctx.Read(count))
2800 return;
2801
2802 for (int i = 0; i < count; i++)
2803 {
2804 int soundIdPlay, slotIdPlay;
2805 if (!ctx.Read(soundIdPlay))
2806 return;
2807
2808 if (!ctx.Read(slotIdPlay))
2809 return;
2810
2811 if (m_ItemSoundHandler && soundIdPlay != 0)
2812 m_ItemSoundHandler.PlayItemSoundClient(soundIdPlay, slotIdPlay);
2813 }
2814 break;
2815 }
2816 case ERPCs.RPC_ITEM_SOUND_STOP:
2817 {
2818 int soundIdStop;
2819 if (!ctx.Read(soundIdStop))
2820 return;
2821
2822 if (m_ItemSoundHandler && soundIdStop != 0)
2823 m_ItemSoundHandler.StopItemSoundClient(soundIdStop);
2824 break;
2825 }
2826 #endif
2827 #endif
2828
2829 }
2830
2831 if (GetWrittenNoteData())
2832 {
2833 GetWrittenNoteData().OnRPC(sender, rpc_type,ctx);
2834 }
2835 }
ERPCs
Определения ERPCs.c:2
WrittenNoteData GetWrittenNoteData()
Определения ItemBase.c:4528
ref ItemSoundHandler m_ItemSoundHandler
Определения ItemBase.c:122
EffectSound m_LockingSound
Определения Land_Underground_Entrance.c:344
Определения PPEConstants.c:68
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
Определения EffectManager.c:178
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
Определения EffectManager.c:280
Manager class for managing Effect (EffectParticle, EffectSound)
Определения EffectManager.c:6
proto bool Read(void value_in)
void OnRPC(PlayerIdentity sender, int rpc_type, ParamsReadContext ctx)
Определения WrittenNoteData.c:13
vector GetPosition()
Get the world position of the Effect.
Определения Effect.c:473

Перекрестные ссылки SEffectManager::DestroyEffect(), GetPosition(), ItemBase::GetWrittenNoteData(), m_ItemSoundHandler, m_LockingSound, WrittenNoteData::OnRPC(), SEffectManager::PlaySound() и Serializer::Read().