You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ArgumentOption.cs 3.0 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using CommandLine;
  2. namespace Server
  3. {
  4. static class DefaultArgumentOptions
  5. {
  6. public static string FileName = "xxxx不用记啊xxxx"; // An impossible name of the playback file to indicate -f is not sepcified.
  7. public static string Token = "xxxx随手推啊xxxx"; // An impossible name of the token to indicate -f is not sepcified.
  8. public static string Url = "xxxx闭眼写啊xxxx";
  9. public static string MapResource = "xxxx多简单啊xxxx";
  10. }
  11. public class ArgumentOptions
  12. {
  13. [Option('p', "port", Required = true, HelpText = "Server listening port")]
  14. public ushort ServerPort { get; set; } = 10086;
  15. [Option('t', "teamCount", Required = false, HelpText = "The number of teams, 1 by defualt")]
  16. public ushort TeamCount { get; set; } = 1;
  17. [Option('c', "playerCount", Required = false, HelpText = "The number of players per team, 1 by default")]
  18. public ushort PlayerCountPerTeam { get; set; } = 1;
  19. [Option('g', "gameTimeInSecond", Required = false, HelpText = "The time of the game in second, 10 minutes by default")]
  20. public uint GameTimeInSecond { get; set; } = 10 * 60;
  21. [Option('f', "fileName", Required = false, HelpText = "The file to store playback file or to read file.")]
  22. public string FileName { get; set; } = DefaultArgumentOptions.FileName;
  23. [Option('b', "playback", Required = false, HelpText = "Whether open the server in a playback mode.")]
  24. public bool Playback { get; set; } = false;
  25. [Option("playbackSpeed", Required = false, HelpText = "The speed of the playback, between 0.25 and 4.0")]
  26. public double PlaybackSpeed { get; set; } = 1.0;
  27. [Option("resultOnly", Required = false, HelpText = "In playback mode to get the result directly")]
  28. public bool ResultOnly { get; set; } = false;
  29. [Option('k', "token", Required = false, HelpText = "Web API Token")]
  30. public string Token { get; set; } = DefaultArgumentOptions.Token;
  31. [Option('u', "url", Required = false, HelpText = "Web Url")]
  32. public string Url { get; set; } = DefaultArgumentOptions.Url;
  33. [Option('m', "mapResource", Required = false, HelpText = "Map Resource Path")]
  34. public string mapResource { get; set; } = DefaultArgumentOptions.MapResource;
  35. [Option("requestOnly", Required = false, HelpText = "Only send web requests")]
  36. public bool RequestOnly { get; set; } = false;
  37. [Option("finalGame", Required = false, HelpText = "Whether it is the final game")]
  38. public bool FinalGame { get; set; } = false;
  39. [Option("cheatMode", Required = false, HelpText = "Whether to open the cheat code")]
  40. public bool CheatMode { get; set; } = false;
  41. [Option("resultFileName", Required = false, HelpText = "Result file name, saved as .json")]
  42. public string ResultFileName { get; set; } = DefaultArgumentOptions.FileName;
  43. }
  44. }