Commit Graph

886 Commits

Author SHA1 Message Date
juanjp600
a75ef8ee51 Optimized MaxVal
0x200 represents a bit that isn't used for any flags, 0x1FF represents all usable bits
2017-01-08 12:45:44 -03:00
juanjp600
073def094f Merge branch 'new-netcode' of https://gitlab.com/poe.regalis/barotrauma into new-netcode
# Conflicts:
#	Subsurface/Source/Characters/Character.cs
2017-01-08 12:30:56 -03:00
juanjp600
4b868fc09d Constant error correction + fixed standing catchup
With constant correction, there's little chance for a large difference to build up, so it becomes practically unnoticeable.
Also added a flag which stops the character from updating client-side until the server sends the spawning position.
2017-01-08 12:20:36 -03:00
Regalis
05cb5989dc Chat range also affects the server host if they're controlling a character, fixed missing sender names in the server lobby 2017-01-07 20:24:01 +02:00
Regalis
6747faae3d Clients can't make their character immortal by not sending inputs, clients don't implode their characters unless the server says so 2017-01-07 19:25:22 +02:00
Regalis
402c745fc3 Reimplemented chat range & radio messages. Each client now has their own chatMsgQueue, so all chat messages don't have to be sent to all clients. 2017-01-07 19:22:48 +02:00
Regalis
44cbd0d9bf Fixed AI characters constantly flipping over the X-axis when inside, fixed clients not receiving a msg about characters spawned by RespawnManager 2017-01-07 16:51:51 +02:00
Regalis
6364915353 Fixed incorrect msg lengths in CHARACTER_POSITION messages (+ calculating the length automatically) 2017-01-07 16:11:50 +02:00
juanjp600
7dc474dab4 Actually round movement.X down to zero
whoops
2017-01-06 16:05:23 -03:00
juanjp600
f453980ace Replaced isStillCountdown with a speed check for server catch-up 2017-01-06 14:09:06 -03:00
Regalis
5d83a33876 Notifying clients when the round ends 2017-01-06 19:06:11 +02:00
Regalis
65d64af041 Server reads CHARACTER_INPUT messages even if the client isn't allowed to move (but ignores the inputs), otherwise it would fail to read the rest of the packet 2017-01-06 18:19:51 +02:00
Regalis
2a7ef5dd84 Merge branch 'new-netcode' of https://gitlab.com/poe.regalis/barotrauma into new-netcode 2017-01-06 17:43:40 +02:00
Regalis
80e743916a Character death syncing, characters don't reselect items when they receive a network msg about an item they have already selected 2017-01-06 17:43:30 +02:00
juanjp600
5b4d6120ff Merge branch 'new-netcode' of https://gitlab.com/poe.regalis/barotrauma into new-netcode 2017-01-05 22:37:45 -03:00
juanjp600
0569a665f4 Fixed a server-side off-by-one error in the player input IDs
I'm guessing this one comes from the player's position not being updated immediately after the input is processed, so that's where most of the remaining error came from.
Also added some rounding to the horizontal velocity when approaching 0, and changed something that depended on the head limb to use the collider instead, which should hopefully further reduce the chance of syncing errors.
2017-01-05 22:37:14 -03:00
Regalis
beac45458e Transforming received in-sub mouse coordinates to outside coordinates if the character is outside and vice versa, HiddenSubPosition fix (can't use Level.Loaded to find the top of the level because the level isn't loaded yet) 2017-01-05 19:08:54 +02:00
Regalis
518eea746e Transforming in-sub MemPos/MemLocalPos coordinates to outside coordinates if the character is outside and vice versa, server doesn't start sending ingame updates until they receive the first ingame update message from the client (no need to send updates while the client is loading or if they fail to start the round) 2017-01-05 18:16:58 +02:00
Regalis
ba4ee843f3 Syncing character/construction selection 2017-01-04 21:37:19 +02:00
Regalis
7a40658fba derp 2017-01-04 20:46:51 +02:00
Regalis
179079b91c Clients can't set the health or stun timer of a character unless they receive a msg from the server 2017-01-03 23:52:15 +02:00
Regalis
bb685019a2 Fixes to unconscious character pos syncing:
- main limb is anchored to collider
- server ignores inputs from unconscious characters and doesn't freeze them
- using timestamp-based interpolation on the client's own character instead of IDs
2017-01-03 23:49:37 +02:00
Regalis
1eea373117 NetEntityEvent fixes:
- comparing event data equality with Object.Equals instead of == because == returns false for boxed value types
- fixed old unacked messages not being resent if there are newer unacked messages that have been resent less than 1.5 * RTT ago
2017-01-03 20:10:03 +02:00
Regalis
1fb15f5589 The collider position of the controlled character is synced with the same interpolation logic as the rest of the characters when unconscious/stunned (todo: make the ragdoll follow the collider even when unconscious/dead/stunned) 2017-01-02 22:40:00 +02:00
Regalis
c318e629ff Health, bleeding, oxygen & stun syncing, sending aim and use inputs and cursor positions to clients so other players will be able to see when someone is shooting, hitting with a wrench etc 2017-01-02 22:12:50 +02:00
Regalis
9c07038fef Cleanup 2017-01-01 23:23:54 +02:00
Regalis
e358ea9917 MonsterEvents and ArtifactEvents spawn the monsters/items during initialization instead of waiting for the round to start (prevents entity ID mismatches if a client starts the event before receiving a message about something the server has spawned) 2017-01-01 23:14:24 +02:00
Regalis
1bba276949 Fixed OnMapLoaded not being called on MapEntities that don't belong to any sub (due to this, gaps weren't created on doors in alien ruins until the game starts running, which occasionally caused entity ID mismatches between clients and the server) 2016-12-30 18:01:15 +02:00
Regalis
1f07b18e5b Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Items/Components/DockingPort.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
2016-12-29 22:18:27 +02:00
Regalis
020aac55ea AICharacter position syncing 2016-12-29 22:01:50 +02:00
Regalis
98183c47fb Syncing aim & use inputs (i.e. left and right click) 2016-12-28 22:33:43 +02:00
Regalis
12b7290bad Fixed Ragdoll.HeadInWater not being set to true if the character is inside a water-filled hull but the head is outside the sub, HUDProgressBars aren't created when a non-controlled character repairs something 2016-12-28 20:00:40 +02:00
Regalis
49d4108eeb Fixed character colliders sinking/floating away when using a railgun controller underwater 2016-12-28 19:56:52 +02:00
juanjp600
a733e917dd Readded input enum flags 2016-12-24 18:14:54 -03:00
Regalis
c3d29e41ad Additional null check in Wire Update, stopping paused sounds before deleting them (prevents an OpenAL error when switching to sub editor when the mainmenu drone sound is playing) 2016-12-21 20:35:38 +02:00
Regalis
c01ac33e1d Option to configure damage sounds for structures with a specific tag, some new sounds 2016-12-21 00:07:25 +02:00
Regalis
32c7edba1c Explosion damage calculations take the size of the limbs into account (e.g. it's possible to damage endworms with explosives that have a damage radius less than 600) 2016-12-20 19:28:25 +02:00
Regalis
dd46ce1d98 Adjusting submarine spawnposition if the sub (or any docked subs) intersect with walls 2016-12-20 16:11:47 +02:00
Regalis
5e8a01636e Fixed exception when trying to remove a limb with no sprite 2016-12-20 16:10:47 +02:00
Regalis
311f388358 Limbs with no sprite don't cause the game to crash anymore, lightsources attached to a limb are drawn at the interpolated position (= DrawPosition) of the limb, lightTexture origin is flipped on the X-axis when parent limb flips 2016-12-17 14:24:54 +02:00
Regalis
b01b38da68 Bunch of new sounds by Omniary, some charactersound & soundplayer refactoring 2016-12-15 21:42:15 +02:00
Regalis
5db3315bf3 The "check updates" tickbox in the launcher can be clicked again, nicer changelog formatting in the launcher, setting kb focus to the item searchbox in sub editor automatically 2016-12-14 19:53:06 +02:00
Regalis
d6ba825baf Wire nodes can't be moved when editing wire connections, all mapentities are deselected when toggling wiring/character mode 2016-12-14 18:09:29 +02:00
Regalis
0e1c94e928 Resyncing netlobby if starting a shift fails (-> autorestart timer resets also at the clients' end) 2016-12-14 17:48:17 +02:00
Regalis
d7ed27381f List of linkable subs in the editor is refreshed after saving a new sub 2016-12-14 17:00:09 +02:00
Regalis
a2f19a3b16 The size of the docked subs is taken into account when generating the level 2016-12-13 23:21:47 +02:00
Regalis
2ef7c2f996 Preventing ruins from spanning above the top of the level 2016-12-13 23:14:41 +02:00
Regalis
40c28a11de Docked subs are forced to correct positions during loading and the docking is "locked" (subs won't get stuck inside each other even if the linked sub is placed incorrectly in the editor) 2016-12-13 23:12:56 +02:00
Regalis
73eb6a2f1b Pausing all sounds when switching to editor screen, temp save folder is cleared before saving (fixes unnecessary files being included in saves) 2016-12-13 23:10:52 +02:00
Regalis
6a189c6ec4 Fix for "collection was modified" exceptions when removing entities using delete or Ctrl+X 2016-12-12 15:01:50 +02:00