ChangeMethodUpdateServer
This commit is contained in:
parent
7a444a1e3e
commit
580d9a2327
1 changed files with 11 additions and 2 deletions
|
@ -16,6 +16,7 @@ namespace ZoFo.GameCore
|
||||||
public class Server
|
public class Server
|
||||||
{
|
{
|
||||||
private ServerNetworkManager networkManager;
|
private ServerNetworkManager networkManager;
|
||||||
|
private int ticks = 0;
|
||||||
public Server()
|
public Server()
|
||||||
{
|
{
|
||||||
networkManager = new ServerNetworkManager();
|
networkManager = new ServerNetworkManager();
|
||||||
|
@ -61,12 +62,20 @@ namespace ZoFo.GameCore
|
||||||
private List<Entity> entities; //entity
|
private List<Entity> entities; //entity
|
||||||
public void Update(GameTime gameTime)
|
public void Update(GameTime gameTime)
|
||||||
{
|
{
|
||||||
foreach (var go in gameObjects)
|
if (ticks == 3) //ОБРАБАТЫВАЕТСЯ 20 РАЗ В СЕКУНДУ
|
||||||
{
|
{
|
||||||
go.UpdateLogic(gameTime);
|
foreach (var go in gameObjects)
|
||||||
|
{
|
||||||
|
go.UpdateLogic(gameTime);
|
||||||
|
}
|
||||||
|
ticks = 0;
|
||||||
|
networkManager.SendData();
|
||||||
}
|
}
|
||||||
|
ticks++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Регистрирует игровой объект
|
/// Регистрирует игровой объект
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Add table
Reference in a new issue