Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Networking Enhancements #4

Merged
merged 4 commits into from
Jul 9, 2017
Merged

Conversation

SunnyBat
Copy link
Contributor

@SunnyBat SunnyBat commented Jul 8, 2017

Fix server crashes due to network read/write failures, Socket failures. Remove player model when disconnected.

-Fix server crash on hard disconnect
-Detect client disconnect
-Remove player object from server+other clients when disconnected
-Disconnect packet added
-Disconnect command added
-Made Disconnect packet serializable
-Wrapped Socket read/writes in try/catch blocks
-Made playersById in Listener a Dictionary with outside locking
--Internal synchronization will not work against outside iteration+modification
--Don't use two locks for no reason; ConcurrentMap is no longer needed
-Round two for trying to remove inactive player objects
-Only allowed to connect to one server at a time
-Display connected/disconnected messages in-game
-Fixed Disconnect packet processing (round 3)
-Fixed multiple Mono Behavior loading
-Only process packets if connected to server
--Possible issue: Packets will be sent, user will disconnect, the next reconnect will process these old packets first
-More error handling - server should not crash from connects/disconnects
-Fixed ClientTester crash
-Fixed issue where a disconnection without authenticating would cause a server crash
@@ -14,7 +14,10 @@ namespace NitroxServer
{
public class Listener
{
private ConcurrentMap<String, Player> playersById = new ConcurrentMap<String, Player>();
// A ConcurrentMap will not protect against concurrency issues when

This comment was marked as abuse.

}
}
}

private void SendCompleted(IAsyncResult ar)
{
Thread.Sleep(40);

This comment was marked as abuse.

[Serializable]
public class Disconnect : Packet
{

This comment was marked as abuse.

if (connection.Open)
{
connection.BeginReceive(new AsyncCallback(DataReceived));
} else

This comment was marked as abuse.


private void outputMessage(String msg)
{
if (testClient)

This comment was marked as abuse.

@Sunrunner37 Sunrunner37 merged commit f026115 into SubnauticaNitrox:master Jul 9, 2017
nesrak1 pushed a commit to nesrak1/Nitrox that referenced this pull request Aug 29, 2017
Measurity referenced this pull request in Measurity/Nitrox Feb 1, 2020
dartasen pushed a commit to dartasen/Nitrox that referenced this pull request Apr 15, 2023
.ToHashSet() doesn't exist in .NetStandard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants