Ejemplo n.º 1
0
        public void P_Init(string evt, string text)
        {
            var split = text.Split('\n');

            Mode            = (VMEODPermissionDoorMode)(int.Parse(split[0]));
            MaxFee          = int.Parse(split[1]);
            PermissionState = int.Parse(split[2]);
            CurDoorFee      = int.Parse(split[3]);
            Flags           = int.Parse(split[4]);

            if (Mode == VMEODPermissionDoorMode.CodeInput)
            {
                //don't open, just show a dialog.
                UIAlert alert = null;
                alert = UIScreen.GlobalShowAlert(new UIAlertOptions()
                {
                    Title   = GameFacade.Strings.GetString("192", "11"),
                    Message = GameFacade.Strings.GetString("192", "1"),
                    Buttons = UIAlertButton.Ok((btn) =>
                    {
                        Send("try_code", alert.ResponseText.Trim());
                        UIScreen.RemoveDialog(alert);
                    }),
                    TextEntry = true,
                    MaxChars  = 9,
                }, true);
            }
            else
            {
                Controller.ShowEODMode(new EODLiveModeOpt
                {
                    Buttons    = 0,
                    Expandable = false,
                    Height     = EODHeight.Normal,
                    Length     = EODLength.Short,
                    Timer      = EODTimer.None,
                    Tips       = EODTextTips.None
                });
            }

            UpdateState();
            UpdateFlags();
            if (Mode == VMEODPermissionDoorMode.Edit)
            {
                Send("set_state", PermissionState.ToString());
                Send("set_flags", Flags.ToString());
                Send("set_fee", CurDoorFee.ToString());
            }
        }
        public override void OnConnection(VMEODClient client)
        {
            var param = client.Invoker.Thread.TempRegisters;

            Mode = (VMEODPermissionDoorMode)param[0];
            if (param.Length > 1)
            {
                MaxFee = param[1];
            }
            if (param.Length > 2)
            {
                PermissionState = param[2];
            }
            if (param.Length > 3)
            {
                DoorFee = param[3];
            }
            if (param.Length > 4)
            {
                Flags = param[4];
            }
        }