Added checks for non-user foreign keys in stores. Load/Saving stores' order is now based on table dependencies. Added ability to use chat message when using redemption.
This commit is contained in:
@ -19,8 +19,9 @@ namespace HermesSocketServer.Requests
|
||||
public Task<RequestResult> Grant(Channel channel, IDictionary<string, object> data)
|
||||
{
|
||||
string name = data["name"].ToString()!;
|
||||
string d = data["data"].ToString()!;
|
||||
string type = data["type"].ToString()!;
|
||||
bool hasMessage = data["has_message"].ToString()!.ToLower() == "true";
|
||||
string d = data["data"].ToString()!;
|
||||
IDictionary<string, string> dict = new Dictionary<string, string>();
|
||||
|
||||
try
|
||||
@ -29,7 +30,7 @@ namespace HermesSocketServer.Requests
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
_logger.Error(ex, $"Failed to parse data on redeemable action while updating action [name: {name}][type: {type}][data: {d}]");
|
||||
_logger.Error(ex, $"Failed to parse data on redeemable action while updating action [name: {name}][type: {type}][has message: {hasMessage}][data: {d}]");
|
||||
return Task.FromResult(RequestResult.Failed("Could not parse the data on this action."));
|
||||
}
|
||||
|
||||
@ -37,14 +38,15 @@ namespace HermesSocketServer.Requests
|
||||
{
|
||||
UserId = channel.Id,
|
||||
Name = name,
|
||||
Data = dict,
|
||||
Type = type,
|
||||
HasMessage = hasMessage,
|
||||
Data = dict,
|
||||
};
|
||||
|
||||
bool result = channel.Actions.Modify(name, action);
|
||||
if (result)
|
||||
{
|
||||
_logger.Information($"Updated redeemable action on channel [name: {name}][type: {type}][channel: {channel.Id}]");
|
||||
_logger.Information($"Updated redeemable action on channel [name: {name}][type: {type}][has message: {hasMessage}][channel: {channel.Id}]");
|
||||
return Task.FromResult(RequestResult.Successful(action));
|
||||
}
|
||||
if (channel.Actions.Get(name) == null)
|
||||
|
Reference in New Issue
Block a user