Beispiel #1
0
        public void Throw(string errorMessage, Exception ex)
        {
            ErrorScreen errorScreen = new ErrorScreen();

            errorScreen.SetError(Resource.Strings.ErrorEncountered, errorMessage);
            Popup(errorScreen, true);
        }
Beispiel #2
0
        private void HandleLeaveMessage(String address, AbstractMessage message)
        {
            String description = String.Format("{0} deixou o jogo.",
                                               controller.GetRemotePlayer().Name);

            ErrorScreen errorScreen = new ErrorScreen("Fim de Jogo",
                                                      description);

            controller.QuitGame(false, false);
            ScreenManager.GetInstance().AddScreen(errorScreen);
        }
Beispiel #3
0
        private void ConnectionLost(String playerName)
        {
            String description = String.Format("Perda de conexão com {0}, verifique as conexões de rede.",
                                               playerName);

            ErrorScreen errorScreen = new ErrorScreen("Falha de Conexão",
                                                      description);

            Thread connectionLost = new Thread(new ParameterizedThreadStart(ShowConnectionLost));

            connectionLost.Start(errorScreen);
        }
Beispiel #4
0
 private void ConnectionLost(String message)
 {
     lock (this)
     {
         if (timerPing != null)
         {
             ErrorScreen errorScreen    = new ErrorScreen("Falha de Conexão", message);
             Thread      connectionLost = new Thread(new ParameterizedThreadStart(ShowConnectionLost));
             connectionLost.Start(errorScreen);
         }
     }
 }
        private void HandleInvalidGuidMessage(String address, AbstractMessage message)
        {
            ErrorScreen errorScreen = new ErrorScreen("Falha de conexão",
                                                      "Perda de integridade com o servidor remoto.");

            controller.SupressUpdate();

            controller.QuitGame(false, false);
            ScreenManager.GetInstance().AddScreen(errorScreen);

            controller.ReleaseUpdate();

            controller.StopClient();
        }
Beispiel #6
0
    // 골드 부족할 때
    IEnumerator Error()
    {
        float valueA = 1;

        ErrorScreen.SetActive(true);
        for (int i = 1; i <= 10; i++)
        {
            yield return(new WaitForSecondsRealtime(0.1f));

            valueA          -= 0.1f;
            ErrorImage.color = new Color(1, 1, 1, valueA);
        }
        ErrorScreen.SetActive(false);
    }
Beispiel #7
0
    public IEnumerator LoadPlayer(Player _player)
    {
        Request request = new Request(_player);

        Debug.Log("Begin load plAYER: " + MainScript.self.servername + "api/v1/player/login?data= " + JsonUtility.ToJson(request));
        WWW www = new WWW(servername + "api/v1/player/login?data=" + JsonUtility.ToJson(request));

        yield return(www);

        Debug.Log(www.text);
        Responce responce = JsonUtility.FromJson <Responce>(www.text);



        if (responce.player.autorize == "1")

        {
            player      = responce.player;
            player.code = PlayerPrefs.GetString("code");

            PlayerPrefs.SetInt("authorization", 1);
            fon_login.SetActive(false);
            fon_cenopad.SetActive(true);
            fon_login.GetComponent <fon_login>().error2.text = "";
            if (responce.player.fname.Trim() == "")
            {
                fon_setting.SetActive(true);
                fon_settings.self.fname.text    = "";
                fon_settings.self.sname.text    = "";
                BirthdayScript.self.input.text  = "";
                BirthdayScript.self.output.text = "";
                StartLoadBanch();
            }
            else
            {
                fon_setting.SetActive(false);
            }
        }



        else
        {
            //show_message
            ErrorScreen.SetActive(true);
            fon_login.GetComponent <fon_login>().error2.text = "Для продолжения необходимо ввести \n Ваш номер телефона и полученный код";
        }
        QRscript.self.ChangeQrCode();
    }
Beispiel #8
0
        private void ConnectionLost(Player player)
        {
            lock (this)
            {
                if (timerPing != null)
                {
                    String description = String.Format("Não foi possível se conectar a {0}, verifique as conexões de rede.",
                                                       player.Name);

                    ErrorScreen errorScreen = new ErrorScreen("Falha de Conexão",
                                                              description);

                    Thread connectionLost = new Thread(new ParameterizedThreadStart(ShowConnectionLost));
                    connectionLost.Start(errorScreen);
                }
            }
        }
