Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: warz on March 18, 2006, 01:31 PM

Title: [C++] User access flags (bitmasking?)
Post by: warz on March 18, 2006, 01:31 PM
I haven't done a moderation bot in forever. Infact, I don't think I've made one in C++. Anywho, I remember reading on certain forums about access flags, and turning them into hex values, or something. Apparantly it makes it easier to deal with?

Anyone know about this? Or can explain how this works..
Title: Re: [C++] User access flags (bitmasking?)
Post by: UserLoser on March 18, 2006, 02:09 PM
http://forum.valhallalegends.com/index.php?topic=7623.msg69281#msg69281
Title: Re: [C++] User access flags (bitmasking?)
Post by: warz on March 18, 2006, 03:05 PM
Alright, I'm pretty sure I understand this. How would you go, though, from the bitfield back to the A-Z equiv?
Title: Re: [C++] User access flags (bitmasking?)
Post by: Eric on March 18, 2006, 06:26 PM
if ((mask & FLAG_S) == FLAG_S)
{
    // S flag
}

if ((mask & FLAG_B) == FLAG_B)
{
    // B flag
}

...