Esempio n. 1
0
        public static unsafe String[] getMapNameAndDescription(String filePath)
        {
            String      mapName        = "";
            String      mapDescription = "";
            EUDSettings es             = new EUDSettings();

            es.action         = (byte)7;
            es.outputFilePath = (byte *)0;
            es.inputFilePath  = toByteArray(filePath);
            try {
                run(&es); // Run extraction
                UnsafeReadBuffer rb = new UnsafeReadBuffer(es.outputFilePath);
                mapName        = rb.readString();
                mapDescription = rb.readString();
                es.action      = (byte)3;
                run(&es); // Free the array data string
            } catch (Exception) {
            }
            return(new String[] { mapName, mapDescription });
        }
        private static MapString readMapString(UnsafeReadBuffer rb, String encoding)
        {
            MapString ms = new MapString();

            ms.mapIndex = rb.readInt();

            ms.str = rb.readString(encoding);
            ms.isMapDescription = rb.readByte() == 1 ? true : false;
            ms.isMapName        = rb.readByte() == 1 ? true : false;

            ms.unitIndexs              = rb.readIntArray(rb.readInt());
            ms.switchIndexes           = rb.readIntArray(rb.readInt());
            ms.locationIndexes         = rb.readIntArray(rb.readInt());
            ms.triggerActionIndexes    = rb.readIntArray(rb.readInt());
            ms.triggerCommentIndexes   = rb.readIntArray(rb.readInt());
            ms.briefingActionIndexes   = rb.readIntArray(rb.readInt());
            ms.briefingCommentsIndexes = rb.readIntArray(rb.readInt());
            ms.forceNamesIndexes       = rb.readIntArray(rb.readInt());

            return(ms);
        }