private void gameStatusRecieve(SocketIOEvent obj) { if (parent.reconnectMode) { int newCorrectionCode = int.Parse(obj.data.GetField("correctionNum").ToString()); if (newCorrectionCode > correctionCode) { correctionCode = newCorrectionCode; } else { Logger.debug("Rconnect data is outdated"); return; } //Logger.debug("Recieved game status:" + obj.data.ToString()); ReGameStatus gameStatus = new ReGameStatus(); gameStatus.fillWithRawObj(obj.data); Logger.debug("Filled with raw obj"); onReconnectComplete(gameStatus); parent.reconnectMode = false; } }
private void onCorrection(SocketIOEvent obj) { JsonData data = JsonMapper.ToJson(obj); parent.lastDataTime = 0; int newCorrectionCode = int.Parse(data["correctionNum"].ToString()); if (newCorrectionCode > correctionCode) { correctionCode = newCorrectionCode; } else { Console.WriteLine("Rconnect data is outdated"); return; } Console.WriteLine("Recieved game status:" + data.ToString()); ReGameStatus gameStatus = new ReGameStatus(); gameStatus.fillWithRawObj(obj.data); onReconnectComplete(gameStatus); Console.WriteLine("Recievd game status"); }