Beispiel #9
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            //graphics.ToggleFullScreen();

            screenState = ScreenState.Title;

            gameScreen     = new GameScreen();
            mainMenuScreen = new MainMenuScreen();
            titleScreen    = new TitleScreen();
            gameOverScreen = new GameOverScreen();
            //playerSelectScreen = new PlayerSelectScreen();
            oneplayerSelectScreen = new OnePlayerSelectScreen();
            twoplayerSelectScreen = new TwoPlayerSelectScreen();
            onlineOptionsScreen   = new OnlineOptionsScreen();
            onlineJoinScreen      = new OnlineJoinScreen();
            optionsScreen         = new OptionsScreen();
            editControls          = new EditControlsScreen();
            pauseScreen           = new PauseScreen();
            errorScreen           = new ErrorScreen();
            gameModeScreen        = new GameModeScreen();
            keyboardScreen        = new KeyboardScreen();
            waitingScreen         = new WaitingScreen();



            graphics.PreferredBackBufferWidth  = 1920;
            graphics.PreferredBackBufferHeight = 1080;
            graphics.ApplyChanges();


            Global.Scale = new Vector2(GraphicsDevice.Viewport.Width / 1920f);

            InputManager.Update();
            Global.UsingKeyboard = !InputManager.PressedKeysPlayer1.IsConnected;
            IsMouseVisible       = true;
            base.Initialize();
        }
Beispiel #10
0
 public ErrorScreenManager(ErrorScreen errorScreen)
 {
     _ErrorScreen           = errorScreen ?? throw new ArgumentNullException(nameof(errorScreen));
     _ErrorScreen.OnEscape += ErrorScreenOnOnEscape;
 }
Beispiel #11
0
 public void closeErrorScreen()
 {
     ErrorScreen.SetActive(false);
 }
