Commit 5932a719 authored by Michael Alexander's avatar Michael Alexander
Browse files

kelar client

parent c92d680b
......@@ -11,8 +11,8 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{698896F3-5690-4F73-9F41-109133F25CE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{698896F3-5690-4F73-9F41-109133F25CE2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{698896F3-5690-4F73-9F41-109133F25CE2}.Debug|Any CPU.ActiveCfg = Release|Any CPU
{698896F3-5690-4F73-9F41-109133F25CE2}.Debug|Any CPU.Build.0 = Release|Any CPU
{698896F3-5690-4F73-9F41-109133F25CE2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{698896F3-5690-4F73-9F41-109133F25CE2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
......
......@@ -6,5 +6,6 @@
Public TIME As Long
Public X As Integer
Public Y As Integer
Public SendAcceptHack As SendFindJSONRecv
End Module
Public Class SendAcceptJSONSend
Public method As String = "sendfind"
Public method As String = "sendaccept"
Public token As String = GlobalVariables.TOKEN
Public offer_token As String
End Class
......
......@@ -6,5 +6,5 @@ End Class
Public Class SendFindJSONRecv
Public status As String
Public offers As String()
Public offers As String()()
End Class
......@@ -23,13 +23,13 @@ Partial Class SendAccept
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Button1 = New System.Windows.Forms.Button()
Me.TableLayoutPanel1 = New System.Windows.Forms.TableLayoutPanel()
Me.TradeboxPanel = New System.Windows.Forms.TableLayoutPanel()
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.Label1 = New System.Windows.Forms.Label()
Me.TableLayoutPanel1.SuspendLayout()
Me.TradeboxPanel.SuspendLayout()
Me.SuspendLayout()
'
'Button1
......@@ -41,33 +41,35 @@ Partial Class SendAccept
Me.Button1.Text = "Back"
Me.Button1.UseVisualStyleBackColor = True
'
'TableLayoutPanel1
'
Me.TableLayoutPanel1.AutoScroll = True
Me.TableLayoutPanel1.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
Me.TableLayoutPanel1.ColumnCount = 5
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50.52083!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 49.47917!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 99.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 113.0!))
Me.TableLayoutPanel1.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 168.0!))
Me.TableLayoutPanel1.Controls.Add(Me.Label5, 4, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Label4, 3, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Label3, 2, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Label2, 1, 0)
Me.TableLayoutPanel1.Controls.Add(Me.Label1, 0, 0)
Me.TableLayoutPanel1.Location = New System.Drawing.Point(12, 11)
Me.TableLayoutPanel1.Name = "TableLayoutPanel1"
Me.TableLayoutPanel1.RowCount = 2
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 3.652968!))
Me.TableLayoutPanel1.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 96.34703!))
Me.TableLayoutPanel1.Size = New System.Drawing.Size(573, 439)
Me.TableLayoutPanel1.TabIndex = 2
'TradeboxPanel
'
Me.TradeboxPanel.AutoScroll = True
Me.TradeboxPanel.AutoSize = True
Me.TradeboxPanel.CellBorderStyle = System.Windows.Forms.TableLayoutPanelCellBorderStyle.[Single]
Me.TradeboxPanel.ColumnCount = 5
Me.TradeboxPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 125.0!))
Me.TradeboxPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75.0!))
Me.TradeboxPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 125.0!))
Me.TradeboxPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75.0!))
Me.TradeboxPanel.ColumnStyles.Add(New System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 75.0!))
Me.TradeboxPanel.Controls.Add(Me.Label5, 4, 0)
Me.TradeboxPanel.Controls.Add(Me.Label4, 3, 0)
Me.TradeboxPanel.Controls.Add(Me.Label3, 2, 0)
Me.TradeboxPanel.Controls.Add(Me.Label2, 1, 0)
Me.TradeboxPanel.Controls.Add(Me.Label1, 0, 0)
Me.TradeboxPanel.Location = New System.Drawing.Point(12, 12)
Me.TradeboxPanel.MaximumSize = New System.Drawing.Size(481, 450)
Me.TradeboxPanel.MinimumSize = New System.Drawing.Size(481, 0)
Me.TradeboxPanel.Name = "TradeboxPanel"
Me.TradeboxPanel.RowCount = 1
Me.TradeboxPanel.RowStyles.Add(New System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 30.0!))
Me.TradeboxPanel.Size = New System.Drawing.Size(481, 34)
Me.TradeboxPanel.TabIndex = 4
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Location = New System.Drawing.Point(406, 1)
Me.Label5.Location = New System.Drawing.Point(408, 1)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(23, 13)
Me.Label5.TabIndex = 6
......@@ -76,16 +78,16 @@ Partial Class SendAccept
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Location = New System.Drawing.Point(292, 1)
Me.Label4.Location = New System.Drawing.Point(332, 1)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(99, 13)
Me.Label4.Size = New System.Drawing.Size(59, 26)
Me.Label4.TabIndex = 4
Me.Label4.Text = "Number Demanded"
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(192, 1)
Me.Label3.Location = New System.Drawing.Point(206, 1)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(82, 13)
Me.Label3.TabIndex = 3
......@@ -94,9 +96,9 @@ Partial Class SendAccept
'Label2
'
Me.Label2.AutoSize = True
Me.Label2.Location = New System.Drawing.Point(99, 1)
Me.Label2.Location = New System.Drawing.Point(130, 1)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(82, 13)
Me.Label2.Size = New System.Drawing.Size(47, 26)
Me.Label2.TabIndex = 1
Me.Label2.Text = "Number Offered"
'
......@@ -114,17 +116,18 @@ Partial Class SendAccept
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(597, 492)
Me.Controls.Add(Me.TradeboxPanel)
Me.Controls.Add(Me.Button1)
Me.Controls.Add(Me.TableLayoutPanel1)
Me.Name = "SendAccept"
Me.Text = "SendAccept"
Me.TableLayoutPanel1.ResumeLayout(False)
Me.TableLayoutPanel1.PerformLayout()
Me.TradeboxPanel.ResumeLayout(False)
Me.TradeboxPanel.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TableLayoutPanel1 As System.Windows.Forms.TableLayoutPanel
Friend WithEvents TradeboxPanel As System.Windows.Forms.TableLayoutPanel
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
......
Public Class SendAccept
Imports Newtonsoft.Json
Public Class SendAccept
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Me.Close()
End Sub
Private Sub SendAccept_Load(sender As Object, e As EventArgs) Handles MyBase.Load
For i As Integer = 0 To GlobalVariables.SendAcceptHack.offers.Length - 1
TradeboxPanel.RowCount += 1
TradeboxPanel.RowStyles.Add(New RowStyle(SizeType.Absolute, 125.0F))
'kol 1
Dim PicBox As New PictureBox
Select Case GlobalVariables.SendAcceptHack.offers(i)(0)
Case 0
PicBox.Image = My.Resources.Honey
Case 1
PicBox.Image = My.Resources.Herbs
Case 2
PicBox.Image = My.Resources.Clay
Case 3
PicBox.Image = My.Resources.Mineral
Case 4
PicBox.Image = My.Resources.Potion
Case 5
PicBox.Image = My.Resources.Incense
Case 6
PicBox.Image = My.Resources.Gems
Case 7
PicBox.Image = My.Resources.LifeElixir
Case 8
PicBox.Image = My.Resources.ManaCrystal
Case 9
PicBox.Image = My.Resources.PhilosopherStone
End Select
PicBox.Height = 125
PicBox.Width = 125
PicBox.SizeMode = PictureBoxSizeMode.StretchImage
TradeboxPanel.Controls.Add(PicBox, 0, i + 1)
'kol 2
Dim NumOfferedLabel As New Label
NumOfferedLabel.Text = GlobalVariables.SendAcceptHack.offers(i)(1)
TradeboxPanel.Controls.Add(NumOfferedLabel, 1, i + 1)
'kol 3
Dim PicBox2 As New PictureBox
Select Case GlobalVariables.SendAcceptHack.offers(i)(2)
Case 0
PicBox2.Image = My.Resources.Honey
Case 1
PicBox2.Image = My.Resources.Herbs
Case 2
PicBox2.Image = My.Resources.Clay
Case 3
PicBox2.Image = My.Resources.Mineral
Case 4
PicBox2.Image = My.Resources.Potion
Case 5
PicBox2.Image = My.Resources.Incense
Case 6
PicBox2.Image = My.Resources.Gems
Case 7
PicBox2.Image = My.Resources.LifeElixir
Case 8
PicBox2.Image = My.Resources.ManaCrystal
Case 9
PicBox2.Image = My.Resources.PhilosopherStone
End Select
PicBox2.Height = 125
PicBox2.Width = 125
PicBox2.SizeMode = PictureBoxSizeMode.StretchImage
TradeboxPanel.Controls.Add(PicBox2, 2, i + 1)
'kol 4
Dim NumDemandedLabel As New Label
NumDemandedLabel.Text = GlobalVariables.SendAcceptHack.offers(i)(3)
TradeboxPanel.Controls.Add(NumDemandedLabel, 3, i + 1)
'kol 5
Dim Btn As New Button
Btn.Width = 100
Btn.Height = 30
Btn.Text = "Buy"
AddHandler Btn.Click, AddressOf SendAccept
Btn.Tag = GlobalVariables.SendAcceptHack.offers(i)(5)
Btn.Visible = True
TradeboxPanel.Controls.Add(Btn, 4, i + 1)
Next
End Sub
Private Sub SendAccept(ByVal Sendr As Object, ByVal e As EventArgs)
Dim Btn As Button
Btn = CType(Sendr, Button)
GlobalVariables.NETWORK = New NetIO
Dim request As New SendAcceptJSONSend
Dim recv As String
request.offer_token = Btn.Tag
recv = NETWORK.SendRecv(request)
Dim recvjson As New SendAcceptJSONRecv
recvjson = JsonConvert.DeserializeObject(Of SendAcceptJSONRecv)(recv)
If (recvjson.status = "ok") Then
MsgBox("Bought!")
SendFind.Close()
SendFind.Show()
Me.Close()
ElseIf (recvjson.status = "fail") Then
MsgBox(recvjson.description)
Else
MsgBox("Unknown error occured!")
End If
End Sub
End Class
\ No newline at end of file
......@@ -82,8 +82,8 @@ Public Class SendFind
recvjson = JsonConvert.DeserializeObject(Of SendFindJSONRecv)(recv)
If (recvjson.status = "ok") Then
MsgBox(recv)
Tradebox.Show()
GlobalVariables.SendAcceptHack = recvjson
SendAccept.Show()
ElseIf (recvjson.status = "fail") Then
MsgBox("Fail to search item")
Else
......
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