Class CheckRevision
Encompasses any revision check functionality for all Battle.net games. This class cannot be inherited.
Inheritance
Inherited Members
Namespace: MBNCSUtil
Assembly: MBNCSUtil.dll
Syntax
public static class CheckRevision
Remarks
This class provides all CheckRevision-related support, including file checksumming and EXE version information.
Methods
| Improve this Doc View SourceDoCheckRevision(String, String[], Int32)
Calculates the revision check for the specified files.
Declaration
public static int DoCheckRevision(string valueString, string[] files, int mpqNumber)
Parameters
Type | Name | Description |
---|---|---|
System.String | valueString | The value string for the check revision function specified by Battle.net's SID_AUTH_INFO message. |
System.String[] | files | The list of files for the given game client. This parameter must be exactly three files long. |
System.Int32 | mpqNumber | The number of the MPQ file. To extract this number, see the ExtractMPQNumber method. |
Returns
Type | Description |
---|---|
System.Int32 | The checksum value. |
Remarks
The file list for this is product-specific and order-specific:
Product | File list |
---|---|
Starcraft; Starcraft: Brood War |
|
Warcraft II: Battle.net Edition |
|
Diablo II; Diablo II: Lord of Destruction |
|
Warcraft III: The Reign of Chaos; Warcraft III: The Frozen Throne |
|
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if the valueString or files parameters are null (Nothing in Visual Basic). |
System.ArgumentOutOfRangeException | Thrown if the files parameter is not a 3-string array. |
System.IO.FileNotFoundException | Thrown if one of the specified game files is not found. |
System.IO.IOException | Thrown in the event of a general I/O error. |
DoLockdownCheckRevision(Byte[], String[], String, String, ref Int32, ref Int32)
Performs the Lockdown revision check.
Declaration
public static byte[] DoLockdownCheckRevision(byte[] valueString, string[] gameFiles, string lockdownFile, string imageFile, ref int version, ref int checksum)
Parameters
Type | Name | Description |
---|---|---|
System.Byte[] | valueString | The value string parameter, not including the null terminator. |
System.String[] | gameFiles | The three game files. This parameter must be exactly three files long. |
System.String | lockdownFile | The path to the lockdown file requested. |
System.String | imageFile | The path to the screen dump. |
System.Int32 | version | [return value] The EXE version. |
System.Int32 | checksum | [return value] The EXE hash. |
Returns
Type | Description |
---|---|
System.Byte[] | The "EXE Information" data. This value should be null-terminated when being inserted into the authorization packet. |
Remarks
The file list for this is product-specific and order-specific:
Product | File list |
---|---|
Starcraft; Starcraft: Brood War |
|
Warcraft II: Battle.net Edition |
|
ExtractMPQNumber(String)
Extracts the MPQ number from the MPQ specified by the Battle.net server.
Declaration
public static int ExtractMPQNumber(string mpqName)
Parameters
Type | Name | Description |
---|---|---|
System.String | mpqName | The name of the MPQ file specified in the SID_AUTH_INFO message. |
Returns
Type | Description |
---|---|
System.Int32 | The number from 0 to 7 specifying the number in the MPQ file. |
Remarks
For older CheckRevision calls, the MPQ number is a required parameter of the CheckRevision function. Note that the MPQ number is simply the number represented in string format in the 8th position (index 7) of the string -- for example, in "IX86ver1.mpq", 1 is the version number.
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown if the name of the MPQ version file is less than 8 characters long. |
System.ArgumentNullException | Thrown if the mpqName parameter is null (Nothing in Visual Basic). |
System.NotSupportedException | Thrown if the mpqName parameter indicates a Lockdown DLL. |
GetExeInfo(String, out String)
Gets EXE information for the specified file.
Declaration
public static int GetExeInfo(string fileName, out string exeInfoString)
Parameters
Type | Name | Description |
---|---|---|
System.String | fileName | The name of the file. |
System.String | exeInfoString | Returns the file's timestamp and other information. |
Returns
Type | Description |
---|---|
System.Int32 | The file's version. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if the fileName parameter is null (Nothing in Visual Basic). |
System.IO.FileNotFoundException | Thrown if the file specified by fileName does not exist in the specified path. |
GetVersionByte(String)
Gets the current "version byte" for the specified product.
Declaration
public static byte GetVersionByte(string productID)
Parameters
Type | Name | Description |
---|---|---|
System.String | productID | The four-character product ID for the product in question. |
Returns
Type | Description |
---|---|
System.Byte | The version byte of the product. |
Remarks
Only the following product IDs can be used with the web service: STAR, SEXP, W2BN, D2DV, D2XP, WAR3, and W3XP. Other product IDs will result an a System.NotSupportedException being thrown.
This method is new and currently in testing. W2BN, D2DV, and D2XP are currently unsupported.