Beispiel #12
0
        public static void Init()
        {
            try
            {
                commands : ColorConsole.Write(ConsoleColor.Cyan, Reference.UserAccount.GetUsername());
                ColorConsole.Write(ConsoleColor.White, Reference.UserAccess);
                ColorConsole.Write(ConsoleColor.Yellow, Reference.CurrentDir);
                ColorConsole.Write(ConsoleColor.White, " => ");
                string cmd = Console.ReadLine();

                if (cmd == "help")
                {
                    ColorConsole.WriteLine(ConsoleColor.White, "help - Shows all commands (this one).\ntime - Shows the current date and time.\ngui - Shows a nice GUI.\nstop - Shuts down kernel.\nreboot - Reboots kernel.\ngetmem - Gets the amount of used and total memory.\ntextpad [file] - The official text editor (read-only) for Sartox OS where [file] is the file to read. If not set, the user will be asked for the file to read.\ncd - Changes current directory.\nls - Lists all files and directories of the current directory.\ncls - Clears the console.\nabout - Shows useful informations about Sartox OS.\nmkdir <directory> - Creates a directory where <directory> is the name of the directory.\nmk <file> - Creates a file where <file> is the name of the file.\nrm <file> - Removes the specified file.\nrmdir <directory> - Removes the specified directory. It's recursive.\nmove <source file/directory> <dest file/directory> - Moves a file or directory from the (source) to the (dest)ination.\ncopy <source file> <dest file> - Copies a file from the (source) to the (dest)ination. It overwrites the destination file (if it exists).\nkeyblang <layout> - Changes the current keyboard layout where <layout> is the new keyboard layout. Currently, 3 keyboard layouts are supported : fr_FR (French), en_US (English, the default one) and de (Deutsch).\ncrash - Crashes the OS in a harmless way (throwing a simple Exception).");
                    goto commands;
                }
                else if (cmd == "gui")
                {
                    SimpleGui.Init();
                }
                else if (cmd == "time")
                {
                    ColorConsole.WriteLine(ConsoleColor.White, DateTime.Now.ToString());
                    goto commands;
                }
                else if (cmd == "getmem")
                {
                    ColorConsole.WriteLine(ConsoleColor.White, MemoryManager.UsedMemory().ToString() + " MB / " + MemoryManager.TotalMemory().ToString() + " MB (used / total)");
                    goto commands;
                }
                else if (cmd == "textpad")
                {
                    Textpad.Run();
                    Console.ReadKey();
                    goto commands;
                }
                else if (cmd.StartsWith("textpad "))
                {
                    Textpad.Run(cmd.Split(" ")[1]);
                    Console.ReadKey();
                    goto commands;
                }
                else if (cmd.StartsWith("keyblang "))
                {
                    string lang = cmd.Split(" ")[1];
                    if (lang == "fr_FR")
                    {
                        Sys.KeyboardManager.SetKeyLayout(new Sys.ScanMaps.FR_Standard());
                    }
                    else if (lang == "en_US")
                    {
                        Sys.KeyboardManager.SetKeyLayout(new Sys.ScanMaps.US_Standard());
                    }
                    else if (lang == "de")
                    {
                        Sys.KeyboardManager.SetKeyLayout(new Sys.ScanMaps.DE_Standard());
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "Unknown keyboard layout.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith("cd "))
                {
                    string newDir = cmd.Split(" ")[1];
                    if (Directory.Exists(newDir))
                    {
                        if (newDir.Contains(Reference.RootPath))
                        {
                            Reference.CurrentDir = newDir;
                        }
                        else
                        {
                            Reference.CurrentDir += newDir;
                        }
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "Directory not found.");
                    }
                    goto commands;
                }
                else if (cmd == "ls")
                {
                    string[] fad = Directory.GetDirectories(Reference.CurrentDir);
                    for (int i = 0; i < fad.Length; i++)
                    {
                        ColorConsole.WriteLine(ConsoleColor.Cyan, fad[i]);
                    }

                    fad = Directory.GetFiles(Reference.CurrentDir);
                    for (int i = 0; i < fad.Length; i++)
                    {
                        ColorConsole.WriteLine(ConsoleColor.Cyan, fad[i]);
                    }
                    goto commands;
                }
                else if (cmd == "cls")
                {
                    Console.Clear();
                    goto commands;
                }
                else if (cmd == "about")
                {
                    ColorConsole.WriteLine(ConsoleColor.White, "Sartox OS v" + Reference.Version + " made by ShiningLea.\n\nSartox OS is an operating system made in C# with the COSMOS kit. The goal here is to provide a minimal but working operating system for any purpose. Currently made by only one developer, it's highly maintained and will continue to be as long as the dev wants to (oh wait, I'm literally writing this message...)");
                    goto commands;
                }
                else if (cmd == "stop")
                {
                    Power.Shutdown();
                }
                else if (cmd.StartsWith("mkdir "))
                {
                    Directory.CreateDirectory(cmd.Split(" ")[1]);
                    goto commands;
                }
                else if (cmd.StartsWith("mk "))
                {
                    File.Create(cmd.Split(" ")[1]);
                    goto commands;
                }
                else if (cmd.StartsWith("rm "))
                {
                    string file = cmd.Split(" ")[1];
                    if (File.Exists(file))
                    {
                        File.Delete(file);
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "The specified file doesn't exist.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith("rmdir "))
                {
                    string dir = cmd.Split(" ")[1];
                    if (Directory.Exists(dir))
                    {
                        Directory.Delete(dir, true);
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "The specified directory doesn't exist.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith("move "))
                {
                    string move = cmd.Split(" ")[1];
                    if (Directory.Exists(move) || File.Exists(move))
                    {
                        Directory.Move(move, cmd.Split(" ")[2]);
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "The source directory/file doesn't exist.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith("copy "))
                {
                    File.Copy(cmd.Split(" ")[1], cmd.Split(" ")[2], true);
                    goto commands;
                }
                else if (cmd == "reboot")
                {
                    Power.Restart();
                }
                else if (cmd == "crash")
                {
                    throw new Exception("Crash initialized by user.");
                }
                else
                {
                    ColorConsole.WriteLine(ConsoleColor.Red, "Invalid command.");
                    goto commands;
                }
            }
            catch (Exception e)
            {
                Global.mDebugger.Send("ERROR : " + e.Message + e.HResult.ToString());
                ErrorScreen.Init(e.Message, e.HResult);
            }
        }
Beispiel #13
0
        public static void Init()
        {
            try
            {
                ColorConsole.WriteLine(ConsoleColor.Cyan, "Classic Shell v1.1");
                commands : ColorConsole.Write(ConsoleColor.Cyan, Reference.UserAccount.GetUsername());
                ColorConsole.Write(ConsoleColor.White, Reference.UserAccess);
                ColorConsole.Write(ConsoleColor.Yellow, Reference.CurrentDir);
                ColorConsole.Write(ConsoleColor.White, " => ");
                string cmd = Console.ReadLine();

                if (cmd == Reference.Commands[0])
                {
                    string all = string.Empty;
                    foreach (string comnd in Reference.Commands)
                    {
                        all += $"{comnd} - ";
                    }
                    ColorConsole.WriteLine(ConsoleColor.White, all.Remove(all.Length - 3));
                    goto commands;
                }
                else if (cmd == Reference.Commands[1])
                {
                    SimpleGui.Init();
                }
                else if (cmd == Reference.Commands[2])
                {
                    ColorConsole.WriteLine(ConsoleColor.White, $"{UnixTime.Now()} (day/month/year hour:minute:second)");
                    goto commands;
                }
                else if (cmd == Reference.Commands[3])
                {
                    ColorConsole.WriteLine(ConsoleColor.White, $"{MemoryManager.UsedMemory()} MB / {MemoryManager.TotalMemory()} MB (used / total)");
                    goto commands;
                }
                else if (cmd == Reference.Commands[4])
                {
                    Textpad.Run();
                    Console.ReadKey();
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[4]} "))
                {
                    Textpad.Run(cmd.Split(" ")[1]);
                    Console.ReadKey();
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[5]} "))
                {
                    string lang    = cmd.Split(" ")[1];
                    string setName = "keyboard_layout";
                    if (lang == "fr")
                    {
                        Sys.KeyboardManager.SetKeyLayout(new Sys.ScanMaps.FR_Standard());
                        SettingsMan.Add(setName, "fr");
                    }
                    else if (lang == "us")
                    {
                        Sys.KeyboardManager.SetKeyLayout(new Sys.ScanMaps.US_Standard());
                        SettingsMan.Add(setName, "en");
                    }
                    else if (lang == "de")
                    {
                        Sys.KeyboardManager.SetKeyLayout(new Sys.ScanMaps.DE_Standard());
                        SettingsMan.Add(setName, "de");
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "Unknown keyboard layout.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[6]} "))
                {
                    string newDir = cmd.Split(" ")[1];
                    if (Directory.Exists(newDir))
                    {
                        if (newDir.Contains(Reference.RootPath))
                        {
                            Reference.CurrentDir = newDir;
                        }
                        else
                        {
                            Reference.CurrentDir += newDir;
                        }
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "Directory not found.");
                    }
                    goto commands;
                }
                else if (cmd == Reference.Commands[7])
                {
                    List <string[]> fad = new List <string[]>
                    {
                        Directory.GetDirectories(Reference.CurrentDir),
                        Directory.GetFiles(Reference.CurrentDir)
                    };

                    for (int i = 0; i < fad.Count; i++)
                    {
                        string[] list = fad[i];
                        for (int y = 0; y < list.Length; y++)
                        {
                            ColorConsole.WriteLine(ConsoleColor.Cyan, list[y]);
                        }
                    }
                    goto commands;
                }
                else if (cmd == Reference.Commands[8])
                {
                    Console.Clear();
                    LoginMan.Init();
                }
                else if (cmd == Reference.Commands[9])
                {
                    Console.Clear();
                    goto commands;
                }
                else if (cmd == Reference.Commands[10])
                {
                    ColorConsole.WriteLine(ConsoleColor.White, $"Sartox OS ver {Reference.Version}, kernel ver {Reference.KernelVersion} made by ShiningLea.\n\nSartox OS is an operating system made in C# with the COSMOS kit. The goal here is to provide a minimal but working operating system for any purpose. Currently made by only one developer, it's highly maintained and will continue to be as long as the dev wants to (oh wait, I'm literally writing this message...)");
                    goto commands;
                }
                else if (cmd == Reference.Commands[11])
                {
                    Power.Shutdown();
                }
                else if (cmd.StartsWith($"{Reference.Commands[12]} "))
                {
                    Directory.CreateDirectory(cmd.Split(" ")[1]);
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[13]} "))
                {
                    File.Create(cmd.Split(" ")[1]);
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[14]} "))
                {
                    File.WriteAllText(cmd.Split(" ")[1], string.Empty);
                    goto commands;
                }
                else if (cmd == Reference.Commands[14])
                {
                    ColorConsole.WriteLine(ConsoleColor.White, "Touch what?");
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[15]} "))
                {
                    File.WriteAllText(cmd.Split(" ")[1], cmd.Split(" ")[2]);
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[16]} "))
                {
                    string file = cmd.Split(" ")[1];
                    if (File.Exists(file))
                    {
                        File.Delete(file);
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "The specified file doesn't exist.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[17]} "))
                {
                    string dir = cmd.Split(" ")[1];
                    if (Directory.Exists(dir))
                    {
                        Directory.Delete(dir, true);
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "The specified directory doesn't exist.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[18]} "))
                {
                    string move = cmd.Split(" ")[1];
                    if (Directory.Exists(move) || File.Exists(move))
                    {
                        Directory.Move(move, cmd.Split(" ")[2]);
                    }
                    else
                    {
                        ColorConsole.WriteLine(ConsoleColor.Red, "The source directory/file doesn't exist.");
                    }
                    goto commands;
                }
                else if (cmd.StartsWith($"{Reference.Commands[19]} "))
                {
                    File.Copy(cmd.Split(" ")[1], cmd.Split(" ")[2], true);
                    goto commands;
                }
                else if (cmd == Reference.Commands[20])
                {
                    Power.Restart();
                }
                else if (cmd == Reference.Commands[21])
                {
                    throw new Exception("Crash initialized by user.");
                }
                else if (cmd == Reference.Commands[22])
                {
                    SartoxShell.Init();
                }
                else
                {
                    ColorConsole.WriteLine(ConsoleColor.Red, "Invalid command.");
                    goto commands;
                }
            }
            catch (Exception e)
            {
                Global.mDebugger.Send("ERROR : " + e.Message + e.HResult.ToString());
                ErrorScreen.Init(e.Message, e.HResult);
            }
        }
Beispiel #14
0
        public void ShowErrorScreen()
        {
            var errorScreen = new ErrorScreen();

            ChangeScreen(errorScreen);
        }