Commit Graph

74 Commits

Author SHA1 Message Date
Regalis
0e5cfbb579 Reactor autotemp is logged 2017-06-02 17:25:42 +03:00
Regalis
c2d918073e Serverlog message types (which atm only determine the color of the message) 2017-05-09 19:56:12 +03:00
Regalis
bee570e2e3 - the server log view is not cleared when saving the log (but old messages are removed when going over the max number of lines)
- log can be viewed in the server lobby, not just in-game
- logging pump, reactor & battery state usage
- GUIListBox.MouseRect doesn't return an empty rect anymore -> listboxes without selectable content can be scrolled with the mouse wheel
2017-05-08 21:30:54 +03:00
Regalis
89941229f8 A reference to the character who triggered a signal is passed to all the recipients of the signal. Allows more accurate server logging: using doors, docking ports or turrets is now properly logged. 2017-04-28 18:10:47 +03:00
Regalis
64c109f13b Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Source/Characters/AI/EnemyAIController.cs
	Subsurface/Source/DebugConsole.cs
	Subsurface/Source/Items/Components/Machines/Radar.cs
	Subsurface/Source/Items/Item.cs
2017-04-27 21:33:44 +03:00
Regalis
1dad5d9bf4 Passive sonar: when not active, the sonar shows nearby sources of sound and a faint outline of the structures around them. Now it's much easier to monitor how much noise the sub is making and to hide from enemies.
+ Changed the visuals of the sonar a bit. The current rendering method is very inefficient though, todo: write a shader
2017-04-24 21:13:54 +03:00
Regalis
31f7eca717 Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Source/GUI/GUIButton.cs
	Subsurface/Source/GameSession/CrewManager.cs
	Subsurface/Source/GameSession/GameSession.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Screens/MainMenuScreen.cs
	Subsurface/Source/Screens/ServerListScreen.cs
