more hax
This commit is contained in:
@@ -50,6 +50,8 @@ namespace OpenRa.Game
|
|||||||
static HardwarePalette palette;
|
static HardwarePalette palette;
|
||||||
public static Minimap minimap;
|
public static Minimap minimap;
|
||||||
|
|
||||||
|
public static Session LobbyInfo = new Session();
|
||||||
|
|
||||||
public static void ChangeMap(string mapName)
|
public static void ChangeMap(string mapName)
|
||||||
{
|
{
|
||||||
SheetBuilder.Initialize(renderer);
|
SheetBuilder.Initialize(renderer);
|
||||||
@@ -72,7 +74,7 @@ namespace OpenRa.Game
|
|||||||
{
|
{
|
||||||
var race = players.ContainsKey(i) ? players[i].Race : Race.Allies;
|
var race = players.ContainsKey(i) ? players[i].Race : Race.Allies;
|
||||||
var name = players.ContainsKey(i) ? players[i].PlayerName : "Player {0}".F(i+1);
|
var name = players.ContainsKey(i) ? players[i].PlayerName : "Player {0}".F(i+1);
|
||||||
players[i] = new Player(i, (PaletteType) i, name, race, "Multi{0}".F(i));
|
players[i] = new Player(i, LobbyInfo.Clients.FirstOrDefault(a => a.Index == i));
|
||||||
}
|
}
|
||||||
|
|
||||||
Rules.Map.InitOreDensity();
|
Rules.Map.InitOreDensity();
|
||||||
@@ -346,6 +348,7 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
public static void SyncLobbyInfo(string data)
|
public static void SyncLobbyInfo(string data)
|
||||||
{
|
{
|
||||||
|
var session = new Session();
|
||||||
var ys = MiniYaml.FromString(data);
|
var ys = MiniYaml.FromString(data);
|
||||||
foreach (var y in ys)
|
foreach (var y in ys)
|
||||||
{
|
{
|
||||||
@@ -355,9 +358,12 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
var client = new Session.Client();
|
var client = new Session.Client();
|
||||||
FieldLoader.Load(client, y.Value);
|
FieldLoader.Load(client, y.Value);
|
||||||
|
session.Clients.Add(client);
|
||||||
|
|
||||||
players[index].SyncFromLobby(client);
|
players[index].SyncFromLobby(client);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LobbyInfo = session;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,14 +31,15 @@ namespace OpenRa.Game
|
|||||||
public Shroud Shroud = new Shroud();
|
public Shroud Shroud = new Shroud();
|
||||||
public Dictionary<string, SupportPower> SupportPowers;
|
public Dictionary<string, SupportPower> SupportPowers;
|
||||||
|
|
||||||
public Player( int index, PaletteType palette, string playerName, Race race, string internalName )
|
public Player( int index, Session.Client client )
|
||||||
{
|
{
|
||||||
Game.world.Add(this.PlayerActor = new Actor("Player", new int2(int.MaxValue, int.MaxValue), this));
|
Game.world.Add(this.PlayerActor = new Actor("Player", new int2(int.MaxValue, int.MaxValue), this));
|
||||||
this.Index = index;
|
this.Index = index;
|
||||||
this.Palette = palette;
|
this.InternalName = "Multi{0}".F(index);
|
||||||
this.InternalName = internalName;
|
|
||||||
this.PlayerName = playerName;
|
this.Palette = client != null ? (PaletteType)client.Palette : (PaletteType)index;
|
||||||
this.Race = race;
|
this.PlayerName = client != null ? client.Name : "Player {0}".F(index+1);
|
||||||
|
this.Race = client != null ? (Race)client.Race : Race.Allies;
|
||||||
|
|
||||||
SupportPowers = Rules.SupportPowerInfo.ToDictionary(
|
SupportPowers = Rules.SupportPowerInfo.ToDictionary(
|
||||||
spi => spi.Key,
|
spi => spi.Key,
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace OpenRa.Game.Traits.Activities
|
|||||||
static Actor ChooseHelipad(Actor self)
|
static Actor ChooseHelipad(Actor self)
|
||||||
{
|
{
|
||||||
return Game.world.Actors.FirstOrDefault(
|
return Game.world.Actors.FirstOrDefault(
|
||||||
a => a.Info == Rules.NewUnitInfo["HPAD"] &&
|
a => a.Info.Name == "hpad" &&
|
||||||
a.Owner == self.Owner &&
|
a.Owner == self.Owner &&
|
||||||
!Reservable.IsReserved(a));
|
!Reservable.IsReserved(a));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user