Compare commits

...

64 Commits

Author SHA1 Message Date
Paul Chote
a364569d1a Update error messages. 2017-05-27 12:31:51 +01:00
Paul Chote
1bbde47910 Improve handling of unknown error codes. 2017-05-27 12:47:38 +02:00
Glenn Martin Jensen
b9764c71f3 Add support for blacklist response
Adds support for the new blacklist response in servernames
2017-05-27 12:45:00 +02:00
Paul Chote
f34390d4b6 Catch and ignore exceptions while loading map previews. 2017-05-26 23:45:19 +02:00
abcdefg30
afa5e718f1 Always make sure to be on the host actor when repairing 2017-05-26 23:03:47 +02:00
Zimmermann Gyula
ed163bbc3d Fix the AI acting the same at game restart. 2017-05-24 16:46:50 +02:00
Paul Chote
daee6bce36 Fix cloak sounds playing on build for initially cloaked actors. 2017-05-24 16:33:01 +02:00
Paul Chote
c32b39a845 Implement a workaround for the mono 5.0 cursor enumerator bug. 2017-05-19 14:34:10 +02:00
rob-v
ec5d1cebee Fix Player slot when changing map 2017-05-14 14:38:58 +02:00
Paul Chote
6cef900749 Work around resolution issues in (legacy) Fullscreen on OSX. 2017-05-13 15:53:36 +02:00
Jean-Rémy Buchs
b850e21b98 Load debug symbols (.mdb on mono only; .pdb on .NET only) for mods if they are present 2017-05-12 23:28:07 +02:00
reaperrr
e279ebf02a Disable DPI scaling on WIndows by default 2017-05-12 01:13:57 +02:00
Paul Chote
d2becb9e67 Prevent repeated keys from toggling observer shroud selector. 2017-05-11 20:51:55 +02:00
Paul Chote
63261868b3 Add KeyInput.IsRepeat. 2017-05-11 20:51:42 +02:00
rob-v
771f606871 Add exception to Archive extraction failed (Invalid archive) error ##12985 2017-05-11 20:51:23 +02:00
rob-v
af2f1bd1dc Fix Pre-damaged bridge tiles visually transform to new when attacked #13076 2017-05-11 20:51:01 +02:00
rob-v
17881bf5ef Lost players except Host can not pause game #12227 2017-05-11 20:50:07 +02:00
reaperrr
3644892e29 Add "Fast" game speed to all mods
Sitting smack in the middle between Default and "Faster", except for order delay (which is same as Faster to avoid rejected/dropped orders).
2017-05-11 20:49:43 +02:00
Kyrylo Silin
9d3c7a924f mods/ra/maps: update Winter Storm
Map link: http://resource.openra.net/maps/20503/

Changes:

* Renamed from `Winter Storm 2` to `Winter Storm`
* Decorated the chain links near middle oil derricks
* Resized the map from 89x82 to 89x86 to add more sea tiles to the top
  and to the bottom
* Fixed broken tile near the ridge to the middle right
2017-05-11 20:38:34 +02:00
Kyrylo Silin
d76f404ddf mods/ra/maps: update Behind The Veil
Map link: http://resource.openra.net/maps/20494/

Changes:

* Renamed from `Behind The Veil` to `Behind the Veil`
* Replaced chain link with walls in the middle to protect oil derricks
  from direct attacks
* Added barrels to the middle area. A middle oil derrick can be
  captured only from 2 spots (if barrels are not destroyed)
* Added barrels between side ridges
* Fixed some bad road tiles (thanks to Frame Limiter)
* Widen side passages to corner expansions by 1 cell
2017-05-11 20:38:07 +02:00
Kyrylo Silin
7396b79e27 mods/ra/maps: update Tandem
Map link: http://resource.openra.net/maps/20495/

Changes:

* Fixed some bad tiles (thanks to Frame Limiter)

  > Bad tile: 75,45
  > Road tiles: 98,59 , 50,12

* Changed author name from `Kyrylo` to `Kyrylo Silin`
2017-05-11 20:37:24 +02:00
Mustafa Alperen Seki
5717798576 Change Turkish Flag outline to Blue. 2017-05-11 20:35:02 +02:00
rob-v
b841713d72 Real tough guy difficulty doesn't fit the UI #12844 2017-05-11 20:34:34 +02:00
Paul Chote
e1b2c47fcf Remove invalid Background widgets from TD map editor. 2017-05-11 20:20:25 +02:00
Mustafa Alperen Seki
6186f9fa3f Remove Sonic Tanks' immunity to other friendly sonic tanks. 2017-05-11 20:19:25 +02:00
GDave
2fc5a20ed9 Tweaked map Deterring Democracy to prevent harvester stalling to the immediate right of the lower-right green tree. 2017-04-21 18:52:32 +01:00
SoScared
de7e0de5c0 Fix tiles on Countercross, Siberian Pass, Sudden Death & Six Below Zero. 2017-04-18 16:29:57 +02:00
Oliver Brakmann
bc8e539c05 Check for dead destination helipad in HeliReturnToBase 2017-04-17 20:46:43 +02:00
Oliver Brakmann
fb75723cfb Check for dead destination airfield in ReturnToBase 2017-04-17 20:46:31 +02:00
Oliver Brakmann
f08d6732e0 Add a setting to disable DPI scaling on Windows systems 2017-04-17 17:50:18 +01:00
abcdefg30
249698261e Fix allies06a freezing when yaks try to attack camo pillboxes 2017-04-15 12:43:12 +02:00
Paul Chote
d6dd904032 Fix spurious warnings when the support mods dir doesn't exist. 2017-04-08 23:01:58 +02:00
Paul Chote
39da616123 Fix crash when carryall cargo is killed on same tick as pickup. 2017-04-08 22:49:30 +02:00
Paul Chote
34231f3959 Set sensible initial turret facings. 2017-04-08 22:45:22 +02:00
Oliver Brakmann
06cb63d24a Fix friendly monster tanks not revealing shroud in Monster Tank Madness 2017-04-08 22:45:22 +02:00
abcdefg30
c7f4825064 Remove a misplaced barrel 2017-04-08 22:45:22 +02:00
abcdefg30
6e976a6a88 Fix Oil Pumps spawning infantry on death 2017-04-08 22:45:22 +02:00
abcdefg30
a0aca5a844 Fix the explosions of the civilian buildings
- it looked weird when they spawned civilians
- other buildings on the map exploded with the wrong explosion
2017-04-08 22:45:22 +02:00
abcdefg30
584dcd4b59 Set the initial cash to 0 2017-04-08 22:45:22 +02:00
abcdefg30
26be876665 Fix the extraction helicopter not showing up in Monster Tank Madness 2017-04-08 22:45:22 +02:00
GDave
d3f40cceaf Update the official cnc/TD map pool 2017-04-05 21:29:04 +02:00
AoAGeneral
34cbfa9ee6 TD Artillery/MRLS Vision.
This is changing the vision of Artillery and MRLS from 8c0 to 5c0.

