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.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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("ip", Required = false, HelpText = "Server listening ip")]
  14. public string ServerIP { get; set; } = "0.0.0.0";
  15. [Option('p', "port", Required = true, HelpText = "Server listening port")]
  16. public ushort ServerPort { get; set; } = 8888;
  17. [Option("teamCount", Required = false, HelpText = "The number of teams, 2 by defualt")]
  18. public ushort TeamCount { get; set; } = 2;
  19. [Option('s', "studentCount", Required = false, HelpText = "The number of students, 4 by default")]
  20. public ushort StudentCount { get; set; } = 4;
  21. [Option('t', "trickerCount", Required = false, HelpText = "The number of trickers, 1 by default")]
  22. public ushort TrickerCount { get; set; } = 1;
  23. [Option("maxStudentCount", Required = false, HelpText = "The max number of students, 4 by default")]
  24. public ushort MaxStudentCount { get; set; } = 4;
  25. [Option("maxTrickerCount", Required = false, HelpText = "The max number of trickers, 1 by default")]
  26. public ushort MaxTrickerCount { get; set; } = 1;
  27. [Option('g', "gameTimeInSecond", Required = false, HelpText = "The time of the game in second, 10 minutes by default")]
  28. public uint GameTimeInSecond { get; set; } = 10 * 60;
  29. [Option('f', "fileName", Required = false, HelpText = "The file to store playback file or to read file.")]
  30. public string FileName { get; set; } = DefaultArgumentOptions.FileName;
  31. [Option("notAllowSpectator", Required = false, HelpText = "Whether to allow a spectator to watch the game.")]
  32. public bool NotAllowSpectator { get; set; } = false;
  33. [Option('b', "playback", Required = false, HelpText = "Whether open the server in a playback mode.")]
  34. public bool Playback { get; set; } = false;
  35. [Option("playbackSpeed", Required = false, HelpText = "The speed of the playback, between 0.25 and 4.0")]
  36. public double PlaybackSpeed { get; set; } = 1.0;
  37. [Option("resultOnly", Required = false, HelpText = "In playback mode to get the result directly")]
  38. public bool ResultOnly { get; set; } = false;
  39. [Option('k', "token", Required = false, HelpText = "Web API Token")]
  40. public string Token { get; set; } = DefaultArgumentOptions.Token;
  41. [Option('u', "url", Required = false, HelpText = "Web Url")]
  42. public string Url { get; set; } = DefaultArgumentOptions.Url;
  43. [Option('m', "mapResource", Required = false, HelpText = "Map Resource Path")]
  44. public string mapResource { get; set; } = DefaultArgumentOptions.MapResource;
  45. [Option("requestOnly", Required = false, HelpText = "Only send web requests")]
  46. public bool RequestOnly { get; set; } = false;
  47. [Option("finalGame", Required = false, HelpText = "Whether it is the final game")]
  48. public bool FinalGame { get; set; } = false;
  49. [Option("cheatMode", Required = false, HelpText = "Whether to open the cheat code")]
  50. public bool CheatMode { get; set; } = false;
  51. [Option("resultFileName", Required = false, HelpText = "Result file name, saved as .json")]
  52. public string ResultFileName { get; set; } = DefaultArgumentOptions.FileName;
  53. }
  54. }