3013 {
3014 super.OnRPC(sender, target, rpc_type, ctx);
3015 Event_OnRPC.Invoke(sender, target, rpc_type, ctx);
3016
3017
3018
3019 if (target)
3020 {
3021
3022 target.OnRPC(sender, rpc_type, ctx);
3023 }
3024 else
3025 {
3026 switch (rpc_type)
3027 {
3028 #ifndef SERVER
3029 #ifndef NO_GUI
3030 case ERPCs.RPC_CFG_GAMEPLAY_SYNC:
3031 {
3032 CfgGameplayHandler.OnRPC(null, ctx);
3033 break;
3034 }
3035 case ERPCs.RPC_UNDERGROUND_SYNC:
3036 {
3037 UndergroundAreaLoader.OnRPC(ctx);
3038 break;
3039 }
3040 case ERPCs.RPC_PLAYERRESTRICTEDAREAS_SYNC:
3041 {
3042 CfgPlayerRestrictedAreaHandler.OnRPC(ctx);
3043 break;
3044 }
3045 case ERPCs.RPC_SEND_NOTIFICATION:
3046 {
3048 float show_time;
3049 string detail_text;
3050
3052 ctx.
Read(show_time);
3053 ctx.
Read(detail_text);
3054
3055 NotificationSystem.AddNotification(type, show_time, detail_text);
3056 break;
3057 }
3058 case ERPCs.RPC_SEND_NOTIFICATION_EXTENDED:
3059 {
3060 float show_time_ext;
3061 string title_text_ext;
3062 string detail_text_ext;
3063 string icon_ext;
3064
3065 ctx.
Read(show_time_ext);
3066 ctx.
Read(title_text_ext);
3067 ctx.
Read(detail_text_ext);
3069
3070 NotificationSystem.AddNotificationExtended(show_time_ext, title_text_ext, detail_text_ext, icon_ext);
3071 break;
3072 }
3073
3074
3075 case ERPCs.RPC_SOUND_HELICRASH:
3076 {
3077 bool playSound;
3078 vector pos;
3079 string sound_set;
3080
3081
3082 Param3<bool, vector, int> playCrashSound = new Param3<bool, vector, int>(false, "0 0 0",0);
3083 if (ctx.
Read(playCrashSound))
3084 {
3085 playSound = playCrashSound.param1;
3086 pos = playCrashSound.param2;
3087 sound_set = CrashSoundSets.GetSoundSetByHash(playCrashSound.param3);
3088 }
3089
3090 if (playSound)
3091 {
3092 m_CrashSound = SEffectManager.PlaySound(sound_set, pos, 0.1, 0.1);
3094 }
3095
3096 break;
3097 }
3098
3099 case ERPCs.RPC_SOUND_ARTILLERY:
3100 {
3101 vector position;
3102 Param1<vector> playArtySound = new Param1<vector>(vector.Zero);
3103 if (ctx.
Read(playArtySound))
3104 {
3105 position = playArtySound.param1;
3106 if (position == vector.Zero)
3107 break;
3108 }
3109 else
3110 break;
3111
3113 break;
3114
3116 break;
3117
3118 m_ArtySound = SEffectManager.PlaySound(
"Artillery_Distant_Barrage_SoundSet", position, 0.1, 0.1);
3120
3121 break;
3122 }
3123 case ERPCs.RPC_SOUND_CONTAMINATION:
3124 {
3125 vector soundPos;
3126
3127 Param1<vector> playContaminatedSound = new Param1<vector>(vector.Zero);
3128 if (ctx.
Read(playContaminatedSound))
3129 {
3130 soundPos = playContaminatedSound.param1;
3131 if (soundPos == vector.Zero)
3132 break;
3133 }
3134 else
3135 break;
3136
3138 break;
3139
3140 EffectSound closeArtySound = SEffectManager.PlaySound("Artillery_Close_SoundSet", soundPos);
3142
3143
3145 if (distance_to_player <= GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE2)
3146 {
3147 float strength_factor = Math.InverseLerp(GameConstants.CAMERA_SHAKE_ARTILLERY_DISTANCE, 0, Math.Sqrt(distance_to_player));
3149 if (camera)
3150 camera.SpawnCameraShake(strength_factor * 4);
3151 }
3152
3153 ParticleManager.GetInstance().PlayInWorld(ParticleList.CONTAMINATED_AREA_GAS_SHELL, soundPos);
3154 break;
3155 }
3156
3157 case ERPCs.RPC_SOUND_ARTILLERY_SINGLE:
3158 {
3159 vector soundPosition;
3160 vector delayedSoundPos;
3161 float soundDelay;
3162
3163 Param3<vector, vector, float> playArtyShotSound = new Param3<vector, vector, float>(vector.Zero, vector.Zero, 0);
3164 if (ctx.
Read(playArtyShotSound))
3165 {
3166 soundPosition = playArtyShotSound.param1;
3167 delayedSoundPos = playArtyShotSound.param2;
3168 soundDelay = playArtyShotSound.param3;
3169 if (soundPosition == vector.Zero)
3170 break;
3171 }
3172 else
3173 break;
3174
3176 break;
3177
3178 m_ArtySound = SEffectManager.PlaySound(
"Artillery_Distant_SoundSet", soundPosition, 0.1, 0.1);
3180
3181
3182 soundDelay -= 5;
3183
3184 soundDelay *= 1000;
3186 break;
3187 }
3188 case ERPCs.RPC_SET_BILLBOARDS:
3189 {
3192
3193 Param1<int> indexP = new Param1<int>(-1);
3194 if (ctx.
Read(indexP))
3195 {
3196 int index = indexP.param1;
3198 }
3199 break;
3200 }
3201 #endif
3202 #endif
3203
3204 case ERPCs.RPC_USER_SYNC_PERMISSIONS:
3205 {
3207 if (ctx.
Read(mute_list))
3208 {
3209 for (int i = 0; i < mute_list.Count(); i++)
3210 {
3211 string uid = mute_list.GetKey(i);
3212 bool mute = mute_list.GetElement(i);
3214 }
3215 }
3216 break;
3217 }
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230 #ifdef DEVELOPER
3231 case ERPCs.DEV_SET_WEATHER:
3232 {
3233 Param1<DebugWeatherRPCData> p1data = new Param1<DebugWeatherRPCData>(null);
3234
3235 if ( ctx.
Read(p1data) )
3236 {
3237 DebugWeatherRPCData data = p1data.param1;
3238
3241
3244
3247
3250
3253
3256
3259
3262
3265 }
3266 else
3267 {
3268 ErrorEx(
"Failed to read weather debug data");
3269 }
3270 break;
3271 }
3272 #endif
3273
3274
3275 #ifdef DIAG_DEVELOPER
3276 #ifdef SERVER
3277 case ERPCs.DIAG_CAMERATOOLS_CAM_DATA:
3278 {
3279 if (!m_CameraToolsMenuServer)
3280 {
3281 m_CameraToolsMenuServer = new CameraToolsMenuServer;
3282 }
3283 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3284 break;
3285 }
3286
3287 case ERPCs.DIAG_CAMERATOOLS_CAM_SUBSCRIBE:
3288 {
3289 if (!m_CameraToolsMenuServer)
3290 {
3291 m_CameraToolsMenuServer = new CameraToolsMenuServer;
3292 }
3293 m_CameraToolsMenuServer.OnRPC(rpc_type, ctx);
3294 break;
3295 }
3296
3297 #endif
3298 #endif
3299
3300 }
3301
3302 }
3303 }
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
proto native DayZPlayer GetPlayer()
proto native Weather GetWeather()
Returns weather controller object.
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)
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 Snowfall GetSnowfall()
Returns a snowfall phenomenon object.
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)
proto native CGame GetGame()
class JsonUndergroundAreaTriggerData GetPosition