inproc server

This commit is contained in:
Chris Forbes
2010-03-09 20:50:59 +13:00
parent 9d139d43a8
commit b2df8d3b0e
5 changed files with 50 additions and 19 deletions

View File

@@ -20,7 +20,9 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Windows.Forms;
using OpenRA.FileFormats;
@@ -30,9 +32,7 @@ using OpenRA.Network;
using OpenRA.Support;
using OpenRA.Traits;
using Timer = OpenRA.Support.Timer;
using System.Runtime.InteropServices;
using System.IO;
using System.Diagnostics;
using OpenRA.Server;
namespace OpenRA
{
@@ -56,7 +56,7 @@ namespace OpenRA
internal static Session LobbyInfo = new Session();
static bool changePending;
internal static Process Server;
public static void LoadModPackages(Manifest manifest)
{
@@ -151,15 +151,13 @@ namespace OpenRA
internal static void CreateServer()
{
Server = new Process();
Server.StartInfo.FileName = "OpenRA.Server.exe";
Server.StartInfo.Arguments = string.Join(" ",Game.LobbyInfo.GlobalSettings.Mods);
Server.Start();
// todo: LobbyInfo is the wrong place for this.
InprocServer.Start(Game.LobbyInfo.GlobalSettings.Mods);
}
internal static void CloseServer()
{
Server.Kill();
InprocServer.Stop();
}
static int lastTime = Environment.TickCount;
@@ -441,9 +439,6 @@ namespace OpenRA
public static void Exit()
{
if (Server != null)
CloseServer();
quit = true;
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -277,6 +277,10 @@
<Project>{BDAEAB25-991E-46A7-AF1E-4F0E03358DAA}</Project>
<Name>OpenRA.FileFormats</Name>
</ProjectReference>
<ProjectReference Include="..\OpenRA.Server\OpenRA.Server.csproj">
<Project>{76F621A1-3D8E-4A99-9F7E-B071EB657817}</Project>
<Name>OpenRA.Server</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">