Example #1
0
 private void SendGobDeletionsOnServer()
 {
     if ((DataEngine.ArenaFrameCount % 3) != 0) return;
     if (_pendingGobDeletionMessage == null) return;
     NetworkEngine.SendToGameClients(_pendingGobDeletionMessage);
     _pendingGobDeletionMessage = null;
 }
Example #2
0
 public override void StartArena()
 {
     Stats.BasicInfoSent = false;
     WebData.Feed("2" + (int)NetworkMode);
     switch (NetworkMode)
     {
         case NetworkMode.Server:
             MessageHandlers.ActivateHandlers(MessageHandlers.GetServerGameplayHandlers());
             _pendingGobDeletionMessage = null;
             DataEngine.Arena.GobRemoved += GobRemovedFromArenaHandler;
             break;
         case NetworkMode.Client:
             _pendingClientGameStateUpdateMessage = new ClientGameStateUpdateMessage();
             break;
     }
     Logic.StartArena();
 }
Example #3
0
 private void GobRemovedFromArenaHandler(Gob gob)
 {
     if (!gob.IsRelevant) return;
     _pendingGobDeletionMessage =_pendingGobDeletionMessage ?? new GobDeletionMessage();
     _pendingGobDeletionMessage.GobIDs.Add(gob.ID);
 }
Example #4
0
 private void HandleGobDeletionMessage(GobDeletionMessage mess, int framesAgo)
 {
     Game.LogicEngine.KillGobsOnClient(mess.GobIDs);
 }