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

◆ OnRPC()

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

uses contants outside of ERPCs !!!!

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

5294 {
5295 super.OnRPC(sender, rpc_type, ctx);
5296
5297 switch (rpc_type)
5298 {
5299 #ifndef SERVER
5300
5301 case ERPCs.RPC_PLAYER_STAT:
5302 if (GetPlayerStats())
5303 GetPlayerStats().OnRPC(ctx);
5304 break;
5305
5306 case ERPCs.RPC_SYNC_DISPLAY_STATUS:
5307 if (GetVirtualHud())
5308 {
5309 GetVirtualHud().OnRPC(ctx);
5310 }
5311 break;
5312
5313 case ERPCs.RPC_PLAYER_SYMPTOM_ON:
5314 if (GetSymptomManager())
5315 {
5316 GetSymptomManager().OnRPC(ERPCs.RPC_PLAYER_SYMPTOM_ON, ctx);
5317 }
5318 break;
5319
5320 case ERPCs.RPC_PLAYER_SYMPTOM_OFF:
5321 if (GetSymptomManager())
5322 {
5323 GetSymptomManager().OnRPC(ERPCs.RPC_PLAYER_SYMPTOM_OFF, ctx);
5324 }
5325 break;
5326
5327 case ERPCs.RPC_DAMAGE_VALUE_SYNC:
5328 if (m_TrasferValues)
5329 m_TrasferValues.OnRPC(ctx);
5330 break;
5331
5332 case ERPCs.RPC_USER_ACTION_MESSAGE:
5333 if (!GetInstanceType() == DayZPlayerInstanceType.INSTANCETYPE_CLIENT)
5334 {
5335 break;
5336 }
5337 if (ctx.Read(m_UAParamMessage))
5338 {
5339 string actiontext = m_UAParamMessage.param1;
5340 MessageAction(actiontext);
5341 }
5342 break;
5343
5344 case ERPCs.RPC_SOFT_SKILLS_SPECIALTY_SYNC:
5345 ref Param1<float> p_synch = new Param1<float>(0);
5346 ctx.Read(p_synch);
5347 float specialty_level = p_synch.param1;
5348 GetSoftSkillsManager().SetSpecialtyLevel(specialty_level);
5349 break;
5350
5351 case ERPCs.RPC_SOFT_SKILLS_STATS_SYNC:
5352 ref Param5<float, float, float, float, bool> p_debug_synch = new Param5<float, float ,float, float, bool>(0, 0, 0, 0, false);
5353 ctx.Read(p_debug_synch);
5354 float general_bonus_before = p_debug_synch.param1;
5355 float general_bonus_after = p_debug_synch.param2;
5356 float last_UA_value = p_debug_synch.param3;
5357 float cooldown_value = p_debug_synch.param4;
5358 float cooldown_active = p_debug_synch.param5;
5359 GetSoftSkillsManager().SetGeneralBonusBefore(general_bonus_before);
5360 GetSoftSkillsManager().SetGeneralBonusAfter(general_bonus_after);
5361 GetSoftSkillsManager().SetLastUAValue(last_UA_value);
5362 GetSoftSkillsManager().SetCoolDownValue(cooldown_value);
5363 GetSoftSkillsManager().SetCoolDown(cooldown_active);
5364 break;
5365
5366 case ERPCs.RPC_WARNING_ITEMDROP:
5367 {
5368 if (GetGame().IsClient() && GetGame().GetUIManager() && !GetGame().GetUIManager().FindMenu(MENU_WARNING_ITEMDROP))
5369 {
5370 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_WARNING_ITEMDROP,null);
5372 }
5373 break;
5374 }
5375
5376 case ERPCs.RPC_WARNING_TELEPORT:
5377 {
5378 if (GetGame().IsClient() && GetGame().GetUIManager() && !GetGame().GetUIManager().FindMenu(MENU_WARNING_TELEPORT))
5379 {
5380 GetGame().GetCallQueue(CALL_CATEGORY_GAMEPLAY).Call(GetGame().GetUIManager().EnterScriptedMenu,MENU_WARNING_TELEPORT,null);
5382 }
5383 break;
5384 }
5385 case ERPCs.RPC_INIT_SET_QUICKBAR:
5386 ref Param1<int> count = new Param1<int>(0);
5387 if (ctx.Read(count))
5388 {
5389 for (int i = 0; i < count.param1 ; i++)
5390 {
5391 m_QuickBarBase.OnSetEntityRPC(ctx);
5392 }
5393 }
5394 break;
5395
5396 case ERPCs.RPC_SYNC_THERMOMETER:
5397 {
5398 float value;
5399 if (ctx.Read(value))
5400 m_Hud.SetTemperature(value.ToString() + "#degrees_celsius");
5401 break;
5402 }
5403
5404
5405 case ERPCs.RPC_CHECK_PULSE:
5406 ctx.Read(CachedObjectsParams.PARAM1_INT);
5407 EPulseType pulse;
5408 if ((CachedObjectsParams.PARAM1_INT.param1 & ActionCheckPulse.TARGET_IRREGULAR_PULSE_BIT) == 0)
5409 {
5410 pulse = EPulseType.REGULAR;
5411 }
5412 else
5413 {
5414 pulse = EPulseType.IRREGULAR;
5415 }
5416
5417 int blood_level = ~ActionCheckPulse.TARGET_IRREGULAR_PULSE_BIT & CachedObjectsParams.PARAM1_INT.param1;
5419 {
5420 m_CheckPulseLastTarget.SetLastUAMessage(ActionCheckPulse.GetPulseMessage(pulse, blood_level));
5421 }
5422 break;
5423
5425 //woodcutting
5426 case PlantType.TREE_HARD:
5427 SoundHardTreeFallingPlay();
5428 break;
5429
5430 case PlantType.TREE_SOFT:
5431 SoundSoftTreeFallingPlay();
5432 break;
5433
5434 case PlantType.BUSH_HARD:
5435 SoundHardBushFallingPlay();
5436 break;
5437
5438 case PlantType.BUSH_SOFT:
5439 SoundSoftBushFallingPlay();
5440 break;
5441
5442 case ERPCs.RPC_DEBUG_MONITOR_FLT:
5444 {
5445 m_DebugMonitorValues.OnRPCFloat(ctx);
5446 }
5447 break;
5448
5449 case ERPCs.RPC_DEBUG_MONITOR_STR:
5451 {
5452 m_DebugMonitorValues.OnRPCString(ctx);
5453 }
5454 break;
5455 #endif
5456
5457
5458 /*
5459 case ERPCs.RPC_CRAFTING_INVENTORY_INSTANT:
5460 ref Param3<int, ItemBase, ItemBase> craftParam = new Param3<int, ItemBase, ItemBase>(-1, NULL, NULL);
5461 if (ctx.Read(craftParam))
5462 {
5463 m_ModuleRecipesManager.PerformRecipeServer(craftParam.param1, craftParam.param2, craftParam.param3, this);
5464 }
5465 break;
5466 */
5467
5468
5469
5470 #ifdef DIAG_DEVELOPER
5471 case ERPCs.DEV_RPC_AGENT_RESET:
5472 {
5473 bool val;
5474 if (ctx.Read(val))
5475 m_AgentPool.RemoveAllAgents();
5476 break;
5477 }
5478
5479 case ERPCs.DEV_PLAYER_DEBUG_REQUEST:
5480 {
5481 PluginRemotePlayerDebugServer plugin_remote_server = PluginRemotePlayerDebugServer.Cast(GetPlugin(PluginRemotePlayerDebugServer));
5482 plugin_remote_server.OnRPC(ctx, this);
5483 break;
5484 }
5485
5486 case ERPCs.DEV_PLAYER_DEBUG_DATA:
5487 {
5488 PluginRemotePlayerDebugClient plugin_remote_client = PluginRemotePlayerDebugClient.Cast(GetPlugin(PluginRemotePlayerDebugClient));
5489 PluginDeveloper plugin_dev = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
5490 if (plugin_dev.m_ScriptConsole)
5491 plugin_dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5492 else
5493 plugin_remote_client.OnRPC(ctx);
5494 break;
5495 }
5496
5497 case ERPCs.DEV_AGENT_GROW:
5498 {
5499 m_AgentPool.RemoteGrowRequestDebug(ctx);
5500 break;
5501 }
5502
5503 case ERPCs.RPC_ITEM_DIAG_CLOSE:
5504 {
5506 mid.StopWatchRequest(this);
5507 break;
5508 }
5509
5511 case ERPCs.DEV_REQUEST_UTS_DEBUG:
5512 {
5513 PluginUniversalTemperatureSourceServer plugin_uts_server = PluginUniversalTemperatureSourceServer.Cast(GetPlugin(PluginUniversalTemperatureSourceServer));
5514 plugin_uts_server.OnRPC(ctx, this);
5515 break;
5516 }
5517
5518 case ERPCs.DEV_UTS_DEBUG_DATA:
5519 {
5520 PluginUniversalTemperatureSourceClient plugin_uts_client = PluginUniversalTemperatureSourceClient.Cast(GetPlugin(PluginUniversalTemperatureSourceClient));
5521 plugin_uts_client.OnRPC(ctx);
5522 break;
5523 }
5525 #endif
5526
5527 #ifdef DEVELOPER
5528 case ERPCs.DEV_RPC_SERVER_SCRIPT:
5529 {
5530 //PluginItemDiagnostic plugin = PluginItemDiagnostic.Cast(GetPlugin(PluginItemDiagnostic));
5531 //SetDebugDeveloper_item(plugin.GetWatchedItem(this));//!! needs to be inside DEVELOPER ifdef
5532
5533 if (ctx.Read(CachedObjectsParams.PARAM1_STRING))
5534 {
5535 _player = this;
5536 string code = CachedObjectsParams.PARAM1_STRING.param1;
5537 bool success = GetGame().ExecuteEnforceScript("void scConsMain() \n{\n" + code + "\n}\n", "scConsMain");
5538 CachedObjectsParams.PARAM1_BOOL.param1 = success;
5539 RPCSingleParam(ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT, CachedObjectsParams.PARAM1_BOOL,true, GetIdentity());
5540 }
5541 break;
5542 }
5543
5544 case ERPCs.DEV_RPC_SERVER_SCRIPT_RESULT:
5545 {
5546 PluginDeveloper dev = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
5547 if (dev.m_ScriptConsole)
5548 dev.m_ScriptConsole.OnRPCEx(rpc_type, ctx);
5549 break;
5550 }
5551
5552 case ERPCs.DEV_SET_DEV_ITEM:
5553 {
5554 Param1<EntityAI> ent = new Param1<EntityAI>(null);
5555 if (ctx.Read(ent) && ent.param1)
5556 {
5558 mid2.RegisterDebugItem(ent.param1, this);
5559 }
5560 //SetDebugDeveloper_item(this);
5561 break;
5562 }
5563
5564 case ERPCs.RPC_ITEM_DIAG:
5565 {
5566 Param1<EntityAI> p1 = new Param1<EntityAI>(null);
5567 if (ctx.Read(p1))
5568 {
5570 plgn.OnRPC(p1.param1, ctx);
5571 }
5572 break;
5573 }
5574 #endif
5575 }
5576
5577 #ifdef DIAG_DEVELOPER
5578 PluginDeveloper module_rc = PluginDeveloper.Cast(GetPlugin(PluginDeveloper));
5579 if (module_rc)
5580 module_rc.OnRPC(this, rpc_type, ctx);
5581
5582 PluginDeveloperSync module_rcs = PluginDeveloperSync.Cast(GetPlugin(PluginDeveloperSync));
5583 if (module_rcs)
5584 module_rcs.OnRPC(this, rpc_type, ctx);
5585
5586 #ifdef SERVER
5587 PluginDiagMenu plugin_diag_menu = PluginDiagMenu.Cast(GetPlugin(PluginDiagMenuServer));
5588 #else
5589 PluginDiagMenu plugin_diag_menu = PluginDiagMenu.Cast(GetPlugin(PluginDiagMenuClient));
5590 #endif
5591
5592 if (plugin_diag_menu)
5593 plugin_diag_menu.OnRPC(this, rpc_type, ctx);
5594 #endif
5595 }
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:2663
PlayerBase m_CheckPulseLastTarget
Определения PlayerBase.c:140
void MessageAction(string text)
Определения PlayerBase.c:6377
ref PlayerAgentPool m_AgentPool
Определения PlayerBase.c:44
VirtualHud GetVirtualHud()
Определения PlayerBase.c:2667
ref DebugMonitorValues m_DebugMonitorValues
Определения PlayerBase.c:56
SoftSkillsManager GetSoftSkillsManager()
Определения PlayerBase.c:6744
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
Определения 3_Game/constants.c:210
const int MENU_WARNING_ITEMDROP
Определения 3_Game/constants.c:208
const int CALL_CATEGORY_GAMEPLAY
Определения 3_Game/tools/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().