MaxLatency added
This commit is contained in:
parent
5ee477e857
commit
42903a1b53
@ -8,7 +8,20 @@ namespace CoopServer
|
||||
public class Client
|
||||
{
|
||||
public long NetHandle = 0;
|
||||
public float Latency = 0.0f;
|
||||
private float CurrentLatency = 0f;
|
||||
public float Latency
|
||||
{
|
||||
get => CurrentLatency;
|
||||
internal set
|
||||
{
|
||||
CurrentLatency = value;
|
||||
|
||||
if ((value * 1000f) > Server.MainSettings.MaxLatency)
|
||||
{
|
||||
Server.MainNetServer.Connections.Find(x => x.RemoteUniqueIdentifier == NetHandle)?.Disconnect($"Too high latency [{value * 1000f}/{(float)Server.MainSettings.MaxLatency}]");
|
||||
}
|
||||
}
|
||||
}
|
||||
public PlayerData Player;
|
||||
private readonly Dictionary<string, object> CustomData = new();
|
||||
private long CallbacksCount = 0;
|
||||
|
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<AssemblyVersion>1.42.0.0001</AssemblyVersion>
|
||||
<AssemblyVersion>1.43.0.0001</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<RepositoryUrl>https://github.com/GTACOOP-R/GTACoop-R</RepositoryUrl>
|
||||
</PropertyGroup>
|
||||
|
@ -4,6 +4,7 @@
|
||||
{
|
||||
public int Port { get; set; } = 4499;
|
||||
public int MaxPlayers { get; set; } = 16;
|
||||
public int MaxLatency { get; set; } = 300;
|
||||
public string Name { get; set; } = "GTACoop:R server";
|
||||
public string WelcomeMessage { get; set; } = "Welcome on this server :)";
|
||||
public string Resource { get; set; } = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user