Print() public static method

public static Print ( string message ) : void
message string
return void
Beispiel #1
0
        public static void Init()
        {
            Version = new CVar("smod_version", "0.1");

            // load plugins

            Server.Print(License);
            Server.RegisterCommand("smod", smod);

            Verifier = new Verifier(Directory.GetCurrentDirectory(), Server.GameDirectory);

            try {
                var doc = new System.Xml.XmlDocument();
                doc.Load(Path.Combine(Server.ModDirectory, Path.Combine("cfg", "databases.xml")));
                try {
                    Database = DefaultDatabase.Load(Path.Combine(Server.ModDirectory, "SharpMod.Database.MySql.dll"));
                    Database.Load(doc);
                } catch (Exception e) {
                    Server.LogError("Database Interface failed to load, using default: {0}", e.Message);
                    Database = new DefaultDatabase();
                    Database.Load(doc);
                }
            } catch (Exception e) {
                Server.LogError("Failed to load cfg/databases.xml: {0}", e.Message);
            }

            Message.Init();
            MapCycle.Init();
        }
Beispiel #2
0
        static void smod(string[] args)
        {
            if (args.Length > 1)
            {
                switch (args[1])
                {
                case "gpl":
                    Server.Print(License);
                    break;

                case "list":
                case "plugins":
                    PluginManager.ShowPlugins();
                    break;

                default:
                    smodHelp();
                    break;
                }
            }
            else
            {
                smodHelp();
            }
        }
Beispiel #3
0
 protected static void Write(Player player, string text)
 {
     if (player == null)
     {
         Server.Print(text);
     }
     else
     {
         player.PrintConsole(text);
     }
 }
Beispiel #4
0
        public static void ShowPlugins()
        {
            int pluginCount = plugins.Count;

            TextTools.TextTable tt = new TextTools.TextTable(new string[] { "# ", "name", "author", "version" });
            tt.Header[0].Alignment = TextTools.Align.Right;

            numberFormatCounter = 0;
            var data = from h in plugins
                       select new string [] { NumberFormat(pluginCount), h.Name, h.Author, h.Version.ToString() };

            Server.Print("Currently loaded plugins:\n");
            tt.Render(data.ToArray(), Server.Print, Console.WindowWidth);
            Server.Print("{0} Plugins\n", plugins.Count);
        }