Commit Graph

6398 Commits

Author SHA1 Message Date
abcdefg30
e8e0e155e5 Explain the try-finally clause in Sync.cs in a comment 2021-10-14 19:45:29 +02:00
abcdefg30
b366db7175 Revert "Directly run unsynced functions if we don't check sync hashes"
This reverts commit 1dc0a603c7.
2021-10-14 19:45:29 +02:00
abcdefg30
69248132ad Don't desync while the world is disposing 2021-10-09 21:13:35 +02:00
abcdefg30
1dc0a603c7 Directly run unsynced functions if we don't check sync hashes 2021-10-09 21:13:35 +02:00
RoosterDragon
6e0917169d Teach FieldLoader.ParseCPos about CPos.Layer. 2021-10-02 21:54:26 +01:00
RoosterDragon
4cc33b2871 Add some ToString overrides to improve debug experience. 2021-10-02 21:54:26 +01:00
RoosterDragon
6f3b4ecae9 Speed up Map.Contains checks for non-flat maps.
We observe that most cells within a map lie within a region where no matter their height, their projection would still remain in map bounds. We can utilise this to perform a fast check for such cells and skipping the expensive checks on their actual height. We only need to check the actual height of a cell if this could cause the projection to go out of bounds.
2021-10-02 21:43:11 +01:00
KonH
9ed809943d Just use Dispose methods without arguments (disposing always passed as true) 2021-10-02 22:14:08 +02:00
KonH
8bce6eb3ac Remove GC.SuppressFinalize calls from classes without destructors 2021-10-02 22:14:08 +02:00
Paul Chote
defaf92752 Send order queue length in ping responses. 2021-10-02 21:03:00 +02:00
Paul Chote
2d08f2bbfd Allow the server to ack no or multiple packets in the same frame. 2021-10-02 21:03:00 +02:00
RoosterDragon
3a7aeb5324 Ensure TargetLineRenderable width and marker size don't get lost.
By making the constructor take non-optional parameters, this highlights some calls sites which were forgetting to set these values. These are now fixed.

Set the path debug to have a marker size of 2 for better visibility.
2021-10-02 12:14:54 +01:00
teinarss
289c4ef2b7 Remove Microsoft.DotNet.PlatformAbstractions 2021-09-29 20:52:44 +02:00
teinarss
80b6a5a27f Update nuget packages 2021-09-29 20:52:44 +02:00
Matthias Mailänder
98b87004cc Bump SharpZipLib. 2021-09-26 11:18:15 +01:00
Paul Chote
8588af1001 Disable chat for the first 5s (configurable) after joining a server. 2021-09-23 12:52:20 +02:00
Paul Chote
2424ddc79a Move NetTickScale (now NetFrameInterval) control to the server. 2021-09-21 15:12:36 +02:00
Paul Chote
df798fb620 Overhaul client latency calculations.
The ping/pong orders are replaced with a dedicated
(and much smaller) Ping packet that is handled
directly in the client and server Connection wrappers.

This allows clients to respond when the orders are
processed, instead of queuing the pong order to be
sent in the next frame (which added an extra 120ms
of unwanted latency).

The ping frequency has been raised to 1Hz, and pings
are now routed through the server events queue in
preparation for the future dynamic latency system.

The raw ping numbers are no longer sent to clients,
the server instead evaluates a single ConnectionQuality
value that in the future may be based on more than
just the ping times.
2021-09-21 15:12:36 +02:00
Paul Chote
67face8cf0 Rename connection packet handling. 2021-09-21 15:12:36 +02:00
Matthias Mailänder
f08a0b113e Allow mods to customize application title. 2021-09-19 22:29:50 +02:00
Matthias Mailänder
5bf4daddec Set the default game name to the player name. 2021-09-15 18:39:24 +02:00
Paul Chote
54c08748e0 Overhaul player disconnect notifications. 2021-09-12 22:53:50 +02:00
Vapre
5ae4662f08 RunUnsynced, do not recalculate sync hash on reentry. Cache debug settings. 2021-09-12 10:06:44 +02:00
abcdefg30
0b75991fbc Make the editor use an EchoConnection instead of a local server 2021-09-07 20:45:50 +02:00
Paul Chote
e0e219793f Fix shellmap OrderManager use after dispose. 2021-09-02 23:23:23 +02:00
Paul Chote
8f412f869d Move order latency control to the server. 2021-09-02 23:23:23 +02:00
Paul Chote
6421c17515 Rework IConnection implementations:
* EchoConnection is now a trivial buffer that stores
  and repeats orders directly without serialization.

