Valhalla Legends Archive

Programming => Battle.net Bot Development => Topic started by: Chriso on October 27, 2007, 06:40 AM

Title: [MBNCSUtil] NLS.CreateAccount()
Post by: Chriso on October 27, 2007, 06:40 AM
I am getting an exception when I try to call the CreateAccount() method within the NLS class, here is the exception:

System.IO.IOException was unhandled
  Message="There is insufficient space in the data buffer for the account creation packet."
  Source="MBNCSUtil"
  StackTrace:
       at MBNCSUtil.NLS.CreateAccount(Stream stream)
       at MBNCSUtil.NLS.CreateAccount(Byte[] buffer, Int32 startIndex, Int32 totalLength)
       at MBNCSUtil.NLS.CreateAccount(BncsPacket acctPacket)


Here is my code:

            AddChat(Color.Yellow, "Attempting to create account...");
            BncsPacket x52 = new BncsPacket((byte)Constants.PID.SID_AUTH_ACCOUNTCREATE);
            NLS nls = new NLS(Config.Username, Config.Password);
            if (nls.CreateAccount(x52) > 0) {          < --- problem occurs here
                bncs.SendData(x52.GetData());
            }
            else
            {
                AddChat(Color.Red, "NLS CreateAccount() call returned no data!");
            }


Any thoughts or suggestions?

I am using MBNCSUtil 2.0.3.15

[Edit: deleted long line that was breaking the layout.]
Title: Re: [MBNCSUtil] NLS.CreateAccount()
Post by: iNsaNe on October 27, 2007, 12:27 PM
why not just do this?

nls.CreateAccount(x52);
Title: Re: [MBNCSUtil] NLS.CreateAccount()
Post by: Chriso on October 27, 2007, 03:15 PM
If you read the documentation, it returns the length of the data... Therefore if the CreateAccount() call fails it would send a malformed packet...
Title: Re: [MBNCSUtil] NLS.CreateAccount()
Post by: MyndFyre on October 27, 2007, 05:37 PM
Hm, what version of .NET are you using (2.0 or 3.5)?  Are you using a Visual Studio 2008 beta?
Title: Re: [MBNCSUtil] NLS.CreateAccount()
Post by: Chriso on October 28, 2007, 02:57 AM
.NET 2.0, VC# Express 2005
Title: Re: [MBNCSUtil] NLS.CreateAccount()
Post by: MyndFyre on October 28, 2007, 04:47 AM
See if you can hit me up on IM.  Do you use the source code or just the binary?  I'd like to walk you through stepping into the code to see exactly what the issue is.
Title: Re: [MBNCSUtil] NLS.CreateAccount()
Post by: Chriso on October 28, 2007, 05:16 AM
I am just using the binary actually, I will be on AIM tomorrow around 10am AEST (Australian Eastern Standard Time) which is GMT+10 :P