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:
8
Main.cs
8
Main.cs
@@ -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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user