mirror of
https://github.com/CyberL1/Minecraft-Realms-Emulator.git
synced 2024-11-21 21:58:21 -05:00
feat: default server address
This commit is contained in:
parent
fe6a66601d
commit
89025e31b2
@ -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);
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user