Commit Graph

305 Commits

Author SHA1 Message Date
Regalis
5455af24d7 Readded spam filter 2017-06-01 19:37:08 +03:00
Regalis
d6c700b535 Spawning extra cargo 2017-05-24 18:43:21 +03:00
Regalis
095054182e Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Source/GUI/GUITextBlock.cs
	Subsurface/Source/GameMain.cs
	Subsurface/Source/Items/Components/Machines/Radar.cs
	Subsurface/Source/Networking/GameClient.cs
2017-05-17 18:51:22 +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
7dad837733 Server limits chatmessage length and the number of chatmessages written in one packet 2017-05-08 19:06:05 +03:00
Regalis
ba49f59204 Some cleanup (mostly removing redundancies from the GameMain class) 2017-05-03 00:27:13 +03:00
Regalis
ab4e8cee83 The server ignores lastRecvIDs in SYNC_IDS messages if the IDs aren't valid (earlier than the client's previous ID, or more recent than the newest ID).
Should be safer than clamping to the valid range - an incorrectly read packet or a message sent just before switching from midround syncing to normal won't cause the IDs to jump to the newest ID and prevent clients from receiving further msgs/events.
2017-05-02 22:46:37 +03:00
Regalis
df7daa5925 Fixed incorrectly positioned character info boxes in the info menu 2017-04-24 19:08:25 +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
f407a38c9e Fixed clients being able to vote for kicking multiple times by disconnecting and reconnecting 2017-04-18 19:46:57 +03:00
Regalis
e4a7d31f78 If a recipient can't be found for a private message sent by a client, the server sends the "player not found" error message to the client 2017-04-17 19:48:29 +03:00
Regalis
dc6ed7daf1 Separate component style for item UIs + option to select the style in the item config files, removed a bunch of hard-coded UI element color changes 2017-04-10 18:11:33 +03:00
Regalis
887735ff32 - DockingPort syncing fix: server waits until the port is locked before sending hull/gap IDs, clients can't lock the port until the server tells them to
- fixed crew commands being disabled in single player instead of multiplayer
- server-side ID error logging fix
2017-04-09 20:51:57 +03:00
Regalis
0301457a8f A fix to occasional "unknown object header" errors.
If an entity had been removed and it's ID taken by some other entity, clients who hadn't received a message about the removal and the new entity would end up reading ENTITY_POSITION messages for the new entity incorrectly. Reading an incorrect number of bits from the message would also prevent the clients from reading the rest of the data in the packet properly.

Now the server doesn't send position updates to clients during midround syncing (because there's no guarantee they know about the entity yet). Clients also force the read position to the correct place after reading a position update in case something goes wrong when reading the msg.
2017-04-09 19:04:49 +03:00
Regalis
e94a50a29a The server keeps track of which ID a client is going to switch to when midround syncing is done, and switches the ID immediately when the client is in sync (instead of waiting for the client to report the new ID).
Fixes clients occasionally getting kicked out the moment they're in sync, because their latest received ID is still set to the ID of the last unique event and the server thinks they're requesting some old event that doesn't necessarily exist anymore.

