Exemplo n.º 1
0
 private static bool DefaultConnectionHandler(ConnectionData data)
 {
     return false;
 }
Exemplo n.º 2
0
        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);
            }
        }
Exemplo n.º 3
0
 private static bool MockConnectionHandler(ConnectionData data)
 {
     if (!data.Alliance)
         return false;
     return true;
 }