• Scheduled Server Maintenance | Friday 6 November

    Our hardware provider has scheduled RAM maintenance to address the recent server instability. Work is expected by 17:00 Central European time.

    Brief downtime or interruptions may occur while the faulty memory modules are replaced. We apologise for the recent disruption and appreciate your patience.


    Special thanks to our sponsor, HyperFilter!

    We keep our community safe. They keep our servers safe. Running your own game servers? Keep them protected with HyperFilter.

MSN protocol fun

Newbie Spellweaver
Joined
Jun 14, 2009
Messages
8
Reaction score
0
OK so I see that sometimes it can get garbled up like this:

Code:
Messenger returned: <NOTIFICATION ver="2" id="2" siteid="0" siteurl="http://g.live.com/"><TO name="[email protected]" pid="0x0:0x0"/><MSG pri="1" id="2"><ACTION url="5meen_us/80"/><SUBSCR url="5meen_us/80"/><BODY lang="1033" icon=""><TEXT>To see your offline messages, get the latest version of Windows Live(TM) Messenger.</TEXT></BODY></MSG></NOTIFICATION>ILN 0 NLN [email protected] display_name 2788999212

The ILN command is just this:
http://msnpiki.msnfanatic.com/index.php/Command:ILN
That's not my problem though...

the code that handles commands is this:
Code:
                    while ((lol = streamReader.ReadLine()) != null)
                    {
                        if (lol.StartsWith("MSG"))
                        {
                            String[] param = lol.Split(' ');
                            int i = 0;
                            String message = "";

                            while (i != Convert.ToInt32(param[3]))
                            {
                                String m = streamReader.ReadLine() + "\r\n";
                                message += m;
                                i += (new ASCIIEncoding()).GetByteCount(m);
                            }

                            DebugLine("Messenger returned: " + message);
                        }
                        else
                        {
                            DebugLine("Messenger returned: " + lol);
                            handleReturn(lol);
                        }
                    }

Any idea how I could work around this issue, I know there are a few ways for handling this but what would be the best?
 
Can you add a language tag in front of the topic's title? Looks like either [Java] or [C#] but I can't see which one :P. Thanks.
 
Back