Beispiel #1
0
        public string SetZone(string zone)
        {
            int continentID;

            if (!zoneToMapId.TryGetValue(zone, out continentID))
            {
                int colon = zone.IndexOf(":");
                if (colon == -1)
                {
                    return(null);
                }
                zone = zone.Substring(colon);
                if (!zoneToMapId.TryGetValue(zone, out continentID))
                {
                    return(null);
                }
            }

            archive.ExtractFile("DBFilesClient\\Map.dbc", "Map.dbc");
            DBC     maps = new DBC();
            DBCFile mf   = new DBCFile("Map.dbc", maps);


            for (int i = 0; i < maps.recordCount; i++)
            {
                int mapID = maps.GetInt(i, 0);
                // Console.WriteLine("   ID:" + maps.GetInt(i, 0));
                // Console.WriteLine(" File: " + maps.GetString(i, 1));
                // Console.WriteLine(" Name: " + maps.GetString(i, 4)); // the file!!!

                if (mapID == continentID) // file == continentFile)
                {
                    //  Console.WriteLine(String.Format("{0,4} {1}", mapID, maps.GetString(i, 1)));
                    string file = maps.GetString(i, 1);
                    continentFile = file;



                    wdt = new WDT();

                    wdtf = new WDTFile(archive, continentFile, wdt, wmomanager, modelmanager);
                    if (!wdtf.loaded)
                    {
                        wdt = null; // bad
                    }
                    else
                    {
                        // Console.WriteLine("  global Objects " + wdt.gwmois.Count + " Models " + wdt.gwmois.Count);
                        //global_triangles.color = new float[3] { 0.8f, 0.8f, 1.0f };
                    }
                    return(continentFile);
                }
            }
            if (wdt == null)
            {
                return("Failed to open file files for continent ID" + continentID);
            }
            return(null);
        }
        public string SetZone(string zone)
        {
            int continentID;

            if (!zoneToMapId.TryGetValue(zone, out continentID))
            {
                int colon = zone.IndexOf(":");
                if (colon == -1)
                {
                    return(null);
                }
                zone = zone.Substring(colon);
                if (!zoneToMapId.TryGetValue(zone, out continentID))
                {
                    return(null);
                }
            }

            var path = Path.Join(dataConfig.PPather, "Map.dbc");

            archive.ExtractFile("..\\PathingAPI\\DBFilesClient\\Map.dbc", "PPather\\Map.dbc");
            DBC     maps = new DBC();
            DBCFile mf   = new DBCFile(path, maps, this.logger);

            for (int i = 0; i < maps.recordCount; i++)
            {
                int mapID = maps.GetInt(i, 0);
                // logger.WriteLine("   ID:" + maps.GetInt(i, 0));
                // logger.WriteLine(" File: " + maps.GetString(i, 1));
                // logger.WriteLine(" Name: " + maps.GetString(i, 4)); // the file!!!

                if (mapID == continentID) // file == continentFile)
                {
                    //  logger.WriteLine(String.Format("{0,4} {1}", mapID, maps.GetString(i, 1)));
                    string file = maps.GetString(i, 1);
                    SetContinent(file);
                    return(continentFile);
                }
            }
            if (wdt == null)
            {
                return("Failed to open file files for continent ID" + continentID);
            }
            return(null);
        }
