Added: Dedicated server support

Added: The ability to not render anything when using the client as a dedicated server
Added: The basic server extension (NullServerExtension)
Exposed: Made some fields public, so that the server extension can access it
This commit is contained in:
geckosoft
2010-11-01 05:10:55 +01:00
committed by Chris Forbes
parent 0112bc4df7
commit 298314626e
8 changed files with 412 additions and 61 deletions

View File

@@ -39,6 +39,10 @@ namespace OpenRA.Network
case "Chat":
{
var client = orderManager.LobbyInfo.ClientWithIndex( clientId );
if (Game.IsHost && Game.Settings.Server.Extension != null && !Game.Settings.Server.Extension.OnIngameChat(client, order.TargetString, false))
break;
if (client != null)
{
var player = world != null ? world.FindPlayerByClient(client) : null;
@@ -52,6 +56,10 @@ namespace OpenRA.Network
case "TeamChat":
{
var client = orderManager.LobbyInfo.ClientWithIndex(clientId);
if (Game.IsHost && Game.Settings.Server.Extension != null && !Game.Settings.Server.Extension.OnIngameChat(client, order.TargetString, true))
break;
if (client != null)
{
if (world == null)
@@ -98,9 +106,14 @@ namespace OpenRA.Network
}
case "SetStance":
{
var targetPlayer = order.Player.World.players[order.TargetLocation.X];
var newStance = (Stance)order.TargetLocation.Y;
if (Game.IsHost && Game.Settings.Server.Extension != null)
Game.Settings.Server.Extension.OnIngameSetStance(order.Player, targetPlayer, newStance);
SetPlayerStance(world, order.Player, targetPlayer, newStance);
// automatically declare war reciprocally