From 51bc9aa134274ee2e63ee44aba186e58ae910dba Mon Sep 17 00:00:00 2001 From: "(no author)" <(no author)@993157c7-ee19-0410-b2c4-bb4e9862e678> Date: Tue, 24 Jul 2007 06:28:44 +0000 Subject: [PATCH] git-svn-id: svn://svn.ijw.co.nz/svn/OpenRa@1336 993157c7-ee19-0410-b2c4-bb4e9862e678 --- OpenRa.Game/Game.cs | 21 ++++++++++-------- OpenRa.Game/Log.cs | 1 + OpenRa.Game/Network/Network.cs | 6 +++++ sequences.xml | 40 ++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+), 9 deletions(-) diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 5316d98678..a74f086a0b 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -47,16 +47,19 @@ namespace OpenRa.Game { return new Refinery( location, palette ); } ); - buildingCreation.Add( "powr", - delegate( int2 location, int palette ) + + string[] buildings = { "powr", "apwr", "weap", "barr", "atek", "stek", "dome" }; + foreach (string s in buildings) + AddBuilding(s); + } + + void AddBuilding(string name) + { + buildingCreation.Add(name, + delegate(int2 location, int palette) { - return new Building( "powr", location, palette ); - } ); - buildingCreation.Add( "apwr", - delegate( int2 location, int palette ) - { - return new Building( "apwr", location, palette ); - } ); + return new Building(name, location, palette); + }); } public void Tick() diff --git a/OpenRa.Game/Log.cs b/OpenRa.Game/Log.cs index 0db4da98c6..96dd48e05a 100644 --- a/OpenRa.Game/Log.cs +++ b/OpenRa.Game/Log.cs @@ -8,6 +8,7 @@ namespace OpenRa.Game static class Log { static StreamWriter writer = File.CreateText("../../../log.txt"); + static Log() { writer.AutoFlush = true; diff --git a/OpenRa.Game/Network/Network.cs b/OpenRa.Game/Network/Network.cs index 5170cfc3cc..884b6d194e 100644 --- a/OpenRa.Game/Network/Network.cs +++ b/OpenRa.Game/Network/Network.cs @@ -17,6 +17,9 @@ namespace OpenRa.Game int nextSyncTime = 0; int currentFrame = 0; + public int CurrentFrame { get { return currentFrame; } } + public int RemainingNetSyncTime { get { return Math.Min(0, Environment.TickCount - nextSyncTime); } } + Queue incomingPackets = new Queue(); public Network() @@ -39,6 +42,9 @@ namespace OpenRa.Game } } }); + + receiveThread.IsBackground = true; + receiveThread.Start(); } public void Send(byte[] data) diff --git a/sequences.xml b/sequences.xml index b5caf51f05..aa4acfa829 100644 --- a/sequences.xml +++ b/sequences.xml @@ -63,6 +63,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +