Лабораторная работа: Greating game on visual basic with multiplayer system
MsgCount = MsgCount - 1
'Direct X System Only Messages not user defineable
If FromPlayer = DPID_SYSMSG Then
Select Case msgtype
' New player, update player list
Case DPSYS_DESTROYPLAYERORGROUP, _
DPSYS_CREATEPLAYERORGROUP
If Connect. Visible Then Connect. UpdateWaiting 'update connection sessions list
Case DPSYS_HOST 'either lost connection or changed you to host
dxHost = True
If Connect. Visible Then
MsgBox ("You are now the host. ")
Connect. UpdateWaiting ' make sure Start button is enabled
End If
End Select
' - --------------------------------------------------------------------------------------
' User specified Message Structure TYPES
Else
' Get name of sending player
If onconnect = False Then
fromplayername = dxplay. GetPlayerFriendlyName (FromPlayer) 'Gets name
opponentsname = fromplayername 'changes to games variable
'Updates status bars and labels.
If usermode = "host" Then
MainBoard. playerdisplaylabel. Caption = opponentsname & " Has Joined The Game"
MainBoard. StatusBar1. SimpleText = opponentsname & "Is Ready To Play, Start Game"
End If
If usermode = "client" Then
MainBoard. playerdisplaylabel. Caption = "You Have Joined " & opponentsname & "'s Game"