Commit Graph

269 Commits

Author SHA1 Message Date
Chris Forbes
5eb61dbdd2 Merge pull request #5411 from RoosterDragon/general-clean
General Cleanup
2014-05-25 11:03:03 +12:00
Pavlos Touboulidis
5a286ef15e Fix #5414 2014-05-23 19:08:45 +03: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
Pavlos Touboulidis
de0a5ebd43 Improve replay metadata and the replay browser
List of changes:

* Better and more filters with new layout, for both mods.

* Rename/Delete/Detele all functionality.

* Simplified ReplayMetadata class considerably by introducing a new
GameInformation data object. The new GameInformation class contains
more information than previously available so the new solution is not
compatible with old replays, meaning it can't read old replays.

* Better and cleaner game information gathering in order to be written
at the end of the replay file.

* Revert changes to ReplayConnection, no longer necessary.

* Better exception message on missing sprites and fonts.

* New "SpawnOccupant" class that holds all the information needed by the
MapPreviewWidget to visualize a spawn point. It was using Session.Client
before and it was necessary to separate it to be able to show information
not available at lobby time.

* Fix keyboard focus UI bug when closing a window would not remove focus.
2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
ce8c42b552 Style & nit fixes 2014-05-22 21:54:14 +03:00
Pavlos Touboulidis
98a05b61b3 Add metadata block to replays
The replay files are just streams all network communication so to
get any info out of them it is necessary to play back the stream
until the wanted information is reached.

This introduces a new metadata block placed at the end of the
replay files and logic to read the new block, or fall back to
playing back the stream for older files.

The replay browser is also updated to use the metadata information
instead of reading the replay stream directly.
2014-05-22 21:54:14 +03:00
WolfGaming
00698cefff Added in code for Tech Levels using prereqs
and fixed up some kinks of the old system
2014-05-19 03:29:25 +00: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
Oliver Brakmann
63f4a0646f Fix build palette showing too many queued items when BuildLimit is reached
When a BuildLimit on an actor type is set and nearly reached, you could
shift-click the build palette and it would show it had five more items
queued when really less are allowed to be built. This fixes it so that
only the allowed number of items is enqueued, and thus showing the
correct number on the build palette.
2014-04-26 16:27:02 +02:00
Matthias Mailänder
ab3dc92554 only add bots when the map allows it
fixes #5110
2014-04-20 14:58:57 +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
Paul Chote
538a25ae6c Fix replays for network games. Fixes #4866. 2014-03-18 20:37:10 +13:00
Paul Chote
2106393122 Simplify the server browser code. 2014-03-16 21:46:00 +13:00
Paul Chote
4c4783262f Simplify the replay browser code. 2014-03-16 21:45:59 +13:00
Paul Chote
c30b18a9d6 Introduce MapCache and MapPreview for improved UI map previews. 2014-03-16 21:45:59 +13:00
Paul Chote
bce0a7b39e Overhaul replay parsing. Fixes #4608. 2014-03-08 11:47:55 +13:00
Paul Chote
6385e7ebaa Stylecop ReplayConnection. 2014-03-08 11:47:55 +13:00
ScottNZ
39484bdd45 Move order lag change announcements to server.log 2014-02-24 13:33:04 +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
Paul Chote
06be4d3efd Catch IOExceptions in Connection.cs. Closes #4083. Closes #4423. 2014-01-31 15:41:32 +13:00
Igor Popov
9d9807b23a cleanup 2014-01-28 11:02:23 +04: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
Paul Chote
bb8f4494f5 Merge pull request #3938 from Mailaender/game-id
Added a Game ID and print it to syncreport.log
2013-10-17 22:51:27 -07:00
Matthias Mailänder
eff943b3eb added OS and Mono/.NET runtime version to syncreport.log 2013-10-17 20:54:58 +02:00
Matthias Mailänder
8c8df3bda9 expose Game ID and client player name to syncreport.log 2013-10-17 20:36:17 +02:00
Matthias Mailänder
353393571f added a Game ID
closes #2570
2013-10-17 20:36:17 +02:00
Matthias Mailänder
f21f314bfe avoid magic number for replay duration calculation 2013-10-16 21:09:45 +02:00
Paul Chote
f5d26bebb7 Don't crash if the server mods don't match.
This allows the ingame dialog to be displayed.
2013-10-07 19:37:15 +02:00
Matthias Mailänder
b618fc7cc2 complete password protected servers
closes #2290
2013-10-07 19:37:12 +02:00
Matthias Mailänder
f4a8a99d87 avoid misleading no sync report available messages 2013-09-29 21:29:17 +02:00
Matthias Mailänder
9d3b93f717 save replays in per mod and version folders
StyleCop cleanups
2013-09-20 17:12:22 +02:00
Chris Forbes
97858dae55 Merge pull request #3737 from Mailaender/invalid-field-index
Added a complete log of incoming data from Session.Deserialize for debugging
2013-09-01 00:49:43 -07:00
Matthias Mailänder
bdfdaac092 sync effects 2013-08-29 17:37:35 +02:00
Matthias Mailänder
11acd7f1df logged the complete incoming bad session yaml
to investigate #3343
also made StyleCop happy
2013-08-23 20:30:04 +02:00
Paul Chote
271ce5275c Add starting cash option. 2013-08-17 14:43:52 +12:00
Paul Chote
ce41eb2361 Add "Build off Ally ConYards" option. Fixes #2464. 2013-08-17 14:42:40 +12:00
Paul Chote
6b1b8d9ed4 Add Order.ExtraData field. 2013-08-11 22:23:51 +12:00
Matthias Mailänder
9d40b430dc try to grab the external IP of localhost from the NAT router 2013-08-08 13:39:18 +02:00
Paul Chote
87b32fd0b9 Tweak starting unit defaults. 2013-08-04 13:07:47 +12:00
Paul Chote
c08f602661 Add lobby options for Shroud and Fog. 2013-08-04 13:04:09 +12:00
Paul Chote
7376cccf4d Smarter unit spawn logic. Fixes #3496. 2013-07-13 19:18:27 +12:00
ScottNZ
a6e5a0b53f Add temp banning to servers 2013-06-29 10:58:37 +12:00
Matthias Mailänder
e9b2bcc579 fix some plenks
no logic changes
2013-06-21 18:05:30 +02:00