spawnpoint loading
This commit is contained in:
@@ -9,6 +9,7 @@ using OpenRa.Game.Graphics;
|
|||||||
using OpenRa.Game.Orders;
|
using OpenRa.Game.Orders;
|
||||||
using OpenRa.Game.Support;
|
using OpenRa.Game.Support;
|
||||||
using OpenRa.Game.Traits;
|
using OpenRa.Game.Traits;
|
||||||
|
using IjwFramework.Types;
|
||||||
|
|
||||||
namespace OpenRa.Game
|
namespace OpenRa.Game
|
||||||
{
|
{
|
||||||
@@ -50,8 +51,8 @@ namespace OpenRa.Game
|
|||||||
static HardwarePalette palette;
|
static HardwarePalette palette;
|
||||||
static string mapName;
|
static string mapName;
|
||||||
public static Minimap minimap;
|
public static Minimap minimap;
|
||||||
|
|
||||||
public static Session LobbyInfo = new Session();
|
public static Session LobbyInfo = new Session();
|
||||||
|
public static int2[] SpawnPoints;
|
||||||
|
|
||||||
public static void ChangeMap(string mapName)
|
public static void ChangeMap(string mapName)
|
||||||
{
|
{
|
||||||
@@ -103,6 +104,12 @@ namespace OpenRa.Game
|
|||||||
|
|
||||||
oreFrequency = (int)(Rules.General.GrowthRate * 60 * 25);
|
oreFrequency = (int)(Rules.General.GrowthRate * 60 * 25);
|
||||||
oreTicks = oreFrequency;
|
oreTicks = oreFrequency;
|
||||||
|
|
||||||
|
SpawnPoints = Rules.AllRules.GetSection("Waypoints")
|
||||||
|
.Select(kv => Pair.New(int.Parse(kv.Key), new int2(int.Parse(kv.Value) % 128, int.Parse(kv.Value) / 128)))
|
||||||
|
.Where(a => a.First < 8)
|
||||||
|
.Select(a => a.Second)
|
||||||
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Initialize(string mapName, Renderer renderer, int2 clientSize,
|
public static void Initialize(string mapName, Renderer renderer, int2 clientSize,
|
||||||
@@ -390,5 +397,12 @@ namespace OpenRa.Game
|
|||||||
"Order lag is now {0} frames.".F(LobbyInfo.GlobalSettings.OrderLatency));
|
"Order lag is now {0} frames.".F(LobbyInfo.GlobalSettings.OrderLatency));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void StartGame()
|
||||||
|
{
|
||||||
|
// todo: spawn starting units for everyone
|
||||||
|
|
||||||
|
orderManager.StartGame();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ namespace OpenRa.Game.Orders
|
|||||||
case "StartGame":
|
case "StartGame":
|
||||||
{
|
{
|
||||||
Game.chat.AddLine(Color.White, "Server", "The game has started.");
|
Game.chat.AddLine(Color.White, "Server", "The game has started.");
|
||||||
Game.orderManager.StartGame();
|
Game.StartGame();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "SyncInfo":
|
case "SyncInfo":
|
||||||
|
|||||||
Reference in New Issue
Block a user