The reason behind this is because we have scouting artillery and MRLS units that have a much larger vision range then infantry and the same vision as hummers and buggies. This turns into games where people build infantry and artillery/MRLS armies and march of death to the enemy. Its more counterable in 1v1 and 2v2 but team games of 3v3+ it becomes incredibly spammy of these units and hard to stop.
2017-04-02 22:01:30 +02:00
abcdefg30
9e9f2dee61 Fixed aircraft not being able to hunt 2017-04-02 21:41:58 +02:00
FrameLimiter
9ec7293b07 Fixed vision for aircraft husks under Gap. 2017-04-01 14:34:06 +02:00
SoScared
2d7e007b85 fix tile errors on various maps 2017-03-28 22:46:17 +02:00
abc013
ac7f9c9efe Polished the mission objectives in allies06a 2017-03-15 22:33:16 +00:00
abc013
fe4462c14d Make the AI only build submarines if the player has a shipyard 2017-03-15 22:33:12 +00:00
SoScared
9c31b5ead7 Reverse making friendly units aware of friendly mines. 2017-03-15 22:33:01 +00:00
SoScared
ee4111939f Reverse alteration of Dual Cold Front 2017-03-15 22:17:11 +01:00
SoScared
d0f46a51c8 Double price/production of S.Bags/Fence/Walls 2017-03-15 22:11:02 +01:00
Mustafa Alperen Seki
99ee0e7e16 Make defences detect cloak. 2017-03-14 15:52:21 +01:00
Mustafa Alperen Seki
cc19238127 Add Nooze's 1 Tile Cliffs to TD 2017-03-13 20:09:21 +01:00
Mustafa Alperen Seki
8db2dd9c3e Add Nooze's 1 Tile Cliffs to RA 2017-03-13 20:09:05 +01:00
Paul Chote
7a4fc47a45 Fix crash when master server query returns unexpected data. 2017-03-12 18:49:58 +01:00
Paul Chote
19ee36cf8e Fix Obelisk not dropping targets when they move out of range. 2017-03-11 22:30:18 +01:00
SoScared
12af79a470 fixed RevealsShroud@GAPGEN vs MiG/YAK 2017-03-11 18:05:17 +01:00
Forcecore
7949d11274 HackyAI now builds refinery near ore. 2017-03-11 12:43:09 +00:00
SoScared
15c5f80af8 final 6p plus map pool alteration 2017-03-11 11:57:05 +00:00
SoScared
ff3eecbf62 final 2-4 player map alteration 2017-03-11 11:42:24 +00:00
Paul Chote
4ce6082c54 Remove TD map Vectors of Battle (10p). 2017-03-10 21:28:00 +01:00
Paul Chote
a6b98bc5c3 Update TD map Order of Battle. 2017-03-10 21:27:31 +01:00
Paul Chote
ed1ef08c84 Update TD map Axis of Advance. 2017-03-10 21:26:35 +01:00
reaperrr
be84b78e77 Polish Morbid Aimless Poseidon
A lot of the cliffs, in particular "north-facing" ones, only reptitively used a single variant, and in some cases the one that should only be used for the "left ending" of a cliff. I fixed the latter and added variation to the former cases.
2017-03-08 22:04:15 +01:00
reaperrr
2cf5e0a7e5 Fix RA Spy attack sequence 2017-03-06 22:43:07 +01:00
241 changed files with 3863 additions and 113 deletions

View File

@@ -69,5 +69,6 @@ namespace OpenRA
public Modifiers Modifiers;
public int MultiTapCount;
public char UnicodeChar;
public bool IsRepeat;
}
}

View File

