public override void Execute(MinEventParams _params) { // FromItem(_params, options.attr_xml); Debug.Log(String.Format(" MEA ZBManager Execute: {0} {1} {2} {3} ", _params, _params.Self, this.arg, started)); long delta = Tick(); if (delta > 10) { Zombiome.ExitGame(); // force re-init. should happen in between games. make sure dt_ref >> frequency } if (this.arg == "start" || this.arg == "enter") { Zombiome.Init(_params.Self.entityId); started = true; // also act on reborn ! } if (this.arg == "stop") { Zombiome.OnDisconnect(); started = false; // also act on reborn ! } }
public IEnumerator Update() { /** Retest game ended whenever we iterate */ /* This routine should not bother on the initial playerId */ // Printer.Print("ZombiomeManager update"); // EntityPlayerLocal player = GameManager.Instance.World.GetLocalPlayers()[0]; if (GameManager.Instance == null || GameManager.Instance.World == null) { Zombiome.ExitGame(); yield break; } List <EntityPlayerLocal> callAtplayers = GetPlayers(); string infos = ""; foreach (EntityPlayerLocal player in callAtplayers) { if (UpdateCluster(player)) { continue; } infos = String.Format("{0} +p{1}{2}", infos, player.EntityName, player.GetPosition()); Zone[] currentZones = Zone.Get(player.GetPosition()); Printer.Print("ZombiomeManager update", player, currentZones); foreach (Zone current in currentZones) { // Printer.Print("ZombiomeManager update", player, current); string inf = current.Next(player, player.GetPosition()); infos = String.Format("{0} * {1}@{2}({3},{4})", infos, inf, current.biome.name[0], current.x, current.z); yield return(null); if (GameManager.Instance == null || GameManager.Instance.World == null) { Zombiome.ExitGame(); yield break; } yield return(null); } if (GameManager.Instance == null || GameManager.Instance.World == null) { Zombiome.ExitGame(); yield break; } } Printer.Print("ZombiomeManager update", callAtplayers.Count, infos); }