Commit 2ed5f9bf authored by Michael Alexander's avatar Michael Alexander
Browse files

few fixes

parent f7418502
Module GlobalVariables
' sets the Form's text property (title)
Public TOKEN As String = "Hello World!"
Public TOKEN As String
Public SERVER_IP As String
Public SERVER_PORT As Integer
Public NETWORK As NetIO
Public TIME As Long
End Module
Public Class CancelOfferJSONSend
Public method As String = "canceloffer"
Public token As String = token
Public token As String = GlobalVariables.TOKEN
Public offer_token As String
End Class
......
Public Class FetchItemJSONSend
Public method As String = "fetchitem"
Public token As String = token
Public token As String = GlobalVariables.TOKEN
Public offer_token As String
End Class
......
Public Class FieldJSONSend
Public method As String = "field"
Public token As String = token
Public token As String = GlobalVariables.TOKEN
End Class
Public Class FieldJSONRecv
......
Public Class InventoryJSONSend
Public method As String = "inventory"
Public token As String = TOKEN
Public token As String = GlobalVariables.TOKEN
End Class
Public Class InventoryJSONRecv
......
Public Class MapJSONSend
Public method As String = "map"
Public token As String = TOKEN
Public token As String = GlobalVariables.TOKEN
End Class
Public Class MapJSONRecv
......@@ -8,4 +8,5 @@ Public Class MapJSONRecv
Public name As String
Public width As Integer
Public height As Integer
Public map As String()
End Class
Public Class MixItemJSONSend
Public method As String = "mixitem"
Public token As String = TOKEN
Public token As String = GlobalVariables.TOKEN
Public item1 As Integer
Public item2 As Integer
End Class
......
Public Class MoveJSONSend
Public method As String = "move"
Public token As String = token
Public token As String = GlobalVariables.TOKEN
Public x As Integer
Public y As Integer
End Class
......
Public Class OfferJSONSend
Public method As String = "offer"
Public token As String = TOKEN
Public token As String = GlobalVariables.TOKEN
Public offered_item As Integer
Public n1 As Integer
Public demanded_item As Integer
......
Public Class SendAcceptJSONSend
Public method As String = "sendfind"
Public token As String = token
Public token As String = GlobalVariables.TOKEN
Public offer_token As String
End Class
......
Public Class SendFindJSONSend
Public method As String = "sendfind"
Public token As String = token
Public token As String = GlobalVariables.TOKEN
Public item As Integer
End Class
......
Public Class TradeboxJSONSend
Public method As String = "tradebox"
Public token As String = TOKEN
Public token As String = GlobalVariables.TOKEN
End Class
Public Class TradeboxJSONRecv
......
......@@ -23,7 +23,8 @@ Public Class Login
recvjson = JsonConvert.DeserializeObject(Of LoginJSONRecv)(recv)
If (recvjson.status = "ok") Then
TOKEN = recvjson.token
GlobalVariables.TOKEN = recvjson.token
GlobalVariables.TIME = recvjson.time
Map.Show()
Me.Close()
ElseIf (recvjson.status = "fail") Then
......@@ -66,8 +67,8 @@ Public Class Login
Private Sub InitializeConnection()
'Initialize connection
SERVER_IP = ServerIPInput.Text
SERVER_PORT = PortInput.Text
NETWORK = New NetIO
GlobalVariables.SERVER_IP = ServerIPInput.Text
GlobalVariables.SERVER_PORT = PortInput.Text
GlobalVariables.NETWORK = New NetIO
End Sub
End Class
Public Class Map
Imports Newtonsoft.Json
Public Class Map
Private x As Integer
Private y As Integer
Private Sub Map_Load(sender As Object, e As EventArgs) Handles MyBase.Load
GlobalVariables.NETWORK = New NetIO
Dim request As New MapJSONSend
Dim recv As String
recv = NETWORK.SendRecv(request)
Dim recvjson As New MapJSONRecv
recvjson = JsonConvert.DeserializeObject(Of MapJSONRecv)(recv)
If (recvjson.status = "ok") Then
MsgBox("HUH")
Else
MsgBox("Unknown error occured!")
End If
End Sub
End Class
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment