5728 {
5729 super.OnRPC(sender, rpc_type, ctx);
5730
5731 switch (rpc_type)
5732 {
5733 #ifndef SERVER
5734
5735 case ERPCs.RPC_PLAYER_STAT:
5738 break;
5739
5740 case ERPCs.RPC_SYNC_DISPLAY_STATUS:
5742 {
5744 }
5745 break;
5746
5747 case ERPCs.RPC_PLAYER_SYMPTOM_ON:
5749 {
5751 }
5752 break;
5753
5754 case ERPCs.RPC_PLAYER_SYMPTOM_OFF:
5756 {
5758 }
5759 break;
5760
5761 case ERPCs.RPC_SYMPTOM_PARAM_SYNC:
5763 {
5765 }
5766 break;
5767
5768 case ERPCs.RPC_DAMAGE_VALUE_SYNC:
5771 break;
5772
5773 case ERPCs.RPC_USER_ACTION_MESSAGE:
5775 {
5776 break;
5777 }
5779 {
5782 }
5783 break;
5784
5785 case ERPCs.RPC_SOFT_SKILLS_SPECIALTY_SYNC:
5786 ref Param1<float> p_synch = new Param1<float>(0);
5788 float specialty_level = p_synch.param1;
5790 break;
5791
5792 case ERPCs.RPC_SOFT_SKILLS_STATS_SYNC:
5793 ref Param5<float, float, float, float, bool> p_debug_synch = new Param5<float, float ,float, float, bool>(0, 0, 0, 0, false);
5794 ctx.
Read(p_debug_synch);
5795 float general_bonus_before = p_debug_synch.param1;
5796 float general_bonus_after = p_debug_synch.param2;
5797 float last_UA_value = p_debug_synch.param3;
5798 float cooldown_value = p_debug_synch.param4;
5799 float cooldown_active = p_debug_synch.param5;
5805 break;
5806
5807 case ERPCs.RPC_WARNING_ITEMDROP:
5808 {
5810 {
5812 g_Game.GetMission().AddActiveInputExcludes({
"menu"});
5813 }
5814 break;
5815 }
5816
5817 case ERPCs.RPC_WARNING_TELEPORT:
5818 {
5820 {
5822 g_Game.GetMission().AddActiveInputExcludes({
"menu"});
5823 }
5824 break;
5825 }
5826 case ERPCs.RPC_INIT_SET_QUICKBAR:
5827 ref Param1<int> count = new Param1<int>(0);
5828 if (ctx.
Read(count))
5829 {
5830 for (int i = 0; i < count.param1 ; i++)
5831 {
5833 }
5834 }
5835 break;
5836
5837 case ERPCs.RPC_SYNC_THERMOMETER:
5838 {
5839 float value;
5840 if (ctx.
Read(value))
5841 m_Hud.SetTemperature(value.
ToString() +
"#degrees_celsius");
5842 break;
5843 }
5844
5845
5846 case ERPCs.RPC_CHECK_PULSE:
5847 ctx.
Read(CachedObjectsParams.PARAM1_INT);
5849 if ((CachedObjectsParams.PARAM1_INT.param1 & ActionCheckPulse.TARGET_IRREGULAR_PULSE_BIT) == 0)
5850 {
5852 }
5853 else
5854 {
5856 }
5857
5858 int blood_level = ~ActionCheckPulse.TARGET_IRREGULAR_PULSE_BIT & CachedObjectsParams.PARAM1_INT.param1;
5860 {
5862 }
5863 break;
5864
5866
5867 case PlantType.TREE_HARD:
5868 SoundHardTreeFallingPlay();
5869 break;
5870
5871 case PlantType.TREE_SOFT:
5872 SoundSoftTreeFallingPlay();
5873 break;
5874
5875 case PlantType.BUSH_HARD:
5876 SoundHardBushFallingPlay();
5877 break;
5878
5879 case PlantType.BUSH_SOFT:
5880 SoundSoftBushFallingPlay();
5881 break;
5882
5883 case ERPCs.RPC_DEBUG_MONITOR_FLT:
5885 {
5887 }
5888 break;
5889
5890 case ERPCs.RPC_DEBUG_MONITOR_STR:
5892 {
5894 }
5895 break;
5896
5897 case ERPCs.RPC_ITEM_REPAIR:
5898 PluginInventoryRepair repairPlugin = PluginInventoryRepair.Cast(
GetPlugin(PluginInventoryRepair));
5899 repairPlugin.OnRPC(ctx);
5900 #endif
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915 #ifdef DIAG_DEVELOPER
5916 case ERPCs.DEV_RPC_AGENT_RESET:
5917 {
5918 bool val;
5921 break;
5922 }
5923
5924 case ERPCs.DEV_PLAYER_DEBUG_REQUEST:
5925 {
5926 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(
GetPlugin(PluginRemotePlayerDebugServer));
5927 plugin_remote_server.OnRPC(ctx, this);
5928 break;
5929 }
5930
5931 case ERPCs.DEV_PLAYER_DEBUG_DATA:
5932 {
5933 PluginRemotePlayerDebugClient plugin_remote_client = PluginRemotePlayerDebugClient.Cast(
GetPlugin(PluginRemotePlayerDebugClient));
5934 PluginDeveloper plugin_dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5935 if (plugin_dev.m_ScriptConsole)
5936 plugin_dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5937 else
5938 plugin_remote_client.OnRPC(ctx);
5939 break;
5940 }
5941
5942 case ERPCs.DEV_AGENT_GROW:
5943 {
5945 break;
5946 }
5947
5948 case ERPCs.RPC_ITEM_DIAG_CLOSE:
5949 {
5951 mid.StopWatchRequest(this);
5952 break;
5953 }
5954
5956 case ERPCs.DEV_REQUEST_UTS_DEBUG:
5957 {
5958 PluginUniversalTemperatureSourceServer plugin_uts_server = PluginUniversalTemperatureSourceServer.Cast(
GetPlugin(PluginUniversalTemperatureSourceServer));
5959 plugin_uts_server.OnRPC(ctx, this);
5960 break;
5961 }
5962
5963 case ERPCs.DEV_UTS_DEBUG_DATA:
5964 {
5965 PluginUniversalTemperatureSourceClient plugin_uts_client = PluginUniversalTemperatureSourceClient.Cast(
GetPlugin(PluginUniversalTemperatureSourceClient));
5966 plugin_uts_client.OnRPC(ctx);
5967 break;
5968 }
5970 #endif
5971
5972 #ifdef DEVELOPER
5973 case ERPCs.DEV_RPC_SERVER_SCRIPT:
5974 {
5975
5976
5977
5978 if (ctx.
Read(CachedObjectsParams.PARAM1_STRING))
5979 {
5981 string code = CachedObjectsParams.PARAM1_STRING.param1;
5982 bool success =
g_Game.ExecuteEnforceScript(
"void scConsMain() \n{\n" + code +
"\n}\n",
"scConsMain");
5983 CachedObjectsParams.PARAM1_BOOL.param1 = success;
5984 RPCSingleParam(
ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT, CachedObjectsParams.PARAM1_BOOL,
true, GetIdentity());
5985 }
5986 break;
5987 }
5988
5989 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
5990 {
5991 PluginDeveloper dev = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
5992 if (dev.m_ScriptConsole)
5993 dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5994 break;
5995 }
5996
5997 case ERPCs.DEV_SET_DEV_ITEM:
5998 {
5999 Param1<EntityAI> ent = new Param1<EntityAI>(null);
6000 if (ctx.
Read(ent) && ent.param1)
6001 {
6003 mid2.RegisterDebugItem(ent.param1, this);
6004 }
6005
6006 break;
6007 }
6008
6009 case ERPCs.RPC_ITEM_DIAG:
6010 {
6011 Param1<EntityAI> p1 = new Param1<EntityAI>(null);
6013 {
6015 plgn.OnRPC(p1.param1, ctx);
6016 }
6017 break;
6018 }
6019 #endif
6020 }
6021
6022 #ifdef DIAG_DEVELOPER
6023 PluginDeveloper module_rc = PluginDeveloper.Cast(
GetPlugin(PluginDeveloper));
6024 if (module_rc)
6025 module_rc.OnRPC(this, rpc_type, ctx);
6026
6027 PluginDeveloperSync module_rcs = PluginDeveloperSync.Cast(
GetPlugin(PluginDeveloperSync));
6028 if (module_rcs)
6029 module_rcs.OnRPC(this, rpc_type, ctx);
6030
6031 #ifdef SERVER
6032 PluginDiagMenu plugin_diag_menu = PluginDiagMenu.Cast(
GetPlugin(PluginDiagMenuServer));
6033 #else
6034 PluginDiagMenu plugin_diag_menu = PluginDiagMenu.Cast(
GetPlugin(PluginDiagMenuClient));
6035 #endif
6036
6037 if (plugin_diag_menu)
6038 plugin_diag_menu.
OnRPC(
this, rpc_type, ctx);
6039 #endif
6040 }
void PluginItemDiagnostic()
PluginBase GetPlugin(typename plugin_type)
SymptomManager GetSymptomManager()
PlayerBase m_CheckPulseLastTarget
void MessageAction(string text)
ref PlayerAgentPool m_AgentPool
VirtualHud GetVirtualHud()
ref DebugMonitorValues m_DebugMonitorValues
SoftSkillsManager GetSoftSkillsManager()
ref TransferValues m_TrasferValues
PlayerStats GetPlayerStats()
QuickBarBase m_QuickBarBase
ref Param1< string > m_UAParamMessage
void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
proto bool Read(void value_in)
void SetCoolDown(bool cool_down)
void SetLastUAValue(float last_ua_value)
void SetGeneralBonusBefore(float general_bonus_before)
void SetCoolDownValue(float cooldown_value)
void SetGeneralBonusAfter(float general_bonus_after)
void SetSpecialtyLevel(float specialty_level)
proto string ToString(bool simple=true)
DayZPlayerInstanceType
defined in C++
proto native DayZPlayerInstanceType GetInstanceType()