(3db48532f) Give joining players "None" permissions by default (so server hosts can automatically give players some permissions if they want to). Save client permissions using the name of the permission preset instead of listing all the permissions given by the preset. Partially implements #1334
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Xml.Linq;
|
||||
|
||||
namespace Barotrauma.Networking
|
||||
@@ -54,7 +55,9 @@ namespace Barotrauma.Networking
|
||||
DebugConsole.Command command = DebugConsole.FindCommand(commandName);
|
||||
if (command == null)
|
||||
{
|
||||
#if SERVER
|
||||
DebugConsole.ThrowError("Error in permission preset \"" + Name + "\" - " + commandName + "\" is not a valid console command.");
|
||||
#endif
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -75,5 +78,10 @@ namespace Barotrauma.Networking
|
||||
List.Add(new PermissionPreset(element));
|
||||
}
|
||||
}
|
||||
|
||||
public bool MatchesPermissions(ClientPermissions permissions, List<DebugConsole.Command> permittedConsoleCommands)
|
||||
{
|
||||
return permissions == this.Permissions && PermittedCommands.SequenceEqual(permittedConsoleCommands);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user