fix
This commit is contained in:
parent
b2ed0bc14c
commit
5e4c576a79
1 changed files with 4 additions and 2 deletions
|
@ -31,6 +31,7 @@ namespace DangerousD.GameCore
|
||||||
public Vector4 CameraBorder;
|
public Vector4 CameraBorder;
|
||||||
public Player GetPlayer1 { get; private set; }
|
public Player GetPlayer1 { get; private set; }
|
||||||
private int _lastUpdate = 0;
|
private int _lastUpdate = 0;
|
||||||
|
private int _currTime = 0;
|
||||||
|
|
||||||
public GameManager()
|
public GameManager()
|
||||||
{
|
{
|
||||||
|
@ -132,14 +133,15 @@ namespace DangerousD.GameCore
|
||||||
|
|
||||||
public void Update(GameTime gameTime)
|
public void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
|
_currTime += gameTime.ElapsedGameTime.Milliseconds;
|
||||||
if (AppManager.Instance.NetworkTasks.Count > 0)
|
if (AppManager.Instance.NetworkTasks.Count > 0)
|
||||||
{
|
{
|
||||||
if (gameTime.TotalGameTime.Milliseconds - _lastUpdate > 800)
|
if (_currTime - _lastUpdate > 800)
|
||||||
{
|
{
|
||||||
AppManager.Instance.DebugHUD.Log("sending");
|
AppManager.Instance.DebugHUD.Log("sending");
|
||||||
AppManager.Instance.NetworkManager.SendMsg(AppManager.Instance.NetworkTasks.ToList());
|
AppManager.Instance.NetworkManager.SendMsg(AppManager.Instance.NetworkTasks.ToList());
|
||||||
AppManager.Instance.NetworkTasks.Clear();
|
AppManager.Instance.NetworkTasks.Clear();
|
||||||
_lastUpdate = gameTime.TotalGameTime.Milliseconds;
|
_lastUpdate = _currTime;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
foreach (var item in BackgroundObjects)
|
foreach (var item in BackgroundObjects)
|
||||||
|
|
Loading…
Add table
Reference in a new issue