Package starlight.taliis.core.files

Examples of starlight.taliis.core.files.dbc


   * @param row the row/value which shall be translated
   * @return
   */
  public String getDBCValue_s(String dbcname,int vCol,int dCol,int row){
    String rets="";
    dbc src;
    //request (load) DBC file
    openedFile of = null;
   
    // ask the file loader
    for(openedFile af : fm.getFileList()) {
      if(af.f.getName().endsWith(dbcname)) {
        of = af;
        break;
      }
    }
    // ask the mpq loader
    if(of==null) {
      if(mpqLoader==null) return null;
      if(!(mpqLoader instanceof PluginRequest)) return null;
      PluginRequest mpql = (PluginRequest)mpqLoader;

      try {
        of = mpql.requestRessource("DBFilesClient\\" + dbcname);
      } catch (InvalidClassException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      } catch (ChunkNotFoundException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
    }
   
    if(of==null) return null;
    src = (dbc)of.obj;
    // copy data
    try{
      Object t;
      int rrow = 0;
      for(int i=0;i<src.getNRecords();i++)
      if(((Number)src.getData(vCol, i)).intValue()==row){
        rrow=i;
        break;
      }
        //int vIndex = ((Number)t).intValue();
       
        // index in the string table
        t = src.getData(dCol, rrow);
        int strIndex = ((Number)t).intValue();
       
        rets=src.getStringByOffset(strIndex).toString();
    }catch (Exception e){
      return null;
    }
        return rets;
  }
View Full Code Here


      }
     
     
    // catch the dbc file we need
    //-----------------------------------------------------
      dbc src;
      if(mix.endsWith("same")) {
        src = data.dbcFile;
      }
      else {
        //request (load) DBC file
        openedFile of = null;
       
        // ask the file loader
        for(openedFile af : fm.getFileList()) {
          if(af.f.getName().endsWith(mix)) {
            of = af;
            break;
          }
        }
        // ask the mpq loader
        if(of==null) {
          if(mpqLoader==null) continue;
          if(!(mpqLoader instanceof PluginRequest)) continue;
          PluginRequest mpql = (PluginRequest)mpqLoader;
         
          of = mpql.requestRessource("DBFilesClient\\" + mix);
        }
       
        if(of==null) continue;
        src = (dbc)of.obj;
      }
     
    // prepare create crosslist vector
    //-----------------------------------------------------
      int l = data.mixArrIndexies[i];
      data.CrossLists[l] = new HashMap<Integer, String>();
     
      // lazy shortcut ..
      HashMap<Integer, String> tmpVec = data.CrossLists[l];
     
      // copy data
      for(int j=0; j<src.getNRecords(); j++) {
        // index in our tmpVector
        Object t = src.getData(vCol, j);
          int vIndex = ((Number)t).intValue();
         
          // index in the string table
          t = src.getData(dCol, j);
          int strIndex = ((Number)t).intValue();
         
          // string we want to store
          tmpVec.put(vIndex, src.getStringByOffset(strIndex).toString());
      }
    }
  }
View Full Code Here

      System.out.println("Open adt File: " + FileName);
      obj = new adt( fileLoader.openBuffer(path) );
    }
    else if(FileName.endsWith("dbc")) {
      System.out.println("Open dbc File: " + FileName);
      obj = new dbc( fileLoader.openBuffer(path) );
    }
    else {
      System.err.println("File Extension is not supported.");
      return;
    }
View Full Code Here

  public void setFileManangerRef(fileMananger ref) {
    fm = ref;
  }
 
  public wowfile load(File f) throws InvalidClassException {
    return new dbc( fileLoader.openBuffer(f.getAbsolutePath()) );
  }
View Full Code Here

TOP

Related Classes of starlight.taliis.core.files.dbc

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.