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;
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
while (!CanStart && !connectCancelled)
@@ -288,6 +288,7 @@ namespace Barotrauma.Networking
else
{
requiresPw = false;
reqAuthTime = DateTime.Now + new TimeSpan(0, 0, 0, 0, 200);
}
needAuth = false; //got auth!
}
+23 -21
View File
@@ -354,22 +354,6 @@ namespace Barotrauma.Networking
foreach (Client c in connectedClients)
{
if (gameStarted)
{
if (c.inGame)
{
ClientWriteIngame(c);
}
else
{
}
}
else
{
ClientWriteLobby(c);
}
//slowly reset spam timers
c.ChatSpamTimer = Math.Max(0.0f, c.ChatSpamTimer - deltaTime);
c.ChatSpamSpeed = Math.Max(0.0f, c.ChatSpamSpeed - deltaTime);
@@ -457,7 +441,7 @@ namespace Barotrauma.Networking
// if 30ms has passed
if (updateTimer < DateTime.Now)
{
if (gameStarted)
/*if (gameStarted)
{
float ignoreDistance = FarseerPhysics.ConvertUnits.ToDisplayUnits(NetConfig.CharacterIgnoreDistance);
@@ -478,14 +462,32 @@ namespace Barotrauma.Networking
//if (FarseerPhysics.ConvertUnits.ToSimUnits(diff.Length()) > NetConfig.CharacterIgnoreDistance) continue;
}
}
}*/
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;
}
@@ -187,6 +187,7 @@ namespace Barotrauma.Networking
//new client
Client newClient = new Client(clName, GetNewClientID());
newClient.lastRecvChatMsgID = ChatMessage.LastID;
newClient.Connection = unauthClient.Connection;
unauthenticatedClients.Remove(unauthClient);
unauthClient = null;