Valhalla Legends Forums Archive | Battle.net Bot Development | MCP send 0x03, Cant get d2gs server ip if i leave password blank. Wtf?

AuthorMessageTime
Purri
[code]Public Sub MCPsend0x03()
Call iClear
Call iWORD(&H2) '(WORD) Request Id *
Call iDWORD(&H0)  ' (DWORD) Difficulty
Call iBYTE(&H1) '(BYTE) Unknown - 1
Call iBYTE(&HFF) '(BYTE) Player difference **
Call iBYTE(&H8) '(BYTE) Maximum players
Call iNTSTRING(Form5.Text1.Text) '(STRING) Game name
Call iNTSTRING("") '(STRING) Game password
Call iNTSTRING("") '(STRING) Game description
    Call iHEADER(&H3, BNRS_HEADER)
    Call iPacket(Form1.Winsock2.SocketHandle)
    ShowChat vbYellow, "Creating game!"
End Sub
[/code]

whats rong?


If i use

[code]
Public Sub MCPsend0x03()
Call iClear
Call iWORD(&H2) '(WORD) Request Id *
Call iDWORD(&H0)  ' (DWORD) Difficulty
Call iBYTE(&H1) '(BYTE) Unknown - 1
Call iBYTE(&HFF) '(BYTE) Player difference **
Call iBYTE(&H8) '(BYTE) Maximum players
Call iNTSTRING(Form5.Text1.Text) '(STRING) Game name
Call iNTSTRING(Form5.Text2.Text) '(STRING) Game password
Call iNTSTRING("") '(STRING) Game description
    Call iHEADER(&H3, BNRS_HEADER)
    Call iPacket(Form1.Winsock2.SocketHandle)
    ShowChat vbYellow, "Creating game!"
End Sub
[/code]

Its works fine. but i want make games without passwords :o
edit typo.

Code works like i want it, only think is that if i make game without password i cant get d2gs ip.
October 23, 2009, 10:35 PM
rabbit
I don't know, but I can tell you that the only password any of your games will ever have using that method is "Form5.Text2.Tex", and not whatever the person typed.

It might help if you provided a packet log.
October 24, 2009, 1:32 AM
MysT_DooM
0x03 C>S
[code]
0030  fe d3 7f 04 00 00 29 00  03 02 00 00 00 00 00 01  ......). ........
0040  ff 08 44 32 20 54 65 73  74 47 61 6d 65 00 00 54  ..D2 Tes tGame..T
0050  65 73 74 69 6e 67 54 68  69 73 47 61 6d 65 00      estingTh isGame.
[/code]

0x03 S>C
[code]
0030  ff 79 56 ad 00 00 0d 00  03 02 00 98 02 00 00 00  .yV..... ........
0040  00 00 00                                          ... 
[/code]

0x04 C>S
[code]
0030  fe c6 a4 e1 00 00 12 00  04 02 00 44 32 20 54 65  ........ ...D2 Te
0040  73 74 47 61 6d 65 00 00                            stGame..
[/code]

0x04 S>C
[code]
0030  ff 67 bd 1b 00 00 15 00  04 02 00 98 02 00 00 d3  .g...... ........
0040  e9 10 d6 01 bb 96 15 00  00 00 00                  ........ ...   
[/code]

Then you 0x22, 0x10 telling bnet you  bouncing to game; connect to the d2 game server from that IP from 0x04, etc etc etc
Review your packet logs and you'll probably see the problem
October 24, 2009, 7:22 PM
BreW
Why don't you use your 'fataly' account anymore?
October 24, 2009, 8:08 PM
Purri
Forgot password :D
Im doing it
[code]
Public Sub MCPhandle0x04(Data As String)
id = GetWORD(Mid(Data, 4, 2))
hD2GSToken = GetWORD(Mid(Data, 6, 2))
unk = GetWORD(Mid(Data, 8, 2))
IP = Asc(Mid(Data, 10, 1)) & "." & Asc(Mid(Data, 11, 1)) & "." & Asc(Mid(Data, 12, 1)) & "." & Asc(Mid(Data, 13, 1))
hD2GShash = GetDWORD(Mid(Data, 14, 4))
Result = GetDWORD(Mid(18, 4))
If (Result = &H0) Then
'//SUXXES
Call send0x22
    Call send0x10
ShowChat vbGreen, "Connecting now D2GS (" & IP & ":4000)"
Form1.Winsock2.Close
Form1.D2GS_SOCKET.Close
Form1.D2GS_SOCKET.Connect IP, 4000
ElseIf (Result = &H29) Then
ShowChat vbRed, "Password incorrect."
ElseIf (Result = &H2A) Then
ShowChat vbRed, "Game does not exist."
ElseIf (Result = &H2B) Then
ShowChat vbRed, "Game is full."
ElseIf (Result = &H2C) Then
ShowChat vbRed, "You do not meet the level requirements for this game."
ElseIf (Result = &H6E) Then
ShowChat vbRed, "A dead hardcore character cannot join a game."
ElseIf (Result = &H71) Then
ShowChat vbRed, "A non-hardcore character cannot join a game created by a Hardcore character."
ElseIf (Result = &H73) Then
ShowChat vbRed, "Unable to join a Nightmare game."
ElseIf (Result = &H74) Then
ShowChat vbRed, "Unable to join a Hell game."
ElseIf (Result = &H78) Then
ShowChat vbRed, "A non-expansion character cannot join a game created by an Expansion character."
ElseIf (Result = &H79) Then
ShowChat vbRed, "A Expansion character cannot join a game created by a non-expansion character."
ElseIf (Result = &H7D) Then
ShowChat vbRed, "A non-ladder character cannot join a game created by a Ladder character."
End If
End Sub

[/code]


Edit, I got it working, soz there was just typo in my code :D Ty for answers!
October 24, 2009, 9:31 PM
rabbit
Dude...learn to press tab.
October 25, 2009, 1:58 PM

Search