test
This commit is contained in:
parent
f72cc03c66
commit
3b0b3d9b15
1 changed files with 8 additions and 2 deletions
|
@ -30,6 +30,8 @@ namespace DangerousD.GameCore
|
||||||
public List<GameObject> otherObjects = new();
|
public List<GameObject> otherObjects = new();
|
||||||
public Vector4 CameraBorder;
|
public Vector4 CameraBorder;
|
||||||
public Player GetPlayer1 { get; private set; }
|
public Player GetPlayer1 { get; private set; }
|
||||||
|
private int _lastUpdate = 0;
|
||||||
|
|
||||||
public GameManager()
|
public GameManager()
|
||||||
{
|
{
|
||||||
others = new List<GameObject>();
|
others = new List<GameObject>();
|
||||||
|
@ -131,9 +133,13 @@ namespace DangerousD.GameCore
|
||||||
public void Update(GameTime gameTime)
|
public void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
if (AppManager.Instance.NetworkTasks.Count > 0)
|
if (AppManager.Instance.NetworkTasks.Count > 0)
|
||||||
|
{
|
||||||
|
if (gameTime.ElapsedGameTime.Milliseconds - _lastUpdate > 1000)
|
||||||
{
|
{
|
||||||
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.ElapsedGameTime.Milliseconds;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
foreach (var item in BackgroundObjects)
|
foreach (var item in BackgroundObjects)
|
||||||
item.Update(gameTime);
|
item.Update(gameTime);
|
||||||
|
|
Loading…
Add table
Reference in a new issue