Added several request messages. Added redemptions. Added life TTS voice changes. A bunch of stuffs.

This commit is contained in:
Tom
2024-08-10 19:36:32 +00:00
parent 95bc073a73
commit c771a56971
36 changed files with 552 additions and 235 deletions

View File

@@ -6,7 +6,7 @@ namespace HermesSocketServer.Socket.Handlers
{
public class ChatterHandler : ISocketHandler
{
public int OpCode { get; } = 6;
public int OperationCode { get; } = 6;
private readonly Database _database;
private readonly HashSet<long> _chatters;
private readonly ChatterMessage[] _array;
@@ -27,7 +27,7 @@ namespace HermesSocketServer.Socket.Handlers
public async Task Execute<T>(WebSocketUser sender, T message, HermesSocketManager sockets)
{
if (message is not ChatterMessage data)
if (message is not ChatterMessage data || sender.Id == null)
return;
lock (_lock)
@@ -45,7 +45,7 @@ namespace HermesSocketServer.Socket.Handlers
try
{
string sql = "INSERT INTO \"Chatter\" (id, name) VALUES (@idd, @name)";
string sql = "INSERT INTO \"Chatter\" (id, name) VALUES (@idd, @name) ON CONFLICT (id) DO UPDATE SET name = @name";
await _database.Execute(sql, new Dictionary<string, object>() { { "idd", data.Id }, { "name", data.Name } });
}
catch (Exception e)