Added one load and one save to db, so that the EF doesnt need to initialize on first load / save

This commit is contained in:
Lennart Kampshoff
2018-09-22 00:27:14 +02:00
parent 12a5ba79ad
commit 3d7ab55b28

View File

@@ -1,5 +1,7 @@
using System; using System;
using System.Linq;
using GTANetworkAPI; using GTANetworkAPI;
using reallife_gamemode.Model;
/** /**
* @overview Life of German Reallife - Main Class (Main.cs) * @overview Life of German Reallife - Main Class (Main.cs)
@@ -20,6 +22,12 @@ namespace reallife_gamemode
NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht."); NAPI.Server.SetCommandErrorMessage("~r~[FEHLER]~s~ Dieser Command existiert nicht.");
NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING); NAPI.Server.SetDefaultSpawnLocation(DEFAULT_SPAWN_POSITION, DEFAULT_SPAWN_HEADING);
NAPI.Server.SetAutoSpawnOnConnect(false); NAPI.Server.SetAutoSpawnOnConnect(false);
using (var context = new DatabaseContext())
{
context.Users.FirstOrDefault();
context.SaveChanges();
}
} }
} }
} }