Removed NioTSO client and server

- NioTSO client isn't needed because we're using RayLib
- Added FreeSO's API server to handle most backend operations
This commit is contained in:
Tony Bark 2024-05-01 02:55:43 -04:00
parent f12ba1502b
commit 22191ce648
591 changed files with 53264 additions and 3362 deletions

View file

@ -0,0 +1,35 @@
using Dapper;
using System.Collections.Generic;
using System.Linq;
namespace FSO.Server.Database.DA.Bookmarks
{
public class SqlBookmarks : AbstractSqlDA, IBookmarks
{
public SqlBookmarks(ISqlContext context) : base(context)
{
}
public void Create(DbBookmark bookmark)
{
Context.Connection.Execute("INSERT INTO fso_bookmarks (avatar_id, type, target_id) " +
" VALUES (@avatar_id, @type, @target_id)"
, bookmark);
}
public bool Delete(DbBookmark bookmark)
{
return Context.Connection.Execute("DELETE FROM fso_bookmarks WHERE avatar_id = @avatar_id AND type = @type AND target_id = @target_id", bookmark) > 0;
}
public List<DbBookmark> GetByAvatarId(uint avatar_id)
{
return Context.Connection.Query<DbBookmark>("SELECT * FROM fso_bookmarks WHERE avatar_id = @avatar_id", new { avatar_id = avatar_id }).ToList();
}
public List<uint> GetAvatarIgnore(uint avatar_id)
{
return Context.Connection.Query<uint>("SELECT target_id FROM fso_bookmarks WHERE avatar_id = @avatar_id AND type = 5", new { avatar_id = avatar_id }).ToList();
}
}
}