sodoff/src/Services/WorldIdService.cs
YoshiCraft64 cecaa50610
support for old ("steps") missions (#20)
* add support for old missions API (aka "steps missions")
* config option to disable loading non SoD Data (used only for missions and achievements for now)
* make AuthenticateUser endpoint compatible with games that use e-mail as login
* add api keys for lands
* add GetGameCurrency endpoint
* allow create empty stores and add store "8" (empty)

---------

Co-authored-by: Robert Paciorek <robert@opcode.eu.org>
2025-02-13 22:58:19 +01:00

26 lines
550 B
C#

using sodoff.Schema;
using sodoff.Util;
namespace sodoff.Services;
public class WorldIdService {
Dictionary<string, int> worlds_id = new();
public WorldIdService()
{
var worlds = XmlUtil.DeserializeXml<World[]>(XmlUtil.ReadResourceXmlString("worlds"));
foreach (var w in worlds)
{
worlds_id[w.Scene] = w.ID;
}
}
public int GetWorldID(string mapName)
{
if (worlds_id.ContainsKey(mapName))
return worlds_id[mapName];
else
return 0;
}
}