Class ConnectionFunctions
Inheritance
System.Object
ConnectionFunctions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Assembly: Asgard3.Core.dll
Syntax
public static class ConnectionFunctions
Fields
BattleNetGameToKeyProduct
Declaration
public static Dictionary<BattleNetGame, BattleNetGame> BattleNetGameToKeyProduct
Field Value
GameToFullNameConversionDictioonary
Declaration
public static Dictionary<BattleNetGame, BattleNetFullGameName> GameToFullNameConversionDictioonary
Field Value
Index
Declaration
Field Value
Type |
Description |
System.Int32 |
|
IsCLI
Declaration
Field Value
Type |
Description |
System.Boolean |
|
KeyProductValueToFullNameConversionDictionary
Declaration
public static Dictionary<BattleNetGameKeyProductValue, BattleNetFullGameName> KeyProductValueToFullNameConversionDictionary
Field Value
KeyProductValueToGameConversionDictionary
Declaration
public static Dictionary<BattleNetGameKeyProductValue, BattleNetGame> KeyProductValueToGameConversionDictionary
Field Value
Main
The main form of the project.
Declaration
Field Value
Type |
Description |
System.Windows.Forms.Form |
|
Methods
BNLSProductIdToInt32(BattleNetGame)
Converts enumClient to the BNLS byte for the client.
Declaration
public static int BNLSProductIdToInt32(BattleNetGame client)
Parameters
Returns
Type |
Description |
System.Int32 |
|
ByteArrayToString(Byte[])
Declaration
public static string ByteArrayToString(this byte[] b)
Parameters
Type |
Name |
Description |
System.Byte[] |
b |
|
Returns
Type |
Description |
System.String |
|
ByteArrayToString(Byte[], Int32)
Turns a byte array into a string.
Declaration
public static string ByteArrayToString(this byte[] b, int upperbound)
Parameters
Type |
Name |
Description |
System.Byte[] |
b |
The byte array to be turned into a string.
|
System.Int32 |
upperbound |
How many of the bytes to turn into a string.
|
Returns
Type |
Description |
System.String |
A string of the byte array.
|
ConvertGameToFullName(BattleNetGame)
Declaration
public static BattleNetFullGameName ConvertGameToFullName(this BattleNetGame game)
Parameters
Returns
ConvertGameToFullName(BattleNetGameKeyProductValue)
Declaration
public static BattleNetFullGameName ConvertGameToFullName(this BattleNetGameKeyProductValue value)
Parameters
Returns
ConvertGameToProductValue(BattleNetGame)
Declaration
public static BattleNetGame ConvertGameToProductValue(this BattleNetGame game)
Parameters
Returns
ConvertKeyProductToGame(BattleNetGameKeyProductValue)
Declaration
public static BattleNetGame ConvertKeyProductToGame(this BattleNetGameKeyProductValue value)
Parameters
Returns
DwordToString(Int32)
Turns a dword into a string.
Declaration
public static string DwordToString(int dword)
Parameters
Type |
Name |
Description |
System.Int32 |
dword |
|
Returns
Type |
Description |
System.String |
|
Declaration
public static string FormatDirectory(this string path)
Parameters
Type |
Name |
Description |
System.String |
path |
|
Returns
Type |
Description |
System.String |
|
FromBattleNetTime(Int32)
Declaration
public static DateTime FromBattleNetTime(this int time)
Parameters
Type |
Name |
Description |
System.Int32 |
time |
|
Returns
Type |
Description |
System.DateTime |
|
FromUnixTime(Int32)
Declaration
public static DateTime FromUnixTime(this int timestamp)
Parameters
Type |
Name |
Description |
System.Int32 |
timestamp |
|
Returns
Type |
Description |
System.DateTime |
|
GetHashFiles(BattleNetCheckRevisionVersion, BattleNetGame, ref String[], ref String, ref String)
Declaration
public static bool GetHashFiles(BattleNetCheckRevisionVersion version, BattleNetGame cid, ref string[] hashFiles, ref string hashpath, ref string binfile)
Parameters
Returns
Type |
Description |
System.Boolean |
|
GetHashFiles(BattleNetGame, ref String, ref String)
Declaration
public static string[] GetHashFiles(BattleNetGame cid, ref string hashpath, ref string binfile)
Parameters
Type |
Name |
Description |
BattleNetGame |
cid |
The Client ID.
|
System.String |
hashpath |
The path where the hashes are located.
|
System.String |
binfile |
The file path for the image file if needed.
|
Returns
Type |
Description |
System.String[] |
The hash files.
|
GetMPQ(String, Int64, String, String, String)
Downloads a battle.net mpq file to be used in hashing.
Declaration
public static void GetMPQ(string f, long ft, string cid, string server, string directory = "Lockdown")
Parameters
Type |
Name |
Description |
System.String |
f |
Name of the MPQ file.
|
System.Int64 |
ft |
Filetime of the MPQ File.
|
System.String |
cid |
The client id.
|
System.String |
server |
The battle.net to download from
|
System.String |
directory |
|
GetSystemUpTime()
Declaration
public static TimeSpan GetSystemUpTime()
Returns
Type |
Description |
System.TimeSpan |
|
IntFromWORD(String)
Gets the value of 2 characters.
Declaration
public static int IntFromWORD(string WORD)
Parameters
Type |
Name |
Description |
System.String |
WORD |
The 2 characters to process.
|
Returns
Type |
Description |
System.Int32 |
The integer value of the 2 characters.
|
IntToHex(Int32)
Turns an integer into Hex
Declaration
public static string IntToHex(int number)
Parameters
Type |
Name |
Description |
System.Int32 |
number |
The integer to be turned into hex
|
Returns
Type |
Description |
System.String |
The hex of the integer
|
IsAllNumbers(String)
Declaration
public static bool IsAllNumbers(this string data)
Parameters
Type |
Name |
Description |
System.String |
data |
|
Returns
Type |
Description |
System.Boolean |
|
IsEveryOtherCap(String)
Declaration
public static bool IsEveryOtherCap(this string data)
Parameters
Type |
Name |
Description |
System.String |
data |
|
Returns
Type |
Description |
System.Boolean |
|
IsLinux()
Declaration
public static bool IsLinux()
Returns
Type |
Description |
System.Boolean |
|
IsRandomized(String)
Declaration
public static bool IsRandomized(this string data)
Parameters
Type |
Name |
Description |
System.String |
data |
|
Returns
Type |
Description |
System.Boolean |
|
RemoveRealm(String)
Declaration
public static string RemoveRealm(this string data)
Parameters
Type |
Name |
Description |
System.String |
data |
|
Returns
Type |
Description |
System.String |
|
RemoveUnderScore(String)
Removes the _ from enums for better display.
Declaration
public static string RemoveUnderScore(this string text)
Parameters
Type |
Name |
Description |
System.String |
text |
|
Returns
Type |
Description |
System.String |
|
ResolveIp(String)
Declaration
public static IPAddress ResolveIp(string server)
Parameters
Type |
Name |
Description |
System.String |
server |
|
Returns
Type |
Description |
System.Net.IPAddress |
|
ResolveIp(String, BattleNetClient)
Resolves an ip from a hostname or an ip.
Declaration
public static IPAddress ResolveIp(string server, BattleNetClient bot)
Parameters
Type |
Name |
Description |
System.String |
server |
The server to resolve.
|
BattleNetClient |
bot |
|
Returns
Type |
Description |
System.Net.IPAddress |
The IPAddress of the requested server.
|
ReverseString(String)
Declaration
public static string ReverseString(this string s)
Parameters
Type |
Name |
Description |
System.String |
s |
The string to be reversed.
|
Returns
Type |
Description |
System.String |
The reversed strig.
|
StringToByteArray(String)
Turns a string into a byte array
Declaration
public static byte[] StringToByteArray(string Data)
Parameters
Type |
Name |
Description |
System.String |
Data |
The string of data to be turned into a byte array.
|
Returns
Type |
Description |
System.Byte[] |
The byte array of the string.
|
ToUnixTime(DateTime)
Declaration
public static int ToUnixTime(this DateTime timestamp)
Parameters
Type |
Name |
Description |
System.DateTime |
timestamp |
|
Returns
Type |
Description |
System.Int32 |
|
ToUnixTime(DateTime, Int32)
Declaration
public static int ToUnixTime(this DateTime timestamp, int subtract)
Parameters
Type |
Name |
Description |
System.DateTime |
timestamp |
|
System.Int32 |
subtract |
|
Returns
Type |
Description |
System.Int32 |
|
TryValidateCDKey(String, BattleNetGame, ConnectionType, out String, out Int32, out String)
Checks if the cdkey is the proper length and contains only valid characters. It also removes spaces and dashes and returns the value.
Declaration
public static bool TryValidateCDKey(string cdkey, BattleNetGame game, ConnectionType conType, out string validatedkey, out int errorCode, out string errorMessage)
Parameters
Type |
Name |
Description |
System.String |
cdkey |
the cdkey to be checked
|
BattleNetGame |
game |
the client the cdkey is for
|
ConnectionType |
conType |
|
System.String |
validatedkey |
the return value of the cdkey
|
System.Int32 |
errorCode |
|
System.String |
errorMessage |
|
Returns
Type |
Description |
System.Boolean |
if the cdkey has passed the sanity checks or not.
|
UnixTimeStamp(Int64)
Declaration
public static DateTime UnixTimeStamp(long timestamp)
Parameters
Type |
Name |
Description |
System.Int64 |
timestamp |
|
Returns
Type |
Description |
System.DateTime |
|
WardenProductIdToInt32(BattleNetGame)
Converts enumClient to the local warden client byte.
Declaration
public static int WardenProductIdToInt32(BattleNetGame client)
Parameters
Returns
Type |
Description |
System.Int32 |
|