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

◆ IsBanned()

static bool Terraria.Netplay.IsBanned ( RemoteAddress address)
inlinestatic

Definition at line 126 of file Netplay.cs.

127 {
128 try
129 {
130 string identifier = address.GetIdentifier();
132 {
133 using StreamReader streamReader = new StreamReader(BanFilePath);
134 string text;
135 while ((text = streamReader.ReadLine()) != null)
136 {
137 if (text == identifier)
138 {
139 return true;
140 }
141 }
142 }
143 }
144 catch (Exception)
145 {
146 }
147 return false;
148 }
static bool Exists([NotNullWhen(true)] string? path)
Definition File.cs:97
static string BanFilePath
Definition Netplay.cs:33

References Terraria.Netplay.BanFilePath, System.IO.File.Exists(), Terraria.Net.RemoteAddress.GetIdentifier(), and System.text.

Referenced by Terraria.MessageBuffer.GetData().