Skip to content

Instantly share code, notes, and snippets.

@KennethanCeyer
Created October 1, 2015 01:11
Show Gist options
  • Save KennethanCeyer/5e9e980661e053ef08d3 to your computer and use it in GitHub Desktop.
Save KennethanCeyer/5e9e980661e053ef08d3 to your computer and use it in GitHub Desktop.
It uses for the game client packet. If you treat the variable to DWORD or not, it makes you wish.
public void setBnetByte(String strData, bool isVariable = false)
{
String hexData = bnetHelper.Acsii2Hex(strData);
if (isVariable)
{
byte[] bData = bnetHelper.Hex2Byte(hexData);
this.setBnetByte(bData);
}
else {
UInt32 intData = UInt32.Parse(hexData, System.Globalization.NumberStyles.AllowHexSpecifier);
this.setBnetByte(intData, isVariable);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment