예제 #1
0
        private void Init()
        {
            // Configure remote logging
            RemoteLogger.SetTag("game", Title.ToLower());
            RemoteLogger.SetTag("game version", Rust.Defines.Connection.protocol.ToString());

            // Add general commands
            cmdlib.AddConsoleCommand("oxide.plugins", this, "ConsolePlugins");
            cmdlib.AddConsoleCommand("global.plugins", this, "ConsolePlugins");
            cmdlib.AddConsoleCommand("oxide.load", this, "ConsoleLoad");
            cmdlib.AddConsoleCommand("global.load", this, "ConsoleLoad");
            cmdlib.AddConsoleCommand("oxide.unload", this, "ConsoleUnload");
            cmdlib.AddConsoleCommand("global.unload", this, "ConsoleUnload");
            cmdlib.AddConsoleCommand("oxide.reload", this, "ConsoleReload");
            cmdlib.AddConsoleCommand("global.reload", this, "ConsoleReload");
            cmdlib.AddConsoleCommand("oxide.version", this, "ConsoleVersion");
            cmdlib.AddConsoleCommand("global.version", this, "ConsoleVersion");

            // Add permission commands
            cmdlib.AddConsoleCommand("oxide.group", this, "ConsoleGroup");
            cmdlib.AddConsoleCommand("global.group", this, "ConsoleGroup");
            cmdlib.AddConsoleCommand("oxide.usergroup", this, "ConsoleUserGroup");
            cmdlib.AddConsoleCommand("global.usergroup", this, "ConsoleUserGroup");
            cmdlib.AddConsoleCommand("oxide.grant", this, "ConsoleGrant");
            cmdlib.AddConsoleCommand("global.grant", this, "ConsoleGrant");
            cmdlib.AddConsoleCommand("oxide.revoke", this, "ConsoleRevoke");
            cmdlib.AddConsoleCommand("global.revoke", this, "ConsoleRevoke");
            cmdlib.AddConsoleCommand("oxide.show", this, "ConsoleShow");
            cmdlib.AddConsoleCommand("global.show", this, "ConsoleShow");

            // Setup the default permission groups
            if (permission.IsLoaded)
            {
                var rank = 0;
                for (var i = DefaultGroups.Length - 1; i >= 0; i--)
                {
                    var defaultGroup = DefaultGroups[i];
                    if (!permission.GroupExists(defaultGroup))
                    {
                        permission.CreateGroup(defaultGroup, defaultGroup, rank++);
                    }
                }
                permission.RegisterValidate(s =>
                {
                    ulong temp;
                    if (!ulong.TryParse(s, out temp))
                    {
                        return(false);
                    }
                    var digits = temp == 0 ? 1 : (int)Math.Floor(Math.Log10(temp) + 1);
                    return(digits >= 17);
                });
                permission.CleanUp();
            }
        }
예제 #2
0
        private void Init()
        {
            // Configure remote logging
            RemoteLogger.SetTag("game", Title.ToLower());
            RemoteLogger.SetTag("game version", Server.Version);

            // Add core plugin commands
            AddCovalenceCommand(new[] { "oxide.plugins", "o.plugins", "plugins" }, "PluginsCommand", "oxide.plugins");
            AddCovalenceCommand(new[] { "oxide.load", "o.load", "plugin.load" }, "LoadCommand", "oxide.load");
            AddCovalenceCommand(new[] { "oxide.reload", "o.reload", "plugin.reload" }, "ReloadCommand", "oxide.reload");
            AddCovalenceCommand(new[] { "oxide.unload", "o.unload", "plugin.unload" }, "UnloadCommand", "oxide.unload");

            // Add core permission commands
            AddCovalenceCommand(new[] { "oxide.grant", "o.grant", "perm.grant" }, "GrantCommand", "oxide.grant");
            AddCovalenceCommand(new[] { "oxide.group", "o.group", "perm.group" }, "GroupCommand", "oxide.group");
            AddCovalenceCommand(new[] { "oxide.revoke", "o.revoke", "perm.revoke" }, "RevokeCommand", "oxide.revoke");
            AddCovalenceCommand(new[] { "oxide.show", "o.show", "perm.show" }, "ShowCommand", "oxide.show");
            AddCovalenceCommand(new[] { "oxide.usergroup", "o.usergroup", "perm.usergroup" }, "UserGroupCommand", "oxide.usergroup");

            // Add core misc commands
            AddCovalenceCommand(new[] { "oxide.lang", "o.lang" }, "LangCommand");
            AddCovalenceCommand(new[] { "oxide.save", "o.save" }, "SaveCommand");
            AddCovalenceCommand(new[] { "oxide.version", "o.version" }, "VersionCommand");

            // Register messages for localization
            foreach (KeyValuePair <string, Dictionary <string, string> > language in Localization.languages)
            {
                lang.RegisterMessages(language.Value, this, language.Key);
            }

            // Setup default permission groups
            if (permission.IsLoaded)
            {
                int rank = 0;
                foreach (string defaultGroup in Interface.Oxide.Config.Options.DefaultGroups)
                {
                    if (!permission.GroupExists(defaultGroup))
                    {
                        permission.CreateGroup(defaultGroup, defaultGroup, rank++);
                    }
                }

                permission.RegisterValidate(s =>
                {
                    if (ulong.TryParse(s, out ulong temp))
                    {
                        int digits = temp == 0 ? 1 : (int)Math.Floor(Math.Log10(temp) + 1);
                        return(digits >= 17);
                    }
                    return(false);
                });

                permission.CleanUp();
            }
        }
