Quote:
Originally Posted by corbit15
ah ok. yeah i did notice it came at random times. alright well thanks for the input.
another question, how can i get flags? such as
BlueName = 1UL << 0,
|
You should learn basics of bit logic.
Each number in computers is actually a series of bits.
Int/Uint = 4 bytes
Byte = 8 bits (binary octet)
Each bit can be either 1 or 0 (on/off)
Therefor Unsigned integer (positive only) has a max value of 4294967297
This can be found by doing...
2^32 + 1
Now... why is this useful? well it means that this is really just a huge long binary string. Using bit logic we can use it to store a huge list of true and false statements... this is how status effects in conquer work.
There's a total of 16 bytes of status effects sent in every character spawn packet... This is troublesome seeing as the largest standardized data type in C# is ULong (8 bytes, max value 18,446,744,073,709,551,615). This is why most sources split it into two "pools" of effects (each a ulong).
Now... the code you just pointed out is the same as saying...
"take the value 1 and place X zeros at the end of it"
We are 'shifting' the bit over.
If we discuss this in binary terms it gives us the following..
1UL << 0 = 1
1UL << 1 = 10
1UL << 2 = 100
1UL << 3 = 1000
1UL << 4 = 10000
1UL << 5 = 100000
1UL << 6 = 1000000
1UL << 7 = 10000000
1UL << 8 = 100000000
note, I posted 8 not because I feel you're dumb and need so many examples but because there are 8 bits in one byte
Ok so this is useful for the reason that we can COMBINE the effects.
1UL << 0 + 1UL << 1 = 11
1UL << 1 + 1UL << 8 = 100000010
Etc
So... To take this back on topic, the way you 'find' these values is by trial and error. You set your status effect to be 1UL << 0 (first possible bit is active), then you try setting status effect to 1UL << 1 (second possible bit is active). You then write down what each one does and you have a list.
Ooh... or you just look in the client which has a complete list of effect name and number of bits it's shifted over but where's the fun in that?
Phew, lots of typing but hopefully someone will find this interesting or educational and hopefully... not incorrect <_< I didn't really take the time to proof read or check this, it's really off the top of my head so please let me know if I missed something or explained something wrong.