feat: Add /getall, logging to .NET, fix manager not getting traveling world (#554)

* fix: Fix world-db not getting current world properly when traveling

* fix: Stop redundant and exception-prone funcResult definition

* Fix: fetching current location

* refactor: Move constructing responseData to its own functions

* Fix: ignore own string requests

* feat: Add NLog dependency, and add some logging to .NET, mostly worlddb

* fix: I missed a semicolon

* refactor: Add more debug logging, change log format, archive less

* feat: Add /getall endpoint

---------

Co-authored-by: Natsumi <cmcooper123@hotmail.com>
This commit is contained in:
Teacup
2023-06-01 20:59:31 -04:00
committed by GitHub
parent 033e2691ae
commit 7d6ca28f86
7 changed files with 276 additions and 103 deletions

View File

@@ -249,6 +249,17 @@ END;";
return query.ToList();
}
/// <summary>
/// Gets all data entries for the world with the specified ID from the database.
/// </summary>
/// <param name="worldId">The ID of the world to get the data entries for.</param>
/// <returns>An enumerable collection of all data entries for the world with the specified ID.</returns>
public IEnumerable<WorldData> GetAllDataEntries(string worldId)
{
var query = sqlite.Table<WorldData>().Where(w => w.WorldId == worldId);
return query.ToList();
}
/// <summary>
/// Gets the size of the data entry, in bytes, with the specified world ID and key from the database.
/// </summary>