Commit Graph

270 Commits

Author SHA1 Message Date
RoosterDragon
82bea961ba Checked LINQ queries and collections for inefficiencies.
- Made Array.IndexOf available via extension method.
- Made ToHashSet extension method.
- Change collections queried often via Contains into sets.
- Avoid Count() extension if Count or Length property exist.
- Made Count() > 0 checks and variations calls to Any() instead.
- Don't call ToList/ToArray if there is no benefit to materializing the sequence.
- If the sequence does benefit from materialization, follow this general pattern:
  - Collection queried often via Contains use ToHashSet to speed up lookups.
  - Short lived variables use ToList. This is because ToArray requires an extra copy to output the final size.
  - Collections persisted into fields or for a long time use ToArray to minimize memory overhead.
2015-01-29 19:20:11 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
RoosterDragon
a6cda967c2 Formatted all files.
Automatically formatted all files via VS. This generally corrects indentation, removes trailing whitespace and corrects misplaced tabs or spaces. Manually tweaked a few files where required.
2015-01-06 21:28:50 +00:00
Matthias Mailänder
44cd174a8d StyleCop clean OpenRA.Game 2015-01-03 19:00:48 +01:00
Oliver Brakmann
30e42cdc62 Merge pull request #7247 from Hellhake/stylecop-game
Fix StyleCop warnings in OpenRA.Game
2015-01-02 12:58:04 +01:00
Hellhake
5a97a4b63b Fix StyleCop warnings in OpenRA.Game 2015-01-02 12:11:01 +01:00
Hellhake
fa72e04042 Remove BOM 2015-01-01 22:51:12 +01:00
asl97
d2a14842d8 avoid a busy server loop with high CPU usage
fixes #7237
2014-12-31 19:46:39 +01:00
Paul Chote
4f44cc1969 Load assets using absolute paths. Fixes #6717. 2014-10-11 11:02:30 +13:00
huwpascoe
d150ea1721 Fix server freeze on client absence. 2014-09-28 16:27:40 +01:00
Matthias Mailänder
f4b3a73af6 remove duplicated "Server: ... the server" wording 2014-09-13 11:22:09 +02:00
Tiago Sousa
ce68d67f0b Disallow same/similar colors (fixes #2820) 2014-08-30 01:53:38 +01:00
Alexander Fast
070d00c678 Fixes year numbers in license text in file headers. 2014-08-21 11:27:52 +02:00
Matthias Mailänder
fa2b2bea0b beautify starting unit notification when joining server
move LobbySettingsNotification into it's own ServerTrait
2014-08-17 07:39:34 +02:00
Matthias Mailänder
b382c0339f only notify when the lobby settings differ from the default 2014-08-03 09:31:25 +02:00
havok13888
65c77677d4 Inform client about changes in lobby options 2014-08-01 15:41:02 -05:00
Pavlos Touboulidis
b88b87b899 Improve game loop
Environment.TickCount was replaced with Game.RunTime that's based on
Stopwatch for increased accuracy.
2014-07-10 04:06:29 +03:00
Matthias Mailänder
1f7b0ad5d4 time limit the port forwarding if possible 2014-06-16 16:42:06 +02:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12:00
Paul Chote
d8e5177a36 Merge pull request #5405 from RoosterDragon/min-max
Added MinBy, MaxBy, etc.
2014-06-09 17:42:01 +12:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
RoosterDragon
0ea3509ee4 Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant. 2014-05-23 08:23:42 +01:00
Matthias Mailänder
187362e80e rename OpenRA.Support.Random aka XRandom to MersenneTwister 2014-05-18 21:53:21 +02:00
Matthias Mailänder
86271c3dd1 use List<MiniYamlNode> instead of System.Text.StringBuilder
add Deserialize methods for everything in Network.Session
2014-05-15 11:36:24 +02:00
Matthias Mailänder
c7fad3a693 StyleCop and TODO 2014-05-15 10:04:21 +02:00
Matthias Mailänder
f68a6bbd76 split latency from Client into ClientPing
closes #4282
2014-05-15 10:04:21 +02:00
Matthias Mailänder
f365f9da2b split lobby SyncInfo order into smaller chunks
closes #4594
2014-05-15 10:04:03 +02:00
Matthias Mailänder
59ace5d01b new shorthand Exts.(Try)ParseIntegerInvariant 2014-05-13 14:16:41 +02:00
Matthias Mailänder
aace818f43 remove unused OpenRA.Server extensions 2014-05-09 08:44:37 +02:00
Matthias Mailänder
b19d286f56 parse with NumberFormatInfo.InvariantInfo everywhere
closes #5240
2014-05-06 18:31:48 +02:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
fcb3d7347a Kick clients who don't have the map when the host force-starts. 2014-03-21 23:33:14 +13:00
Matthew Uzzell
c6b0e37f7e updated the AllowSpectate variable to be AllowSpectators
added KickSpectatorsLogic for a confimation of kicking spectators & changed the toggle buttons to be a checkbox
2014-02-22 21:55:35 +00:00
Matthew Uzzell
88121b272d edited the LobbyLogic to include a spectator toggle in the server admin dropdown. 2014-02-22 21:55:34 +00:00
Matthias Mailänder
e367cea840 one MOTD for all mods and create a default motd.txt 2014-01-04 09:34:17 +01:00
Paul Chote
6d6d1e230b Remove runtime mod merging. Closes #3421. 2013-11-15 09:54:42 +13:00
ScottNZ
1394c1dcee Remove some misc redundancies 2013-11-12 19:39:39 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Matthias Mailänder
bc133d199e StyleCop cleanup 2013-11-10 07:34:52 +01:00
Matthias Mailänder
7de2dd7083 add suffix to the player has disconnected message in-game
closes #3864
2013-11-10 07:31:26 +01:00
Matthias Mailänder
21a607a43e StyleCop cleanup 2013-11-09 17:23:33 +01:00
Paul Chote
142db86acd SyncInfo is only valid during the initial lobby phase. Fixes #3973.
Existing broken replays can be fixed manually by removing the SyncInfo order at the end of the file.
2013-11-09 16:30:32 +13:00
Matthias Mailänder
b618fc7cc2 complete password protected servers
closes #2290
2013-10-07 19:37:12 +02:00
Paul Chote
d867e8200f Reset default state when a dedicated server clears. 2013-08-04 12:06:47 +12:00
Paul Chote
40533918f3 Allow mods to set default lobby options. 2013-08-04 12:03:18 +12:00
Paul Chote
57a27eb948 Restore packet size restriction with 128k limit. 2013-07-14 17:00:44 +12:00
Paul Chote
567b1967cf Revert "restrict packet size to 4K in server"
This reverts commit edb08d6fec.
2013-07-13 21:03:44 +12:00
Paul Chote
9746b53cb6 Merge pull request #3535 from chrisforbes/lobby-robustness
restrict packet size to 4K in server
2013-07-11 04:33:42 -07:00
Chris Forbes
edb08d6fec restrict packet size to 4K in server
- Sending a negative length no longer crashes the server
- Sending very large lengths can't force us to buffer stupid amounts of data

The offending client just gets kicked if they do this.
2013-07-08 14:58:07 +12:00