Add prefix, suffix, color to group command.
Fix stupid chat color getter returning the hex color.
This commit is contained in:
parent
1df0129919
commit
e246183108
4 changed files with 151 additions and 7 deletions
|
|
@ -181,7 +181,7 @@ namespace TShockAPI.DB
|
|||
/// <param name="parentname">parent of group</param>
|
||||
/// <param name="permissions">permissions</param>
|
||||
/// <param name="chatcolor">chatcolor</param>
|
||||
public void UpdateGroup(string name, string parentname, string permissions, string chatcolor)
|
||||
public void UpdateGroup(string name, string parentname, string permissions, string chatcolor, string suffix, string prefix)
|
||||
{
|
||||
Group group = GetGroupByName(name);
|
||||
if (group == null)
|
||||
|
|
@ -210,13 +210,17 @@ namespace TShockAPI.DB
|
|||
|
||||
// Ensure any group validation is also persisted to the DB.
|
||||
var newGroup = new Group(name, parent, chatcolor, permissions);
|
||||
string query = "UPDATE GroupList SET Parent=@0, Commands=@1, ChatColor=@2 WHERE GroupName=@3";
|
||||
if (database.Query(query, parentname, newGroup.Permissions, string.Format("{0},{1},{2}", newGroup.R, newGroup.G, newGroup.B), name) != 1)
|
||||
newGroup.Prefix = prefix;
|
||||
newGroup.Suffix = suffix;
|
||||
string query = "UPDATE GroupList SET Parent=@0, Commands=@1, ChatColor=@2, Suffix=@3, Prefix=@4 WHERE GroupName=@5";
|
||||
if (database.Query(query, parentname, newGroup.Permissions, newGroup.ChatColor, suffix, prefix, name) != 1)
|
||||
throw new GroupManagerException(string.Format("Failed to update group \"{0}\".", name));
|
||||
|
||||
group.ChatColor = chatcolor;
|
||||
group.Permissions = permissions;
|
||||
group.Parent = parent;
|
||||
group.Prefix = prefix;
|
||||
group.Suffix = suffix;
|
||||
}
|
||||
|
||||
#if COMPAT_SIGS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue