public override void OnRead(RiftClient From)
        {
            Log.Success("WorldList", "Request : In Progress");

            Realm[] Realms = Program.AcctMgr.GetRealms();

            LobbyWorldListResponse Rp = new LobbyWorldListResponse();

            foreach (Realm Rm in Realms)
            {
                LobbyWorldEntry Entry = new LobbyWorldEntry();
                Entry.RealmID         = Rm.RiftId;
                Entry.PVP             = Rm.PVP == 1;
                Entry.Recommended     = Rm.Recommended == 1;
                Entry.Population      = 0;
                Entry.RP              = Rm.RP == 1;
                Entry.Version         = Rm.ClientVersion;
                Entry.CharactersCount = Rm.GetObject <CharactersMgr>().GetCharactersCount(From.Acct.Id);
                Entry.Language        = Rm.Language;
                if (Rm.Online > 0)
                {
                    Entry.AddField(16, EPacketFieldType.True, (bool)true);
                }

                Rp.Realms.Add(Entry);
            }

            Log.Success("WorldList", "Count = " + Rp.Realms.Count);

            From.SendSerialized(Rp);
        }
Example #2
0
        public async void SendSignalAsync(IRCode iRCode, string BlasterName)
        {
            if (iRCode.Command != null && iRCode.Command != "")
            {
                Rm RMBlaster = GetRMBlasterByName(BlasterName);
                WLog("Send {0} via {1}", iRCode.Name, BlasterName);
                var x = await RMBlaster.Auth();

                if (x)
                {
                    var data = StringHelper.CreateBytesFromHexString(iRCode.Command);
                    x = await RMBlaster.SendData(data);

                    if (x)
                    {
                        WLog("OK");
                    }
                    else
                    {
                        WLog("! Blaster [{0}] not respond", BlasterName);
                    }
                }
                else
                {
                    WLog("! Blaster [{0}] not respond", BlasterName);
                }
            }
        }
Example #3
0
        public async void LearnIRCodeAsync(IRCode irCode, string BlasterName)
        {
            Rm RMBlaster = GetRMBlasterByName(BlasterName);

            WLog("Enter learning mode on {0}", BlasterName);
            var x = await RMBlaster.Auth();

            if (x)
            {
                x = await RMBlaster.EnterLearning();

                if (x)
                {
                    MessageBox.Show(" Point the remote control to be learned to RM Pro, and press the button. Hit OK finally", "Learning...", MessageBoxButtons.OK);
                    var data = await RMBlaster.CheckData();

                    if (data.Length > 0)
                    {
                        string code = StringHelper.CreateHexPrintableString(data);
                        WLog("Code={0}", code);
                        irCode.Command = code;
                    }
                }
                else
                {
                    WLog("! Blaster [{0}] not respond", BlasterName);
                }
            }
            else
            {
                WLog("! Blaster [{0}] not respond", BlasterName);
            }
        }
Example #4
0
        private async void SendSignalAsync(int join)
        {
            Rm RMBlaster = GetRMBlasterByName(IRCodes[join].Blaster);

            WLog("Send {0} via {1}", IRCodes[join].Name, IRCodes[join].Blaster);
            var x = await RMBlaster.Auth();

            if (x)
            {
                var data = StringHelper.CreateBytesFromHexString(IRCodes[join].Command);
                x = await RMBlaster.SendData(data);

                if (x)
                {
                    WLog("OK");
                }
                else
                {
                    WLog("! Blaster [{0}] not respond", IRCodes[join].Blaster);
                }
            }
            else
            {
                WLog("! Blaster [{0}] not respond", IRCodes[join].Blaster);
            }
        }
Example #5
0
        private async void StartLearningAsync()
        {
            var DevName   = ((IRCode)dgvIRCodes.CurrentRow.DataBoundItem).Blaster;
            Rm  RMBlaster = GetRMBlasterByName(DevName);

            WLog("Enter learning mode on {0}", DevName);
            var x = await RMBlaster.Auth();

            if (x)
            {
                x = await RMBlaster.EnterLearning();

                if (x)
                {
                    MessageBox.Show(" Point the remote control to be learned to RM Pro, and press the button. Hit OK finally", "Learning...", MessageBoxButtons.OK);
                    var data = await RMBlaster.CheckData();

                    if (data.Length > 0)
                    {
                        string code = StringHelper.CreateHexPrintableString(data);
                        WLog("Code={0}", code);
                        ((IRCode)dgvIRCodes.CurrentRow.DataBoundItem).Command = code;
                        dgvIRCodes.Refresh();
                    }
                }
                else
                {
                    WLog("! Blaster [{0}] not respond", DevName);
                }
            }
            else
            {
                WLog("! Blaster [{0}] not respond", DevName);
            }
        }