예제 #3
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", MultiplayerManager.Instance.GameDetails.Name);
        }
예제 #4
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", global::Game.Configuration.Config.Singleton.ServerName);
        }
예제 #5
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", Provider.serverName);
        }
예제 #6
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", BlockstormExtension.DedicatedServerConfiguration.string_12);
        }
예제 #7
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", GamePrefs.GetString(EnumGamePrefs.ServerName));
        }
예제 #8
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", CommandLine.GetVariable("name"));
        }
예제 #9
0
        private void OnServerInitialized()
        {
            if (serverInitialized) return;
            serverInitialized = true;

            permission.MigrateGroup("player", "default");

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", server.hostname);

            // Update server console window and status bars
            RustLegacyExtension.ServerConsole();
        }
예제 #10
0
        private void Init()
        {
            // Configure remote logging
            RemoteLogger.SetTag("game", "hurtworld");
            RemoteLogger.SetTag("version", GameManager.Instance.GetProtocolVersion().ToString());

            // Register messages for localization
            lang.RegisterMessages(messages, this);

            // Add general chat commands
            //cmdlib.AddChatCommand("oxide.plugins", this, "CmdPlugins");
            //cmdlib.AddChatCommand("plugins", this, "CmdPlugins");
            cmdlib.AddChatCommand("oxide.load", this, "CmdLoad");
            cmdlib.AddChatCommand("load", this, "CmdLoad");
            cmdlib.AddChatCommand("oxide.unload", this, "CmdUnload");
            cmdlib.AddChatCommand("unload", this, "CmdUnload");
            cmdlib.AddChatCommand("oxide.reload", this, "CmdReload");
            cmdlib.AddChatCommand("reload", this, "CmdReload");
            cmdlib.AddChatCommand("oxide.version", this, "CmdVersion");
            cmdlib.AddChatCommand("version", this, "CmdVersion");

            // Add permission chat commands
            cmdlib.AddChatCommand("oxide.group", this, "CmdGroup");
            cmdlib.AddChatCommand("group", this, "CmdGroup");
            cmdlib.AddChatCommand("oxide.usergroup", this, "CmdUserGroup");
            cmdlib.AddChatCommand("usergroup", this, "CmdUserGroup");
            cmdlib.AddChatCommand("oxide.grant", this, "CmdGrant");
            cmdlib.AddChatCommand("grant", this, "CmdGrant");
            cmdlib.AddChatCommand("oxide.revoke", this, "CmdRevoke");
            cmdlib.AddChatCommand("revoke", this, "CmdRevoke");
            cmdlib.AddChatCommand("oxide.show", this, "CmdShow");
            cmdlib.AddChatCommand("show", this, "CmdShow");

            if (permission.IsLoaded)
            {
                var rank = 0;
                for (var i = DefaultGroups.Length - 1; i >= 0; i--)
                {
                    var defaultGroup = DefaultGroups[i];
                    if (!permission.GroupExists(defaultGroup))
                    {
                        permission.CreateGroup(defaultGroup, defaultGroup, rank++);
                    }
                }
                permission.CleanUp(s =>
                {
                    ulong temp;
                    return(ulong.TryParse(s, out temp));
                });
            }
        }
