Skip to content

Commit

Permalink
Made CRev a little more flexible with hash files
Browse files Browse the repository at this point in the history
Any number of files is now supported for each product, and expected
files can be omitted by setting their values to NULL or leaving them
empty.
  • Loading branch information
Davnit committed Mar 15, 2016
1 parent abf7ee4 commit 1b7b79d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Hashing/CheckRevisionV1.java
Original file line number Diff line number Diff line change
Expand Up @@ -287,26 +287,26 @@ private static int getNum(char c)


public static String[] getFiles(int prod, byte plat){
String[] ret = {"", "", ""};
List<String> ret = new ArrayList<String>();

if(prod < 0) return null;
if(prod > Constants.prods.length + 1) return null;

switch(plat){
case Constants.PLATFORM_INTEL:
ret[0] = Constants.IX86files[prod-1][0] + Constants.IX86files[prod-1][1];
ret[1] = Constants.IX86files[prod-1][0] + Constants.IX86files[prod-1][2];
ret[2] = Constants.IX86files[prod-1][0] + Constants.IX86files[prod-1][3];

// hotfix for D2 update on 3/10/2016
if (prod == Constants.PRODUCT_DIABLO2 || prod == Constants.PRODUCT_LORDOFDESTRUCTION) ret = new String[] { ret[0] };
String[] files = Constants.IX86files[prod - 1];
for (int i = 1; i < files.length - 1; i++) {
if (!files[i].equalsIgnoreCase("NULL") && files[i].length() > 0)
ret.add(files[0] + files[i]);
}
break;
/*case PLATFORM_POWERPC:
break;
case PLATFORM_MACOSX:
break;*/
default: ret = null;
default: return null;
}
return ret;
return ret.toArray(new String[0]);
}


Expand Down

0 comments on commit 1b7b79d

Please sign in to comment.