• Welcome to Valhalla Legends Archive.
 

0x50 with C# Problem

Started by PhoeNix_FasT, August 15, 2007, 01:10 PM

Previous topic - Next topic

Hdx

ah, my bad I haven't really bothered to look at MBNCSutil more hen to fix stupid little problems joe comes  me with.
none the less, Using 'DWordStrings' in this case is just... ya.
I can understand inserting the product/platform ids as such. IF C# dosen't allow for
unsigned long int star_product = 'STAR';
It would make things simpler, but he should still get into the habbit of using things properly. If he were to use them only use on special occasions where the DWord value would be best represented/understood as a string (product/platform ids, as in BNI files)
And treating everything else as its proper numerical value.
/myopinion
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

MyndFyre

The thing is, it's not appropriate to say "InsertProductID" either, because these aren't strictly used for product IDs or platform IDs.  Another example of where they're used is Warcraft III stats.

It's my opinion that code clarity is significantly better when the string literal is present than when you encode the string into a series of bytes or an actual numeric value (which is what I take "treating everything else as its proper numerical value" to mean).  We all find it easier to understand a strings than a series of hex bytes.  Doing it this way also allows your library to black-box any endianness changes that might happen across platforms. 
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Camel

MindFyre, using constants would avoid that problem. I use the numerical values exclusively, but never directly.
public static final int PRODUCT_CHAT = 0x43484154;
public static final int PRODUCT_STAR = 0x53544152;
public static final int PRODUCT_SEXP = 0x53455850;
public static final int PRODUCT_W2BN = 0x5732424E;
public static final int PRODUCT_D2DV = 0x44324456;
public static final int PRODUCT_D2XP = 0x44325850;
public static final int PRODUCT_JSTR = 0x4A535452;
public static final int PRODUCT_WAR3 = 0x57415233;
public static final int PRODUCT_W3XP = 0x57335850;
public static final int PRODUCT_DRTL = 0x4452544C;
public static final int PRODUCT_DSHR = 0x44534852;
public static final int PRODUCT_SSHR = 0x53534852;

devcode

People who lack understanding of the language should stfu aka Hdx, fo reel

Hdx

People who lack common decency, and just like to flame people should fuck off. Namely devcode.
I know enough about the language to make my way, and enough about descent (descent not excellent), to voice my opinion on a public forum of which I have been a member for many years.
~Hdx

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status