private void timer_update_Tick(object sender, EventArgs e) { if (m_client != null) { m_client.Update(); } }
public void Update() { if (_client != null) { _client.Update();//接收数据 } }
// Update is called once per frame void Update() { if (gameClient != null) { gameClient.Update(); } }
/*----------------------------------------------------------------------------------------- * * Client-server stuff : * * -----------------------------------------------------------------------------------------*/ /// <summary> /// Updates game logic and client-server interaction. /// </summary> /// <param name="gameTime"></param> void UpdateClientServerGame(GameTime gameTime) { cl.Update(gameTime); ui.Update(gameTime); ed.Update(gameTime); }
static void RunOutgame(RegisterMemory rmem) { try { GameTime.Update(); GUCTimer.Update(GameTime.Ticks); GameTime.Update(); GameClient.Update(); GameTime.Update(); InputHandler.Update(); if (!ShowConnectionAttempts()) { if (!outgameStarted) { outgameStarted = true; VobRenderArgs.Init(); ScriptManager.Interface.StartOutgame(); } GameTime.Update(); ScriptManager.Interface.Update(GameTime.Ticks); } #region Gothic WinApi.Process.CDECLCALL <WinApi.NullReturnCall>(0x5053E0); // void __cdecl sysEvent(void) using (zColor color = zColor.Create(0, 0, 0, 0)) zCRenderer.Vid_Clear(color, 3); zCRenderer.BeginFrame(); zCView.GetScreen().Render(); zCRenderer.EndFrame(); zCRenderer.Vid_Blit(1, 0, 0); zCSndSys_MSS.DoSoundUpdate(); #endregion if (fpsWatch.IsRunning) { long diff = 8 * TimeSpan.TicksPerMillisecond - fpsWatch.Elapsed.Ticks; if (diff > 0) { Thread.Sleep((int)(diff / TimeSpan.TicksPerMillisecond)); } } fpsWatch.Restart(); } catch (Exception e) { Logger.LogError(e); } }
static void ThreadUpdate() { while (true) { Thread.Sleep(1); mGateClient.Update(1.0f / 1000.0f); mGameClient.Update(1.0f / 1000.0f); Console.Title = "GameServer:" + mGameClient.GetPing().ToString() + " " + "GateServer:" + mGateClient.GetPing().ToString(); } }
public void Update(float deltaTime) { m_gameClient.Update(); if (!m_gameClient.IsConnected()) { return; } m_inputCtrl.Update(deltaTime, 0); ProcessNetworkMessages(); while (!m_inputCtrl.MessageQueue.Empty()) { var localMessage = m_inputCtrl.MessageQueue.Dequeue(); // m_gameClient.Send(localMessage); // m_match.ProcessMessage(localMessage); } m_match.Update(deltaTime); }
static void RunIngame(RegisterMemory rmem) { try { spikeWatch.Restart(); // Update Timers GameTime.Update(); GUCTimer.Update(GameTime.Ticks); // Do networking, read packets GameTime.Update(); GameClient.Update(); // handle peripherals' input GameTime.Update(); InputHandler.Update(); if (!ShowConnectionAttempts()) { if (!ingameStarted) { ingameStarted = true; ScriptManager.Interface.StartIngame(); } // ClientScripts update GameTime.Update(); ScriptManager.Interface.Update(GameTime.Ticks); if (GameClient.Client.IsIngame) { // Update worlds GameTime.Update(); World.UpdateWorlds(GameTime.Ticks); } // Check spectator stuff GameTime.Update(); GameClient.UpdateSpectator(GameTime.Ticks); // check player hero GameTime.Update(); NPC.UpdateHero(GameTime.Ticks); } // update guc sounds GameTime.Update(); SoundHandler.Update3DSounds(); spikeWatch.Stop(); if (spikeTimer.IsReady) { spikeLongest = 0; } if (spikeLongest < spikeWatch.Elapsed.Ticks) { spikeLongest = spikeWatch.Elapsed.Ticks; } if (fpsWatch.IsRunning) { long diff; if ((diff = 8 * TimeSpan.TicksPerMillisecond - fpsWatch.Elapsed.Ticks) > 0) { Thread.Sleep((int)(diff / TimeSpan.TicksPerMillisecond)); } } lastElapsed = fpsWatch.Elapsed.Ticks; fpsWatch.Restart(); } catch (Exception e) { Logger.LogError(e); } }
public void Update() { for (int i = 0; i < Bullets.Count; ++i) { Bullet B = Bullets[i]; B.Update(); if (B.Removed) { Bullets.RemoveAt(i); } } for (int i = 0; i < Tiles.Count; ++i) { GEntity T = Tiles[i]; T.Update(); if (T.Removed) { Tiles.RemoveAt(i); } } for (int i = 0; i < Entities.Count; ++i) { GEntity E = Entities[i]; E.HasFocus = false; E.Update(); if (E.Removed) { Entities.RemoveAt(i); } } for (int i = 0; i < Particles.Count; ++i) { Particle P = Particles[i]; P.Update(); if (P.Removed) { Particles.RemoveAt(i); } } for (int i = 0; i < Bonuses.Count; ++i) { Bonus B = Bonuses.ElementAt(i).Value; B.Update(); if (B.Removed || (B.LifeSpanExpired && Client.IsMain)) { Client.OnBonusRemove(B.Id); Bonuses.Remove(B.Id); } } CurrentPlayer.Update(); if (CurrentPlayer.Removed && (Client.IsConnected || Client.IsMain)) { CurrentPlayer.Respawn(); } ManageBonusGeneration(); Client.Update(CurrentPlayer); }
void Update() { m_gameClient.Update(); }
void Update() { client.Update(); }
protected virtual void Update() { GameClient?.Update(); GameServer?.Update(); }
/// <summary> /// Обновить состояние игры /// </summary> private static void Update() { gameClient.Update(); }