예제 #11
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", BlockstormExtension.DedicatedServerConfiguration.string_12);

            // Update server console window and status bars
            BlockstormExtension.ServerConsole();
        }
예제 #12
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", MyMultiplayer.Static?.HostName);

            // Update server console window and status bars
            SpaceEngineersExtension.ServerConsole();
        }
예제 #13
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", global::Game.Configuration.Config.Singleton.ServerName);

            // Update server console window and status bars
            InterstellarRiftExtension.ServerConsole();
        }
예제 #14
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", MultiplayerManager.Instance.GameDetails.Name);

            // Update server console window and status bars
            FromTheDepthsExtension.ServerConsole();
        }
예제 #15
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Add 'oxide' and 'modded' tags
            //SteamGameServer.SetGameTags("oxide,modded");

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", NetworkController.NetManager_.ServManager.Server_NAME);
        }
예제 #16
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", ServerConfig.ServerName);

            // Update server console window and status bars
            PlanetExplorersExtension.ServerConsole();
        }
예제 #17
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", Provider.serverName);

            // Update server console window and status bars
            UnturnedExtension.ServerConsole();
        }
예제 #18
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", PlayerPrefs.GetString("MpGameName"));

            // Save the level every X minutes
            Interface.Oxide.GetLibrary <Timer>().Once(300f, () => LevelSerializer.SaveGame("Game"));
        }
예제 #19
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", Main.worldName);

            // Update server console window and status bars
            TerrariaExtension.ServerConsole();
        }
예제 #20
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", CommandLine.GetVariable("name"));

            // Update server console window and status bars
            NomadExtension.ServerConsole();
        }
예제 #21
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", GamePrefs.GetString(EnumGamePrefs.ServerName));

            // Update server console window and status bars
            SevenDaysExtension.ServerConsole();
        }
예제 #22
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Add 'oxide' and 'modded' tags
            SteamGameServer.SetGameTags("oxide,modded");

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", GameManager.Instance.ServerConfig.GameName);
        }
예제 #23
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", MySandboxGame.ConfigDedicated.ServerName);

            // Update server console window and status bars
            SpaceEngineersExtension.ServerConsole();
        }
예제 #24
0
        private void Init()
        {
            // Configure remote logging
            RemoteLogger.SetTag("game", "rust legacy");
            RemoteLogger.SetTag("version", Rust.Defines.Connection.protocol.ToString());

            // Add general commands
            cmdlib.AddConsoleCommand("oxide.plugins", this, "cmdPlugins");
            cmdlib.AddConsoleCommand("global.plugins", this, "cmdPlugins");
            cmdlib.AddConsoleCommand("oxide.load", this, "cmdLoad");
            cmdlib.AddConsoleCommand("global.load", this, "cmdLoad");
            cmdlib.AddConsoleCommand("oxide.unload", this, "cmdUnload");
            cmdlib.AddConsoleCommand("global.unload", this, "cmdUnload");
            cmdlib.AddConsoleCommand("oxide.reload", this, "cmdReload");
            cmdlib.AddConsoleCommand("global.reload", this, "cmdReload");
            cmdlib.AddConsoleCommand("oxide.version", this, "cmdVersion");
            cmdlib.AddConsoleCommand("global.version", this, "cmdVersion");

            // Add permission commands
            cmdlib.AddConsoleCommand("oxide.group", this, "cmdGroup");
            cmdlib.AddConsoleCommand("global.group", this, "cmdGroup");
            cmdlib.AddConsoleCommand("oxide.usergroup", this, "cmdUserGroup");
            cmdlib.AddConsoleCommand("global.usergroup", this, "cmdUserGroup");
            cmdlib.AddConsoleCommand("oxide.grant", this, "cmdGrant");
            cmdlib.AddConsoleCommand("global.grant", this, "cmdGrant");
            cmdlib.AddConsoleCommand("oxide.revoke", this, "cmdRevoke");
            cmdlib.AddConsoleCommand("global.revoke", this, "cmdRevoke");
            cmdlib.AddConsoleCommand("oxide.show", this, "cmdShow");
            cmdlib.AddConsoleCommand("global.show", this, "cmdShow");

            // Setup the default permission groups
            if (permission.IsLoaded)
            {
                var rank = 0;
                for (var i = DefaultGroups.Length - 1; i >= 0; i--)
                {
                    var defaultGroup = DefaultGroups[i];
                    if (!permission.GroupExists(defaultGroup))
                    {
                        permission.CreateGroup(defaultGroup, defaultGroup, rank++);
                    }
                }
                permission.CleanUp(s =>
                {
                    ulong temp;
                    return(ulong.TryParse(s, out temp));
                });
            }
        }
