1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
|
Private Sub MaterialFlatButton1_Click(sender As Object, e As EventArgs) Handles MaterialFlatButton1.Click
FlatStatusBar1.Text = "Status: Connexion in progress.."
FlatAlertBox1.Text = "Connexion in progress.."
FlatAlertBox1.kind = FlatAlertBox._Kind.Info
If MakeConnection(MaterialSingleLineTextField1.Text, MaterialSingleLineTextField2.Text) Then
FlatStatusBar1.Text = "Status: Connected"
FlatAlertBox1.Text = "You are now connected to " & MaterialSingleLineTextField1.Text & ":" & MaterialSingleLineTextField2.Text & " !"
FlatAlertBox1.kind = FlatAlertBox._Kind.Success
MaterialTabControl1.SelectedTab = MaterialTabControl1.TabPages.Item(1)
Dim MakePingResult As String = MakePing()
TextBox1.Text = MakePingResult
Dim obj As Players
obj = JsonConvert.DeserializeObject(Of Players)(MakePingResult)
MsgBox(obj.max)
Return
Else
FlatAlertBox1.Text = "Unable to connect to server: The server is Offline"
FlatAlertBox1.kind = FlatAlertBox._Kind.Error
FlatStatusBar1.Text = "Status: Not connected"
End If
End Sub
Public Class Players
Public Property max() As Integer
Get
Return m_max
End Get
Set
m_max = Value
End Set
End Property
Private m_max As Integer
Public Property online() As Integer
Get
Return m_online
End Get
Set
m_online = Value
End Set
End Property
Private m_online As Integer
End Class
Public Class Version
Public Property name() As String
Get
Return m_name
End Get
Set
m_name = Value
End Set
End Property
Private m_name As String
Public Property protocol() As Integer
Get
Return m_protocol
End Get
Set
m_protocol = Value
End Set
End Property
Private m_protocol As Integer
End Class
Public Class Example
Public Property description() As String
Get
Return m_description
End Get
Set
m_description = Value
End Set
End Property
Private m_description As String
Public Property players() As Players
Get
Return m_players
End Get
Set
m_players = Value
End Set
End Property
Private m_players As Players
Public Property version() As Version
Get
Return m_version
End Get
Set
m_version = Value
End Set
End Property
Private m_version As Version
End Class |