• Welcome to Valhalla Legends Archive.
 

[VB6] Problems with MCP_STARTUP...

Started by Arthas, June 08, 2004, 11:03 PM

Previous topic - Next topic

Arthas

Alright. I have looked at all the examples you've given in these forums, and I still cannot login to the MCP server. I get stuck at "Connected to Realm Server". You see, pre-1.10 I could, but now I cannot. What am I doing wrong? Here's my code...

0x3E:

Case &H3E
       Realm.RealmLogonStatusCode = GetDWORD(Mid$(data, 9, 4))
       Select Case Realm.RealmLogonStatusCode
           Case &H80000001
               addText "MCP: Realm is down!", vbRed
           Case &H80000002
               addText "MCP: Realm logon failed!", vbRed
           Case Else
               With Realm
                   .Cookie = GetDWORD(Mid$(data, 5, 4))
                   .StatusCode = GetDWORD(Mid$(data, 9, 4))
                   .MCPChunk1 = Mid(data, 5, 16)
                   .IP = GetDWORD(Mid$(data, 21, 4))
                   .Port = HexNumValue(StrToHex(Mid$(data, 25, 2)))
                   .MCPChunk2 = Mid(data, 29, 48)
                   .Name = Mid$(data, 77, InStr(1, Mid$(data, 77), vbNullChar) - 1)
                   wsMCP.Connect GetIpFromLong(.IP), 6112
               End With
               addText "MCP: Attempting to logon to MCP server " & GetIpFromLong(Realm.IP) & vbNewLine, vbGreen
       End Select


Initiation:

Private Sub wsMCP_Connect()
addText "MCP: Connected to Realm server.", vbGreen
wsMCP.SendData Chr(1)
   
With PacketBuf
   .InsertNonNTString Realm.MCPChunk1 & Realm.MCPChunk2
   .InsertNTString Realm.Name
   .SendPacket wsMCP, &H1
End With
End Sub


To me... It all looks good. To battle.net... It does not.

UserLoser.


BaDDBLooD

There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Arthas

I get nothing back in my DataArrival sub. In my packet logs, I get no response to 0x01.

BaDDBLooD

This is just a guess... but i would say the formation of your MCP Packet is wrong

it should be like



MakeWORD(Len(Buffer) + 3) & Chr(PacketID) & Buffer

[/code

I am sure you can Addapt it to fit your actual code
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Arthas

Here's my ConnectMCP sub, this might help a bit as well:

Public Function ConnectMCP(bRealm As String)
   Dim rpass As String
   rpass = String(5 * 4, vbNullChar)
       Call A2(rpass, Servers)
       With PacketBuf
           .InsertDWORD &H1
           .InsertNonNTString rpass
           .InsertNTString bRealm
           .SendPacket sckBnet, &H3E
       End With
End Function

BaDDBLooD

Dude

you need a "SEPERATE" sendpacket function for MCP

using what i stated above
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.

Arthas

You need to be more elaborate. I do have a seperate send packet function in my packet buffer. About what you said in your first post in this thread, I have no clue what you mean.

Arthas

Ahhh nevermind, I made a puny typo in my sendpacket sub, thanks though, you made me realize it.

BaDDBLooD

Quote from: Arthas on June 09, 2004, 11:12 PM
Ahhh nevermind, I made a puny typo in my sendpacket sub, thanks though, you made me realize it.

No Problemo.
There are only two kinds of people who are really fascinating: people who know absolutely everything, and people who know absolutely nothing.