feat: default server address

This commit is contained in:
CyberL1 2024-03-06 11:35:00 +01:00
parent fe6a66601d
commit 89025e31b2
2 changed files with 14 additions and 3 deletions

View File

@ -102,7 +102,7 @@ namespace Minecraft_Realms_Emulator.Controllers
var connection = new Connection
{
World = world,
Address = "127.0.0.1"
Address = _context.Configuration.FirstOrDefault(x => x.Key == "defaultServerAddress").Value
};
_context.Worlds.Update(world);

View File

@ -22,9 +22,20 @@ namespace Minecraft_Realms_Emulator.Helpers
};
db.Configuration.Add(newsLink);
db.SaveChanges();
}
if (db.Configuration.FirstOrDefault(s => s.Key == "defaultServerAddress") == null)
{
var defaultServerAddress = new Configuration
{
Key = "defaultServerAddress",
Value = "127.0.0.1"
};
db.Configuration.Add(defaultServerAddress);
}
db.SaveChanges();
}
}
}