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

◆ OnRPC()

override void ManBase::OnRPC ( PlayerIdentity sender,
int rpc_type,
ParamsReadContext ctx )
inlineprotected

uses contants outside of ERPCs !!!!

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

5304 {
5305 super.OnRPC(sender, rpc_type, ctx);
5306
5307 switch (rpc_type)
5308 {
5309 #ifndef SERVER
5310
5311 case ERPCs.RPC_PLAYER_STAT:
5312 if (GetPlayerStats())
5313 GetPlayerStats().OnRPC(ctx);
5314 break;
5315
5316 case ERPCs.RPC_SYNC_DISPLAY_STATUS:
5317 if (GetVirtualHud())
5318 {
5319 GetVirtualHud().OnRPC(ctx);
5320 }
5321 break;
5322
5323 case ERPCs.RPC_PLAYER_SYMPTOM_ON:
5324 if (GetSymptomManager())
5325 {
5326 GetSymptomManager().OnRPC(ERPCs.RPC_PLAYER_SYMPTOM_ON, ctx);
5327 }
5328 break;
5329
5330 case ERPCs.RPC_PLAYER_SYMPTOM_OFF:
5331 if (GetSymptomManager())
5332 {
5333 GetSymptomManager().OnRPC(ERPCs.RPC_PLAYER_SYMPTOM_OFF, ctx);
5334 }
5335 break;
5336
5337 case ERPCs.RPC_DAMAGE_VALUE_SYNC:
5338 if (m_TrasferValues)
5339 m_TrasferValues.OnRPC(ctx);
5340 break;
5341
5342 case ERPCs.RPC_USER_ACTION_MESSAGE:
5343 if (!GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT)
5344 {
5345 break;
5346 }
5347 if (ctx.Read(m_UAParamMessage))
5348 {
5349 string actiontext = m_UAParamMessage.param1;
5350 MessageAction(actiontext);
5351 }
5352 break;
5353
5354 case ERPCs.RPC_SOFT_SKILLS_SPECIALTY_SYNC:
5355 ref Param1<float> p_synch = new Param1<float>(0);
5356 ctx.Read(p_synch);
5357 float specialty_level = p_synch.param1;
5358 GetSoftSkillsManager().SetSpecialtyLevel(specialty_level);
5359 break;
5360
5361 case ERPCs.RPC_SOFT_SKILLS_STATS_SYNC:
5362 ref Param5<float, float, float, float, bool> p_debug_synch = new Param5<float, float ,float, float, bool>(0, 0, 0, 0, false);
5363 ctx.Read(p_debug_synch);
5364 float general_bonus_before = p_debug_synch.param1;
5365 float general_bonus_after = p_debug_synch.param2;
5366 float last_UA_value = p_debug_synch.param3;
5367 float cooldown_value = p_debug_synch.param4;
5368 float cooldown_active = p_debug_synch.param5;
5369 GetSoftSkillsManager().SetGeneralBonusBefore(general_bonus_before);
5370 GetSoftSkillsManager().SetGeneralBonusAfter(general_bonus_after);
5371 GetSoftSkillsManager().SetLastUAValue(last_UA_value);
5372 GetSoftSkillsManager().SetCoolDownValue(cooldown_value);
5373 GetSoftSkillsManager().SetCoolDown(cooldown_active);
5374 break;
5375
5376 case ERPCs.RPC_WARNING_ITEMDROP:
5377 {
5378 if (GetGame().IsClient() && GetGame().GetUIManager() && !GetGame().GetUIManager().FindMenu(MENU_WARNING_ITEMDROP))
5379 {
5380 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_WARNING_ITEMDROP,null);
5382 }
5383 break;
5384 }
5385
5386 case ERPCs.RPC_WARNING_TELEPORT:
5387 {
5388 if (GetGame().IsClient() && GetGame().GetUIManager() && !GetGame().GetUIManager().FindMenu(MENU_WARNING_TELEPORT))
5389 {
5390 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_WARNING_TELEPORT,null);
5392 }
5393 break;
5394 }
5395 case ERPCs.RPC_INIT_SET_QUICKBAR:
5396 ref Param1<int> count = new Param1<int>(0);
5397 if (ctx.Read(count));
5398 {
5399 for (int i = 0; i < count.param1 ; i++)
5400 {
5401 m_QuickBarBase.OnSetEntityRPC(ctx);
5402 }
5403 }
5404 break;
5405
5406 case ERPCs.RPC_SYNC_THERMOMETER:
5407 {
5408 float value;
5409 if (ctx.Read(value))
5410 m_Hud.SetTemperature(value.ToString() + "#degrees_celsius");
5411 break;
5412 }
5413
5414
5415 case ERPCs.RPC_CHECK_PULSE:
5416 ctx.Read(CachedObjectsParams.PARAM1_INT);
5417 EPulseType pulse;
5418 if ((CachedObjectsParams.PARAM1_INT.param1 & ActionCheckPulse.TARGET_IRREGULAR_PULSE_BIT) == 0)
5419 {
5420 pulse = EPulseType.REGULAR;
5421 }
5422 else
5423 {
5424 pulse = EPulseType.IRREGULAR;
5425 }
5426
5427 int blood_level = ~ActionCheckPulse.TARGET_IRREGULAR_PULSE_BIT & CachedObjectsParams.PARAM1_INT.param1;
5429 {
5430 m_CheckPulseLastTarget.SetLastUAMessage(ActionCheckPulse.GetPulseMessage(pulse, blood_level));
5431 }
5432 break;
5433
5435 //woodcutting
5436 case PlantType.TREE_HARD:
5437 SoundHardTreeFallingPlay();
5438 break;
5439
5440 case PlantType.TREE_SOFT:
5441 SoundSoftTreeFallingPlay();
5442 break;
5443
5444 case PlantType.BUSH_HARD:
5445 SoundHardBushFallingPlay();
5446 break;
5447
5448 case PlantType.BUSH_SOFT:
5449 SoundSoftBushFallingPlay();
5450 break;
5451
5452 case ERPCs.RPC_DEBUG_MONITOR_FLT:
5454 {
5455 m_DebugMonitorValues.OnRPCFloat(ctx);
5456 }
5457 break;
5458
5459 case ERPCs.RPC_DEBUG_MONITOR_STR:
5461 {
5462 m_DebugMonitorValues.OnRPCString(ctx);
5463 }
5464 break;
5465 #endif
5466
5467
5468 /*
5469 case ERPCs.RPC_CRAFTING_INVENTORY_INSTANT:
5470 ref Param3<int, ItemBase, ItemBase> craftParam = new Param3<int, ItemBase, ItemBase>(-1, NULL, NULL);
5471 if (ctx.Read(craftParam))
5472 {
5473 m_ModuleRecipesManager.PerformRecipeServer(craftParam.param1, craftParam.param2, craftParam.param3, this);
5474 }
5475 break;
5476 */
5477
5478
5479
5480 #ifdef DIAG_DEVELOPER
5481 case ERPCs.DEV_RPC_AGENT_RESET:
5482 {
5483 bool val;
5484 if (ctx.Read(val))
5485 m_AgentPool.RemoveAllAgents();
5486 break;
5487 }
5488
5489 case ERPCs.DEV_PLAYER_DEBUG_REQUEST:
5490 {
5491 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(GetPlugin(PluginRemotePlayerDebugServer));
5492 plugin_remote_server.OnRPC(ctx, this);
5493 break;
5494 }
5495
5496 case ERPCs.DEV_PLAYER_DEBUG_DATA:
5497 {
5498 PluginRemotePlayerDebugClient plugin_remote_client = PluginRemotePlayerDebugClient.Cast(GetPlugin(PluginRemotePlayerDebugClient));
5499 PluginDeveloper plugin_dev = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
5500 if (plugin_dev.m_ScriptConsole)
5501 plugin_dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5502 else
5503 plugin_remote_client.OnRPC(ctx);
5504 break;
5505 }
5506
5507 case ERPCs.DEV_AGENT_GROW:
5508 {
5509 m_AgentPool.RemoteGrowRequestDebug(ctx);
5510 break;
5511 }
5512
5513 case ERPCs.RPC_ITEM_DIAG_CLOSE:
5514 {
5516 mid.StopWatchRequest(this);
5517 break;
5518 }
5519
5521 case ERPCs.DEV_REQUEST_UTS_DEBUG:
5522 {
5523 PluginUniversalTemperatureSourceServer plugin_uts_server = PluginUniversalTemperatureSourceServer.Cast(GetPlugin(PluginUniversalTemperatureSourceServer));
5524 plugin_uts_server.OnRPC(ctx, this);
5525 break;
5526 }
5527
5528 case ERPCs.DEV_UTS_DEBUG_DATA:
5529 {
5530 PluginUniversalTemperatureSourceClient plugin_uts_client = PluginUniversalTemperatureSourceClient.Cast(GetPlugin(PluginUniversalTemperatureSourceClient));
5531 plugin_uts_client.OnRPC(ctx);
5532 break;
5533 }
5535 #endif
5536
5537 #ifdef DEVELOPER
5538 case ERPCs.DEV_RPC_SERVER_SCRIPT:
5539 {
5540 //PluginItemDiagnostic plugin = PluginItemDiagnostic.Cast(GetPlugin(PluginItemDiagnostic));
5541 //SetDebugDeveloper_item(plugin.GetWatchedItem(this));//!! needs to be inside DEVELOPER ifdef
5542
5543 if (ctx.Read(CachedObjectsParams.PARAM1_STRING))
5544 {
5545 _player = this;
5546 string code = CachedObjectsParams.PARAM1_STRING.param1;
5547 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
5548 CachedObjectsParams.PARAM1_BOOL.param1 = success;
5549 RPCSingleParam(ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT, CachedObjectsParams.PARAM1_BOOL,true, GetIdentity());
5550 }
5551 break;
5552 }
5553
5554 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
5555 {
5556 PluginDeveloper dev = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
5557 if (dev.m_ScriptConsole)
5558 dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5559 break;
5560 }
5561
5562 case ERPCs.DEV_SET_DEV_ITEM:
5563 {
5564 Param1<EntityAI> ent = new Param1<EntityAI>(null);
5565 if (ctx.Read(ent) && ent.param1)
5566 {
5568 mid2.RegisterDebugItem(ent.param1, this);
5569 }
5570 //SetDebugDeveloper_item(this);
5571 break;
5572 }
5573
5574 case ERPCs.RPC_ITEM_DIAG:
5575 {
5576 Param1<EntityAI> p1 = new Param1<EntityAI>(null);
5577 if (ctx.Read(p1))
5578 {
5580 plgn.OnRPC(p1.param1, ctx);
5581 }
5582 break;
5583 }
5584 #endif
5585 }
5586
5587 #ifdef DIAG_DEVELOPER
5588 PluginDeveloper module_rc = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
5589 if (module_rc)
5590 module_rc.OnRPC(this, rpc_type, ctx);
5591
5592 PluginDeveloperSync module_rcs = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
5593 if (module_rcs)
5594 module_rcs.OnRPC(this, rpc_type, ctx);
5595
5596 #ifdef SERVER
5597 PluginDiagMenu plugin_diag_menu = PluginDiagMenu.Cast(GetPlugin(PluginDiagMenuServer));
5598 #else
5599 PluginDiagMenu plugin_diag_menu = PluginDiagMenu.Cast(GetPlugin(PluginDiagMenuClient));
5600 #endif
5601
5602 if (plugin_diag_menu)
5603 plugin_diag_menu.OnRPC(this, rpc_type, ctx);
5604 #endif
5605 }
EPulseType
Определения EPulseType.c:2
ERPCs
Определения ERPCs.c:2
void PluginItemDiagnostic()
Определения PluginItemDiagnostic.c:74
PluginBase GetPlugin(typename plugin_type)
Определения PluginManager.c:316
PlayerBase _player
Определения QuickBarBase.c:18
override ScriptCallQueue GetCallQueue(int call_category)
Определения DayZGame.c:1187
proto native bool ExecuteEnforceScript(string expression, string mainFnName)
Delevoper only: Executes Enforce Script expression, if there is an error, is printed into the script ...
proto native Mission GetMission()
SymptomManager GetSymptomManager()
Определения PlayerBase.c:2665
PlayerBase m_CheckPulseLastTarget
Определения PlayerBase.c:140
void MessageAction(string text)
Определения PlayerBase.c:6385
ref PlayerAgentPool m_AgentPool
Определения PlayerBase.c:44
VirtualHud GetVirtualHud()
Определения PlayerBase.c:2669
ref DebugMonitorValues m_DebugMonitorValues
Определения PlayerBase.c:56
SoftSkillsManager GetSoftSkillsManager()
Определения PlayerBase.c:6752
ref TransferValues m_TrasferValues
Определения PlayerBase.c:55
Hud m_Hud
Определения PlayerBase.c:93
PlayerStats GetPlayerStats()
Определения PlayerBase.c:1844
QuickBarBase m_QuickBarBase
Определения PlayerBase.c:86
ref Param1< string > m_UAParamMessage
Определения PlayerBase.c:68
void AddActiveInputExcludes(array< string > excludes)
void OnRPC(PlayerBase player, int rpc_type, ParamsReadContext ctx)
Определения PluginDeveloper.c:61
proto void Call(func fn, void param1=NULL, void param2=NULL, void param3=NULL, void param4=NULL, void param5=NULL, void param6=NULL, void param7=NULL, void param8=NULL, void param9=NULL)
adds call into the queue with given parameters and arguments (arguments are held in memory until the ...
proto bool Read(void value_in)
void SetCoolDown(bool cool_down)
Определения SoftSkillsManager.c:369
void SetLastUAValue(float last_ua_value)
Определения SoftSkillsManager.c:433
void SetGeneralBonusBefore(float general_bonus_before)
Определения SoftSkillsManager.c:501
void SetCoolDownValue(float cooldown_value)
Определения SoftSkillsManager.c:415
void SetGeneralBonusAfter(float general_bonus_after)
Определения SoftSkillsManager.c:513
void SetSpecialtyLevel(float specialty_level)
Определения SoftSkillsManager.c:290
void OnRPC(int rpc_type, ParamsReadContext ctx)
Определения StateManager.c:590
proto string ToString(bool simple=true)
DayZPlayerInstanceType
defined in C++
Определения dayzplayer.c:1068
proto native DayZPlayerInstanceType GetInstanceType()
proto native CGame GetGame()
const int MENU_WARNING_TELEPORT
Определения constants.c:210
const int MENU_WARNING_ITEMDROP
Определения constants.c:208
const int CALL_CATEGORY_GAMEPLAY
Определения tools.c:10

Перекрестные ссылки _player, Mission::AddActiveInputExcludes(), ScriptCallQueue::Call(), CALL_CATEGORY_GAMEPLAY, CGame::ExecuteEnforceScript(), CGame::GetCallQueue(), GetGame(), GetInstanceType(), CGame::GetMission(), GetPlayerStats(), GetPlugin(), ActionCheckPulse::GetPulseMessage(), GetSoftSkillsManager(), GetSymptomManager(), GetVirtualHud(), m_AgentPool, m_CheckPulseLastTarget, m_DebugMonitorValues, m_Hud, m_QuickBarBase, m_TrasferValues, m_UAParamMessage, MENU_WARNING_ITEMDROP, MENU_WARNING_TELEPORT, MessageAction(), PluginBase::OnRPC(), CachedObjectsParams::PARAM1_BOOL, CachedObjectsParams::PARAM1_INT, CachedObjectsParams::PARAM1_STRING, PluginItemDiagnostic(), Serializer::Read(), ActionCheckPulse::TARGET_IRREGULAR_PULSE_BIT и float::ToString().