Beispiel #3
0
        public string SetZone(string zone)
        {
            int continentID;

            if (!zoneToMapId.TryGetValue(zone, out continentID))
            {
                int colon = zone.IndexOf(":");
                if (colon == -1)
                {
                    return(null);
                }
                zone = zone.Substring(colon);
                if (!zoneToMapId.TryGetValue(zone, out continentID))
                {
                    return(null);
                }
            }

            archive.ExtractFile("DBFilesClient\\Map.dbc", "PPather\\Map.dbc");
            var maps = new DBC();
            var mf   = new DBCFile("PPather\\Map.dbc", maps);


            for (int i = 0; i < maps.recordCount; i++)
            {
                int mapID = maps.GetInt(i, 0);
                // PathGraph.Log("   ID:" + maps.GetInt(i, 0));
                // PathGraph.Log(" File: " + maps.GetString(i, 1));
                // PathGraph.Log(" Name: " + maps.GetString(i, 4)); // the file!!!

                if (mapID == continentID) // file == continentFile)
                {
                    //  PathGraph.Log(String.Format("{0,4} {1}", mapID, maps.GetString(i, 1)));
                    string file = maps.GetString(i, 1);
                    SetContinent(file);
                    return(continentFile);
                }
            }
            if (wdt == null)
            {
                return("Failed to open file files for continent ID" + continentID);
            }
            return(null);
        }
Beispiel #4
0
        public string SetZone(string zone)
        {
            int continentID;

            if (!zoneToMapId.TryGetValue(zone, out continentID))
            {
                int colon = zone.IndexOf(":");
                if (colon == -1)
                    return null;
                zone = zone.Substring(colon);
                if (!zoneToMapId.TryGetValue(zone, out continentID))
                {
                    return null;
                }
            }

            archive.ExtractFile("DBFilesClient\\Map.dbc", "PPather\\Map.dbc");
            DBC maps = new DBC();
            DBCFile mf = new DBCFile("PPather\\Map.dbc", maps);

            for (int i = 0; i < maps.recordCount; i++)
            {
                int mapID = maps.GetInt(i, 0);
                // Console.WriteLine("   ID:" + maps.GetInt(i, 0));
                // Console.WriteLine(" File: " + maps.GetString(i, 1));
                // Console.WriteLine(" Name: " + maps.GetString(i, 4)); // the file!!!

                if (mapID == continentID) // file == continentFile)
                {
                    //  Console.WriteLine(String.Format("{0,4} {1}", mapID, maps.GetString(i, 1)));
                    string file = maps.GetString(i, 1);
                    SetContinent(file);
                    return continentFile;
                }
            }
            if (wdt == null)
            {
                return "Failed to open file files for continent ID" + continentID;
            }
            return null;
        }
Beispiel #5
0
        public string SetZone(string zone)
        {
            int continentID;

            if (!zoneToMapId.TryGetValue(zone, out continentID))
            {
                int colon = zone.IndexOf(":");
                if(colon == -1)
                    return null;
                zone = zone.Substring(colon);
                if (!zoneToMapId.TryGetValue(zone, out continentID))
                {
                    return null;
                }
            }

            archive.ExtractFile("DBFilesClient\\Map.dbc", "Map.dbc");
            DBC maps = new DBC();
            DBCFile mf = new DBCFile("Map.dbc", maps);

            for (int i = 0; i < maps.recordCount; i++)
            {
                int mapID = maps.GetInt(i, 0);
               // Console.WriteLine("   ID:" + maps.GetInt(i, 0));
               // Console.WriteLine(" File: " + maps.GetString(i, 1));
               // Console.WriteLine(" Name: " + maps.GetString(i, 4)); // the file!!!

                if (mapID == continentID) // file == continentFile)
                {
                    //  Console.WriteLine(String.Format("{0,4} {1}", mapID, maps.GetString(i, 1)));
                    string file = maps.GetString(i, 1);
                    continentFile = file;

                    wdt = new WDT();

                    wdtf = new WDTFile(archive, continentFile, wdt, wmomanager, modelmanager);
                    if (!wdtf.loaded)
                        wdt = null; // bad
                    else
                    {

                       // Console.WriteLine("  global Objects " + wdt.gwmois.Count + " Models " + wdt.gwmois.Count);
                        //global_triangles.color = new float[3] { 0.8f, 0.8f, 1.0f };
                    }
                    return continentFile;
                }
            }
            if (wdt == null)
            {
                return "Failed to open file files for continent ID" + continentID;
            }
            return null;
        }