Valhalla Legends Forums Archive | Battle.net Bot Development | EID_ShowUser

AuthorMessageTime
iNsaNe
When I join a channel with my bot and receive the EID_ShowUser (0x01) sub message for SID_ChatEvent, 75% of the time I don't receive the first two users (at the top of the channel). So if there was 25 users in the channel, I would be only able to add 23 of them to my channel list. I'm not sure how to parse this message correctly, unless I make battle.net give me a user update which I dont want to do (for flooding reasons). I am using war3

This is my code:

[code]case 0x0F: //chat event
{
int eventid = rd.ReadInt32();
switch (eventid)
{
case 0x01: //show user
{
rd.SeekTo(0);
while (rd.Position != rd.Length)
{
rd.Seek(28);    //moves past the header and other values

String ^username = rd.ReadNTString();
array<String ^> ^userinfo = rd.ReadNTString()->Split(' ');

lvChannel->Items->Add(username, geticonpos(userinfo[0], userinfo[1]));
}

break;
}
        ...
...[/code]


Wouldn't the code be correct because of the while loop? I mean, sometimes Battle.net throws in jumbled packets... so I'm not sure what is wrong and why I am not parsing it correctly.
November 11, 2007, 5:02 AM
MyStiCaL
uhm the users that it dont add would they happened to be channel operators?
November 11, 2007, 5:06 AM
iNsaNe
no because channel operators have different flags, not separate packets.

--edit: When i say the at the top of the channel, i dont necessarily mean channel operators. It's who ever is at the top.
November 11, 2007, 5:41 AM
l2k-Shadow
are you correctly parsing clumped TCP packets? ex: 2 0x0F messages sent inside one TCP message from the bnet server.
November 11, 2007, 5:54 AM
iNsaNe
Yeah, that's what the while loop is there for. It reads all of the data sent.
November 11, 2007, 6:08 AM
l2k-Shadow
imo you'd be better off splitting the packets right after your recv() call, then pass it to your 0x0F handler and get rid of the loop.

however if that is not causing the problem, perhaps it's a threading issue where the threads are running over each other.
-- it's quite hard to tell.. if the code parses the other 23 persons correctly, i'd try to look into more abstract issues outside of that code section..
November 11, 2007, 6:31 AM
UserLoser
[quote author=iNsaNe link=topic=17164.msg174764#msg174764 date=1194759664]
no because channel operators have different flags, not separate packets.

--edit: When i say the at the top of the channel, i dont necessarily mean channel operators. It's who ever is at the top.
[/quote]

Not always true, sometimes you'll get the so-called 'EID_USERFLAGS' msg
November 13, 2007, 1:17 AM
MyStiCaL
[quote author=UserLoser link=topic=17164.msg174801#msg174801 date=1194916623]
[quote author=iNsaNe link=topic=17164.msg174764#msg174764 date=1194759664]
no because channel operators have different flags, not separate packets.

--edit: When i say the at the top of the channel, i dont necessarily mean channel operators. It's who ever is at the top.
[/quote]

Not always true, sometimes you'll get the so-called 'EID_USERFLAGS' msg
[/quote]

I just asked because i've had somewhat the same problem in the past, and it was because of flags update.
November 13, 2007, 1:18 AM
DDA-TriCk-E
EID_SHOWUSER is received when you join a channel where there are operators already designated. EID_USERFLAGS is received when a user gains or loses operator status.
November 14, 2007, 12:27 AM
BreW
[quote author=Chriso.de link=topic=17164.msg174815#msg174815 date=1195000052]
EID_USERFLAGS is received when a user gains or loses operator status.
[/quote]
Or when there's some flag update ;) (doesn't necessarily mean just gaining/losing operator status, squelch/unsquelch, users gaining speaker flags, etc)
November 14, 2007, 2:14 AM
DDA-TriCk-E
[quote author=brew link=topic=17164.msg174817#msg174817 date=1195006472]
Or when there's some flag update ;) (doesn't necessarily mean just gaining/losing operator status, squelch/unsquelch, users gaining speaker flags, etc)
[/quote]
Yeah it was just an example.

Another little thing you might want to support is void viewing, which is done by sending /unignore [yourname].  It will send an EID_USERFLAGS event for each user in The Void and you will need to add each user to the listview.
November 14, 2007, 4:28 AM
iNsaNe
I'm trying to avoid getting userflags to refresh the channel list.

I created a new thread (i'm quite new to threads) it seems to be working great except that now like 25% of the time im missing 1 user.
November 14, 2007, 6:10 AM

Search