Definition at line 4819 of file Main.cs.
4820 {
4824 {
4827 {
4830 {
4832 }
4833 }
4834 }
4835 else
4836 {
4838 }
4843 {
4844 bool flag = true;
4845 while (flag)
4846 {
4851 {
4853 }
4865 {
4867 }
4868 try
4869 {
4871 }
4872 catch
4873 {
4874 }
4876 {
4877 try
4878 {
4882 {
4888 {
4890 }
4891 }
4892 }
4893 catch
4894 {
4895 }
4896 try
4897 {
4899 }
4900 catch
4901 {
4902 }
4903 continue;
4904 }
4906 {
4909 {
4918 try
4919 {
4921 {
4922 case 1:
4926 break;
4927 case 2:
4931 break;
4932 case 3:
4936 break;
4937 }
4938 }
4939 catch
4940 {
4941 }
4942 try
4943 {
4945 }
4946 catch
4947 {
4948 }
4949 }
4952 {
4962 try
4963 {
4965 {
4966 case 1:
4969 break;
4970 case 2:
4973 break;
4974 case 3:
4977 break;
4978 case 4:
4981 break;
4982 }
4983 }
4984 catch
4985 {
4986 }
4987 try
4988 {
4990 }
4991 catch
4992 {
4993 }
4994 }
4997 {
5006 try
5007 {
5009 {
5010 case 1:
5011 WorldGen.WorldGenParam_Evil = -1;
5013 break;
5014 case 2:
5015 WorldGen.WorldGenParam_Evil = 0;
5017 break;
5018 case 3:
5019 WorldGen.WorldGenParam_Evil = 1;
5021 break;
5022 }
5023 }
5024 catch
5025 {
5026 }
5027 try
5028 {
5030 }
5031 catch
5032 {
5033 }
5034 }
5038 {
5043 {
5045 {
5048 continue;
5049 }
5051 try
5052 {
5054 }
5055 catch
5056 {
5057 }
5058 }
5059 else
5060 {
5061 try
5062 {
5064 }
5065 catch
5066 {
5067 }
5069 }
5070 }
5075 {
5080 {
5081 if (
text3.Length >= 40)
5082 {
5085 continue;
5086 }
5088 try
5089 {
5091 }
5092 catch
5093 {
5094 }
5095 }
5096 else
5097 {
5099 }
5100 }
5104 if (
text3.Length == 0)
5105 {
5107 }
5108 else
5109 {
5111 }
5118 {
5120 {
5123 }
5124 }
5125 try
5126 {
5128 }
5129 catch
5130 {
5131 }
5132 while (!
task.IsCompleted)
5133 {
5136 {
5140 {
5142 }
5144 }
5145 }
5146 continue;
5147 }
5148 try
5149 {
5153 {
5154 continue;
5155 }
5158 {
5163 try
5164 {
5166 {
5168 }
5171 {
5174 }
5176 }
5177 catch
5178 {
5179 }
5180 try
5181 {
5183 }
5184 catch
5185 {
5186 }
5187 }
5190 {
5195 try
5196 {
5198 {
5200 }
5203 {
5204 Netplay.ListenPort =
num5;
5206 }
5207 }
5208 catch
5209 {
5210 }
5211 try
5212 {
5214 }
5215 catch
5216 {
5217 }
5218 }
5221 {
5226 try
5227 {
5229 {
5230 Netplay.UseUPNP = true;
5232 }
5234 {
5235 Netplay.UseUPNP = false;
5237 }
5238 }
5239 catch
5240 {
5241 }
5242 try
5243 {
5245 }
5246 catch
5247 {
5248 }
5249 }
5255 flag = false;
5256 try
5257 {
5259 }
5260 catch
5261 {
5262 }
5263 }
5264 catch
5265 {
5266 }
5267 }
5268 }
5269 try
5270 {
5272 }
5273 catch
5274 {
5275 }
5279 while (!
task2.IsCompleted)
5280 {
5282 {
5284 {
5286 }
5288 {
5291 }
5292 }
5293 }
5294 try
5295 {
5297 {
5299 }
5300 }
5301 catch
5302 {
5303 }
5305 {
5308 {
5310 }
5312 return;
5313 }
5319 Console.Title =
"Terraria Server: " +
worldName;
5322 {
5324 }
5326 double num6 = 16.666666666666668;
5330 Netplay.StartServer();
5332 while (!Netplay.Disconnect)
5333 {
5336 {
5342 {
5345 }
5346 if (Netplay.HasClients)
5347 {
5349 }
5351 {
5353 }
5354 if (
Main.OnTickForThirdPartySoftwareOnly !=
null)
5355 {
5356 Main.OnTickForThirdPartySoftwareOnly();
5357 }
5358 double num9 = stopwatch.Elapsed.TotalMilliseconds +
num7;
5360 {
5363 {
5365 if (!Netplay.HasClients)
5366 {
5369 }
5370 }
5371 }
5372 }
5374 }
5375 if (Netplay.SaveOnServerExit)
5376 {
5379 }
5381 }
static void Write(string format, object? arg0)
static ConsoleKeyInfo ReadKey()
static int ToInt32(object? value)
static byte Max(byte val1, byte val2)
static void Sleep(int millisecondsTimeout)
static void ProcessSpecialWorldSeeds(string processedSeed)
static WorldFileData CreateMetadata(string name, bool cloudSave, int GameMode)
static Exception LastThrownLoadException
static string GetTextValue(string key)
static string versionNumber
static List< WorldFileData > WorldList
static void WriteFancyWorldLoadErrorToConsole()
static string ReadLineInput()
static WorldFileData ActiveWorldFileData
static IntPtr FindWindow(string lpClassName, string lpWindowName)
static string oldStatusText
static string versionNumber2
static void EraseWorld(int i)
static Stopwatch saveTime
static bool ShowWindow(IntPtr hWnd, int nCmdShow)
static string worldPathName
static void startDedInput()
void SetNetPlayers(int mPlayers)
static string newWorldName
static UnifiedRandom rand
static GenerationProgress AutogenProgress
override void Initialize()
static Terraria.Social.Base.CloudSocialModule Cloud
static readonly IntPtr Zero
References Terraria.Main.ActiveWorldFileData, Terraria.Main.AutogenProgress, Terraria.Main.autoShutdown, System.Console.Clear(), Terraria.Social.SocialAPI.Cloud, Terraria.IO.WorldFile.CreateMetadata(), Terraria.WorldGen.CreateNewWorld(), Terraria.Main.dedServ, Terraria.Netplay.Disconnect, Terraria.WorldGen.drunkWorldGen, Terraria.Main.EraseWorld(), Terraria.Main.FindWindow(), Terraria.Main.gameMenu, Terraria.Main.GameMode, Terraria.WorldGen.getGoodWorldGen, Terraria.Localization.Language.GetTextValue(), Terraria.Netplay.HasClients, System.Text.RegularExpressions.i, Terraria.Main.Initialize(), ReLogic.OS.Platform.IsWindows, Terraria.IO.WorldFile.LastThrownLoadException, System.length, Terraria.Netplay.ListenPort, Terraria.WorldGen.loadFailed, Terraria.WorldGen.loadSuccess, Terraria.Main.LoadWorlds(), System.Math.Max(), Terraria.Main.maxTilesX, Terraria.Main.maxTilesY, System.Reflection.MaxValue, Terraria.Main.menuMode, System.Reflection.Name, Terraria.Main.NeverSleep(), Terraria.Main.newWorldName, Terraria.WorldGen.notTheBees, Terraria.Main.oldStatusText, Terraria.Main.OnTickForThirdPartySoftwareOnly, Terraria.GameContent.UI.States.UIWorldCreation.ProcessSpecialWorldSeeds(), Terraria.Main.rand, System.Console.ReadKey(), Terraria.Main.ReadLineInput(), Terraria.Netplay.SaveOnServerExit, Terraria.Main.saveTime, Terraria.IO.WorldFile.SaveWorld(), Terraria.WorldGen.serverLoadWorld(), Terraria.Main.SetNetPlayers(), Terraria.Main.showSplash, Terraria.Main.ShowWindow(), System.Threading.Thread.Sleep(), System.Diagnostics.Stopwatch.Start(), Terraria.Main.startDedInput(), Terraria.Netplay.StartServer(), Terraria.Main.statusText, System.task, System.Convert.ToInt32(), Microsoft.Xna.Framework.Update, System.value, Terraria.Main.versionNumber, Terraria.Main.versionNumber2, Terraria.Main.WorldList, Terraria.Main.worldName, Terraria.Main.worldPathName, System.Console.Write(), Terraria.Main.WriteFancyWorldLoadErrorToConsole(), System.Console.WriteLine(), Terraria.Main.YouCanSleepNow(), and System.IntPtr.Zero.