Valhalla Legends Forums Archive | Battle.net Bot Development | Handing out a BNLS Connection...

AuthorMessageTime
Myndfyr
Hi all,

Many cheers to those of you who helped me out. I've gotten it to connect to bnet with SC/BW, and I guess the reason I haven't been able to get it to connect with WC2 or D2 is that I haven't set it up to send ASCII strings (just UTF-8) yet. No big deal.

I was wondering if you guys would mind terribly if I freely handed out a bot sort of API.... Basically, when I designed my bot, I tried to make the connection mechanism as abstract and high-level as possible. That way, anyone could pick up my library (correction... anyone with the .NET runtime) and plug it into their own bot - kind of like CSB, but without a chat window preprogrammed for you.

It would include basic options - what kind of connection/game, whether or not to enable UDB, cd keys, Username/passwords, etc.

My way to secure it and make sure that I have some idea of who is using this API is to have it retrieve _my_ BNLS bot name and password from my webserver... This would be a quick, single call, but at least I'd get to see who was using it (if I set up my own registration system).

Which brings me back around to my question - would you all mind terribly if I did this? I don't want to do something that could jeopardize what you have set up with BNLS, so I won't do anything if you don't want me to.

Thanks for the help! I look forward to showing you guys the final product. =)

--Rob
September 30, 2003, 11:46 PM
Hitmen
As long as it's much less newb-friendly than CSB I'm sure no one would mind, at least make it so people need to know *something* about programming to use it.

And I don't think anyone could really "jeopardize what they have set up with BNLS" right now :P
September 30, 2003, 11:58 PM
iago
I would recommend encryping it, although it doesn't seem like the best idea to do that.

Actually, I would suggest just pretending to do that, expecting to get back certain verification information that would allow them to use it, and don't let it connect unless it gets that information. That is, I'm assuming that you're doing this because you want to know who's using it, not because you want to get the code but because you want to find out who's using it :)
October 1, 2003, 12:33 AM
Myndfyr
Well, I'm not sure if it's much-less-newb-friendly... Right now, I've got:

-- public enumerations for the games.
-- abstract Packet class, inherited by BnlsPacket, BnetPacket, and RealmPacket that provide automatic implementation of the correct ordering of headers and correct string encoding (ASCII vs. UTF-8), and automatic string reversal for the InsertNonNTString(string) method.
-- single Connection class. Basically, you call InitializeConnection. It has one event to handle in and of itself (StateChanged), which sends yet another flags-type enumeration back to any consumers about what is connected and what isn't.
-- The Connection class has an EventHost property which holds an EventHost class. This class is instantiated only once per connection, and anything that wants to consume the events from Bnet is required to wire into these events.... Basically:
EventHost.Disconnected
EventHost.JoinedChannel
EventHost.LeftChannel
EventHost.WhisperReceived
EventHost.WhisperSent
EventHost.Talk
EventHost.Broadcast
EventHost.ChannelInfo
EventHost.User // fired for 0x01 ShowUser or 0x09 UserFlags
EventHost.ChannelFull
EventHost.ChannelDNE
EventHost.ChannelRestricted
EventHost.Info
EventHost.Error
EventHost.Emote
EventHost.Unknown

That's it. As many clients as they want can wire into this event host (per the .NET model), and boom, that's it.

Right now, obfuscation is a technology a little beyond my (monetary) grasp, although if people donate to the project (once I have a website setup), perhaps I'll buy it to obfuscate my API assembly. At least for now, though, I'll make it so that the consumer can't get onto BNLS without contacting my webservice with his/her own username and password (to use my API assembly).

-Rob
October 2, 2003, 12:06 AM
K
Google for Dotfuscator. the community edition is free. If you have a function like this:
[code]
public static void DoSomething(MyClass first, string second)
{ MyClass first = new MyClass(first, second); }[/code]

You can end up with something like this:

[code]
public static void a(a a, string b)
{ a c = new a(a, b); }
}[/code]

Which can get very confusing very quickly, since it can rename instances and types to the same thing :-D.
October 2, 2003, 5:43 AM
iago
haha, I should use that for my CS assignments! :)

but isn't obfuscation a bad thing?
October 2, 2003, 3:56 PM
kamakazie
[quote author=iago link=board=17;threadid=2911;start=0#msg22817 date=1065110219]
haha, I should use that for my CS assignments! :)

but isn't obfuscation a bad thing?
[/quote]

that is how a lot of people's code looks like in my class. Is very annoying.
October 2, 2003, 4:58 PM
K
Right, but dotfuscator does it on the assembly after it's compiled -- it doesn't touch your original source code. You'll only see the obfuscated code if you look at or decompile the MSIL.
October 2, 2003, 7:26 PM
Myndfyr
Dotfuscator (the community edition) ships free with VS 2003 right?
October 2, 2003, 8:12 PM
K
Yup. I'm not really sure what it's capabilities are, since I use the pro one.
October 2, 2003, 8:59 PM

Search