• Welcome to Valhalla Legends Archive.
 

Huh!?

Started by BaDaSs, November 23, 2006, 10:55 PM

Previous topic - Next topic

BaDaSs

Ok, I'm not sure if this is on topic for this forum, but I was reading the BNLS Prot Spec (http://www.valhallalegends.com/yoni/BNLSProtocolSpec.txt) and I noticed something odd...
It claims that using BNLS_VERSIONCHECKEX2 (0x1A) will

request the current version code for the given product (eliminating the need for BNLS_REQUESTVERSIONBYTE)

And I'm not sure I understand the purpose...
In order to get the reply from this packet and actually use the versionbyte from it, is to send the packet with the data received from SID_AUTH_INFO which is the only place you need the version byte (AFAIK), so why does this packet send the versionbyte, and why does it state that it eliminates the need for BNLS_REQUESTVERSIONBYTE?!?!
Can someone shed some light? Or maybe revise the Protocol Spec? thx
Network One
Aegis - http://opn1.net/Aegis

Hdx

Send the cached one your bot has.
Then if you receive a different one in 0x1a, store the one you received, and then reconnect.
OR If you are using an older client, (Like JSTR) the verbyte is sent after you receive the vercheck info.
etc...
It would have more purpose if BNLS ever supports DRTL or the correct W2BN login sequence.
But as of now it really doesn't have any benefits.
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

BaDaSs

Thanks Hdx,
That makes a little more sense, but the real question behind it is I guess, why did they actually state that it would eliminate the need for BNLS_REQUESTVERSION when in fact, it doesn't do that at all...
Network One
Aegis - http://opn1.net/Aegis

Hdx

Quote from: Hdx on November 23, 2006, 11:03 PMif you receive a different one in 0x1a, store the one you received, and then reconnect.
That eliminates the need for 0x10.
The verbytes RARLY change (only like every other patch)
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

BaDaSs

If the verbyte DID happen to change, and you were still using 0x1a, you would never obtain the newest version byte because you 'eliminated' 0x10 ;)
Network One
Aegis - http://opn1.net/Aegis

Hdx

No.... Thats why you STORE IT
You get the latest VB in 0x1a....
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

BaDaSs

how do you get the latest versionbyte from 0x1a if you can't send it without the current version byte. (because of the need to send 0x50 first)
Network One
Aegis - http://opn1.net/Aegis

Hdx

#7
BNCS Connect
BNCS C->S 0x50 Config.VerByte
BNCS S->C 0x50
BNLS Connect
BNLS C->S 0x1A
BNLS S->C 0x1A
  If 0x1A.VerByte != Config.VerByte Then
    Config.VerByte = 0x1A.VerByte
    Connection.Reconnect()
  Else
    BNCS C->S 0x51
  End If


Understand now?
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

BaDaSs

... I never didn't understand.
I don't think you do though.
Quote from: Hdx on November 23, 2006, 11:47 PM
BNCS Connect
BNCS C->S 0x50 Config.VerByte
BNCS S->C 0x50
BNLS Connect
BNLS C->S 0x1A
BNLS S->C 0x1A
  If 0x1A.VerByte != Config.VerByte Then
    Config.VerByte = 0x1A.VerByte
    Connection.Reconnect()
  Else
    BNCS C->S 0x51
  End If


Understand now?
~-~(HDX)~-~

S->C 0x50?
The server wouldn't send you the data you need in order to proceed, it would tell you that the game version is out of date because the versionbyte is old.
Network One
Aegis - http://opn1.net/Aegis

Hdx

Yes it will.
Even if the verbyte is old, it still sends you everything the client needs to send 0x51.
AND THEN in 0x51 S->C it tells you you are outdated.

~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

BaDaSs

Thanks Hdx, I was completely unaware of that :-D
That will help out in my connection process ^^
<3
Network One
Aegis - http://opn1.net/Aegis

Hdx

Think of it logically next time!
If the client is old, how would it know what file to download to patch?
The file name is sent in 0x51 S->C(Extra info string at the end of the packet)
And that is only sent when the server gets 0x51 C->S....
Also, TEST for yourself next time!
~-~(HDX)~-~

Proud host of the JBLS server www.JBLS.org.
JBLS.org Status:
JBLS/BNLS Server Status

BaDaSs

Why do people put version bytes in their configs for bots ;-p
Network One
Aegis - http://opn1.net/Aegis

topaz

Quote from: BaDaSs on November 24, 2006, 12:51 AM
Why do people put version bytes in their configs for bots ;-p

Because they don't all use BNLS.
RLY...?

Skywing

Hdx is correct.  This feature of BNLS_VERSIONCHECKEX2 is intended to be used as an optimization to eliminate an extra potential round trip time per logon that is used to retrieve a value which very infrequently changes.

The intended use is that clients should persist the last known version code value for each product.  When using BNLS, if a client receives a different version code in response to BNLS_VERSIONCHECKEX2, then it should drop and reconnect the affected Battle.net connection (instead of sending the SID_AUTH_CHECK request to Battle.net), and update its persisted copy of that product's version code.  The next connection attempt with that product should use the new version code supplied in the previous BNLS_VERSIONCHECKEX2.

Because the frequency of patching games vs logging on to a game with a client emulator is such that logging on is by the vast majority the common case, using this scheme can cut down on time to complete a Battle.net logon (and bandwidth overhead with respect to communicating with BNLS) in the common case of logging on after a previously successful logon, where the product in question has not just been patched.

The old mechanism required clients to request the latest version code explicitly on every logon attempt if they wished to use that mechanism to keep their version codes up to date automagically.  While you could previously achieve a similar effect by sending a BNLS_VERSIONCHECK and BNLS_REQUESTVERSIONBYTE simultaneously without waiting for a response on either, going this route 1) significantly increases the complexity of clients due to the asynchronous nature of BNLS responses (you must be careful to handle the case of BNLS_VERISONCHECK or BNLS_REQUESTVERSIONBYTE coming back in different orders than the one with which they were originally sent), and 2) reduces bandwidth overhead, as the overhead of sending an extra BNLS_REQUESTVERISONBYTE and receiving the response is now condensed into a single four-byte field.  With the new-style combined message, you now only need to wait for one message instead of two (thus freeing the programmer from request/response ordering concerns), and you get all of the information that you would need all in one shot, making handling the message an easier process to manage.

BNLS_REQUESTVERSIONBYTE is still supported for backwards compatibility purposes, but if you are writing a new client (or significantly altering an already-existing client), it is in general to your advantage to combine these two operations using BNLS_VERSIONCHECKEX2 if you are already using BNLS for both retrieving the latest version code and running version checks.