• Welcome to Valhalla Legends Archive.
 

EID_ShowUser

Started by iNsaNe, November 10, 2007, 11:02 PM

Previous topic - Next topic

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:

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;
}
        ...
...



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.

Mystical

uhm the users that it dont add would they happened to be channel operators?

iNsaNe

#2
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.

l2k-Shadow

are you correctly parsing clumped TCP packets? ex: 2 0x0F messages sent inside one TCP message from the bnet server.
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

iNsaNe

Yeah, that's what the while loop is there for. It reads all of the data sent.

l2k-Shadow

#5
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..
Quote from: replaced on November 04, 2006, 11:54 AM
I dunno wat it means, someone tell me whats ix86 and pmac?
Can someone send me a working bot source (with bnls support) to my email?  Then help me copy and paste it to my bot? ;D
Já jsem byl určenej abych tady žil,
Dával si ovar, křen a k tomu pivo pil.
Tam by ses povídaj jak prase v žitě měl,
Já nechci před nikym sednout si na prdel.

Já nejsem z USA, já nejsem z USA, já vážně nejsem z USA... a snad se proto na mě nezloběj.

UserLoser

Quote from: iNsaNe on November 10, 2007, 11:41 PM
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.

Not always true, sometimes you'll get the so-called 'EID_USERFLAGS' msg

Mystical

Quote from: UserLoser on November 12, 2007, 07:17 PM
Quote from: iNsaNe on November 10, 2007, 11:41 PM
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.

Not always true, sometimes you'll get the so-called 'EID_USERFLAGS' msg

I just asked because i've had somewhat the same problem in the past, and it was because of flags update.

Chriso

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.

brew

Quote from: Chriso.de on November 13, 2007, 06:27 PM
EID_USERFLAGS is received when a user gains or loses operator status.
Or when there's some flag update ;) (doesn't necessarily mean just gaining/losing operator status, squelch/unsquelch, users gaining speaker flags, etc)
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Chriso

Quote from: brew on November 13, 2007, 08:14 PM
Or when there's some flag update ;) (doesn't necessarily mean just gaining/losing operator status, squelch/unsquelch, users gaining speaker flags, etc)
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.

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.