54 {
55 try
56 {
59 {
61 if (
int.TryParse(
s, out var result))
62 {
63 switch (result)
64 {
65 case 0:
67 break;
68 case 1:
70 break;
71 case 2:
73 break;
74 case 3:
76 break;
77 case 4:
79 break;
80 case 5:
82 break;
83 default:
85 break;
86 }
87 }
88 else
89 {
91 }
92 }
93 else
94 {
96 }
97 }
98 catch
99 {
100 }
103 {
105 if (num <= 255 && num >= 1)
106 {
107 game.SetNetPlayers(num);
108 }
109 }
110 string arg;
112 {
113 Netplay.ServerPassword = Main.ConvertFromSafeArgument(arg);
114 }
115 string s2;
116 if ((s2 =
TryParameter(
"-lang")) !=
null &&
int.TryParse(s2, out var result2))
117 {
119 }
121 {
123 }
124 string worldName;
126 {
127 game.SetWorldName(worldName);
128 }
129 string newMOTD;
131 {
132 game.NewMOTD(newMOTD);
133 }
134 string banFilePath;
136 {
137 Netplay.BanFilePath = banFilePath;
138 }
140 {
141 game.EnableAutoShutdown();
142 }
144 {
145 Netplay.SpamCheck = true;
146 }
147 string serverWorldRollbacks;
148 if ((serverWorldRollbacks =
TryParameter(
"-worldrollbackstokeep")) !=
null)
149 {
150 game.setServerWorldRollbacks(serverWorldRollbacks);
151 }
152 string worldSize;
154 {
155 game.autoCreate(worldSize);
156 }
158 {
159 Netplay.UseUPNP = false;
160 }
162 {
163 Main.UseExperimentalFeatures = true;
164 }
165 string world;
167 {
168 game.SetWorld(world, cloud: false);
169 }
171 {
172 game.SetWorld(world, cloud: true);
173 }
174 string configPath;
176 {
177 game.LoadDedConfig(configPath);
178 }
179 string autogenSeedName;
181 {
182 Main.AutogenSeedName = autogenSeedName;
183 }
184 }
static int ToInt32(object? value)
static Process GetCurrentProcess()
static string TryParameter(params string[] keys)
static bool HasParameter(params string[] keys)
static LanguageManager Instance