+ added a debug command that creates a ton of entity events
2017-04-08 20:10:15 +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
af80a44970 Server doesn't apply distance effects to chat messages sent by someone without a character (e.g. a client in the lobby, the server itself) 2017-04-07 18:12:14 +03:00
juanjp600
e1d5d63dbd Sync monster spawn settings 2017-04-06 16:50:11 -03:00
juanjp600
4ad373294c Update client.UnreceivedEntityEventCount on every event write
I noticed that if the main event IDs went over 10000 and there were more than 450 unique events, the server would sometimes skip the next event the client needed. Sometimes the client would also not realize that the last event it received was the final init event, so it would reject all further events because of a huge ID discrepancy. The init events will likely need to be reworked, but updating UnreceivedEntityEventCount seems to help somewhat.
2017-04-06 12:37:38 -03:00
Regalis
1a3c18c727 EntitySpawner sends spawn/removal messages to clients using EntityEvents.
EntityEvents and EntitySpawner used to work independently of each other, with separate IDs, and there was no guarantee that spawning and events would happen in the correct order. For example, a client could fail to read events during midround syncing because the entity has been removed, or read an event for an incorrect entity because the entity has been removed and the ID taken by some other entity.
2017-03-27 21:05:32 +03:00
Regalis
067db912f4 - EntitySpawner recursively deletes contained items when an item is deleted
- items in the inventories of the characters inside the shuttle are deleted when resetting the respawn shuttle
- fixed host's character not being taken into account when assigning jobs for respawning characters if the host is not respawning
2017-03-24 18:49:55 +02:00
Regalis
fe4a8b419d Chatmessage GUITextBlock height matches the height of the message (-> multi-line messages don't overlap), fixed the name of the server being added to server chatmessages if there are no recipients 2017-03-20 20:52:10 +02:00
Regalis
8d8620047d Fixed clients who leave a server and re-join becoming desynced and not being kicked by the server.
The clients didn't reset their ChatMessage.LastID, which caused an exception to be thrown when clamping the chatmsg ID server-side, preventing the server from updating the lastRecvEntityEventID of the client later in the method. The server wouldn't kick the client, because ServerEntityEventManager wouldn't handle cases where a client is waiting for an event that doesn't exist anymore.
2017-03-14 22:43:15 +02:00
Regalis
4a37dab3ca Fixed hosts character being taken into account in both teams' job assignment 2017-03-14 19:50:40 +02:00
Regalis
3f590da395 Fixed AddToGUIUpdateList crashes (I think):
The callbacks from the async requests to master server only assign the response to a variable, preventing GUIComponents from being manipulated from two threads simultaneously
2017-03-14 17:27:15 +02:00
Regalis
8c659e2a08 Server checks if midround syncing is needed when a client is in the game (i.e. loaded the sub, etc), not when the client requests the start message. Some clients take longer to start the round than others, and they may miss unique messages even if they were in the lobby when the round started.
Clients also get extra 10 seconds to receive newly created events after the midround syncing is done
2017-03-13 21:50:01 +02:00
Regalis
3f1f2d23f2 Server sends the maximum number of players to the master server instead of the maximum number of connections, case-insensitive chat message commands 2017-03-13 20:53:35 +02: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
Regalis
c851770386 Fixed "trying to read past the buffer size" errors caused by item updates sent by clients, midround syncing timeout period is calculated based on the number of events the client needs to receive 2017-03-11 12:49:08 +02:00
Regalis
a1342fdc45 Server-side file transfer UI, server notifies the recipient of a file transfer if the transfer is cancelled, fixed TextGetter not working on wrapped GUITextBlocks 2017-03-10 19:16:17 +02:00
Regalis
6a31d56175 Fixed mid-round joining clients automatically getting kicked out because they're missing old events
Now they're kicked out if they're not in sync within 10 seconds of joining, TODO: calculate a reasonable timeout based on the amount of events and/or give the client more time if they keep receiving events
2017-03-09 21:40:58 +02:00
Regalis
e406b76cd5 Some more logic to handle missing sub files and active file transfers when starting a round:
- server waits for transfers to finish before starting the round (up to a max 20 seconds, can be skipped by the host)
- clients enable the spectate button when the round starts (in case they fail to start the round due to a missing sub file or an error)
- clients notify the server if a transfer is cancelled

+ FileReceivers can't be instantiated if a server is running
2017-03-09 19:56:27 +02:00
Regalis
6bae2cf47b File transfers (somewhat) working. Todo: testing, show active transfers in the UI 2017-03-07 23:01:01 +02:00
Regalis
5450ff498a Progress on file transfers (class for receiving files, FileSender can transfer multiple files to the same recipient simultaneously) 2017-03-07 20:03:40 +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
juanjp600
ecb7500df9 Converted UInt32 ID's to UInt16
TODO: test everything, make sure nothing broke
2017-03-06 16:25:12 -03:00
Regalis
c96fcf7f34 Clients can't use headsets that are in the inventory 2017-03-03 20:31:07 +02:00
Regalis
65625777e5 Monster syncing fixes:
- clients freeze and disable AI characters if no updates have been received in a while (due to the monster being far away from player-controlled characters at the servers side for example)
- server disables AI characters that are too far for updates to be sent to clients (-> targets of monster missions can't swim away from the spawnpos and cause the clients' sonars to point to an incorrect position)
2017-03-01 23:14:15 +02:00
juanjp600
7935ecce46 - fixed crash in UpdateVoteStatus
- fixed clients reconnecting automatically after being kicked for desync
2017-03-01 17:04:51 -03:00
juanjp600
e681a2d29a Clients that are waiting for very old events are kicked 2017-03-01 16:40:07 -03:00
Regalis
27a883349c Server keeps a reference to the StartGame coroutine and checks if it has stopped running before the round has started, and if so, resets autorestart timer and start button (i.e. an exception at any point during startup will trigger the reset) 2017-02-27 21:30:39 +02:00
Regalis
12466e304e Fixed server failing to start a round if there's a selected cargo spawnpoint is not inside a hull 2017-02-25 15:03:10 +02:00
Regalis
3fcaff0288 Merge branch 'master' into new-netcode
Conflicts:
	Subsurface/Properties/AssemblyInfo.cs
2017-02-22 23:33:14 +02:00
Regalis
d7aba531d7 Server port included in refresh and remove requests to master server, spectators see indicators for both subs during combat missions 2017-02-21 20:57:04 +02:00
Regalis
502211c6a7 Resetting entity event IDs (lastSentToAll & client-specific IDs) when a round ends 2017-02-20 20:26:12 +02:00
Regalis
6c8f5b8999 The server maintains a list of unique EntityEvents created during the round and sends them to clients who join mid-round 2017-02-18 15:09:13 +02:00
juanjp600
c46856167c Stopped server events that hadn't been sent to everyone from being removed 2017-02-16 20:34:29 -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
d46207916f Server doesn't send character position updates to far-away clients, clients disable characters if they haven't received position updates in a while 2017-02-07 18:59:25 +02:00