@@ -46,7 +46,11 @@ namespace OpenRA
{
try
{
var directory = new DirectoryInfo(Platform.ResolvePath(path));
var resolved = Platform.ResolvePath(path);
if (!Directory.Exists(resolved))
continue;
var directory = new DirectoryInfo(resolved);
foreach (var subdir in directory.EnumerateDirectories())
mods.Add(Pair.New(subdir.Name, subdir.FullName));

View File

@@ -201,7 +201,19 @@ namespace OpenRA
foreach (var p in todo)
{
if (p.Preview != null)
Game.RunAfterTick(() => p.SetMinimap(sheetBuilder.Add(p.Preview)));
{
Game.RunAfterTick(() =>
{
try
{
p.SetMinimap(sheetBuilder.Add(p.Preview));
}
catch (Exception e)
{
Log.Write("debug", "Failed to load minimap with exception: {0}", e);
}
});
}
// Yuck... But this helps the UI Jank when opening the map selector significantly.
Thread.Sleep(Environment.ProcessorCount == 1 ? 25 : 5);

View File

@@ -11,6 +11,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using OpenRA.Primitives;
@@ -26,6 +27,7 @@ namespace OpenRA
readonly Cache<string, Type> typeCache;
readonly Cache<Type, ConstructorInfo> ctorCache;
readonly Pair<Assembly, string>[] assemblies;
readonly bool isMonoRuntime = Type.GetType("Mono.Runtime") != null;
public ObjectCreator(Assembly a)
{
@@ -54,7 +56,18 @@ namespace OpenRA
Assembly assembly;
if (!ResolvedAssemblies.TryGetValue(hash, out assembly))
{
assembly = Assembly.Load(data);
Stream symbolStream = null;
var hasSymbols = false;
// Mono has its own symbol format.
if (isMonoRuntime)
hasSymbols = modFiles.TryOpen(path + ".mdb", out symbolStream);
// .NET uses .pdb files.
else
hasSymbols = modFiles.TryOpen(path.Substring(0, path.Length - 4) + ".pdb", out symbolStream);
assembly = hasSymbols ? Assembly.Load(data, symbolStream.ReadAllBytes()) : Assembly.Load(data);
ResolvedAssemblies.Add(hash, assembly);
}

View File

@@ -139,8 +139,15 @@ namespace OpenRA.Orders
if (mi.Modifiers.HasModifier(Modifiers.Alt))
modifiers |= TargetModifiers.ForceMove;
// The Select(x => x) is required to work around an issue on mono 5.0
// where calling OrderBy* on SelectManySingleSelectorIterator can in some
// circumstances (which we were unable to identify) replace entries in the
// enumeration with duplicates of other entries.
// Other action that replace the SelectManySingleSelectorIterator with a
// different enumerator type (e.g. .Where(true) or .ToList()) also work.
var orders = self.TraitsImplementing<IIssueOrder>()
.SelectMany(trait => trait.Orders.Select(x => new { Trait = trait, Order = x }))
.Select(x => x)
.OrderByDescending(x => x.Order.OrderPriority);
for (var i = 0; i < 2; i++)

View File

@@ -120,6 +120,9 @@ namespace OpenRA
[Desc("At which frames per second to cap the framerate.")]
public int MaxFramerate = 60;
[Desc("Disable high resolution DPI scaling on Windows operating systems.")]
public bool DisableWindowsDPIScaling = true;
public int BatchSize = 8192;
public int SheetSize = 2048;

View File

@@ -53,11 +53,12 @@ namespace OpenRA.Mods.Cnc.Activities
if (rearmTarget == null)
return new Wait(20);
// Add a CloseEnough range of 512 to the Repair activity in order to ensure that we're at the host actor
return ActivityUtils.SequenceActivities(
new MoveAdjacentTo(self, Target.FromActor(rearmTarget)),
movement.MoveTo(self.World.Map.CellContaining(rearmTarget.CenterPosition), rearmTarget),
new Rearm(self),
new Repair(self, rearmTarget),
new Repair(self, rearmTarget, new WDist(512)),
this);
}

View File

@@ -342,7 +342,7 @@ namespace OpenRA.Mods.Common.AI
foreach (var defense in Info.DefenseQueues)
builders.Add(new BaseBuilder(this, defense, p, playerPower, playerResource));
Random = new MersenneTwister((int)p.PlayerActor.ActorID);
Random = new MersenneTwister(Game.CosmeticRandom.Next());
// Avoid all AIs trying to rush in the same tick, randomize their initial rush a little.
var smallFractionOfRushInterval = Info.RushInterval / 20;
@@ -562,7 +562,7 @@ namespace OpenRA.Mods.Common.AI
foreach (var r in nearbyResources)
{
var found = findPos(r, baseCenter, Info.MinBaseRadius, Info.MaxBaseRadius);
var found = findPos(baseCenter, r, Info.MinBaseRadius, Info.MaxBaseRadius);
if (found != null)
return found;
}

View File

@@ -43,12 +43,12 @@ namespace OpenRA.Mods.Common.Activities
if (IsCanceled)
return NextActivity;
if (dest == null || Reservable.IsReserved(dest))
if (dest == null || dest.IsDead || Reservable.IsReserved(dest))
dest = ChooseHelipad(self);
var initialFacing = heli.Info.InitialFacing;
if (dest == null)
if (dest == null || dest.IsDead)
{
var rearmBuildings = heli.Info.RearmBuildings;
var nearestHpad = self.World.ActorsHavingTrait<Reservable>()

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Activities
void Calculate(Actor self)
{
if (dest == null || Reservable.IsReserved(dest))
if (dest == null || dest.IsDead || Reservable.IsReserved(dest))
dest = ChooseAirfield(self, true);
if (dest == null)
@@ -116,7 +116,7 @@ namespace OpenRA.Mods.Common.Activities
if (!isCalculated)
Calculate(self);
if (dest == null)
if (dest == null || dest.IsDead)
{
var nearestAfld = ChooseAirfield(self, false);

View File

@@ -20,9 +20,11 @@ namespace OpenRA.Mods.Common.Activities
public class Hunt : Activity
{
readonly IEnumerable<Actor> targets;
readonly IMove move;
public Hunt(Actor self)
{
move = self.Trait<IMove>();
var attack = self.Trait<AttackBase>();
targets = self.World.ActorsHavingTrait<Huntable>().Where(
a => self != a && !a.IsDead && a.IsInWorld && a.AppearsHostileTo(self)
@@ -39,7 +41,7 @@ namespace OpenRA.Mods.Common.Activities
return this;
return ActivityUtils.SequenceActivities(
new AttackMoveActivity(self, new Move(self, target.Location, WDist.FromCells(2))),
new AttackMoveActivity(self, move.MoveTo(target.Location, 2)),
new Wait(25),
this);
}

View File

@@ -19,16 +19,13 @@ namespace OpenRA.Mods.Common.Activities
public class Repair : Activity
{
readonly RepairsUnitsInfo repairsUnits;
readonly Health health;
readonly Target host;
readonly WDist closeEnough;
int remainingTicks;
Health health;
bool played = false;
public Repair(Actor self, Actor host)
: this(self, host, WDist.Zero) { }
public Repair(Actor self, Actor host, WDist closeEnough)
{
this.host = Target.FromActor(host);

View File

@@ -35,19 +35,20 @@ namespace OpenRA.Mods.Common.Commands
public void InvokeCommand(string name, string arg)
{
if (world.LocalPlayer == null)
return;
switch (name)
{
case "pause":
world.IssueOrder(new Order("PauseGame", null, false)
{
TargetString = world.Paused ? "UnPause" : "Pause"
});
if (Game.IsHost || (world.LocalPlayer != null && world.LocalPlayer.WinState != WinState.Lost))
world.IssueOrder(new Order("PauseGame", null, false)
{
TargetString = world.Paused ? "UnPause" : "Pause"
});
break;
case "surrender":
world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));
if (world.LocalPlayer != null)
world.IssueOrder(new Order("Surrender", world.LocalPlayer.PlayerActor, false));
break;
}
}

View File

@@ -14,6 +14,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using OpenRA.Server;
using S = OpenRA.Server.Server;
@@ -23,6 +24,13 @@ namespace OpenRA.Mods.Common.Server
{
// 3 minutes. Server has a 5 minute TTL for games, so give ourselves a bit of leeway.
const int MasterPingInterval = 60 * 3;
static readonly Dictionary<int, string> MasterServerErrors = new Dictionary<int, string>()
{
{ 1, "Server port is not accessible from the internet." },
{ 2, "Server name contains a blacklisted word." }
};
public int TickTimeout { get { return MasterPingInterval * 10000; } }
public void Tick(S server)
@@ -89,14 +97,31 @@ namespace OpenRA.Mods.Common.Server
if (isInitialPing)
{
var masterResponseText = Encoding.UTF8.GetString(masterResponse);
Log.Write("server", "Master server: " + masterResponseText);
var errorCode = 0;
var errorMessage = string.Empty;
if (masterResponseText.Length > 0)
{
var regex = new Regex(@"^\[(?<code>\d+)\](?<message>.*)");
var match = regex.Match(masterResponseText);
errorMessage = match.Success && int.TryParse(match.Groups["code"].Value, out errorCode) ?
match.Groups["message"].Value.Trim() : "Failed to parse error message";
}
isInitialPing = false;
lock (masterServerMessages)
{
masterServerMessages.Enqueue("Master server communication established.");
if (masterResponseText.Contains("[001]")) // Server does not respond code
if (errorCode != 0)
{
Log.Write("server", masterResponseText);
masterServerMessages.Enqueue("Warning: Server ports are not forwarded.");
// Hardcoded error messages take precedence over the server-provided messages
string message;
if (!MasterServerErrors.TryGetValue(errorCode, out message))
message = errorMessage;
masterServerMessages.Enqueue("Warning: " + message);
masterServerMessages.Enqueue("Game has not been advertised online.");
}
}

View File

@@ -391,8 +391,10 @@ namespace OpenRA.Mods.Common.Traits
var name = a.Info.Name;
if (Info.RearmBuildings.Contains(name))
yield return new Rearm(self);
// Add a CloseEnough range of 512 to ensure we're at the host actor
if (Info.RepairBuildings.Contains(name))
yield return new Repair(self, a);
yield return new Repair(self, a, new WDist(512));
}
public void ModifyDeathActorInit(Actor self, TypeDictionary init)

View File

@@ -26,23 +26,25 @@ namespace OpenRA.Mods.Common.Traits
public override Activity GetAttackActivity(Actor self, Target newTarget, bool allowMove, bool forceAttack)
{
return new SetTarget(this, newTarget);
return new SetTarget(this, newTarget, allowMove);
}
protected class SetTarget : Activity
{
readonly Target target;
readonly AttackOmni attack;
readonly bool allowMove;
public SetTarget(AttackOmni attack, Target target)
public SetTarget(AttackOmni attack, Target target, bool allowMove)
{
this.target = target;
this.attack = attack;
this.allowMove = allowMove;
}
public override Activity Tick(Actor self)
{
if (IsCanceled || !target.IsValidFor(self))
if (IsCanceled || !target.IsValidFor(self) || !attack.IsReachableTarget(target, allowMove))
return NextActivity;
attack.DoAttack(self, target);

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
yield return Pair.New(Template, 100);
if (DamagedTemplate != 0)
yield return Pair.New(DamagedTemplate, 50);
yield return Pair.New(DamagedTemplate, 49);
if (DestroyedTemplate != 0)
yield return Pair.New(DestroyedTemplate, 0);

View File

@@ -42,7 +42,7 @@ namespace OpenRA.Mods.Common.Traits
public virtual object Create(ActorInitializer init) { return new Carryall(init.Self, this); }
}
public class Carryall : INotifyKilled, ISync, IRender, INotifyActorDisposing, IIssueOrder, IResolveOrder, IOrderVoice
public class Carryall : INotifyKilled, ISync, ITick, IRender, INotifyActorDisposing, IIssueOrder, IResolveOrder, IOrderVoice
{
public enum CarryallState
{
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
public Carryall(Actor self, CarryallInfo info)
{
this.Info = info;
Info = info;
Carryable = null;
State = CarryallState.Idle;
@@ -79,6 +79,13 @@ namespace OpenRA.Mods.Common.Traits
facing = self.Trait<IFacing>();
}
void ITick.Tick(Actor self)
{
// Cargo may be killed in the same tick as, but after they are attached
if (Carryable != null && Carryable.IsDead)
DetachCarryable(self);
}
void INotifyActorDisposing.Disposing(Actor self)
{
if (State == CarryallState.Carrying)
@@ -156,7 +163,7 @@ namespace OpenRA.Mods.Common.Traits
IEnumerable<IRenderable> IRender.Render(Actor self, WorldRenderer wr)
{
if (State == CarryallState.Carrying)
if (State == CarryallState.Carrying && !Carryable.IsDead)
{
if (carryablePreview == null)
{

View File

@@ -69,6 +69,7 @@ namespace OpenRA.Mods.Common.Traits
CPos? lastPos;
bool wasCloaked = false;
bool firstTick = true;
int cloakedToken = ConditionManager.InvalidConditionToken;
public Cloak(CloakInfo info)
@@ -145,7 +146,8 @@ namespace OpenRA.Mods.Common.Traits
if (conditionManager != null && cloakedToken == ConditionManager.InvalidConditionToken && !string.IsNullOrEmpty(Info.CloakedCondition))
cloakedToken = conditionManager.GrantCondition(self, Info.CloakedCondition);
if (!self.TraitsImplementing<Cloak>().Any(a => a != this && a.Cloaked))
// Sounds shouldn't play if the actor starts cloaked
if (!(firstTick && Info.InitialDelay == 0) && !self.TraitsImplementing<Cloak>().Any(a => a != this && a.Cloaked))
Game.Sound.Play(SoundType.World, Info.CloakSound, self.CenterPosition);
}
else if (!isCloaked && wasCloaked)
@@ -153,11 +155,12 @@ namespace OpenRA.Mods.Common.Traits
if (cloakedToken != ConditionManager.InvalidConditionToken)
cloakedToken = conditionManager.RevokeCondition(self, cloakedToken);
if (!self.TraitsImplementing<Cloak>().Any(a => a != this && a.Cloaked))
if (!(firstTick && Info.InitialDelay == 0) && !self.TraitsImplementing<Cloak>().Any(a => a != this && a.Cloaked))
Game.Sound.Play(SoundType.World, Info.UncloakSound, self.CenterPosition);
}
wasCloaked = isCloaked;
firstTick = false;
}
public bool IsVisible(Actor self, Player viewer)

View File

@@ -114,7 +114,8 @@ namespace OpenRA.Mods.Common.Traits
if (CanRearmAt(order.TargetActor) && CanRearm())
self.QueueActivity(new Rearm(self));
self.QueueActivity(new Repair(self, order.TargetActor));
// Add a CloseEnough range of 512 to ensure we're at the host actor
self.QueueActivity(new Repair(self, order.TargetActor, new WDist(512)));
var rp = order.TargetActor.TraitOrDefault<RallyPoint>();
if (rp != null)

View File

@@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
public bool HandleKeyPress(KeyInput e)
{
if (e.Event == KeyInputEvent.Down)
if (e.Event == KeyInputEvent.Down && !e.IsRepeat)
{
var h = Hotkey.FromKeyInput(e);
if (h == Game.Settings.Keys.ObserverCombinedView && !limitViews)

View File

@@ -164,9 +164,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.RunAfterTick(() => { Ui.CloseWindow(); onSuccess(); });
}
catch (Exception)
catch (Exception e)
{
Log.Write("install", "Extraction failed");
Log.Write("install", "Archive extraction failed: " + e.ToString());
foreach (var f in extracted)
{
@@ -174,7 +174,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
File.Delete(f);
}
onError("Invalid archive");
onError("Archive extraction failed");
}
finally
{

View File

@@ -294,6 +294,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
name.YieldKeyboardFocus();
return true;
};
HideChildWidget(parent, "SLOT_OPTIONS");
}
public static void SetupNameWidget(Widget parent, Session.Slot s, Session.Client c)
@@ -517,5 +519,12 @@ namespace OpenRA.Mods.Common.Widgets.Logic
return address;
}
static void HideChildWidget(Widget parent, string widgetId)
{
var widget = parent.GetOrNull(widgetId);
if (widget != null)
widget.IsVisible = () => false;
}
}
}

View File

@@ -10,6 +10,7 @@
#endregion
using System;
using System.Collections;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
@@ -56,7 +57,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
switch (searchStatus)
{
case SearchStatus.Failed: return "Failed to contact master server.";
case SearchStatus.Failed: return "Failed to query server list.";
case SearchStatus.NoGames: return "No games found. Try changing filters.";
default: return "";
}
@@ -300,18 +301,24 @@ namespace OpenRA.Mods.Common.Widgets.Logic
{
currentQuery = null;
if (i.Error != null)
List<GameServer> games = null;
if (i.Error == null)
{
RefreshServerListInner(null);
return;
try
{
var data = Encoding.UTF8.GetString(i.Result);
var yaml = MiniYaml.FromString(data);
games = yaml.Select(a => new GameServer(a.Value))
.Where(gs => gs.Address != null)
.ToList();
}
catch
{
searchStatus = SearchStatus.Failed;
}
}
var data = Encoding.UTF8.GetString(i.Result);
var yaml = MiniYaml.FromString(data);
var games = yaml.Select(a => new GameServer(a.Value))
.Where(gs => gs.Address != null);
Game.RunAfterTick(() => RefreshServerListInner(games));
};
@@ -343,7 +350,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
currentMap = server != null ? modData.MapCache[server.Map] : null;
}
void RefreshServerListInner(IEnumerable<GameServer> games)
void RefreshServerListInner(List<GameServer> games)
{
if (games == null)
return;

View File

@@ -241,7 +241,8 @@ namespace OpenRA.Mods.Common.Widgets
{
var key = Hotkey.FromKeyInput(e);
if (key == Game.Settings.Keys.PauseKey && World.LocalPlayer != null) // Disable pausing for spectators
if (key == Game.Settings.Keys.PauseKey
&& (Game.IsHost || (World.LocalPlayer != null && World.LocalPlayer.WinState != WinState.Lost))) // Disable pausing for spectators and defeated players
World.SetPauseState(!World.Paused);
else if (key == Game.Settings.Keys.SelectAllUnitsKey && !World.IsGameOver)
{

View File

@@ -40,7 +40,7 @@ namespace OpenRA.Platforms.Default
WindowSize = windowSize;
// Disable legacy scaling on Windows
if (Platform.CurrentPlatform == PlatformType.Windows)
if (Platform.CurrentPlatform == PlatformType.Windows && !Game.Settings.Graphics.DisableWindowsDPIScaling)
SetProcessDPIAware();
SDL.SDL_Init(SDL.SDL_INIT_NOPARACHUTE | SDL.SDL_INIT_VIDEO);
@@ -63,6 +63,11 @@ namespace OpenRA.Platforms.Default
Console.WriteLine("Using resolution: {0}x{1}", WindowSize.Width, WindowSize.Height);
var windowFlags = SDL.SDL_WindowFlags.SDL_WINDOW_OPENGL | SDL.SDL_WindowFlags.SDL_WINDOW_ALLOW_HIGHDPI;
// HiDPI doesn't work properly on OSX with (legacy) fullscreen mode
if (Platform.CurrentPlatform == PlatformType.OSX && windowMode == WindowMode.Fullscreen)
SDL.SDL_SetHint(SDL.SDL_HINT_VIDEO_HIGHDPI_DISABLED, "1");
window = SDL.SDL_CreateWindow("OpenRA", SDL.SDL_WINDOWPOS_CENTERED, SDL.SDL_WINDOWPOS_CENTERED,
WindowSize.Width, WindowSize.Height, windowFlags);
@@ -82,7 +87,7 @@ namespace OpenRA.Platforms.Default
else if (Platform.CurrentPlatform == PlatformType.Windows)
{
float ddpi, hdpi, vdpi;
if (SDL.SDL_GetDisplayDPI(0, out ddpi, out hdpi, out vdpi) == 0)
if (!Game.Settings.Graphics.DisableWindowsDPIScaling && SDL.SDL_GetDisplayDPI(0, out ddpi, out hdpi, out vdpi) == 0)
{
WindowScale = ddpi / 96;
WindowSize = new Size((int)(SurfaceSize.Width / WindowScale), (int)(SurfaceSize.Height / WindowScale));
@@ -107,7 +112,23 @@ namespace OpenRA.Platforms.Default
ReleaseWindowMouseFocus();
if (windowMode == WindowMode.Fullscreen)
{
SDL.SDL_SetWindowFullscreen(window, (uint)SDL.SDL_WindowFlags.SDL_WINDOW_FULLSCREEN);
// Fullscreen mode on OSX will ignore the configured display resolution
// and instead always picks an arbitrary scaled resolution choice that may
// not match the window size, leading to graphical and input issues.
// We work around this by force disabling HiDPI and resetting the window and
// surface sizes to match the size that is forced by SDL.
// This is usually not what the player wants, but is the best we can consistently do.
if (Platform.CurrentPlatform == PlatformType.OSX)
{
int width, height;
SDL.SDL_GetWindowSize(window, out width, out height);
WindowSize = SurfaceSize = new Size(width, height);
WindowScale = 1;
}
}
else if (windowMode == WindowMode.PseudoFullscreen)
{
// Work around a visual glitch in OSX: the window is offset

View File

@@ -170,7 +170,8 @@ namespace OpenRA.Platforms.Default
Key = keyCode,
Modifiers = mods,
UnicodeChar = (char)e.key.keysym.sym,
MultiTapCount = tapCount
MultiTapCount = tapCount,
IsRepeat = e.key.repeat != 0
};
// Special case workaround for windows users

BIN
mods/cnc/bits/cliffsl1.sno Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl1.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl1.win Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl2.sno Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl2.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl2.win Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl3.sno Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl3.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl3.win Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl4.sno Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl4.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/cliffsl4.win Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
mods/cnc/bits/tunnel1.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/tunnel2.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/tunnel3.tem Normal file

Binary file not shown.

BIN
mods/cnc/bits/tunnel4.tem Normal file

Binary file not shown.

View File

@@ -77,7 +77,7 @@ Container@NEW_MAP_BG:
Font: Bold
Key: return
Background@SAVE_MAP_PANEL:
Container@SAVE_MAP_PANEL:
Logic: SaveMapLogic
X: (WINDOW_RIGHT - WIDTH)/2
Y: (WINDOW_BOTTOM - HEIGHT)/2

View File

@@ -173,7 +173,7 @@ Container@MENU_BACKGROUND:
Width: 140
Height: 35
Text: Back
Background@MAP_EDITOR_MENU:
Container@MAP_EDITOR_MENU:
Width: PARENT_RIGHT
Visible: False
Children:

BIN
mods/cnc/maps/16-9.oramap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
mods/cnc/maps/arcade.oramap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
mods/cnc/maps/contra.oramap Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -0,0 +1,536 @@
MapFormat: 11
RequiresMod: cnc
Title: Desert Rats
Author: Madness
Tileset: DESERT
MapSize: 72,72
Bounds: 1,1,70,70
Visibility: Lobby
Categories: Conquest
Players:
PlayerReference@Neutral:
Name: Neutral
OwnsWorld: True
NonCombatant: True
Faction: Random
PlayerReference@Creeps:
Name: Creeps
NonCombatant: True
Faction: Random
Enemies: Multi0, Multi1
PlayerReference@Multi0:
Name: Multi0
Playable: True
Faction: Random
Enemies: Creeps
PlayerReference@Multi1:
Name: Multi1
Playable: True
Faction: Random
Enemies: Creeps
Actors:
Actor0: mpspawn
Owner: Neutral
Location: 22,16
Actor3: t18
Owner: Neutral
Location: 16,4
Actor4: t18
Owner: Neutral
Location: 4,8
Actor5: t08
Owner: Neutral
Location: 8,2
Actor6: v19
Owner: Neutral
Location: 9,6
Actor7: v19
Owner: Neutral
Location: 18,5
Actor8: t18
Owner: Neutral
Location: 28,4
Actor9: t04
Owner: Neutral
Location: 27,5
Actor10: t08
Owner: Neutral
Location: 30,8
Actor11: t04
Owner: Neutral
Location: 30,8
Actor12: t18
Owner: Neutral
Location: 41,11
Actor13: t04
Owner: Neutral
Location: 39,12
Actor14: wood
Owner: Neutral
Location: 46,11
Actor15: wood
Owner: Neutral
Location: 46,10
Actor16: wood
Owner: Neutral
Location: 47,10
Actor17: wood
Owner: Neutral
Location: 48,10
Actor18: wood
Owner: Neutral
Location: 49,10
Actor19: wood
Owner: Neutral
Location: 50,10
Actor20: wood
Owner: Neutral
Location: 50,11
Actor21: v21
Owner: Neutral
Location: 49,12
Actor22: wood
Owner: Neutral
Location: 51,13
Actor23: wood
Owner: Neutral
Location: 52,13
Actor24: wood
Owner: Neutral
Location: 52,14
Actor25: c2
Owner: Neutral
Location: 49,11
SubCell: 3
Facing: 92
Actor26: t18
Owner: Neutral
Location: 47,10
Actor27: t08
Owner: Neutral
Location: 50,14
Actor28: t08
Owner: Neutral
Location: 36,23
Actor29: t04
Owner: Neutral
Location: 38,21
Actor30: t04
Owner: Neutral
Location: 36,21
Actor31: t04
Owner: Neutral
Location: 36,24
Actor32: t04
Owner: Neutral
Location: 20,23
Actor33: t04
Owner: Neutral
Location: 13,5
Actor34: t04
Owner: Neutral
Location: 10,6
Actor35: t04
Owner: Neutral
Location: 8,6
Actor36: t04
Owner: Neutral
Location: 19,5
Actor37: rock5
Owner: Neutral
Location: 27,31
Actor38: t18
Owner: Neutral
Location: 28,28
Actor39: t04
Owner: Neutral
Location: 26,30
Actor40: t04
Owner: Neutral
Location: 22,39
Actor41: t08
Owner: Neutral
Location: 23,39
Actor42: split2
Owner: Neutral
Location: 21,32
Actor43: v31
Owner: Neutral
Location: 2,34
Actor44: v25
Owner: Neutral
Location: 2,35
Actor45: v24
Owner: Neutral
Location: 5,35
Actor46: v27
Owner: Neutral
Location: 5,38
Actor47: v30
Owner: Neutral
Location: 5,40
Actor48: t18
Owner: Neutral
Location: 6,40
Actor49: t18
Owner: Neutral
Location: 1,35
Actor50: v22
Owner: Neutral
Location: 1,38
Actor51: v29
Owner: Neutral
Location: 3,39
Actor52: t08
Owner: Neutral
Location: 1,39
Actor54: v27
Owner: Neutral
Location: 2,43
Actor55: v24
Owner: Neutral
Location: 2,39
Actor56: t18
Owner: Neutral
Location: 6,50
Actor57: v35
Owner: Neutral
Location: 5,51
Actor58: t04
Owner: Neutral
Location: 5,51
Actor59: t08
Owner: Neutral
Location: 1,60
Actor60: t18
Owner: Neutral
Location: 5,61
Actor61: t18
Owner: Neutral
Location: 18,69
Actor63: t08
Owner: Neutral
Location: 4,70
Actor64: t18
Owner: Neutral
Location: 0,69
Actor65: t18
Owner: Neutral
Location: 1,66
Actor66: v32
Owner: Neutral
Location: 6,69
Actor67: t18
Owner: Neutral
Location: 8,68
Actor68: split2
Owner: Neutral
Location: 13,64
Actor69: t18
Owner: Neutral
Location: 19,46
Actor70: t09
Owner: Neutral
Location: 19,47
Actor71: t04
Owner: Neutral
Location: 19,47
Actor72: wood
Owner: Neutral
Location: 25,60
Actor73: wood
Owner: Neutral
Location: 25,61
Actor74: wood
Owner: Neutral
Location: 24,61
Actor75: wood
Owner: Neutral
Location: 23,61
Actor76: wood
Owner: Neutral
Location: 22,61
Actor77: wood
Owner: Neutral
Location: 21,61
Actor78: wood
Owner: Neutral
Location: 21,60
Actor79: wood
Owner: Neutral
Location: 19,57
Actor80: wood
Owner: Neutral
Location: 19,58
Actor81: wood
Owner: Neutral
Location: 20,58
Actor82: t18
Owner: Neutral
Location: 29,58
Actor83: t09
Owner: Neutral
Location: 32,58
Actor84: t04
Owner: Neutral
Location: 31,56
Actor85: t18
Owner: Neutral
Location: 23,59
Actor86: t08
Owner: Neutral
Location: 21,56
Actor87: v24
Owner: Neutral
Location: 21,58
Actor88: c6
Owner: Neutral
Location: 22,60
SubCell: 3
Facing: 92
Actor89: t18
Owner: Neutral
Location: 43,65
Actor90: t04
Owner: Neutral
Location: 42,64
Actor91: t04
Owner: Neutral
Location: 39,63
Actor92: t08
Owner: Neutral
Location: 40,63
Actor93: t04
Owner: Neutral
Location: 32,69
Actor94: t18
Owner: Neutral
Location: 34,46
Actor95: t04
Owner: Neutral
Location: 34,45
Actor96: t09
Owner: Neutral
Location: 35,48
Actor97: t04
Owner: Neutral
Location: 32,49
Actor98: rock1
Owner: Neutral
Location: 19,40
Actor99: t18
Owner: Neutral
Location: 21,42
Actor100: v19
Owner: Neutral
Location: 24,43
Actor101: v27
Owner: Neutral
Location: 24,45
Actor102: v23.husk
Owner: Neutral
Location: 22,44
Actor103: t18
Owner: Neutral
Location: 34,37
Actor104: t18
Owner: Neutral
Location: 36,32
Actor105: t04
Owner: Neutral
Location: 36,37
Actor106: t04
Owner: Neutral
Location: 34,33
Actor107: t04
Owner: Neutral
Location: 32,36
Actor108: t04
Owner: Neutral
Location: 37,36
Actor109: t09
Owner: Neutral
Location: 37,37
Actor110: t04
Owner: Neutral
Location: 44,33
Actor111: v19
Owner: Neutral
Location: 47,28
Actor112: v27
Owner: Neutral
Location: 47,26
Actor113: t18
Owner: Neutral
Location: 49,26
Actor114: rock1
Owner: Neutral
Location: 51,29
Actor115: v23
Owner: Neutral
Location: 48,27
Actor116: t09
Owner: Neutral
Location: 49,28
Actor117: t04
Owner: Neutral
Location: 51,27
Actor118: t18
Owner: Neutral
Location: 51,22
Actor119: t09
Owner: Neutral
Location: 50,23
Actor120: t04
Owner: Neutral
Location: 52,22
Actor121: t18
Owner: Neutral
Location: 42,40
Actor122: t04
Owner: Neutral
Location: 43,39
Actor123: split2
Owner: Neutral
Location: 50,39
Actor124: t08
Owner: Neutral
Location: 47,32
Actor125: t04
Owner: Neutral
Location: 46,31
Actor126: t04
Owner: Neutral
Location: 50,46
Actor127: v25
Owner: Neutral
Location: 68,35
Actor128: v24
Owner: Neutral
Location: 65,35
Actor129: v33
Owner: Neutral
Location: 68,38
Actor130: v27
Owner: Neutral
Location: 66,33
Actor131: v22
Owner: Neutral
Location: 68,33
Actor132: v29
Owner: Neutral
Location: 68,32
Actor133: v24
Owner: Neutral
Location: 69,29
Actor134: v27
Owner: Neutral
Location: 69,28
Actor135: v30
Owner: Neutral
Location: 65,31
Actor136: v28
Owner: Neutral
Location: 66,30
Actor137: t18
Owner: Neutral
Location: 65,28
Actor138: t18
Owner: Neutral
Location: 69,34
Actor139: t08
Owner: Neutral
Location: 69,32
Actor140: t04
Owner: Neutral
Location: 69,25
Actor141: t04
Owner: Neutral
Location: 66,45
Actor142: t18
Owner: Neutral
Location: 63,18
Actor143: v36
Owner: Neutral
Location: 64,20
Actor144: t04
Owner: Neutral
Location: 63,19
Actor145: t18
Owner: Neutral
Location: 62,1
Actor146: t18
Owner: Neutral
Location: 66,-1
Actor147: t18
Owner: Neutral
Location: 71,3
Actor148: t08
Owner: Neutral
Location: 70,11
Actor149: t18
Owner: Neutral
Location: 65,7
Actor150: v33
Owner: Neutral
Location: 64,2
Actor151: t09
Owner: Neutral
Location: 63,2
Actor152: t04
Owner: Neutral
Location: 38,1
Actor153: split2
Owner: Neutral
Location: 58,7
Actor154: t18
Owner: Neutral
Location: 67,58
Actor155: t04
Owner: Neutral
Location: 66,60
Actor157: t08
Owner: Neutral
Location: 63,69
Actor160: v19
Owner: Neutral
Location: 62,65
Actor161: v19
Owner: Neutral
Location: 53,66
Actor162: t18
Owner: Neutral
Location: 51,64
Actor163: t04
Owner: Neutral
Location: 51,65
Actor164: t04
Owner: Neutral
Location: 56,64
Actor165: t04
Owner: Neutral
Location: 62,63
Actor166: mpspawn
Owner: Neutral
Location: 49,55
Actor167: t04
Owner: Neutral
Location: 4,10
Actor168: split2
Owner: Neutral
Location: 61,58
Actor169: split2
Owner: Neutral
Location: 10,13
Rules: rules.yaml

View File

@@ -0,0 +1,6 @@
World:
GlobalLightingPaletteEffect:
Red: 1.1
Green: 0.95
Blue: 1.051
Ambient: 0.68

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More