Make the editor use an EchoConnection instead of a local server
This commit is contained in:
committed by
Matthias Mailänder
parent
e0e219793f
commit
0b75991fbc
@@ -103,6 +103,20 @@ namespace OpenRA
|
|||||||
static void JoinLocal()
|
static void JoinLocal()
|
||||||
{
|
{
|
||||||
JoinInner(new OrderManager(new EchoConnection()));
|
JoinInner(new OrderManager(new EchoConnection()));
|
||||||
|
|
||||||
|
// Add a spectator client for the local player
|
||||||
|
// On the shellmap this player is controlling the map via scripted orders
|
||||||
|
OrderManager.LobbyInfo.Clients.Add(new Session.Client
|
||||||
|
{
|
||||||
|
Index = OrderManager.Connection.LocalClientId,
|
||||||
|
Name = Settings.Player.Name,
|
||||||
|
PreferredColor = Settings.Player.Color,
|
||||||
|
Color = Settings.Player.Color,
|
||||||
|
Faction = "Random",
|
||||||
|
SpawnPoint = 0,
|
||||||
|
Team = 0,
|
||||||
|
State = Session.ClientState.Ready
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// More accurate replacement for Environment.TickCount
|
// More accurate replacement for Environment.TickCount
|
||||||
@@ -484,27 +498,13 @@ namespace OpenRA
|
|||||||
|
|
||||||
public static void LoadEditor(string mapUid)
|
public static void LoadEditor(string mapUid)
|
||||||
{
|
{
|
||||||
|
JoinLocal();
|
||||||
StartGame(mapUid, WorldType.Editor);
|
StartGame(mapUid, WorldType.Editor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LoadShellMap()
|
public static void LoadShellMap()
|
||||||
{
|
{
|
||||||
var shellmap = ChooseShellmap();
|
var shellmap = ChooseShellmap();
|
||||||
|
|
||||||
// Add a spectator client for the local player,
|
|
||||||
// who is controlling the map via scripted orders
|
|
||||||
OrderManager.LobbyInfo.Clients.Add(new Session.Client
|
|
||||||
{
|
|
||||||
Index = OrderManager.Connection.LocalClientId,
|
|
||||||
Name = Settings.Player.Name,
|
|
||||||
PreferredColor = Settings.Player.Color,
|
|
||||||
Color = Settings.Player.Color,
|
|
||||||
Faction = "Random",
|
|
||||||
SpawnPoint = 0,
|
|
||||||
Team = 0,
|
|
||||||
State = Session.ClientState.Ready
|
|
||||||
});
|
|
||||||
|
|
||||||
using (new PerfTimer("StartGame"))
|
using (new PerfTimer("StartGame"))
|
||||||
{
|
{
|
||||||
StartGame(shellmap, WorldType.Shellmap);
|
StartGame(shellmap, WorldType.Shellmap);
|
||||||
|
|||||||
@@ -343,10 +343,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
void LoadMapIntoEditor(string uid)
|
void LoadMapIntoEditor(string uid)
|
||||||
{
|
{
|
||||||
ConnectionLogic.Connect(Game.CreateLocalServer(uid),
|
Game.LoadEditor(uid);
|
||||||
"",
|
|
||||||
() => { Game.LoadEditor(uid); },
|
|
||||||
() => { Game.CloseServer(); SwitchMenu(MenuType.MapEditor); });
|
|
||||||
|
|
||||||
DiscordService.UpdateStatus(DiscordState.InMapEditor);
|
DiscordService.UpdateStatus(DiscordState.InMapEditor);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user