Hello. I was wondering is it possible to get ip to cruise InSim who connected to server? For example I write command !UserIP S2 and it shows his ip.
Thanks
Thanks
#region ' Get IP String '
static public string GetIPString(string Username)
{
string file = globalVars.globalserverlog;
StreamReader Sr = new StreamReader(file);
if (Sr.BaseStream.Length > 4096)
{
Sr.BaseStream.Seek(-4096, SeekOrigin.End);
}
string line = null;
while ((line = Sr.ReadLine()) != null)
{
if (line.Contains("Authorised : "))
{
int index1 = line.LastIndexOf("(" + Username + ")", StringComparison.OrdinalIgnoreCase);
if (index1 != -1)
{
string Msg = line;
Sr.Close();
return line.Substring(index1 - 15);
}
}
}
Sr.Close();
return "";
}