private static bool DefaultConnectionHandler(ConnectionData data) { return false; }
private void HandleConnections(MeshTile tile) { if (tile.Header.OffMeshConCount <= 0) return; var count = tile.Header.OffMeshConCount; for (int i = 0; i < count; i++) { var con = tile.GetOffMeshConnection(i); if (con == null) continue; var path = TaxiHelper.GetPath((int)con.UserID); if (path == null) { DisableConnection(tile, i); continue; } var from = TaxiHelper.GetNode(path.From); var to = TaxiHelper.GetNode(path.To); if (from == null || to == null) { DisableConnection(tile, i); continue; } var data = new ConnectionData { Alliance = from.IsAlliance || to.IsAlliance, Horde = from.IsHorde || to.IsHorde, Cost = path.Cost, From = from.Name, To = to.Name, Id = (int)con.UserID }; if (!ConnectionHandler(data)) DisableConnection(tile, i); } }
private static bool MockConnectionHandler(ConnectionData data) { if (!data.Alliance) return false; return true; }