예제 #1
0
        /// <summary>
        /// Initialized the game.
        /// </summary>
        public void InitializeGame()
        {
#if DEB
            if (GUIReferences.InputListener == null)
            {
                DebugUtil.Error("INPUT LISTENER IS NULL. PLEASE BAKE THE GAME HOLDER!");
            }
            if (GUIReferences.TerminalComponent == null)
            {
                DebugUtil.Error("TERMINAL COMPONENT IS NULL. PLEASE BAKE THE GAME HOLDER!");
            }
#endif

            Constants.Colors           = Colors;
            DataHolder.DebugCondition  = DebugCondition;
            DataHolder.GUIReferences   = GUIReferences;
            DataHolder.DreamReferences = DreamReferences;

            DataHolder.GUIReferences.TerminalComponent.Initialize();
            StoryUtil.Init();
            LoopUtil.Init();
            WindowUtil.Initialize();
            DataUtil.LoadData();
            ProgramUtil.SetupPrograms();
            GUIUtil.SetCursorToDefault();

            TerminalUtil.HideTerminal();
            AnnouncementUtil.HideAnnouncement();

            DreamUtil.ExecuteDreamOne();
        }
예제 #2
0
        public static void ExecuteOnFile(Pair <string, string> fileArg, Pair <string, string> hintArg)
        {
            var      filePath = fileArg.Value;
            HashFile file     = FileSystem.FindFileByPath(filePath);

            if (file == null)
            {
                var msg = string.Format("No file found at '{0}'.", filePath);
                msg = TextUtil.Error(msg);
                TerminalUtil.ShowText(msg);
            }
            else
            {
                var password = file.Password;
                LoopUtil.RunCoroutine(ExecuteOnPassword(password, hintArg.Value, (success) =>
                {
                    if (success)
                    {
                        var msg = string.Format("Password found!\nThe password of '{0}' is: {1}", filePath, file.Password);
                        msg     = TextUtil.Success(msg);
                        TerminalUtil.ShowText(msg);
                    }
                    else
                    {
                        var msg = "Unable to find the password of '{0}' with the given arguments. Please try another set of hints.";
                        msg     = string.Format(msg, filePath);
                        msg     = TextUtil.Error(msg);
                        TerminalUtil.ShowText(msg);
                    }
                }));
            }
        }
예제 #3
0
        public static void Initialize()
        {
            WindowIds            = 0;
            CurrentlyOpenWindows = SList.Create <Window>(5);

            DefaultTextState              = new WindowState();
            DefaultTextState.CanBeClosed  = true;
            DefaultTextState.CanBeMoved   = true;
            DefaultTextState.CanBeResized = true;

            DefaultImageState              = new WindowState();
            DefaultImageState.CanBeClosed  = true;
            DefaultImageState.CanBeMoved   = true;
            DefaultImageState.CanBeResized = false;

            LoopUtil.CallForever(UpdateWindowsScrollBars, UpdateScrollBarsInterval);
            LoopUtil.CallForever(UpdateImageWindowsBlendFactor, UpdateImageWindowBlendFactor);

            MaxWindowSize = new Vector2();

            Resolution resolution;

            if (Screen.resolutions.Length > 1)
            {
                resolution = Screen.resolutions[Screen.resolutions.Length - 2];
            }
            else
            {
                resolution = Screen.resolutions[Screen.resolutions.Length - 1];
            }

            MaxWindowSize.x = resolution.width;
            MaxWindowSize.y = resolution.height;
        }
예제 #4
0
        public static void Init()
        {
            DebugUtil.Assert(Instance != null, "LoopUtil.Init being called multiple times!");

            Instance            = new GameObject("LOOP-UTIL").AddComponent <LoopUtil>();
            UpdateCallbacks     = SList.Create <Action>(5);
            LateUpdateCallbacks = SList.Create <Action>(3);
        }
예제 #5
0
        public void Initialize()
        {
            LoopUtil.AddUpdate(OnUpdate);

            TelephoneAudioSource.loop = true;
            TelephoneAudioSource.PlayDelayed(DelayForPhoneRing);
            LoopUtil.RunCoroutine(LookAtPhone(DelayForPhoneRing + .3f));
        }
예제 #6
0
        public static void ExecuteOnDevice(Pair <string, string> deviceArg, Pair <string, string> username, Pair <string, string> hintArg)
        {
            var deviceTarget = deviceArg.Value;
            var device       = DeviceUtil.FindDeviceByIpOrName(deviceTarget);

            if (device == null)
            {
                var msg = string.Format("No device found with IP or Name equal to '{0}'", deviceTarget);
                msg = TextUtil.Error(msg);
                TerminalUtil.ShowText(msg);
            }
            else
            {
                var hasSSH = DeviceUtil.HasProgram(device, ProgramType.SSH);
                if (hasSSH)
                {
                    var user = DeviceUtil.FindUserByName(device, username.Value);
                    if (user == null)
                    {
                        var msg = string.Format("The device '{0}' has no user with name '{1}'.", deviceTarget, username.Value);
                        msg = TextUtil.Error(msg);
                        TerminalUtil.ShowText(msg);
                    }
                    else
                    {
                        var password = user.Password;
                        LoopUtil.RunCoroutine(ExecuteOnPassword(password, hintArg.Value, success =>
                        {
                            if (success)
                            {
                                var msg = "Password found! The password for '{0}' is '{1}'.";
                                msg     = string.Format(msg, user.Username, user.Password);
                                msg     = TextUtil.Success(msg);
                                TerminalUtil.ShowText(msg);
                            }
                            else
                            {
                                var msg = string.Format(
                                    "Unable to find the password of user '{0}' with the given arguments.\nPlease try another set of hints.",
                                    user.Username);
                                msg = TextUtil.Error(msg);
                                TerminalUtil.ShowText(msg);
                            }
                        }));
                    }
                }
                else
                {
                    var msg = "The device '{0}' is not running a SSH instance. We have no way to validate password attempts.";
                    msg = string.Format(msg, deviceTarget);
                    msg = TextUtil.Error(msg);
                    TerminalUtil.ShowText(msg);
                }
            }
        }
예제 #7
0
        public static Coroutine RunAnnouncement(Announcement announcement)
        {
            DataHolder.GUIReferences.AnnouncementPanel.gameObject.SetActive(true);

            return(LoopUtil.RunCoroutine(InternalAnnouncementRunner(announcement)));
        }
예제 #8
0
 public void Finish()
 {
     Sound.Stop();
     LoopUtil.RemoveUpdate(OnUpdate);
 }
예제 #9
0
 public void Initialize()
 {
     Sound.Play();
     LoopUtil.AddUpdate(OnUpdate);
 }
예제 #10
0
        public void Finish()
        {
            LoopUtil.RemoveUpdate(OnUpdate);

            TelephoneAudioSource.Stop();
        }
예제 #11
0
 public static void ExecuteDreamOne()
 {
     LoopUtil.RunCoroutine(InternalExecuteDreamOne());
 }
 public void Finish()
 {
     LoopUtil.RemoveUpdate(OnUpdate);
     LoopUtil.RemoveLateUpdate(OnLateUpdate);
 }
 public void StartLookingAtPhone()
 {
     LoopUtil.AddLateUpdate(OnLateUpdate);
 }
 public void Initiate()
 {
     LoopUtil.AddUpdate(OnUpdate);
 }