Commit Graph

441 Commits

Author SHA1 Message Date
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Ivaylo Draganov
a7279415dc Allow player to add a "priority unit" to production queue
* If production is ordered by `Ctrl + Left Click` the item is added to the top of the stack after the currently produced item
* Works with `Shift` for priority queueing of 5 items
* This modifier is not taken into account for `ParallelProductionQueue` as it doesn't make sense in that context
2018-11-03 17:54:50 +01:00
teinarss
cfaf5a6467 Updated CPos struct to use a bit field for all properties. 2018-10-02 00:54:45 +01:00
teinarss
e353c8c176 Changed SubCell to byte 2018-09-30 19:48:27 +01:00
Paul Chote
8533aa8d26 Disable sync reports when we know we won't need them.
Generating the sync report takes ~twice as long as
a normal tick, and occurs once every 3 ticks.

These reports record of all of the synced state
(separate to the sync hash, which is still calculated)
in order to generate the syncreport.log of the game
desyncs. This perf overhead is completely unnecessary
when we know that we won't have other syncreports to
compare against (singleplayer, replays).

Disabling report generation in these cases gives
us an easy 40% average tick-time win.
2018-09-10 19:44:06 +02:00
Paul Chote
8475bd6294 Ignore malformed orders instead of crashing. 2018-08-25 18:23:35 +02:00
Paul Chote
e374c8e6c3 Sync auth information with the master server. 2018-08-18 16:57:28 +02:00
Paul Chote
c74159e549 Add player authentication backend. 2018-07-29 00:30:17 +02:00
teinarss
0c1b11ed4f Added Dedicated to GlobalSettings 2018-07-05 23:22:09 +01:00
Paul Chote
8c0f4fde81 Fix newlines in C# files. 2018-07-01 11:08:32 +02:00
Paul Chote
6ef802b929 Send mod title, website, and an icon URL to the master server.
Prefer the title returned by the master server in the games list.
2018-05-31 17:45:58 +02:00
Paul Chote
ba8eac0e38 Remove deprecated Order.TargetActor and Target.FromOrder. 2018-05-30 18:06:59 +02:00
Paul Chote
768265bbd2 Unify TargetFlash handling around Targets. 2018-05-30 18:06:59 +02:00
Peter Antal
3ce2417a06 Create SupportDirPrefix and IsPathRelativeToSupportDirectory() as members on Platform class. 2018-03-10 12:54:01 +00:00
Paul Chote
e69cf4fd5c Rename another Stream.Write(byte[]) extension method. 2018-03-07 22:29:35 +01:00
Paul Chote
42f1db0d4b Rename Stream.Write(byte[]) extension method to fix compatibility with newer mono. 2018-03-03 18:40:01 +01:00
Paul Chote
234e6cc566 Prevent injected unpause orders from restarting a finished game. 2018-02-04 15:30:53 +01:00
RoosterDragon
a726b57367 Fix order serialization issues. 2018-01-28 15:41:28 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
36c3e07535 Remove CRLF from GameServer.cs. 2018-01-01 21:12:58 +01:00
Paul Chote
58547fda89 Guess mod titles based on other versions, if they exist. 2018-01-01 21:12:58 +01:00
Paul Chote
f8abd5d319 Serialize the correct player in FrozenActor-targeting orders. 2018-01-01 16:01:44 +01:00
Paul Chote
b3cde077fc Don't break the order stream if a frozen actor refers to a bogus player. 2018-01-01 16:01:44 +01:00
Paul Chote
3ba610b535 Implement new master server ping protocol. 2017-12-26 20:05:38 +01:00
Paul Chote
205c45198c Remove secondary AllowPortForward setting.
The global setting is fine, and this simplifies
both the code and the UI.
2017-12-24 01:47:44 +01:00
Paul Chote
ec4cf0646f Rewrite Serialize to improve clarity. 2017-12-21 20:01:14 +01:00
Paul Chote
5b51261dd3 Serialize the correct target type. 2017-12-21 20:01:14 +01:00
Paul Chote
9c88fc154f Remove redundant switch from order serialization. 2017-12-21 20:01:14 +01:00
RoosterDragon
987d0b77ac When dumping syncable traits, use a struct for the synced values.
Since most traits have few syncable members, this allows us to avoid allocating an array whose lifetime is only a few ticks long. For traits with more members, we fall back to allocating the array.
2017-12-19 22:01:08 +02:00
RoosterDragon
ca01a1f186 Presize MemoryStream when possible.
Also use GetBuffer when we know we have presized the stream to the exact required size to prevent a needless copy.
2017-12-19 00:59:11 +01:00
Paul Chote
3f67feab0e Rename boolean LobbyOption fields. 2017-12-12 22:43:11 +01:00
RoosterDragon
8ef8c60a1a Remove allocations when enumerating sync hashes on an actor.
Exposing Actor.SyncHashes as an array allows allocation free enumeration, we just need to adjust the SyncHash type to run the hash function.
2017-12-10 13:49:52 +00:00
RoosterDragon
713cdaef5d Reduce allocations needed by ReplayConnection.
Packets from each chunk are now saved directly in an array, removing the overhead of a list. Additionally, a list is reused as a buffer for decoding packets into, preventing a new buffer from needing to be allocated for each chunk.
2017-11-19 12:11:38 +00:00
Pavel Penev
8d7eb0bc47 Fix order deserialization when there is no indended order subject 2017-11-13 00:37:44 +01:00
Paul Chote
5f9a67ed87 Migrate frozen actors from ExtraData to Target. 2017-10-26 18:48:41 +03:00
Paul Chote
29c423772f Serialize order Target directly instead of TargetActor/TargetCell. 2017-10-26 18:48:41 +03:00
Paul Chote
d967c564a2 Remove TargetActor and TargetLocation from order issuing. 2017-10-15 19:07:46 +02:00
Paul Chote
4896a90b8d Add plumbing to issue orders against a generic Target. 2017-10-15 19:07:46 +02:00
Paul Chote
75d4062698 Limit chat messages to 2500 characters. 2017-10-14 13:10:27 +02:00
rob-v
78bedb0513 Fix IsSinglePlayer 2017-06-27 22:43:15 +01:00
RoosterDragon
2def72a078 Clear previous effects data when generating a new sync report. 2017-06-12 18:25:35 -05:00
Paul Chote
d9800d4e2b Fix repair cursor visual feedback target. 2017-04-24 08:52:48 +01:00
rob-v
bad2c1c2bf Unify ingame message prefixes. #12923
Unify ingame message prefixes. #12923
2017-03-18 21:46:30 +01:00
RoosterDragon
aa3024f1f8 Fix thread-safety and dispose issues in NetworkConnection.
- Calling Close() on a TcpClient is documented to also close the underlying sockets and streams for us. This means we can avoid also calling socket.Client.Close() and generating exceptions on mono.
- TcpClient is not thread-safe. However the NetworkStream returned by GetStream() is thread-safe for a single reader/single writer scenario. If we create and dispose the client on the calling thread, and pass the NetworkStream into the thread we spawn for reading, then we can avoid thread-safety issues incurred by trying to Close() the connection from another thread.
- The clean shutdown means we don't need to make the dodgy Thread.Abort() call as it will end normally, and that means we don't need a finalizer to ensure the thread is killed off.
- Refactor how receivedPackets work in EchoConnection to avoid lock(this).
- Mark connectionState and clientId as volatile since they are set from another thread.
2017-02-21 14:10:06 +00:00
Paul Chote
9516a6af69 Fix game server compatibility check. 2017-02-12 18:48:03 +00:00
reaperrr
0c44a49722 Merge pull request #12600 from pchote/externalmods
Add support for switching to mods from other engine installations.
2017-02-12 13:18:53 +01:00
Paul Chote
f2e6601e07 Remove legacy MP lobby mod and replay switching logic. 2017-02-11 16:45:18 +00:00
Paul Chote
2da4e87b94 Implement new server-connection mod switching logic. 2017-02-11 16:21:34 +00:00
Matthias Mailänder
13263f7bb2 Drop Maxmind.GeoIP and Newtonsoft.Json dependencies 2017-02-05 11:54:22 +01:00
RoosterDragon
fbf6f45b11 Avoid boxing Booleans when dumping sync traits.
We can return the resulting strings directly.
2017-01-19 20:23:47 +00:00