feat: assign address to world on creation

This commit is contained in:
CyberL1 2024-02-20 09:45:21 +01:00
parent db64404c92
commit ca57e03ee3

View File

@ -92,12 +92,20 @@ namespace Minecraft_Realms_Emulator.Controllers
var subscription = new Subscription var subscription = new Subscription
{ {
World = world, World = world,
StartDate = ((DateTimeOffset) DateTime.Now).ToUnixTimeMilliseconds().ToString(), StartDate = ((DateTimeOffset)DateTime.Now).ToUnixTimeMilliseconds().ToString(),
SubscriptionType = SubscriptionType.NORMAL.ToString() SubscriptionType = SubscriptionType.NORMAL.ToString()
}; };
var connection = new Connection
{
World = world,
Address = "127.0.0.1"
};
_context.Worlds.Update(world); _context.Worlds.Update(world);
_context.Subscriptions.Add(subscription); _context.Subscriptions.Add(subscription);
_context.Connections.Add(connection);
_context.SaveChanges(); _context.SaveChanges();