• Welcome to Valhalla Legends Archive.
 
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - Barumonk

#1
There are probably more elegant ways to handle this but oh well, here goes...

private bool m_Active = true;

...

//initialize everything

while (m_Active)
{
    //handle something here, be it sockets or console commands

    //m_Active = false; to shutdown
}

//dispose unmanaged resources, shut down the bot
#2
I know -_-;; I'm saying the closest thing possible in C# to a macro is a function that would have a similar return.  I'm just afraid of boxing and unboxing, or passing oversized objects.  I'll probably just get un-lazy and pass x, y, and z.
#3
The reason is that I don't want to pass a reference type that I don't think qualifies as small enough not to cause a performance hit, and I want to keep backwards compatability with another library.  -_-  Although I just realized that it wouldn't matter with this implementation because I would still be passing the reference type to the function that splits it appart.  I also realize its a macro but they aren't possible in C#, its why im calling it a function because thats the only way I can see it in C#.

Anyway, I just fixed it by changing Vector to a struct instead of a class.
#4
C/C++ Programming / Re: C++ 6.0 Or .NET?
January 15, 2005, 07:43 PM
In .NET, you can mix normal C++ code and .NET code in the same application.  If your not trying for speed then its great.  In .NET you don't need to worry about releasing objects as much as in normal C++, but it does still matter.  Most of the time you will find yourself implementing the IDisposable interface on managed reference types to eliminate 3rd generation+ GC objects that aren't being used by the application anymore.  In certian situations, not worrying about allocating and disposing the managed objects and letting the GC handle them can speed up your application beyond that of a normal C++ application, but it generally requires some type of strategy (dispose pattern).

If you really get lazy, when someone complains that there is no linux or mac versions, you can direct them towards the Mono implementation of the framework, which requires no extra programming on your part.  The .NET Portable framework is also in the works, but Mono is farther ahead at the moment.  Thats all I can think of right now. ^^
#5
I'm attempting to reproduce this bit of C/C++ code into C#...

#define VectorExpand(v) (v).x, (v).y, (v).z

... and following code is a basic explanation in C# of how it would idealy work...

public class Vector
{
    public float X;
    public float Y;
    public float Z;

    public Vector(float p_X, float p_Y, float p_Z)  //constructor
    {
        X = p_X;
        Y = p_Y;
        Z = p_Z;
    }
}

public class VectorUtil
{
    public void MethodNumber1()
    {
        MethodNumber3( VectorExpand( MethodNumber2() ) );  //this is my problem
    }

    public Vector MethodNumber2()
    {
        return new Vector(43, 56, 83);  //return a vector
    }

    public void MethodNumber3(float p_X, float p_Y, float p_Z)
    { /***/ }
}


VectorExpand returns 3 separate floats that aren't in an array. Well, technically its a params type array, but unless I missed something, its not possible to use params like that.  Does anyone know how to duplicate this in C# or maybe within IL code?  I know its possible in MVC++ but I want to avoid the slowdown from marshalling, im going for speed. =/
#7
Battle.net Bot Development / Re:BRAND NEW
May 11, 2003, 02:17 AM
Air Force/Navy have computer programmer as a possible MOS, the Army *may* have it and I know the Marines don't.  If a recruiter told you otherwise he is lying.  Also for reference they use C/C++, Cobal and Fortran.
#8
First Name: Jordan
Age: 18
Current Location: St. Charles, Missouri, United States
Known Languages: English, French, and Visual Basic; Learning C/C++
Description: High School drop out, obtained my G.E.D. through the military.  Quiet and shy person, so I most likely won't post more then once a week.
#9
Battle.net Bot Development / Re:Some help...
April 30, 2003, 12:24 AM
To answer your question, the packet is built correctly but it doesn't seem as you have given the required code to make it "work".  Assuming "Packet" is the reference used to the PacketBuffer Class:

With Packet
   'Build Here, example: .InsertDWORD &H0
End With

A suggestion is to check to make sure its using WarCraft II BNE before initiating a connection, it would be pointless to connect, send your Protocol byte only to stop right there... or you could just set it up for use with any product.  Also ".InsertDWORD &H360", you might wanna customize that unless you want everyone who uses it's timezone to be GMT -6 [Central Time Zone, North America].
#10
Battle.net Bot Development / Re:1.10
April 29, 2003, 05:05 PM
Quote from: MesiaH on April 29, 2003, 01:48 PM
You got it all wrong, the ORIGINAL bnetauth.dll does not support the new hashing method used in 0x51, and does support the hashing for the old login. Please remember that Stu created the original bnetauth.dll, and somebody else edited it and used one-letter functions, which wasnt entirely meant for distribution...

My mistake, I obviously wasn't aware of the difference in versions by developers.
#11
Battle.net Bot Development / Re:0x51
April 29, 2003, 12:32 PM
From what I can tell your asking for source code, which isn't the best idea.  I can give you a few links to look into that will hopfully give you enough of an idea of how to build and parse them yourself that you don't need anyone elses source code [not to mention you feel alot better about what you have accomplished if you write it yourself].

Short explaination of WORDs, DWORDs, and things of the like:
http://forum.valhallalegends.com/phpbbs/index.php?board=17;action=display;threadid=520;start=msg3630#msg3630

Documentation of SID_AUTH_INFO [0x50] and SID_AUTH_CHECK [0x51] including the server responses, you will need to create an account for this one:
http://www.valhallalegends.com/arta/bnetdocs/

In many people's opinion if you don't already know the first link then you shouldn't be programming binary bots, or just programming at all, so perhaps you should learn those for future discussions if you don't already know them.  This is a really crappy post, oh well, I need a cup of coffee.
#12
Battle.net Bot Development / Re:1.10
April 28, 2003, 09:57 PM
Hash.dll and CheckRevision.dll don't need any update to work correctly for RATS/PXES v1.10.  If your using 0x51 then BnetAuth.dll would be much better as it holds the functions of both Hash.dll and CheckRevision.dll along with several additions, but I dont beleive BnetAuth.dll supports the old login method with 0x07 and 0x36.
#13
Thanks, you just saved me alot of time and trouble.  I'll find another way eventually, there is always a way to do something, it just depends on how hard you reach for it if you succeed or fail.
#14
Would it be possible to do this?

Public CModule() As New ClassModule
ReDim CModule(0)

...then later in the program...

ReDim Preserve CModule(UBound(CModule) + 1)

I was going to create a winsock using api in a class module and use this as a way to add a new socket without knowing how many would be needed beforehand, but I thought it would be best to ask first incase I might be wasting my time.