Valhalla Legends Forums Archive | Battle.net Bot Development | BN# - Beta 1

AuthorMessageTime
Myndfyr
BN# (that's "BN-Sharp") has reached Beta 1!

If you haven't yet heard of BN#, it's a Microsoft .NET Framework-based utility library meant for simplifying the process of connecting to Battle.net.  It's a highly-optimized, highly efficient, object-oriented, and extensible drop-in for most Battle.net projects.  Oh, and I almost forgot to mention -- it's open-source.


[u]What's new in Beta 1?[/u]
New Features
[list][*] Most appropriate classes has have WCF attributes applied to them and can be serialized with a DataContractSerializer.
[*] Added the ability to request user profiles.
[*] Friends support was added in this release
[*] BN# exposes a new event called EventExceptionThrown.  The purpose of this event is to allow a host application to know when a specific plugin or feature set is causing an error and handle it gracefully.  JinxBot will handle this condition, for example, by allowing the user to unload plugins on-demand if they are causing many exceptions.
[*] Additional clan support was added; BN# now understands and supports events for clan functions such as formation, chieftan change, new formation searching, and disband.  Corresponding new functions include BeginClanCandidateSearch, InviteUsersToNewClan, RespondToNewClanInvitation, DisbandClan, and DesignateClanChieftan.  Corresponding new events include ClanCandidatesSearchCompleted, ClanFormationCompleted, ClanFormationInvitationReceived, ClanDisbandCompleted, ClanInvitationReceived, ClanInvitationResponseReceived, ClanRemovalResponse, LeftClan, and ClanChangeChieftanCompleted.
[*] A new interface is supported for the ordering of packet parsing priority.  This would allow, for example, a moderation plugin to require that ChatEvent packets are processed first (to receive UserJoined events).  To support this functionality, implement the IPacketPriorityProvider interface in the BNSharp.Plugins namespace, and call BattleNetClient.RegisterCustomPacketPriorities/UnregisterCustomPacketPriorities.
[*] A demonstration project of a JinxBot plugin for adding MCP (Realm Server) support to BN# is available in the repository.  It obeys some JinxBot contracts, but extends BN# to include handling for realm servers.
[*] A new method was added to BattleNetClient called CreateAccount().  If the login process fails, you can attempt to create the account by calling CreateAccount; it will use the information provided in the Settings object (this information can be changed dynamically at run-time).  CreateAccount will result in the AccountCreated or AccountCreationFailed events to be raised; if AccountCreated is raised, the client will automatically log in.
[*] The client no longer automatically disconnects because of an account login failure.  (CD key or versioning failure still results in an automatic disconnect).
[*] To support the no auto-disconnect policy, a new method was added to BattleNetClient called ContinueLogin().  This method allows the user to change the Settings object to modify the username and password of the desired login and then begin logging in again.
[/list]

Breaking Changes
[list][*] By default, BNSharp requires support for .NET 3.0 because it references System.Runtime.Serialization version 3.0.0.0.  For details on compiling without support for WCF data contract serialization, see the article Compiling BN# for .NET 2.0 on the JinxBot wiki.
[*] IBattleNetSettings now requires a new property, '''PingType''', which allows the connection to attempt to drive a 0ms, -1ms, or standard ping type.  Old code will need to add this property to the IBattleNetSettings implementation class.
[*] Users now automatically have a Stats property that contains a reference to a class derived from UserStats.  This change is breaking and will impact code written for an older CTP release.  If using the latest code, this will be compatible with handling code from r15 or newer.
[*] The LoginFailed event is no longer prototyped as EventHandler but LoginFailedEventHandler.  The LoginFailedEventArgs class contains contextual information about the reason for login failure.
[/list]

Non-Breaking Changes
[list][*] BN# includes the attributes used for data contract serialization as internal, stub attributes that will enable cross-versioning compatbility.  For more information, see the article on compiling for .NET 2.0.  This also removes the #if !NET_2_0 conditionals wrapping the attribute declarations throughout the data code.
[*] BN# now guarantees events are fired in the correct order by creating additional threads and event queues.  This should increase the reliability of the order of events when joining a channel, for example.  (Previously, joining a channel could cause a user to be listed as joined before the ChannelJoined event fired due to a race condition, which could cause the user to be added to the user list and then removed).
[*] Events on a BattleNetClient now have dedicated threads for Normal- and Low-priority event handlers.  High-priority events are still executed on the Parse() loop.  All Normal-priority event handlers are executed before outstanding Low-priority event handlers are executed.
[*] Added a new Position property to the MBNCSUtil DataReader class.
[*] Modified the non-Lockdown version of CheckRevision to use approximately 25mb less of memory allocations and reallocations, saving 3-4 gen-0 garbage collections.  The Lockdown version of CheckRevision uses significantly less memory and will be updated in a future version of BN#.
[/list]

Bug fixes
[list][*] Corrected a defect in which a Warcraft 3 statstring would be incorrectly parsed due to a server defect.
[*] Corrected the IBattleNetEvents interface and the EventSink interface to expose all events
[*] Guarantees correct detection of Disconnected events.
[/list]

Get BN# from the above link and check out the online documentation!
August 8, 2008, 7:29 AM
Myndfyr
I released Beta 2; it was a bugfix release and offers a new utility class that gets about halfway there to the full implementation of Warden.  This functionality will be rolled into MBNCSUtil proper soon as well.

New Features
[list]
[*]Support for Warden has been partially implemented in the BNSharp.MBNCSUtil namespace in the class WardenEncryptionContext. The end-user is still required to implement the IWardenModule interface. However, developing the implementation should be significantly improved. This contribution was a joint effort by Warrior[x86] and MyndFyre.
[*]Several changes that were related to Warden have been implemented and rolled into the BattleNetClient class. These issues did not necessarily prevent correct implementation of Warden, but they did not follow the documentation and were corrected in this release.
[*]Corrected an issue that caused an exception on the parsing thread during friend updates on Starcraft and Brood War.
[/list]

What's coming for Beta 3
[list]
[*]Support for Warcraft III profiles and clan information lookups.
[*]Built-in support for ad messages.
[*]Support for setting e-mail interactively during login.
[*]Sanity checking for passing the IBattleNetSettings interface.
[*]The ability to change the server on ConnectionBase without reinstantiating the class.
[*]Binary Join Channel command function.
[*]Support for chat message throttling via the ICommandQueueProvider interface.
[*]All remaining internal connection status strings will be removed into the localizable file format.
[/list]
August 15, 2008, 9:05 AM

Search