* NetworkConnection no longer subclasses EchoConnection,
  and now also caches local orders without serialization.

* Replay recording was moved to NetworkConnection
  (it is never used on EchoConnection).
2021-09-02 23:23:23 +02:00
Paul Chote
408f30b5cd Extract OrderIO.SerializeOrders helper.
Note: This changes immediate orders to no longer be
individually framed in their own packets.
2021-09-02 23:23:23 +02:00
teinarss
db74f155bb Update DropClient to always drop Connection 2021-09-02 08:05:37 +02:00
Andre Mohren
2c84c43607 Fixed odd sprite size "frame hopping". 2021-09-02 07:34:13 +02:00
Paul Chote
e389c00a11 Remove packet byte wrangling from OrderManager. 2021-08-26 22:00:59 +02:00
Paul Chote
512dee0ac0 Fix rendering glitches with EnableDepthBuffer disabled. 2021-08-25 17:42:44 +02:00
teinarss
b4256df9c1 Cleanup in Connection 2021-08-22 09:43:25 +01:00
Paul Chote
3551eb3128 Fix map preview bounds calculation. 2021-08-21 14:16:02 +02:00
Paul Chote
7f94d67d39 Replace Map.CustomTerrain radar colors with IRadarTerrainLayer.
* TSVeinsRenderer now shows border cells on the radar
* BuildableTerrainLayer now uses the radar colors defined on the individual tiles
* CliffBackImpassabilityLayer no longer overrides the underlying terrain color.
2021-08-21 14:16:02 +02:00
Paul Chote
dcd3e8d444 Ignore terrain slopes when calculating model shadows.
This is less realistic, but better matches the original
game and is the only practical way to reduce visual issues
caused by long shadows being cast over multiple cells.
2021-08-21 13:45:41 +02:00
Paul Chote
68710e48a6 Add terrain orientation support for Mobile. 2021-08-21 13:45:41 +02:00
Paul Chote
c88d1bbefa Add WRot SLerp and axis-angle ctor.
These allow more complex calculations to be made
using rotations.
2021-08-21 13:45:41 +02:00
Paul Chote
27f9f35efb Fix incorrect world height to screen depth conversion. 2021-08-20 20:17:55 +02:00
Paul Chote
ef1aee5e95 Fix and document the depth buffer calculations. 2021-08-20 20:17:55 +02:00
Paul Chote
962d6496bd Overhaul depth preview rendering:
* Replace Jet color map with grayscale
* Added Shift + \ hotkey to toggle preview
* Added Shift + [, Shift + ] hotkeys to change contrast
* Added Shift + ;, Shift + ' hotkeys to change offset
2021-08-20 20:17:55 +02:00
Vapre
2ea2815529 CallFunc, avoid null check. 2021-08-20 12:31:04 +02:00
abcdefg30
b8ba1b36fe Don't throw an exception when creating a hardware cursor fails 2021-08-14 17:11:34 +01:00
teinarss
fba4c5049c Replace Thread.CurrentThread.ManagedThreadId with Environment.CurrentManagedThreadId 2021-08-10 23:02:18 +02:00
abcdefg30
ba7e1319ac Remove DisableWindowsRenderThread and use threaded renderering for non windowed mode 2021-08-07 14:49:09 +01:00
Paul Chote
7a93ff3258 Add support for TS-style tinted target flashes. 2021-08-02 21:50:32 +02:00
Paul Chote
1ecb3bf99a Don't add empty Translations nodes to maps. 2021-07-31 13:14:46 +02:00
Paul Chote
24f64ae1a8 Fix an edge case where the wrong sheet may be mapped to a depth sprite. 2021-07-25 19:20:19 +02:00
Paul Chote
70892a6661 Change DrawSprite calls to provide scales instead of sizes.
This allows us to remove a hacky workaround for calculating
depth offsets when sprites have size.Z == 0.
2021-07-25 00:32:17 +02:00
Vapre
2e6f444285 Map.Contains check grid type once. 2021-07-24 15:34:56 +02:00