mirror of
https://github.com/SoDOff-Project/sodoff.git
synced 2025-11-27 10:06:53 -08:00
* 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>
26 lines
550 B
C#
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;
|
|
}
|
|
}
|