Now that I uploaded to the server I get a very strange error:
Code for event Started ran for too long
1014ms. The maximum runtime is 100ms
at System.Net.UnsafeNclNativeMethods.WinHttp.WinHttpDetectAutoProxyConfigUrl(UInt32 autoDetectFlags, SafeGlobalFree& autoConfigUrl)
at System.Net.AutoWebProxyScriptEngine.SafeDetectAutoProxyUrl(UInt32 discoveryMethod)
at System.Net.AutoWebProxyScriptEngine.AutoDetector.DetectScriptLocation()
at System.Net.AutoWebProxyScriptEngine.EnsureEngineAvailable(Int32& syncStatus)
at System.Net.AutoWebProxyScriptEngine.GetProxies(Uri destination, Boolean returnFirstOnly, AutoWebProxyState& autoWebProxyState, Int32& syncStatus)
at System.Net.WebProxy.GetProxiesAuto(Uri destination, AutoWebProxyState& autoWebProxyState, Int32& syncStatus)
at System.Net.ProxyScriptChain.GetNextProxy(Uri& proxy)
at System.Net.ProxyChain.ProxyEnumerator.MoveNext()
at System.Net.ServicePointManager.FindServicePoint(Uri address, IWebProxy proxy, ProxyChain& chain, HttpAbortDelegate& abortDelegate, Int32& abortState)
at System.Net.HttpWebRequest.FindServicePoint(Boolean forceFind)
at System.Net.HttpWebRequest.BeginGetRequestStream(AsyncCallback callback, Object state)
at ServersideGameCode.GameCode.GameStarted()
As you can see the error originates from the GameStarted() method, it says it is running too long. here's the method, it's really small and simple:
- Code: Select all
public override void GameStarted() {
roomState = FILLING_UP;
Visible = true;
paused = false;
endTurnMsgs = new Dictionary<int,Dictionary<int,Message>>();
var np = RoomData["players"];
switch (np) {
case "1":
numPlayers = 1;
break;
case "2":
numPlayers = 2;
break;
case "3":
numPlayers = 3;
break;
case "4":
numPlayers = 4;
break;
}
password = RoomData["password"];
activePlayers = 0;
armiesAvailable = new List<int>();
for (var i = 1; i <= numPlayers; i++)
{
armiesAvailable.Add(i);
}
}
Nothing fancy there.
Now, the strange thing is not only that I dont get this in my local server,
but that if I open 3 instances of the game then the third one works!
I've repeated the procedure many times, and as long as I open 2 instances before I dont get an error for the third one,
that is: I create 2 rooms and the third one works.
I cant think of an explanation for this weird behavior, any ideas?