Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix query combiner bug resulting in lost write queries.

- This was the cause of the issue that resulted in some servers not
  being marked as offline expectedly.  If the query combiner ran
  out of space, buffered queries were lost due to the wrong query
  variable being executed.
  • Loading branch information...
commit 5efe7ad814f13ba869f772cca06bb222879d44e9 1 parent 6406ec6
@SkywingvL authored
View
15 NWNMasterServer/NWGameServer.cs
@@ -49,10 +49,11 @@ public NWGameServer(NWMasterServer MasterServer, IPEndPoint ServerAddress)
/// Save the server to the database. The server is assumed to be
/// locked.
/// </summary>
- public void Save()
+ /// <returns>True if the save was successful.</returns>
+ public bool Save()
{
if (MasterServer.ConnectionString == null)
- return;
+ return false;
try
{
@@ -187,7 +188,10 @@ public void Save()
Logger.Log(LogLevel.Error, "NWGameServer.Save(): Failed to save server {0}: Exception: {1}",
ServerAddress,
e);
+ return false;
}
+
+ return true;
}
/// <summary>
@@ -712,7 +716,12 @@ private void HeartbeatTimer_Elapsed(object sender, ElapsedEventArgs e)
ActivePlayerCount = 0;
Online = false;
Expired = true;
- Save();
+
+ if (!Save())
+ {
+ Logger.Log(LogLevel.Error, "NWGameServer.HeartbeatTimer_Elapsed(): Server {0} could not be saved as expired.", this);
+ Expired = false;
+ }
}
}
View
2  NWNMasterServer/NWMasterServer.cs
@@ -261,7 +261,7 @@ public void ExecuteQueryNoReaderCombine(string Query)
QueryCombineTimer.Start();
if (DirectQuery != null)
- MySqlHelper.ExecuteNonQuery(ConnectionString, Query);
+ MySqlHelper.ExecuteNonQuery(ConnectionString, DirectQuery);
}
catch (Exception e)
{
Please sign in to comment.
Something went wrong with that request. Please try again.