Minor fixes and tweaks

This commit is contained in:
juanjp600
2016-09-01 22:22:45 -03:00
parent 51dd858af1
commit e0b6642767
4 changed files with 34 additions and 30 deletions
+2 -1
View File
@@ -199,7 +199,7 @@ namespace Barotrauma.Networking
bool CanStart = false; bool CanStart = false;
DateTime timeOut = DateTime.Now + new TimeSpan(0,0,20); DateTime timeOut = DateTime.Now + new TimeSpan(0,0,20);
DateTime reqAuthTime = DateTime.Now + new TimeSpan(0, 0, 1); DateTime reqAuthTime = DateTime.Now + new TimeSpan(0, 0, 0, 0, 200);
// Loop until we are approved // Loop until we are approved
while (!CanStart && !connectCancelled) while (!CanStart && !connectCancelled)
@@ -288,6 +288,7 @@ namespace Barotrauma.Networking
else else
{ {
requiresPw = false; requiresPw = false;
reqAuthTime = DateTime.Now + new TimeSpan(0, 0, 0, 0, 200);
} }
needAuth = false; //got auth! needAuth = false; //got auth!
} }
+20 -18
View File
@@ -354,22 +354,6 @@ namespace Barotrauma.Networking
foreach (Client c in connectedClients) foreach (Client c in connectedClients)
{ {
if (gameStarted)
{
if (c.inGame)
{
ClientWriteIngame(c);
}
else
{
}
}
else
{
ClientWriteLobby(c);
}
//slowly reset spam timers //slowly reset spam timers
c.ChatSpamTimer = Math.Max(0.0f, c.ChatSpamTimer - deltaTime); c.ChatSpamTimer = Math.Max(0.0f, c.ChatSpamTimer - deltaTime);
c.ChatSpamSpeed = Math.Max(0.0f, c.ChatSpamSpeed - deltaTime); c.ChatSpamSpeed = Math.Max(0.0f, c.ChatSpamSpeed - deltaTime);
@@ -457,7 +441,7 @@ namespace Barotrauma.Networking
// if 30ms has passed // if 30ms has passed
if (updateTimer < DateTime.Now) if (updateTimer < DateTime.Now)
{ {
if (gameStarted) /*if (gameStarted)
{ {
float ignoreDistance = FarseerPhysics.ConvertUnits.ToDisplayUnits(NetConfig.CharacterIgnoreDistance); float ignoreDistance = FarseerPhysics.ConvertUnits.ToDisplayUnits(NetConfig.CharacterIgnoreDistance);
@@ -478,12 +462,30 @@ namespace Barotrauma.Networking
//if (FarseerPhysics.ConvertUnits.ToSimUnits(diff.Length()) > NetConfig.CharacterIgnoreDistance) continue; //if (FarseerPhysics.ConvertUnits.ToSimUnits(diff.Length()) > NetConfig.CharacterIgnoreDistance) continue;
} }
} }*/
if (server.ConnectionsCount > 0) if (server.ConnectionsCount > 0)
{ {
if (sparseUpdateTimer < DateTime.Now) SparseUpdate(); if (sparseUpdateTimer < DateTime.Now) SparseUpdate();
foreach (Client c in ConnectedClients)
{
if (gameStarted)
{
if (c.inGame)
{
ClientWriteIngame(c);
}
else
{
ClientWriteLobby(c);
}
}
else
{
ClientWriteLobby(c);
}
}
} }
updateTimer = DateTime.Now + updateInterval; updateTimer = DateTime.Now + updateInterval;
@@ -187,6 +187,7 @@ namespace Barotrauma.Networking
//new client //new client
Client newClient = new Client(clName, GetNewClientID()); Client newClient = new Client(clName, GetNewClientID());
newClient.lastRecvChatMsgID = ChatMessage.LastID;
newClient.Connection = unauthClient.Connection; newClient.Connection = unauthClient.Connection;
unauthenticatedClients.Remove(unauthClient); unauthenticatedClients.Remove(unauthClient);
unauthClient = null; unauthClient = null;