• Welcome to Valhalla Legends Archive.
 

.net...

Started by ExOrCizT, September 30, 2003, 08:07 PM

Previous topic - Next topic

MyndFyre

Quote from: Kp on October 01, 2003, 10:32 PM
There is a layer of buffering done directly by the OS for you on any stream socket.  Is this what you meant, or is .NET wasting extra resources by rebuffering beyond that?
Well, they *call* it a buffer, and so I've just more or less gone with the flow....  In reality, I'm supposed to declare a byte[] and the system transfers the received data into the byte[], where I then get to parse it into Unicode or ASCII or UTF-8... or just the dwords, etc.  Buffering is done by the system, I just get the data.

Quote from: Kp on October 01, 2003, 10:32 PMIsn't that what I told you to do in the first place? :)
Well, I don't know, I guess I misunderstood what you meant....

Quote from: Kp on October 01, 2003, 10:32 PMAlso, I find the implementation of your parsing code to be greatly amusing.  It is approximately the same length as my C implementation, except mine does no extra memory allocations, and performs copies only when absolutely necessary (which is generally quite rare due to how I handle incoming messages :)).  It's not your fault your parser is so much less efficient, at least not directly.  It's the fault of your choice of language. :)  Am I correct to assume that, like Java, .NET lacks the concept of pointer arithmetic?  If it has such a concept, your code could potentially be improved quite a bit performance-wise.
Not exactly....  Essentially, the *common type system* doesn't support pointers; however, a language can support pointers.  In my case, using C#, I *could* use pointers, but I'd have to enable "unsafe code support" in the compiler.  The class library doesn't really provide much in the way of pointers, either, so I don't see what the big deal is.  Eh, I'm not overtly concerned about performance right now - it's actually running fairly well.  I might rewrite it to Managed C++ for the next version - but that will be once I *learn* C++.  =)  I just got pointer arithmetic down a couple weeks ago.

I'm having trouble getting WC3 (standard) to authenticate.  Here are my packet orders:

BNLS_AUTHORIZE (0x0e)
BNLS_AUTHORIZEPROOF (0x0f)
SID_AUTH_INFO (0x50)
BNLS_VERIFYSERVER (0x11) -- I'm getting a failure back here, although I might be copying the data wrong.
BNLS_CDKEY (0x01)
SID_AUTH_CHECK (0x51)
BNLS_HASHDATA (0x0b)
SID_LOGINRESPONSE2 (0x3a) -- I don't think I'm getting quite this far.

This works for SC, BW, W2, D2, and (I assume) JStr.  Any ideas?

Thanks!

--Rob
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

K

#16
Quote from: Myndfyre on October 02, 2003, 01:22 AM
I might rewrite it to Managed C++ for the next version - but that will be once I *learn* C++.  =)  I just got pointer arithmetic down a couple weeks ago.


Don't bother -- Managed C++ is good if you have some c++ library that you want to quickly port to .NET or need to do things .NET has trouble with.  IMO, if you want managed code, stick with C#; if you want unmanaged, use C/C++.  If you want both, write a dll or write only the required assemblies in managed c++.

Soul Taker

Quote from: Kp on October 01, 2003, 10:32 PM...The sender could theoretically call send on one byte at a time...
I've seen that happen with Telnet, makes it very annoying to read packet logs!

Skywing

#18
I would check the endianness of the server IP address that send to BNLS.  This should be in network byte order (I don't think anyone stores IP addresses as little endian doublewords).

You cannot use the old-style login method with Warcraft III; the server requires that you use NLS.  You should make the decision on whether or not to use NLS based on the SID_AUTH_INFO reply sent to you by Battle.net.

TriCk

I have realised a few things on .NET that are different ...
For instance... u can't get the Winsock's Connection State ... i tried on .NET and gave up due to the amount of things that i just couldnt figure out using winsocks

Skywing

Quote from: TriCk on October 06, 2003, 03:17 AM
I have realised a few things on .NET that are different ...
For instance... u can't get the Winsock's Connection State ... i tried on .NET and gave up due to the amount of things that i just couldnt figure out using winsocks
You are intended to use sockets for serious network programming with .NET.  This means that keeping track of the 'connection state' is up to you.

MyndFyre

Quote from: Skywing on October 06, 2003, 12:07 PM
Quote from: TriCk on October 06, 2003, 03:17 AM
I have realised a few things on .NET that are different ...
For instance... u can't get the Winsock's Connection State ... i tried on .NET and gave up due to the amount of things that i just couldnt figure out using winsocks
You are intended to use sockets for serious network programming with .NET.  This means that keeping track of the 'connection state' is up to you.

Aye....  Until I started working with Sockets for my bot project, I hardly understood what a byte[] was.  I'm glad, though, that I started this project before I got into my Assembler class...  Now I know about endian-ness and all that good stuff ahead of time.  =D
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.