3087 {
3088 super.OnRPC(sender, target, rpc_type, ctx);
3089 Event_OnRPC.Invoke(sender, target, rpc_type, ctx);
3090
3091
3092
3093 if (target)
3094 {
3095
3096 target.OnRPC(sender, rpc_type, ctx);
3097 }
3098 else
3099 {
3100 switch (rpc_type)
3101 {
3102 #ifndef SERVER
3103 #ifndef NO_GUI
3104 case ERPCs.RPC_CFG_GAMEPLAY_SYNC:
3105 {
3106 CfgGameplayHandler.OnRPC(null, ctx);
3107 break;
3108 }
3109 case ERPCs.RPC_UNDERGROUND_SYNC:
3110 {
3111 UndergroundAreaLoader.OnRPC(ctx);
3112 break;
3113 }
3114 case ERPCs.RPC_PLAYERRESTRICTEDAREAS_SYNC:
3115 {
3116 CfgPlayerRestrictedAreaHandler.OnRPC(ctx);
3117 break;
3118 }
3119 case ERPCs.RPC_SEND_NOTIFICATION:
3120 {
3122 float show_time;
3123 string detail_text;
3124
3126 ctx.
Read(show_time);
3127 ctx.
Read(detail_text);
3128
3129 NotificationSystem.AddNotification(type, show_time, detail_text);
3130 break;
3131 }
3132 case ERPCs.RPC_SEND_NOTIFICATION_EXTENDED:
3133 {
3134 float show_time_ext;
3135 string title_text_ext;
3136 string detail_text_ext;
3137 string icon_ext;
3138
3139 ctx.
Read(show_time_ext);
3140 ctx.
Read(title_text_ext);
3141 ctx.
Read(detail_text_ext);
3143
3144 NotificationSystem.AddNotificationExtended(show_time_ext, title_text_ext, detail_text_ext, icon_ext);
3145 break;
3146 }
3147
3148
3149 case ERPCs.RPC_SOUND_HELICRASH:
3150 {
3151 bool playSound;
3152 vector pos;
3153 string sound_set;
3154
3155
3156 Param3<bool, vector, int> playCrashSound = new Param3<bool, vector, int>(false, "0 0 0",0);
3157 if (ctx.
Read(playCrashSound))
3158 {
3159 playSound = playCrashSound.param1;
3160 pos = playCrashSound.param2;
3161 sound_set = CrashSoundSets.GetSoundSetByHash(playCrashSound.param3);
3162 }
3163
3164 if (playSound)
3165 {
3166 m_CrashSound = SEffectManager.PlaySound(sound_set, pos, 0.1, 0.1);
3168 }
3169
3170 break;
3171 }
3172
3173 case ERPCs.RPC_SOUND_ARTILLERY:
3174 {
3175 vector position;
3176 Param1<vector> playArtySound = new Param1<vector>(vector.Zero);
3177 if (ctx.
Read(playArtySound))
3178 {
3179 position = playArtySound.param1;
3180 if (position == vector.Zero)
3181 break;
3182 }
3183 else
3184 break;
3185
3187 break;
3188
3190 break;
3191
3192 m_ArtySound = SEffectManager.PlaySound(
"Artillery_Distant_Barrage_SoundSet", position, 0.1, 0.1);
3194
3195 break;
3196 }
3197 case ERPCs.RPC_SOUND_CONTAMINATION:
3198 {
3199 vector soundPos;
3200
3201 Param1<vector> playContaminatedSound = new Param1<vector>(vector.Zero);
3202 if (ctx.
Read(playContaminatedSound))
3203 {
3204 soundPos = playContaminatedSound.param1;
3205 if (soundPos == vector.Zero)
3206 break;
3207 }
3208 else
3209 break;
3210
3212 break;
3213
3214 EffectSound closeArtySound = SEffectManager.PlaySound("Artillery_Close_SoundSet", soundPos);
3216
3217
3218 float distance_to_player = vector.DistanceSq(soundPos,
g_Game.GetPlayer().GetPosition());
3219 if (distance_to_player <= GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE2)
3220 {
3221 float strength_factor = Math.InverseLerp(GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE, 0, Math.Sqrt(distance_to_player));
3223 if (camera)
3224 camera.SpawnCameraShake(strength_factor * 4);
3225 }
3226
3227 ParticleManager.GetInstance().PlayInWorld(ParticleList.CONTAMINATED_AREA_GAS_SHELL, soundPos);
3228 break;
3229 }
3230
3231 case ERPCs.RPC_SOUND_ARTILLERY_SINGLE:
3232 {
3233 vector soundPosition;
3234 vector delayedSoundPos;
3235 float soundDelay;
3236
3237 Param3<vector, vector, float> playArtyShotSound = new Param3<vector, vector, float>(vector.Zero, vector.Zero, 0);
3238 if (ctx.
Read(playArtyShotSound))
3239 {
3240 soundPosition = playArtyShotSound.param1;
3241 delayedSoundPos = playArtyShotSound.param2;
3242 soundDelay = playArtyShotSound.param3;
3243 if (soundPosition == vector.Zero)
3244 break;
3245 }
3246 else
3247 break;
3248
3250 break;
3251
3252 m_ArtySound = SEffectManager.PlaySound(
"Artillery_Distant_SoundSet", soundPosition, 0.1, 0.1);
3254
3255
3256 soundDelay -= 5;
3257
3258 soundDelay *= 1000;
3260 break;
3261 }
3262 case ERPCs.RPC_SET_BILLBOARDS:
3263 {
3266
3267 Param1<int> indexP = new Param1<int>(-1);
3268 if (ctx.
Read(indexP))
3269 {
3270 int index = indexP.param1;
3272 }
3273 break;
3274 }
3275 #endif
3276 #endif
3277
3278 case ERPCs.RPC_USER_SYNC_PERMISSIONS:
3279 {
3280 map<string, bool> mute_list;
3281 if (ctx.
Read(mute_list))
3282 {
3283 for (int i = 0; i < mute_list.Count(); i++)
3284 {
3285 string uid = mute_list.GetKey(i);
3286 bool mute = mute_list.GetElement(i);
3288 }
3289 }
3290 break;
3291 }
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304 #ifdef DEVELOPER
3305 case ERPCs.DEV_SET_WEATHER:
3306 {
3307 Param1<DebugWeatherRPCData> p1data = new Param1<DebugWeatherRPCData>(null);
3308
3309 if ( ctx.
Read(p1data) )
3310 {
3311 DebugWeatherRPCData data = p1data.param1;
3312
3315
3318
3321
3324
3327
3330
3333
3336
3339 }
3340 else
3341 {
3342 ErrorEx(
"Failed to read weather debug data");
3343 }
3344 break;
3345 }
3346 #endif
3347
3348
3349 #ifdef DIAG_DEVELOPER
3350 #ifdef SERVER
3351 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
3352 {
3353 if (!m_CameraToolsMenuServer)
3354 {
3355 m_CameraToolsMenuServer = new CameraToolsMenuServer;
3356 }
3357 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3358 break;
3359 }
3360
3361 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
3362 {
3363 if (!m_CameraToolsMenuServer)
3364 {
3365 m_CameraToolsMenuServer = new CameraToolsMenuServer;
3366 }
3367 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3368 break;
3369 }
3370
3371 #endif
3372 #endif
3373
3374 }
3375
3376 }
3377 }
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
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 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)
class DayZPlayerCameraResult DayZPlayerCamera(DayZPlayer pPlayer, HumanInputController pInput)