mirror of
https://github.com/RaidMax/IW4M-Admin.git
synced 2025-06-10 15:20:48 -05:00
More stats polishing
fixed player specification for commands with multiple words
This commit is contained in:
@ -744,7 +744,7 @@ namespace SharedLibrary.Commands
|
||||
E.Data = E.Data.RemoveWords(1);
|
||||
E.Owner.Reports.Add(new Report(E.Target, E.Origin, E.Data));
|
||||
|
||||
await E.Origin.Tell($"Thank you for your report, and administrator has been notified");
|
||||
await E.Origin.Tell($"Thank you for your report, an administrator has been notified");
|
||||
await E.Owner.ExecuteEvent(new Event(Event.GType.Report, E.Data, E.Origin, E.Target, E.Owner));
|
||||
await E.Owner.ToAdmins(String.Format("^5{0}^7->^1{1}^7: {2}", E.Origin.Name, E.Target.Name, E.Data));
|
||||
}
|
||||
|
@ -73,6 +73,8 @@ namespace SharedLibrary.Objects
|
||||
public DateTime ConnectionTime { get; set; }
|
||||
[NotMapped]
|
||||
public Server CurrentServer { get; set; }
|
||||
[NotMapped]
|
||||
public int Score { get; set; }
|
||||
|
||||
private string _ipaddress;
|
||||
public override string IPAddress
|
||||
|
@ -26,8 +26,8 @@ namespace SharedLibrary.Network
|
||||
|
||||
static string[] SendQuery(QueryType Type, Server QueryServer, string Parameters = "")
|
||||
{
|
||||
if ((DateTime.Now - LastQuery).TotalMilliseconds < 100)
|
||||
Task.Delay(100).Wait();
|
||||
if ((DateTime.Now - LastQuery).TotalMilliseconds < 300)
|
||||
Task.Delay(300).Wait();
|
||||
LastQuery = DateTime.Now;
|
||||
var ServerOOBConnection = new UdpClient();
|
||||
ServerOOBConnection.Client.SendTimeout = 1000;
|
||||
|
@ -233,6 +233,12 @@ namespace SharedLibrary.Services
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public async Task<int> GetTotalPlayTime()
|
||||
{
|
||||
using (var context = new DatabaseContext())
|
||||
return await context.Clients.SumAsync(c => c.TotalConnectionTime);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
@ -62,7 +62,9 @@ namespace SharedLibrary
|
||||
int.TryParse(playerInfo[0], out cID);
|
||||
var regex = Regex.Match(responseLine, @"\d+\.\d+\.\d+.\d+\:\d{1,5}");
|
||||
string cIP = regex.Value.Split(':')[0];
|
||||
Player P = new Player() { Name = cName, NetworkId = npID, ClientNumber = cID, IPAddress = cIP, Ping = Ping };
|
||||
regex = Regex.Match(responseLine, @"[0-9]{1,2}\s+[0-9]+\s+");
|
||||
int score = Int32.Parse(regex.Value.Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)[1]);
|
||||
Player P = new Player() { Name = cName, NetworkId = npID, ClientNumber = cID, IPAddress = cIP, Ping = Ping, Score = score};
|
||||
StatusPlayers.Add(P);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user