本文整理汇总了C#中Mod.Save方法的典型用法代码示例。如果您正苦于以下问题:C# Mod.Save方法的具体用法?C# Mod.Save怎么用?C# Mod.Save使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Mod
的用法示例。
在下文中一共展示了Mod.Save方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SimpleConsoleInputHandler
public void SimpleConsoleInputHandler()
{
MinecraftModUpdater.Logger.Log(Logger.Level.Info,"Simple Console Input Handler is online and ready. \r\nEnter \"help\" for a list of commands.");
while (Online)
{
string input = Console.ReadLine();
if (!Online) break;
switch (input)
{
case "connected":
MinecraftModUpdater.Logger.Log(Logger.Level.Info,"There are {0} connected clients.", Clients.Count);
if (Clients.Count > 0)
{
MinecraftModUpdater.Logger.Log(Logger.Level.Info,"Connected Clients:");
foreach (Client c in Clients)
{
MinecraftModUpdater.Logger.Log(Logger.Level.Info,c.ToString());
}
}
break;
case "exit":
case "stop":
foreach (Client c in Clients)
{
Packet.Send(new MetadataPacket { SData = new string[] { "shutdown", "The Server is shutting down." } }, c.PacketHandler.Stream);
}
if (Clients.Count > 0) MinecraftModUpdater.Logger.Log(Logger.Level.Info,"Waiting for {0} clients to exit.", Clients.Count);
while (Clients.Count > 0) Thread.Sleep(500);
Dispose();
break;
case "populate":
foreach(string s in Directory.GetFiles(Config.ModsPath + "/mods"))
{
Mod m = new Mod
{
Author = "null",
Description = "",
FileSize = 0,
ModFile = "mods/" + Path.GetFileName(s),
ModName = Path.GetFileName(s),
BlacklistedUsers = new List<string>(),
WhitelistedUsers = new List<string>(),
PostDownloadCLI = new string[0],
Identifier = Extras.GenerateHashFromString(Path.GetFileName(s)),
ConfigFile = Config.ModsPath + "/xml/" + Path.GetFileName(s) + ".xml",
RequiredMods = new List<Mod>()
};
m.Save();
}
Mods.Clear();
ModImages.Clear();
LoadMods();
break;
case "help":
case "?":
default:
MinecraftModUpdater.Logger.Log(Logger.Level.Info,"exit, stop - Safely stops the update server after all clients exit.");
MinecraftModUpdater.Logger.Log(Logger.Level.Info,"connected - Shows a list of connected clients.");
MinecraftModUpdater.Logger.Log(Logger.Level.Info,"populate - Automagicly reads all of the files in the mods folder and creates XML files for them.");
break;
}
}
}