TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ SaveRecent()

static void Terraria.Main.SaveRecent ( )
inlinestatic

Definition at line 3952 of file Main.cs.

3953 {
3954 Utils.TryCreatingDirectory(SavePath);
3955 try
3956 {
3957 if (File.Exists(SavePath + Path.DirectorySeparatorChar + "servers.dat"))
3958 {
3959 File.SetAttributes(SavePath + Path.DirectorySeparatorChar + "servers.dat", FileAttributes.Normal);
3960 }
3961 }
3962 catch
3963 {
3964 }
3965 try
3966 {
3967 using FileStream output = new FileStream(SavePath + Path.DirectorySeparatorChar + "servers.dat", FileMode.Create);
3968 using BinaryWriter binaryWriter = new BinaryWriter(output);
3969 binaryWriter.Write(279);
3970 for (int i = 0; i < 10; i++)
3971 {
3972 binaryWriter.Write(recentWorld[i]);
3973 binaryWriter.Write(recentIP[i]);
3974 binaryWriter.Write(recentPort[i]);
3975 }
3976 }
3977 catch
3978 {
3979 }
3980 }
static int[] recentPort
Definition Main.cs:867
static string SavePath
Definition Main.cs:2841
static string[] recentIP
Definition Main.cs:865
static string[] recentWorld
Definition Main.cs:863

References Terraria.Main.recentIP, Terraria.Main.recentPort, Terraria.Main.recentWorld, Terraria.Main.SavePath, and Terraria.Utils.TryCreatingDirectory().

Referenced by Terraria.Netplay.AddCurrentServerToRecentList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: