• Welcome to Valhalla Legends Archive.
 

MCP send 0x03, Cant get d2gs server ip if i leave password blank. Wtf?

Started by Purri, October 23, 2009, 05:35 PM

Previous topic - Next topic

Purri

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


whats rong?


If i use


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


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.

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.
Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.

MysT_DooM

0x03 C>S

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.


0x03 S>C

0030  ff 79 56 ad 00 00 0d 00  03 02 00 98 02 00 00 00   .yV..... ........
0040  00 00 00                                           ...   


0x04 C>S

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..


0x04 S>C

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                  ........ ...   


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


vb6, something about that combination of numbers and letters is sexy

brew

<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Purri

Forgot password :D
Im doing it

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




Edit, I got it working, soz there was just typo in my code :D Ty for answers!

rabbit

Grif: Yeah, and the people in the red states are mad because the people in the blue states are mean to them and want them to pay money for roads and schools instead of cool things like NASCAR and shotguns.  Also, there's something about ketchup in there.