Beispiel #1
0
        public override void Init()
        {
            ExistingMods = new Dictionary <Mod, ModManifest>();
            LoadOrder    = new List <Mod>();

            ConsoleSys = Sys.Ref.ConsoleSys;
            SteamSys   = Sys.Ref.Shared.GetNode <SteamSys>();

            List <string> ModFolders = new List <string>();

            ModFolders.AddRange(SteamSys.GetModFolders());

            ModFolders.AddRange(FilesystemUtil.Sys.DirGetDirsTop("Mods"));

            foreach (var Folder in ModFolders)
            {
                ParseMod(Folder.Replace('\\', '/'));
            }

            if (Core.Mod.ModID == null)
            {
                ConsoleSys.Panic("We could not find any mod assigned as a Core. Quitting...");
                return;
            }
        }
Beispiel #2
0
        public override void Init()
        {
            Entries    = new Entries();
            Categories = new Categories();

            ConsoleSys  = Sys.Ref.ConsoleSys;
            AssemblySys = Sys.Ref.Shared.GetNode <AssemblySys>();
        }
Beispiel #3
0
        public override void Init()
        {
            if (!FilesystemUtil.Sys.FileExists("steam_appid.txt"))
            {
                ConsoleSys.Panic("steam_appid.txt does not exist, could not get AppID.");
                return;
            }

            ConsoleSys = Sys.Ref.ConsoleSys;
            EventSys   = Sys.Ref.Shared.GetNode <EventSys>();

            try
            {
                AppID = uint.Parse(FilesystemUtil.Sys.FileRead("steam_appid.txt"));

                if (!Packsize.Test())
                {
                    ConsoleSys.Panic("Packsize Test returned false, the wrong version of Steamworks.NET is being run in this platform.");
                    return;
                }

                if (!DllCheck.Test())
                {
                    ConsoleSys.Panic("DllCheck Test returned false, One or more of the Steamworks binaries seems to be the wrong version.");
                    return;
                }

                if (SteamAPI.RestartAppIfNecessary(new AppId_t(AppID)))
                {
                    ConsoleSys.Panic("Steam requested us to restart app");
                    return;
                }
            }
            catch (Exception Exception)
            {
                ConsoleSys.Panic(Exception.Message);
                return;
            }

            if (!SteamAPI.Init())
            {
                ConsoleSys.Panic("SteamAPI_Init() failed. Refer to Valve's documentation or the comment above this line for more information.");
                return;
            }
            else
            {
                m_SteamAPIWarningMessageHook = new SteamAPIWarningMessageHook_t(SteamAPIDebugTextHook);
                SteamClient.SetWarningMessageHook(m_SteamAPIWarningMessageHook);

                ExistingItems = GetModFolders();

                DownloadList         = new List <ulong>();
                DownloadItemResponse = Callback <DownloadItemResult_t> .Create(OnDownloadedItem);
            }
        }
Beispiel #4
0
        public override void Init()
        {
            ConsoleSys = Sys.Ref.ConsoleSys;

            RegisteredCommands = new Dictionary <string, List <Command> >();
            Paths = new Dictionary <int, List <BoundPath> >();

            AutofillLimit = Sys.Ref.Shared.GetObject <ConfigSys>().Shared.Get <int>("Unary.Common.Console.AutofillLimit");

            ProcessFiles("Unary.Common", ".");
        }
Beispiel #5
0
        public override void Init()
        {
            ConsoleSys = Sys.Ref.ConsoleSys;

            Assemblies = new Dictionary <string, Assembly>();

            NamedTypes  = new Dictionary <string, Type>();
            ActualTypes = new Dictionary <Type, string>();

            Assembly[] NewAssemblies = AppDomain.CurrentDomain.GetAssemblies();

            foreach (var Entry in NewAssemblies)
            {
                string CurrentName = Entry.GetName().Name;

                if (CurrentName.BeginsWith("System") || CurrentName.BeginsWith("Godot") ||
                    CurrentName.BeginsWith("mscorlib") || CurrentName.BeginsWith("Unary."))
                {
                    Assemblies[CurrentName] = Entry;
                    AddTypes(Assemblies[CurrentName]);
                }
            }
        }
Beispiel #6
0
        public override void _Ready()
        {
            Ref = this;

            Debug = OS.IsDebugBuild();

            Shared = new SysManager();
            Server = new SysManager();
            Client = new SysManager();

            AddChild(Shared);
            AddChild(Server);
            AddChild(Client);

            LaunchArguments = OS.GetCmdlineArgs().ToList();

            AppType = new SysAppType();

            if (LaunchArguments.Contains("server"))
            {
                AppType.SetServer(true);
            }
            else
            {
                AppType.SetClient(true);
            }

            try
            {
                Shared.AddUI(new ConsoleSys(), "Console");

                ConsoleSys = Shared.GetUI <ConsoleSys>();

                Main NewCommon = new Main();
                NewCommon.AddShared();

                Shared.AddObject(new BootSys());

                Shared.GetObject <BootSys>().Add("Unary.Common", NewCommon);

                if (AppType.IsServer())
                {
                    Shared.GetObject <BootSys>().AddServer("Unary.Common");
                }
                else
                {
                    Shared.GetObject <BootSys>().AddClient("Unary.Common");
                }

                Shared.AddObject(new ModSys());

                Mod CoreMod = Shared.GetObject <ModSys>().Core.Mod;

                Shared.InitCore(CoreMod);

                if (AppType.IsServer())
                {
                    Server.InitCore(CoreMod);
                }
                else
                {
                    Client.InitCore(CoreMod);
                }

                Shared.GetObject <BootSys>().AddShared(CoreMod.ModID);

                if (AppType.IsServer())
                {
                    Shared.GetObject <BootSys>().AddServer(CoreMod.ModID);
                }
                else
                {
                    Shared.GetObject <BootSys>().AddClient(CoreMod.ModID);
                }
            }
            catch (Exception Exception)
            {
                ConsoleSys.Panic(Exception.Message);
            }
        }