[ the jinxbot project :: home | community forum | bn# | controls | mbncsutil | get the source ]
Completes a DataBuffer implementation with the additional data used by the BNCS protocol.

Namespace:  MBNCSUtil
Assembly:  MBNCSUtil (in MBNCSUtil.dll) Version: 2.1.7.22 (2.1.7.22)

Syntax

C#
public sealed class BncsPacket : DataBuffer
Visual Basic (Declaration)
Public NotInheritable Class BncsPacket _
	Inherits DataBuffer
Visual C++
public ref class BncsPacket sealed : public DataBuffer

Examples

The following example illustrates creating a buffer that contains only the SID_NULL packet:

Note: this example assumes you have a Socket object called "sck" in the current context.

CopyC#
1[C#]
2BncsPacket pckNull = new BncsPacket(0);
3sck.Send(pckNull.GetData(), 0, pckNull.Count, SocketFlags.None);
Copy 
1[Visual Basic]
2Dim pckNull As New BncsPacket(0)
3sck.Send(pckNull.GetData(), 0, pckNull.Count, SocketFlags.None)
CopyC++
1[C++]
2BncsPacket ^pckNull = gcnew BncsPacket(0);
3sck->Send(pckNull->GetData(), 0, pckNull->Count, SocketFlags.None);

Examples

The following example illustrates calculating the revision check (SID_AUTH_ACCONTLOGON) of Warcraft III:

Note: this example assumes you have a Socket object called "sck" in the current context.

CopyC#
1[C#]
2BncsPacket pckLogin = new BncsPacket(0x53);
3NLS nls = new NLS(userName, password);
4nls.LoginAccount(pckLogin);
5sck.Send(pckLogin.GetData(), 0, pckLogin.Count, SocketFlags.None);
Copy 
1[Visual Basic]
2Dim pckLogin As New BncsPacket(&H51)
3Dim nls As New NLS(userName, password)
4nls.LoginAccount(pckLogin)
5sck.Send(pckLogin.GetData(), 0, pckLogin.Count, SocketFlags.None)
CopyC++
1[C++]
2// NOTE that userName and password must be System::String^, not char*!
3BncsPacket ^pckLogin = gcnew BncsPacket(0x51);
4NLS ^nls = gcnew NLS(userName, password);
5nls->LoginAccount(pckLogin)
6sck->Send(pckLogin->GetData(), 0, pckLogin->Count, SocketFlags.None);

Inheritance Hierarchy

System..::.Object
  MBNCSUtil..::.DataBuffer
    MBNCSUtil..::.BncsPacket

See Also