Exemplo n.º 1
0
    public override void Execute(GameCommandTrigger trigger)
    {
        bool enable = trigger.Get <byte>("enable") == 1;

        if (!enable)
        {
            trigger.Session.Send(TimeScalePacket.SetTimeScale(false, 0, 0, 0, 0));
            return;
        }

        float        startScale   = trigger.Get <float>("startScale");
        float        endScale     = trigger.Get <float>("endScale");
        float        duration     = trigger.Get <float>("duration");
        byte         interpolator = trigger.Get <byte>("interpolator");
        bool         broadcast    = trigger.Get <byte>("broadcast") == 1;
        PacketWriter packet       = TimeScalePacket.SetTimeScale(true, startScale, endScale, duration, interpolator);

        if (broadcast)
        {
            trigger.Session.FieldManager.BroadcastPacket(packet);
            return;
        }

        trigger.Session.Send(packet);
    }
Exemplo n.º 2
0
 public void SetTimeScale(bool enable, float startScale, float endScale, float duration, byte interpolator)
 {
     Field.BroadcastPacket(TimeScalePacket.SetTimeScale(enable, startScale, endScale, duration, interpolator));
 }