Fixed errors related to managing emotes.
This commit is contained in:
@ -26,10 +26,7 @@ namespace HermesSocketServer.Socket.Handlers
|
|||||||
if (message is not EmoteDetailsMessage data || sender.Id == null)
|
if (message is not EmoteDetailsMessage data || sender.Id == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (data.Emotes == null)
|
if (data.Emotes == null || !data.Emotes.Any())
|
||||||
return;
|
|
||||||
|
|
||||||
if (!data.Emotes.Any())
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
lock (_lock)
|
lock (_lock)
|
||||||
@ -38,7 +35,7 @@ namespace HermesSocketServer.Socket.Handlers
|
|||||||
{
|
{
|
||||||
if (_emotes.Contains(entry.Key))
|
if (_emotes.Contains(entry.Key))
|
||||||
{
|
{
|
||||||
_emotes.Remove(entry.Key);
|
data.Emotes.Remove(entry.Key);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -46,6 +43,9 @@ namespace HermesSocketServer.Socket.Handlers
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!data.Emotes.Any())
|
||||||
|
return;
|
||||||
|
|
||||||
int rows = 0;
|
int rows = 0;
|
||||||
string sql = "INSERT INTO \"Emote\" (id, name) VALUES (@idd, @name)";
|
string sql = "INSERT INTO \"Emote\" (id, name) VALUES (@idd, @name)";
|
||||||
using (var connection = await _database.DataSource.OpenConnectionAsync())
|
using (var connection = await _database.DataSource.OpenConnectionAsync())
|
||||||
|
Reference in New Issue
Block a user