예제 #25
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Configure remote logging
            RemoteLogger.SetTag("hostname", Provider.serverName);
            RemoteLogger.SetTag("version", Provider.APP_VERSION);

            // Update server console window and status bars
            UnturnedExtension.ServerConsole();
        }
예제 #26
0
        /// <summary>
        /// Loads this extension
        /// </summary>
        public override void Load()
        {
            // Register our loader
            Manager.RegisterPluginLoader(new UnityPluginLoader());

            // Register engine clock
            Interface.Oxide.RegisterEngineClock(() => Time.realtimeSinceStartup);

            // Configure remote logging
            RemoteLogger.SetTag("os", SystemInfo.operatingSystem);
            RemoteLogger.SetTag("cpu", SystemInfo.processorType);

            // Register our MonoBehaviour
            UnityScript.Create();
        }
예제 #27
0
파일: NomadCore.cs 프로젝트: sjaslow/Oxide
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }

            Analytics.Collect();
            NomadExtension.ServerConsole();

            // Configure remote logging
            RemoteLogger.SetTag("game", Title.ToLower());
            RemoteLogger.SetTag("game version", Server.Version);

            serverInitialized = true;
        }
예제 #28
0
        public static void CheckCompilerBinary()
        {
            BinaryPath = null;
            var rootDirectory = Interface.Oxide.RootDirectory;
            var binaryPath    = rootDirectory + @"\basic.exe";

            if (File.Exists(binaryPath))
            {
                BinaryPath = binaryPath;
                return;
            }
            switch (Environment.OSVersion.Platform)
            {
            case PlatformID.Win32NT:
            case PlatformID.Win32S:
            case PlatformID.Win32Windows:
                binaryPath = rootDirectory + @"\CSharpCompiler.exe";
                if (!File.Exists(binaryPath))
                {
                    Interface.Oxide.LogError("Cannot compile C# (.cs) plugins. Unable to find CSharpCompiler.exe!");
                    return;
                }
                break;

            case PlatformID.Unix:
            case PlatformID.MacOSX:
                binaryPath = rootDirectory + @"/CSharpCompiler";
                if (IntPtr.Size != 8)
                {
                    binaryPath += ".x86";
                }
                if (!File.Exists(binaryPath))
                {
                    Interface.Oxide.LogError("Cannot compile C# (.cs) plugins. Unable to find CSharpCompiler!");
                    return;
                }
                Syscall.chmod(binaryPath, FilePermissions.S_IRWXU | FilePermissions.S_IRGRP | FilePermissions.S_IXGRP | FilePermissions.S_IROTH | FilePermissions.S_IXOTH);
                break;
            }
            BinaryPath = EscapePath(binaryPath);

            var versionInfo = FileVersionInfo.GetVersionInfo(binaryPath);

            CompilerVersion = $"{versionInfo.FileMajorPart}.{versionInfo.FileMinorPart}.{versionInfo.FileBuildPart}.{versionInfo.FilePrivatePart}";
            RemoteLogger.SetTag("compiler version", CompilerVersion);
        }
예제 #29
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Add some Steam tags
            //SteamGameServer.SetGameTags("oxide,modded");

            // Configure remote logging
            RemoteLogger.SetTag("hostname", NetworkController.NetManager_.ServManager.Server_NAME);

            // Update server console window and status bars
            HideHoldOutExtension.ServerConsole();
        }
예제 #30
0
        private void OnServerInitialized()
        {
            if (serverInitialized)
            {
                return;
            }
            serverInitialized = true;

            // Add 'oxide' and 'modded' tags
            SteamGameServer.SetGameTags("oxide,modded");

            // Configure the hostname after it has been set
            RemoteLogger.SetTag("hostname", GameManager.Instance.ServerConfig.GameName);

            // Update server console window and status bars
            HurtworldExtension.ServerConsole();
        }