2017-04-23 21:40:11 +03:00
Regalis
9a36df0f52 ItemComponent syncing fixes:
- Relay and lightcomponent states are synced (otherwise clients won't be notified if the state is, for example, toggled by a signal from a button).
- Clients don't play door sounds if a signal attempts to set the state to the same value as the predicted state, but DO play if a correction from the server changes the state from the predicted one.
- Clients are notified if a reactor receives a shutdown signal.
- Powercontainer updates are sent if the charge changes by 1%, not by 1 unit.
2017-04-11 20:38:07 +03:00
Regalis
347f549ac1 Reactors, sonars, nav terminals, pumps and batteries use similar delayed correction logic as doors and inventories.
I.e. the clients delay correcting the state of the item until the local player stops manipulating the state (atm the delay is 1 sec). Prevents pumping speeds, steering directions and whatnot from switching to an old state and back - now the corrections should not be visible to the players unless the client predicts the state wrong.
2017-04-11 00:48:53 +03:00
Regalis
fac31b4892 - Fixed railgun sounds not playing at the clients' end
- Server sends updates for batteries when their charge changes (not strictly necessary assuming the rest of the electrical grid stays in sync, but just in case)
- Reactor state is synced with clients if modified through the debug console
- Increased maximum item velocity to 64 units/s, all item are clamped to the max vel
2017-04-10 20:13:33 +03:00
Regalis
3844dd9dac GUIStyle logic changes: instead of having a predetermined GUIComponentStyle for each type of GUIComponent, any GUIComponent can use any style. The GUIComponent constructors take the name of the style as a parameter, and if no style is specified, the default style for the GUIComponent in question will be used. 2017-04-08 16:46:53 +03:00
Regalis
5bdb57b98a Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Characters/AICharacter.cs
	Subsurface/Source/Characters/Animation/HumanoidAnimController.cs
	Subsurface/Source/Characters/Character.cs
	Subsurface/Source/GameMain.cs
	Subsurface/Source/Items/Components/Signal/Connection.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Networking/GameServerLogin.cs
	Subsurface/Source/Physics/PhysicsBody.cs
2017-03-11 13:24:09 +02:00
juanjp600
d6c292a2cc SharpFont + ScalableFont implementation
https://github.com/Robmaister/SharpFont

TODO: replace Code Bold.otf with the full version, fix any bugs, build on Linux, possibly move ToolBox string wrapping and limiting logic to ScalableFont class for better results.
2017-03-07 13:44:42 -03:00
Regalis
52bf73722f ServerEntityEventManager doesn't process received events until the character inputs of the client for the corresponding frame have been processed (fixes character movement lagging behind EntityEvents at the servers side)
+ split character networking logic into a separate file, characters drop items at the position of their collider instead of hands
2017-02-09 23:09:42 +02:00
Regalis
1f454d593e Inventory syncing, objHeader is passed to the ClientRead/ServerRead methods so they can determine how to read the msg (is it an inventory update, position, input, etc) 2016-12-10 16:39:58 +02:00
Regalis
fa712e0102 Checking if a client can access an item in the itemcomponent serialization methods 2016-12-09 16:56:17 +02:00
Regalis
adde3461ea Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
	Subsurface/Source/Characters/Animation/HumanoidAnimController.cs
	Subsurface/Source/Characters/Character.cs
	Subsurface/Source/Items/Components/Door.cs
	Subsurface/Source/Items/Components/Power/PowerContainer.cs
	Subsurface/Source/Items/Components/Signal/Wire.cs
	Subsurface/Source/Items/Item.cs
	Subsurface/Source/Networking/ChatMessage.cs
	Subsurface/Source/Networking/GameClient.cs
	Subsurface/Source/Networking/GameServer.cs
	Subsurface/Source/Networking/GameServerLogin.cs
	Subsurface/Source/Networking/GameServerSettings.cs
	Subsurface/Source/Networking/NetworkMember.cs
2016-11-24 19:52:40 +02:00
juanjp600
d2c17274fe GUI elements now respect render order + some minor distance comparison optimization 2016-11-15 22:26:36 -03:00
Regalis
3d234aef73 Sending NetEntityEvents from client to server, ItemComponent class doesn't implement the INetSerializable interfaces (only the derived classes do), reactor syncing 2016-11-13 19:34:23 +02:00
Regalis
498c72c64a Server sends ServerEntityEvents to clients, NetEntityEvents can contain an object array which will be passed to the serializable entity (now only used for ItemComponent indices) 2016-11-13 13:56:48 +02:00
Regalis
c314b37029 Some classes for syncing entity state changes. Similar to the NetworkEvents in the old netcode, but the logic is split into separate classes which prevent the server from reading updates for entities that aren't IClientSerializable.
todo: add NetEntityEventManagers to server & client, some logic to prevent sending events that don't need to be sent (e.g. duplicate event state updates)
2016-11-12 20:56:06 +02:00
juanjp600
f0acf69065 Merge remote-tracking branch 'barotrauma/master' into new-netcode
# Conflicts:
#	Subsurface/Properties/AssemblyInfo.cs
#	Subsurface/Source/Characters/AI/EnemyAIController.cs
#	Subsurface/Source/Characters/AICharacter.cs
#	Subsurface/Source/Characters/Character.cs
#	Subsurface/Source/Items/Components/Signal/Connection.cs
#	Subsurface/Source/Items/Item.cs
#	Subsurface/Source/Map/Structure.cs
#	Subsurface/Source/Networking/GameClient.cs
#	Subsurface/Source/Networking/GameServer.cs
#	Subsurface/Source/Screens/NetLobbyScreen.cs
2016-11-05 18:18:20 -03:00
Regalis
eb2c51c2f1 Cleanup with resharper (mostly removing redundancies & using collection.Length/Count properties instead of the Count method) 2016-10-31 20:50:20 +02:00
Regalis
9fed308705 InGame update messages include a timestamp which is passed to the ClientRead methods
Now only used in character position syncing, but some other entities may also have an use for it (e.g. discarding outdated data)
2016-10-18 19:04:32 +03:00
juanjp600
f5268c7c6c Fixes
It compiles now, but it's probably really broken.
2016-10-11 21:37:23 -03:00
juanjp600
e1296e4a8e Backported vsync changes from new-netcode, WIP hull visibility culling
The hull culling functions are there, they just aren't being used right now because there are some annoying bugs.
2016-10-02 22:24:31 -03:00
juanjp600
33641ead3e Fixed timestep for some GUI & input code
Fixed timestep only applied to the physics simulation, but input and GUI updates were not being handled properly, so here's some progress into fixing them.
2016-09-18 11:03:52 -03:00
juanjp600
bfd8bc6b35 Server serialization functions require client 2016-09-07 17:32:20 -03:00
Regalis
cf77a59c97 Implemented some of the itemcomponent read/write methods, made submarines server serializable 2016-09-02 17:59:08 +03:00
juanjp600
af220dbc2a Removed Fill/ReadNetworkData
These functions needed to be replaced because they rely heavily on reliability.

Instead, new functions called (Write/Read)Data(Server/Client) will be added. 

Separating client and server code into completely separate functions will help ensure that proper security checks are performed.
2016-08-29 20:02:46 -03:00
Regalis
6c5452570e More sanity checks to make sure clients aren't doing something they're not allowed to:
- AICharacter, hull, structure and submarine updates from clients are ignored
- character updates from anyone else than the client controlling the character are ignored
- players can't pick/drop items from anyone else's inventory (unless the target is unconscious/stunned/cuffed)
- server has authority over reactor temperature
2016-08-16 17:56:33 +03:00
Regalis
19915fc4e5 - server log and item lists in editor can be filtered
- changes to item highlighting logic (easier in cramped subs)
- sub name/description boxes and selected items are reset when leaving the editor
2016-07-06 18:10:22 +03:00
Regalis
b4af92ace2 Small optimization: items have a list of components that have to be drawn 2016-05-24 21:17:38 +03:00
Regalis
ed529052a2 - relaycomponent inherits from powertransfer, so that they're included when calculating the load/power for the grid
- deactivated powertransfer components don't carry power
- fixed reactor graph lines going over the graph if load > 10 000
2016-05-24 19:17:42 +03:00
Regalis
d3ab7946a8 Using ToLowerInvariant instead of ToLower (the game works for Turkish players now!)
http://www.moserware.com/2008/02/does-your-code-pass-turkey-test.html
2016-04-27 17:14:09 +03:00
Regalis
c5685db0aa - handheld sonar
- junction boxes, sonar monitors, navigation terminals and engines break down if they're underwater long enough
- reactor cools down if it's underwater
- job-specific gear are grouped by job in separate .xml files
2016-04-09 14:31:59 +03:00
Regalis
5f05db7ca4 - fixed "signal loops" causing StackOverFlowExceptions (now the signals can only take 10 "steps" between components per frame)
- parameter for changing the output value of And/Or components when the input conditions aren't met
- or components work properly now
- a limited number of signals (100) can be queued in a delay component
2016-04-02 02:25:44 +03:00
Regalis
d713874bd6 Tweaked AITarget ranges: now it's possible to evade some monsters by stopping the sub and/or turning off noisy devices, AITarget ranges can be made visible by entering "ShowAITargets" in the console, misc cleanup 2016-03-12 21:35:21 +02:00
Regalis
d1580328ed Some cleanup using ReSharper (mostly removing redundancies) 2016-03-12 15:32:34 +02:00
Regalis
c605adf879 Fixed networkevents crashing due to client trying to access server.connectedclients 2016-02-19 17:18:31 +02:00
Regalis
94e34c0ed9 Molochs can damage characters, server log UI, stun weapons have a longer stun time, characters can't breathe when wearing a diving suit with no oxygen tank 2016-02-14 19:05:03 +02:00
Regalis
bec6d95198 Server log, ai characters steer away from the abyss 2016-02-14 16:47:23 +02:00
Regalis
6de5bac61b Only limbs with enough mass can cause impact damage to the sub, basictutorial changes, prevent ragdolls from teleporting inside submarinebody 2016-02-07 23:18:51 +02:00
Regalis
201dc1b733 Supercapacitors have much higher max output but smaller capacity, fixed not being able to drag wire nodes in editor, batteries working properly now 2016-02-07 12:32:19 +02:00
Regalis
6db3062cc8 dmgn 2016-02-05 19:34:10 +02:00
Regalis
7098a9a5e0 v0.3:
- Launcher checks whether a patch is newer than the current version instead of going through the patches until the current version is found
- CharacterHUD is drawn under crew commander and other UI elements
- All structures other than the command room windows are restored to full health in tutorial
- Longer cooldown for moloch attacks
- AIObjectiveCombat always overrides current order
2016-01-23 14:37:00 +02:00
Regalis
c78784068c -fixed a typo in fabricableItem requirement & added checking for said typos
- fixed being able to set battery recharge sped over the limits
- fixed vents being added to OxygenGenerator.ventlist multiple times
- fixed item.Submarine not being set if pulling an item from a fabricator
- some tutorial fixes
- fixed TraitorMode endmessage not being shown if the sub isn't at the end and neither character is dead
- SalvageQuest fails if the item has been destroyed
-
2016-01-21 20:59:26 +02:00
Regalis
1a5b3fa66a Endworm attacks working, itemlabel text saving bugfix, deconstructors & fabricators need power, engine sprite, disable wire node dragging in character mode, only hit with one meleeweapon at a time, fixrequirement text overflow fix, mapentities can hace multiple categories, Gap.FindHull fix, Waypoint ladder & gap saving, stuff 2016-01-18 20:09:38 +02:00
Regalis
0fc085c86d Item UI replacements, fabricator bugfix, randomly spawning artifacts, AI can fix leaks, LimbAttacks do damage once (not each frame for the duration of the attack) 2016-01-14 21:06:08 +02:00
Regalis
eb20af622d Limb collisions can damage hull again, new UI for steering, sonar & reactor, fabricators can require more than one of each ingredient, timer for character imploding, AICharacter position syncing changes, watcher, commands can also be given to controlled character 2016-01-13 22:19:01 +02:00