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

◆ IsClientCompatible()

static bool Terraria.ModLoader.ModNet.IsClientCompatible ( string clientVersion,
out bool isModded,
out string kickMsg )
inlinestaticpackage

Definition at line 155 of file ModNet.cs.

156 {
157 kickMsg = null;
158 isModded = clientVersion.StartsWith("tModLoader");
159 if (AllowVanillaClients && clientVersion == "Terraria" + 279)
160 {
161 return true;
162 }
164 {
165 return true;
166 }
167 string[] split = clientVersion.Split('!');
168 if (StableNetVersion != null && split.Length == 2 && Version.TryParse(split[1], out Version netVer) && netVer == StableNetVersion)
169 {
170 Logging.tML.Debug((object)("Client has " + split[0] + ", assuming net compatibility"));
171 return true;
172 }
173 kickMsg = (isModded ? ("You are on " + split[0] + ", server is on " + BuildInfo.versionedName) : "You cannot connect to a tModLoader Server with an unmodded client");
174 return false;
175 }
static bool AllowVanillaClients
Definition ModNet.cs:109
static ? Version StableNetVersion
Definition ModNet.cs:115
static string NetVersionString
Definition ModNet.cs:117

References Terraria.ModLoader.ModNet.AllowVanillaClients, Terraria.ModLoader.ModNet.NetVersionString, Terraria.ModLoader.ModNet.StableNetVersion, Terraria.ModLoader.Logging.tML, and Terraria.ModLoader.BuildInfo.versionedName.

Referenced by Terraria.MessageBuffer.GetData().

+ Here is the caller graph for this function: