3142 {
3143 super.OnRPC(sender, target, rpc_type, ctx);
3144 Event_OnRPC.Invoke(sender, target, rpc_type, ctx);
3145
3146
3147
3148 if (target)
3149 {
3150
3151 target.OnRPC(sender, rpc_type, ctx);
3152 }
3153 else
3154 {
3155 switch (rpc_type)
3156 {
3157 #ifndef SERVER
3158 #ifndef NO_GUI
3159 case ERPCs.RPC_CFG_GAMEPLAY_SYNC:
3160 {
3161 CfgGameplayHandler.OnRPC(null, ctx);
3162 break;
3163 }
3164 case ERPCs.RPC_BUNKERBROADCAST_CONFIG_SYNC:
3165 {
3166 CfgBunkerBroadcastHandler.OnRPC(ctx);
3167 break;
3168 }
3169 case ERPCs.RPC_UNDERGROUND_SYNC:
3170 {
3171 UndergroundAreaLoader.OnRPC(ctx);
3172 break;
3173 }
3174 case ERPCs.RPC_PLAYERRESTRICTEDAREAS_SYNC:
3175 {
3176 CfgPlayerRestrictedAreaHandler.OnRPC(ctx);
3177 break;
3178 }
3179 case ERPCs.RPC_SEND_NOTIFICATION:
3180 {
3182 float show_time;
3183 string detail_text;
3184
3186 ctx.
Read(show_time);
3187 ctx.
Read(detail_text);
3188
3189 NotificationSystem.AddNotification(type, show_time, detail_text);
3190 break;
3191 }
3192 case ERPCs.RPC_SEND_NOTIFICATION_EXTENDED:
3193 {
3194 float show_time_ext;
3195 string title_text_ext;
3196 string detail_text_ext;
3197 string icon_ext;
3198
3199 ctx.
Read(show_time_ext);
3200 ctx.
Read(title_text_ext);
3201 ctx.
Read(detail_text_ext);
3203
3204 NotificationSystem.AddNotificationExtended(show_time_ext, title_text_ext, detail_text_ext, icon_ext);
3205 break;
3206 }
3207
3208
3209 case ERPCs.RPC_SOUND_HELICRASH:
3210 {
3211 bool playSound;
3212 vector pos;
3213 string sound_set;
3214
3215
3216 Param3<bool, vector, int> playCrashSound = new Param3<bool, vector, int>(false, "0 0 0",0);
3217 if (ctx.
Read(playCrashSound))
3218 {
3219 playSound = playCrashSound.param1;
3220 pos = playCrashSound.param2;
3221 sound_set = CrashSoundSets.GetSoundSetByHash(playCrashSound.param3);
3222 }
3223
3224 if (playSound)
3225 {
3226 m_CrashSound = SEffectManager.PlaySound(sound_set, pos, 0.1, 0.1);
3228 }
3229
3230 break;
3231 }
3232
3233 case ERPCs.RPC_SOUND_ARTILLERY:
3234 {
3236 Param1<vector> playArtySound = new Param1<vector>(vector.Zero);
3237 if (ctx.
Read(playArtySound))
3238 {
3241 break;
3242 }
3243 else
3244 break;
3245
3247 break;
3248
3250 break;
3251
3252 m_ArtySound = SEffectManager.PlaySound(
"Artillery_Distant_Barrage_SoundSet",
position, 0.1, 0.1);
3254
3255 break;
3256 }
3257 case ERPCs.RPC_SOUND_CONTAMINATION:
3258 {
3259 vector soundPos;
3260
3261 Param1<vector> playContaminatedSound = new Param1<vector>(vector.Zero);
3262 if (ctx.
Read(playContaminatedSound))
3263 {
3264 soundPos = playContaminatedSound.param1;
3265 if (soundPos == vector.Zero)
3266 break;
3267 }
3268 else
3269 break;
3270
3272 break;
3273
3274 EffectSound closeArtySound = SEffectManager.PlaySound("Artillery_Close_SoundSet", soundPos);
3276
3277
3278 float distance_to_player = vector.DistanceSq(soundPos,
g_Game.GetPlayer().GetPosition());
3279 if (distance_to_player <= GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE2)
3280 {
3281 float strength_factor = Math.InverseLerp(GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE, 0, Math.Sqrt(distance_to_player));
3283 if (camera)
3284 camera.SpawnCameraShake(strength_factor * 4);
3285 }
3286
3287 ParticleManager.GetInstance().PlayInWorld(ParticleList.CONTAMINATED_AREA_GAS_SHELL, soundPos);
3288 break;
3289 }
3290
3291 case ERPCs.RPC_SOUND_ARTILLERY_SINGLE:
3292 {
3293 vector soundPosition;
3294 vector delayedSoundPos;
3295 float soundDelay;
3296
3297 Param3<vector, vector, float> playArtyShotSound = new Param3<vector, vector, float>(vector.Zero, vector.Zero, 0);
3298 if (ctx.
Read(playArtyShotSound))
3299 {
3300 soundPosition = playArtyShotSound.param1;
3301 delayedSoundPos = playArtyShotSound.param2;
3302 soundDelay = playArtyShotSound.param3;
3303 if (soundPosition == vector.Zero)
3304 break;
3305 }
3306 else
3307 break;
3308
3310 break;
3311
3312 m_ArtySound = SEffectManager.PlaySound(
"Artillery_Distant_SoundSet", soundPosition, 0.1, 0.1);
3314
3315
3316 soundDelay -= 5;
3317
3318 soundDelay *= 1000;
3320 break;
3321 }
3322 case ERPCs.RPC_SET_BILLBOARDS:
3323 {
3326
3327 Param1<int> indexP = new Param1<int>(-1);
3328 if (ctx.
Read(indexP))
3329 {
3330 int index = indexP.param1;
3332 }
3333 break;
3334 }
3335 #endif
3336 #endif
3337
3338 case ERPCs.RPC_USER_SYNC_PERMISSIONS:
3339 {
3340 map<string, bool> mute_list;
3341 if (ctx.
Read(mute_list))
3342 {
3343 for (int i = 0; i < mute_list.Count(); i++)
3344 {
3345 string uid = mute_list.GetKey(i);
3346 bool mute = mute_list.GetElement(i);
3348 }
3349 }
3350 break;
3351 }
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364 #ifdef DEVELOPER
3365 Weather weather;
3366 case ERPCs.DEV_SET_WEATHER:
3367 {
3368 Param1<DebugWeatherRPCData> p1data = new Param1<DebugWeatherRPCData>(null);
3369
3370 if ( ctx.
Read(p1data) )
3371 {
3372 DebugWeatherRPCData data = p1data.param1;
3373 weather =
g_Game.GetWeather();
3374
3377
3380
3383
3386
3389
3392
3395
3398
3401 }
3402 else
3403 {
3404 ErrorEx(
"Failed to read weather debug data");
3405 }
3406 break;
3407 }
3408 case ERPCs.DEV_SET_SANDSTORM:
3409 {
3410 Param1<DebugSandstormRPCData> p1SandstormData = new Param1<DebugSandstormRPCData>(null);
3411
3412 if (ctx.
Read(p1SandstormData))
3413 {
3414 DebugSandstormRPCData sandstormData = p1SandstormData.param1;
3415 weather =
g_Game.GetWeather();
3416
3417
3420
3421
3422 weather.
GetWindDirection().
Set(stormAngle, sandstormData.m_FadeInTime, sandstormData.m_Duration);
3423
3424 if (sandstormData.m_OvercastValue < 0.8)
3425 sandstormData.m_OvercastValue = 0.8;
3426
3427 weather.
GetOvercast().
Set(sandstormData.m_OvercastValue, sandstormData.m_FadeInTime, sandstormData.m_Duration);
3428
3429 if (sandstormData.m_WindMagnitudeValue < 18.0)
3430 sandstormData.m_WindMagnitudeValue = 18.0;
3431
3432 weather.
GetWindMagnitude().
Set(sandstormData.m_WindMagnitudeValue, sandstormData.m_FadeInTime, sandstormData.m_Duration);
3433 weather.
GetRain().
Set(0, sandstormData.m_FadeInTime, sandstormData.m_Duration);
3434
3435 if (sandstormData.m_StartStorm)
3437 }
3438 }
3439 case ERPCs.DEV_STOP_SANDSTORM:
3440 {
3441 weather =
g_Game.GetWeather();
3443 return;
3444
3446 }
3447 case ERPCs.DEV_SET_SANDSTORM_WEATHER:
3448 {
3449 weather =
g_Game.GetWeather();
3451 return;
3452
3455 }
3456 case ERPCs.DEV_STOP_SANDSTORM_WEATHER:
3457 {
3458 weather =
g_Game.GetWeather();
3460 return;
3461
3464 }
3465 #endif
3466
3467
3468 #ifdef DIAG_DEVELOPER
3469 #ifdef SERVER
3470 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
3471 {
3472 if (!m_CameraToolsMenuServer)
3473 {
3474 m_CameraToolsMenuServer = new CameraToolsMenuServer;
3475 }
3476 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3477 break;
3478 }
3479
3480 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
3481 {
3482 if (!m_CameraToolsMenuServer)
3483 {
3484 m_CameraToolsMenuServer = new CameraToolsMenuServer;
3485 }
3486 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3487 break;
3488 }
3489 case ERPCs.DIAG_GEYSER_VALUES:
3490 {
3491 auto geyserParams = new Param3<bool, float, float>(false, 0, 0);
3492 if (ctx.
Read(geyserParams))
3493 {
3494 if (!m_GeyserDiagData)
3495 m_GeyserDiagData = new GeyserDebugData();
3496
3497 m_GeyserDiagData.SetData(geyserParams.param1, geyserParams.param2, geyserParams.param3);
3498 }
3499 break;
3500 }
3501 #endif
3502 #endif
3503
3504 }
3505
3506 }
3507 }
NotificationType
DEPRECATED (moved into NotificationSystem)
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)
ref EffectSound m_ArtySound
void DelayedMidAirDetonation(float x, float y, float z)
override ScriptCallQueue GetCallQueue(int call_category)
proto native void MutePlayer(string muteUID, string playerUID, bool mute)
Mutes voice of source player to target player.
static ref ScriptInvoker Event_OnRPC
void ForceOvercastReset()
ref EffectSound m_CrashSound
ref BillboardSetHandler m_BillboardSetHandler
const int MIN_ARTY_SOUND_RANGE
float m_OvercastInterpolation
float m_SnowfallInterpolation
float m_WindDirectionValue
float m_VolFogDistanceDensity
float m_VolFogHeightBiasTime
float m_VolFogDistanceDensityTime
float m_VolFogHeightDensityTime
float m_WindDInterpolation
float m_VolFogHeightDensity
float m_RainInterpolation
float m_WindMagnitudeValue
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
proto string GetPlainId()
plaintext unique id of player (cannot be used in database or logs)
proto native void Stop(float duration, bool calledByWeather)
Stops the sandstorm, leaving it to fade out over duration seconds. The sandstorm must be active prior...
proto native bool Start(float duration, bool calledByWeather)
proto native vector GetDirection()
Returns the direction from the start position to the end position of the sandstorm.
proto native bool IsActive()
Returns whether sandstorm is currently active.
proto void CallLater(func fn, int delay=0, bool repeat=false, 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)
proto native Fog GetFog()
Returns a fog phenomenon object.
proto native void SetDynVolFogHeightBias(float value, float time=0)
Sets the 'dynamic' volumetric height bias. Takes effect only if enabled via world config.
proto native WindMagnitude GetWindMagnitude()
Returns a wind magnitude phenomenon object.
proto native void SetDynVolFogDistanceDensity(float value, float time=0)
Sets the dynamic volumetric fog distance density. Only takes effect if dynamic volumetric fog is enab...
proto native Sandstorm GetSandstorm()
Returns the sandstorm phenomenon weather controller.
proto native Snowfall GetSnowfall()
Returns a snowfall phenomenon object.
static proto float WindDirectionToAngle(vector dir)
Returns the xz angle of the provided wind vector.
proto native WindDirection GetWindDirection()
Returns a wind direction phenomenon object.
proto native void SetDynVolFogHeightDensity(float value, float time=0)
Sets the dynamic volumetric fog height density. Only takes effect if dynamic volumetric fog is enable...
proto native Rain GetRain()
Returns a rain phenomenon object.
proto native Overcast GetOvercast()
Returns an overcast phenomenon object.
proto native void Set(float forecast, float time=0, float minDuration=0)
Sets the forecast.
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)