public void FireEvent(string id, PMEventArgs args) { if (events.ContainsKey(id)) { if (events [id] != null) { events [id] (id, args); } } if (allEvents != null) { allEvents(id, args); } if (eventsLite.ContainsKey(id)) { if (eventsLite [id] != null) { eventsLite [id] (); } } if (allEventsLite != null) { allEventsLite(); } }
void OnEvent(string id, PMEventArgs args) { if (PrintEvents) { print("All events listener: " + id); } }
public void onCarBrake(string id, PMEventArgs args) { var velocity = args.Floating; var power = Mathf.Clamp(velocity / MaximumShakeVelocity, 0, 1); UnityEngine.Debug.Log(power); cameraShake.Shake(power); }
private void OnBurn(string id, PMEventArgs args) { var burnInfo = (BurnInfo)args.Custom; var otherGameObject = burnInfo.OtherGameObject; var wheelMaterial = burnInfo.WheelMaterial; var otherObjectWithMaterial = otherGameObject.GetComponent <ObjectWithMaterial>(); if (otherObjectWithMaterial != null) { var effect = WheelFloorEffectTable.GetEffect(wheelMaterial, otherObjectWithMaterial.PiekaMaterial); EffectData effectData = new EffectData("burnInfo", burnInfo); effectData.Position = burnInfo.Point; effect.Play(effectData); } }
private void onBrake(string id, PMEventArgs args) { brake = args.Floating; }
private void onAcceleration(string id, PMEventArgs args) { acceleration = args.Floating; }
private static void PM(ib0tClient client, String ags, ulong time) { String tmp = ags; int finder = tmp.IndexOf(":"); String[] lens = tmp.Substring(0, finder).Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries); tmp = tmp.Substring(finder + 1); int n_len = int.Parse(lens[0]); int t_len = int.Parse(lens[1]); String name = tmp.Substring(0, n_len); String text = tmp.Substring(n_len, t_len); if (text.Length > 300) { text = text.Substring(0, 300); } PMEventArgs args = new PMEventArgs { Cancel = false, Text = text }; if (name == Settings.Get <String>("bot")) { if (text.StartsWith("#login") || text.StartsWith("#register")) { Command(client, text.Substring(1)); return; } else { if (text.StartsWith("#") || text.StartsWith("/")) { Command(client, text.Substring(1)); } if (!client.Quarantined) { Events.BotPrivateSent(client, args.Text); } } } else { if (!client.Captcha) { return; } IClient target = UserPool.AUsers.Find(x => x.Name == name && x.LoggedIn); if (target == null) { target = UserPool.WUsers.Find(x => x.Name == name && x.LoggedIn); } if (target == null && ServerCore.Linker.Busy && ServerCore.Linker.LoginPhase == LinkLeaf.LinkLogin.Ready) { target = ServerCore.Linker.FindUser(x => x.Name == name); if (target != null) { ServerCore.Linker.SendPacket(LinkLeaf.LeafOutbound.LeafPrivateText(ServerCore.Linker, client.Name, target, text)); return; } } if (target == null) { client.QueuePacket(WebOutbound.OfflineTo(client, name)); } else if (target.IgnoreList.Contains(client.Name) || client.Muzzled) { client.QueuePacket(WebOutbound.IgnoringTo(client, name)); } else { if (target.Cloaked) { client.QueuePacket(WebOutbound.OfflineTo(client, name)); return; } Events.PrivateSending(client, target, args); if (!args.Cancel && !String.IsNullOrEmpty(args.Text) && client.SocketConnected) { target.IUser.PM(client.Name, args.Text); Events.PrivateSent(client, target, args.Text); } } } }
public static void FireEvent(string id, PMEventArgs args) { eventSystem.FireEvent(id, args); }
protected void FireEvent(string id, PMEventArgs args) { SEventSystem.FireEvent(id, args); }