Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions SlipeServer.Server/MtaServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ public class MtaServer
/// </summary>
public string MapName { get; set; } = "unknown";

/// <summary>
/// Clients with a lower version will not be allowed to connect.
/// See: <a href="https://nightly.mtasa.com/ver/" />
/// </summary>
public string MinClientVersion { get; set; } = "1.6.0-9.22789.0";

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we make this nullable as to not force them to be set at all times?


/// <summary>
/// Current server password, to be entered when connecting
/// </summary>
Expand Down
4 changes: 3 additions & 1 deletion SlipeServer.Server/Resources/Resource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class Resource
public string Name { get; }
public string Path { get; }
public bool IsOopEnabled { get; set; }
public string MinClientVersion { get; set; }

public Resource(
MtaServer server,
Expand Down Expand Up @@ -55,6 +56,7 @@ public Resource(
}.AssociateWith(server);

this.Exports = new List<string>();
this.MinClientVersion = server.MinClientVersion;
}

public void Start()
Expand All @@ -75,7 +77,7 @@ public void Stop()

public void StartFor(Player player)
{
new ResourceStartPacket(this.Name, this.NetId, this.Root.Id, this.DynamicRoot.Id, (ushort)this.SanitisedNoClientScripts.Count, null, null, this.IsOopEnabled, this.PriorityGroup, this.Files, this.Exports)
new ResourceStartPacket(this.Name, this.NetId, this.Root.Id, this.DynamicRoot.Id, (ushort)this.SanitisedNoClientScripts.Count, null, this.MinClientVersion, this.IsOopEnabled, this.PriorityGroup, this.Files, this.Exports)
.SendTo(player);

if (this.SanitisedNoClientScripts.Any())
Expand Down