Example #6
0
 public Room(string aName, string aDescription, Rm aN, Rm aS, Rm aW, Rm aE) :
     base(aName, aDescription)
 {
     N = aN;
     S = aS;
     W = aW;
     E = aE;
 }
Example #7
0
 public Room(string aName, string aDescription, Rm aN, Rm aS, Rm aW, Rm aE, ThingList tl)
     : base(aName, aDescription, tl)
 {
     _n = aN;
     _s = aS;
     _e = aE;
     _w = aW;
 }
Example #8
0
 public void MovePlayer(Rm newPosition)
 {
     if (newPosition == Rm.NOEXIT)
     {
         Console.WriteLine("You can't go that way from here.");
     }
     else
     {
         _player.Location = _map.RoomAt(newPosition);
         Console.WriteLine($"You are now in the {_player.Location.Name}");
     }
     return;
 }
        static void Main(string[] args)
        {
            IVideoMediaVisitor visitor = new ResizeVisitor();
            IMedia             rm      = new Rm();

            rm.Play();
            ((IVideoMedia)rm).Accept(visitor);

            IMedia mpeg = new Mpeg();

            mpeg.Play();
            ((IVideoMedia)mpeg).Accept(visitor);

            Console.Read();
        }
Example #10
0
        public void LoadRealms()
        {
            _Realms.Clear();

            IList <Realm> Rms = CharacterDB.SelectAllObjects <Realm>();

            foreach (Realm Rm in Rms)
            {
                Rm.GenerateName();
                Rm.Online = 0;
                Rm.Dirty  = true;
                _Realms.Add(Rm.RealmId, Rm);
                CharacterDB.SaveObject(Rm);
            }

            Log.Success("LoadRealms", "Loaded " + _Realms.Count + " Realm(s)");
        }
Example #11
0
 public void Visit(Rm rm)
 {
     Console.WriteLine("Resize Rm.");
 }
Example #12
0
 public NewResourceChain <Rm <T> > SimpleRootCaseMinor <T>(OfResourceBank.DResourceSourceDefinition <T> getIdentityAndDraw) =>
 SimpleRootCase(getIdentityAndDraw, true).Let(
     r => new NewResourceChain <Rm <T> >(Rm <T> .FromContents(new ContentsMinor <T>(r.Value)), r.Wipe));
Example #13
0
        public static void Parse(CommandToken token, TerminalGame game)
        {
            Console.WriteLine("Command: {0}", token.Command);
            switch (token.Command)
            {
            case "":
            {
                game.Terminal.Write("");
                break;
            }

            case "echo":
            {
                Echo.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "sudo":
            {
                game.Terminal.WriteLine("user is not in the sudoers file.  This incidient will be reported.");
                break;
            }

            case "man":
            {
                break;
            }

            case "ip":
            {
                Ip.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "ifconfig":
            case "ipconfig":
            {
                Ifconfig.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "pwd":
            {
                game.Terminal.WriteLine($"{World.World.GetInstance().Player.ConnectedComp.FileSystem.CurrentDir.Name}");
                break;
            }

            case "cls":
            case "clear":
            {
                game.Terminal.Clear();
                break;
            }

            case "help":
            {
                game.Terminal.WriteLine(Utils.Help.GetHelp());
                break;
            }

            case "reboot":
            {
                break;
            }

            case "shutdown":
            {
                break;
            }

            case "quit":
            case "exit":
            {
                break;
            }

            case "login":
            {
                break;
            }

            case "disconnect":
            case "dc":
            {
                Disconnect.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "connect":
            {
                Connect.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "rm":
            {
                Rm.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "rmdir":
            {
                break;
            }

            case "mkdir":
            {
                Mkdir.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "touch":
            {
                Touch.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "cat":
            {
                Cat.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "ls":
            case "dir":
            {
                Ls.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "cd":
            {
                Cd.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "save":
            {
                World.World.GetInstance().Save();
                game.Terminal.WriteLine("Game saved.");
                break;
            }

            case "nmap":
            {
                Nmap.GetInstance().Init(game, null, token.Args);
                break;
            }

            case "sshnuke":
            {
                Sshnuke.GetIsntance().Init(game, null, token.Args);
                break;
            }

            default:
            {
                game.Terminal.WriteLine(token.Command + " is not a recognized command");
                break;
            }
            }
        }
Example #14
0
 public static string GetString(string key)
 {
     return(Rm.GetString(key, Culture));
 }