Valhalla Legends Archive

Programming => Battle.net Bot Development => BnetDocs Research and Discussion => Topic started by: Hell-Lord on February 03, 2007, 05:43 PM

Title: D2 Game Flags
Post by: Hell-Lord on February 03, 2007, 05:43 PM
Realityripple has asked me to post this since he has not had his account creation accepted by an Admin. Anyway he has  the D2 game flag values. Apparently MCP_GAMELIST and MCP_GAMEINFO have incorrect data. The "status" field is incorrect it's a flag field and the correct values are as follows:


Public Const D2GAME_HARDCORE                  As Long = &H800      'Hardcore Game

Public Const D2GAME_NIGHTMARE                 As Long = &H1000     'Nightmare Game

Public Const D2GAME_HELL                            As Long = &H2000     'Hell Game

Public Const D2GAME_EMPTY                         As Long = &H20000    'Game is empty/Creator failed to join

Public Const D2GAME_EXPANSION                 As Long = &H100000   'Expansion Game

Public Const D2GAME_LADDER                       As Long = &H200000   'Ladder Game

Public Const D2GAME_DOWN                         As Long = &HFFFFFFFF 'Realm Down

Public Const D2GAME_GONE                         As Long = &HFFFFFFFE 'Game Doesn't Exist


And btw &HFFFFFFFF and &HFFFFFFFE are equal to -1 and -2 respectively
Title: Re: D2 Game Flags
Post by: Barabajagal on February 03, 2007, 06:08 PM
Apparently I can create another account and rename it to fit my needs, though. As a PS to this post which Paul made for me, I'd like to know if anyone else has recorded other values? And does anyone know why all the Flags have a 4 at the end of them?
Title: Re: D2 Game Flags
Post by: Hell-Lord on February 03, 2007, 06:10 PM
Hi  ;)
Title: Re: D2 Game Flags
Post by: topaz on February 03, 2007, 06:34 PM
Nah, they aren't -1 and -2.
Title: Re: D2 Game Flags
Post by: Hell-Lord on February 03, 2007, 06:37 PM
uh yea they are
Title: Re: D2 Game Flags
Post by: Barabajagal on February 03, 2007, 06:37 PM
If you're using vb, DWords end up being Longs, and since Longs can't handle that large of a number, it loops around. CLng(&HFFFFFFFF) = -1.
Title: Re: D2 Game Flags
Post by: topaz on February 03, 2007, 07:17 PM
0xFFFFFFFF == 4294967295L
0xFFFFFFFE == 4294967294L


Less fail, plz
Title: Re: D2 Game Flags
Post by: Barabajagal on February 03, 2007, 07:20 PM
Try MsgBox Hex$(CLng(-1))
Title: Re: D2 Game Flags
Post by: Yegg on February 03, 2007, 10:17 PM
Quote from: Ripple on February 03, 2007, 07:20 PM
Try MsgBox Hex$(CLng(-1))

No. topaz is correct on this.
Title: Re: D2 Game Flags
Post by: Ringo on February 04, 2007, 06:13 AM
That would depend totaly on the long being signed or unsigned, no?
Ripple: vb6 numeric data types are generaly signed.
An example of a signed long: -2147483648 to 2147483647
An example of a unsigned long: 0 to 4294967295

Point being -- Your both right? :P
Title: Re: D2 Game Flags
Post by: UserLoser on February 04, 2007, 11:47 AM
Quote from: Ripple on February 03, 2007, 07:20 PM
Try MsgBox Hex$(CLng(-1))

Like stated by Ringo, VB6 data types such as a long are signed.
Title: Re: D2 Game Flags
Post by: Barabajagal on February 04, 2007, 03:37 PM
As i said:

If you're using vb, DWords end up being Longs, and since Longs can't handle that large of a number, it loops around. CLng(&HFFFFFFFF) = -1.

Notice the first part of that sentence.
Title: Re: D2 Game Flags
Post by: E.T. on February 08, 2007, 11:26 PM
I have the 0x04 flag as 'Valid': it's in all packets containing an actual game, but the server also sends an empty packet at the end of the list which doesn't contain the flag or anything else, probably to tell the client it's now time to display the list...


        /// <summary>
        /// If not present, the packet contains no useful information.
        /// <para>For <see cref="RealmServer.GameList"/>, this means the packet marks the end of listing.</para>
        /// <para>For <see cref="RealmServer.GameInfo"/>, the game was destroyed since listed !?</para>
        /// </summary>
        Valid = 4,
Title: Re: D2 Game Flags
Post by: Barabajagal on February 08, 2007, 11:45 PM
A value of 4 for valid would make sense... it'd be nice to know if there were any other results... but so far, all the game flags return with 4. Any further info on flag meanings (there seems to be quite a few empty spaces) would be very appreciated.
Title: Re: D2 Game Flags
Post by: E.T. on February 09, 2007, 03:46 AM
I don't have any more info at the moment, sorry.