Лабораторная работа: Greating game on visual basic with multiplayer system
Label8. Caption = "Waiting for other Players"
Exit Sub
NO_Hosting:
MsgBox "Could not Host Game", vbOKOnly, "Try Again"
End Sub
Private Sub join_Click ()
On Error GoTo Oops
Call goplay
Dim address As DirectPlayAddress
Set address = EnumConnect. GetAddress (lanchoice)
Call dxplay. InitializeConnection (address)
Dim details2 As Byte
Dim SessionData As DirectPlaySessionData
Set SessionData = dxplay. CreateSessionData
'Gets Session any open session info
Set EnumSession = dxplay. GetDPEnumSessions (SessionData, 0, DPENUMSESSIONS_AVAILABLE)
Set SessionData = EnumSession. GetItem (1)
'Get open session name
details = SessionData. GetSessionName
If details > "" And usermode = "client" Then
joingame. Enabled = True
End If
Call updatedisplay
gameopen. Caption = details
Exit Sub
Oops:
MsgBox "Connection Failed", vbOKOnly, "Tic Tac Oops"
Exit Sub
End Sub