Files
Client/Server/ToolProject/RCMS_Tool/CharRestraint.vb
LGram16 dd97ddec92 Restructure repository to include all source folders
Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-29 20:17:20 +09:00

360 lines
12 KiB
VB.net
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
Imports System.Text
Public Class CharRestraint
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents GroupBox1 As System.Windows.Forms.GroupBox
Friend WithEvents txtSearchID As System.Windows.Forms.TextBox
Friend WithEvents btnSearch As System.Windows.Forms.Button
Friend WithEvents cboServerID As System.Windows.Forms.ComboBox
Friend WithEvents grdResult As System.Windows.Forms.DataGrid
Friend WithEvents btnReg As System.Windows.Forms.Button
Friend WithEvents cboType As System.Windows.Forms.ComboBox
Friend WithEvents btnBlockClose As System.Windows.Forms.Button
Friend WithEvents lblsearchwide As System.Windows.Forms.Label
Friend WithEvents lbluid As System.Windows.Forms.Label
Friend WithEvents lblserver As System.Windows.Forms.Label
Friend WithEvents lbltitle As System.Windows.Forms.Label
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.lbltitle = New System.Windows.Forms.Label()
Me.GroupBox1 = New System.Windows.Forms.GroupBox()
Me.cboType = New System.Windows.Forms.ComboBox()
Me.lblsearchwide = New System.Windows.Forms.Label()
Me.lbluid = New System.Windows.Forms.Label()
Me.lblserver = New System.Windows.Forms.Label()
Me.btnSearch = New System.Windows.Forms.Button()
Me.txtSearchID = New System.Windows.Forms.TextBox()
Me.cboServerID = New System.Windows.Forms.ComboBox()
Me.grdResult = New System.Windows.Forms.DataGrid()
Me.btnReg = New System.Windows.Forms.Button()
Me.btnBlockClose = New System.Windows.Forms.Button()
Me.GroupBox1.SuspendLayout()
CType(Me.grdResult, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'lbltitle
'
Me.lbltitle.AutoSize = True
Me.lbltitle.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lbltitle.Font = New System.Drawing.Font("GulimChe", 14.25!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(129, Byte))
Me.lbltitle.Location = New System.Drawing.Point(440, 56)
Me.lbltitle.Name = "lbltitle"
Me.lbltitle.Size = New System.Drawing.Size(128, 24)
Me.lbltitle.TabIndex = 1
Me.lbltitle.Text = "ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> "
'
'GroupBox1
'
Me.GroupBox1.Controls.AddRange(New System.Windows.Forms.Control() {Me.cboType, Me.lblsearchwide, Me.lbluid, Me.lblserver, Me.btnSearch, Me.txtSearchID, Me.cboServerID})
Me.GroupBox1.Location = New System.Drawing.Point(48, 96)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(576, 80)
Me.GroupBox1.TabIndex = 2
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20><>ȸ<EFBFBD>ϱ<EFBFBD>"
'
'cboType
'
Me.cboType.Location = New System.Drawing.Point(336, 24)
Me.cboType.Name = "cboType"
Me.cboType.Size = New System.Drawing.Size(112, 20)
Me.cboType.TabIndex = 12
'
'lblsearchwide
'
Me.lblsearchwide.AutoSize = True
Me.lblsearchwide.Location = New System.Drawing.Point(248, 28)
Me.lblsearchwide.Name = "lblsearchwide"
Me.lblsearchwide.Size = New System.Drawing.Size(79, 14)
Me.lblsearchwide.TabIndex = 11
Me.lblsearchwide.Text = "<EFBFBD><EFBFBD>ȸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
'
'lbluid
'
Me.lbluid.AutoSize = True
Me.lbluid.Location = New System.Drawing.Point(16, 52)
Me.lbluid.Name = "lbluid"
Me.lbluid.Size = New System.Drawing.Size(97, 14)
Me.lbluid.TabIndex = 8
Me.lbluid.Text = "UID(<28><><EFBFBD><EFBFBD><EFBFBD>ε<EFBFBD><CEB5><EFBFBD>)"
'
'lblserver
'
Me.lblserver.AutoSize = True
Me.lblserver.Location = New System.Drawing.Point(56, 29)
Me.lblserver.Name = "lblserver"
Me.lblserver.Size = New System.Drawing.Size(54, 14)
Me.lblserver.TabIndex = 6
Me.lblserver.Text = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
'
'btnSearch
'
Me.btnSearch.Location = New System.Drawing.Point(456, 24)
Me.btnSearch.Name = "btnSearch"
Me.btnSearch.Size = New System.Drawing.Size(96, 40)
Me.btnSearch.TabIndex = 4
Me.btnSearch.Text = "<EFBFBD>˻<EFBFBD>"
'
'txtSearchID
'
Me.txtSearchID.Location = New System.Drawing.Point(120, 48)
Me.txtSearchID.Name = "txtSearchID"
Me.txtSearchID.Size = New System.Drawing.Size(112, 21)
Me.txtSearchID.TabIndex = 3
Me.txtSearchID.Text = ""
'
'cboServerID
'
Me.cboServerID.Location = New System.Drawing.Point(120, 24)
Me.cboServerID.Name = "cboServerID"
Me.cboServerID.Size = New System.Drawing.Size(112, 20)
Me.cboServerID.TabIndex = 1
'
'grdResult
'
Me.grdResult.DataMember = ""
Me.grdResult.HeaderForeColor = System.Drawing.SystemColors.ControlText
Me.grdResult.Location = New System.Drawing.Point(48, 184)
Me.grdResult.Name = "grdResult"
Me.grdResult.Size = New System.Drawing.Size(904, 336)
Me.grdResult.TabIndex = 3
'
'btnReg
'
Me.btnReg.Location = New System.Drawing.Point(648, 120)
Me.btnReg.Name = "btnReg"
Me.btnReg.Size = New System.Drawing.Size(80, 48)
Me.btnReg.TabIndex = 4
Me.btnReg.Text = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
'
'btnBlockClose
'
Me.btnBlockClose.Location = New System.Drawing.Point(768, 120)
Me.btnBlockClose.Name = "btnBlockClose"
Me.btnBlockClose.Size = New System.Drawing.Size(80, 48)
Me.btnBlockClose.TabIndex = 5
Me.btnBlockClose.Text = "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
'
'CharRestraint
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(1028, 701)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.btnBlockClose, Me.btnReg, Me.grdResult, Me.GroupBox1, Me.lbltitle})
Me.Name = "CharRestraint"
Me.Text = "ij<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
Me.GroupBox1.ResumeLayout(False)
CType(Me.grdResult, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub CharRestraint_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ProcessPacket.ICharRestraint = Me
DBConn.SetServerNames(cboServerID)
cboServerID.SelectedIndex = 0
txtSearchID.Visible = False
lbluid.Visible = False
txtSearchID.Visible = False
Me.Text = ITextCharRestraint.formheader
lbltitle.Text = ITextCharRestraint.formheader
lblserver.Text = ITextCharRestraint.lblserver
lblsearchwide.Text = ITextCharRestraint.lblsearchwide
Me.lbluid.Text = ITextCharRestraint.lbluid
btnSearch.Text = ITextButton.btnSearch
btnReg.Text = ITextAdminSetting.chkRestraintReg
Me.btnBlockClose.Text = ITextAdminSetting.chkRestraintRelease
cboType.Items.Add(ITextCharRestraint.cboType_1)
cboType.Items.Add(ITextCharRestraint.cboType_2)
cboType.SelectedIndex = 0
grdResult.DataSource = ds.Tables(CharRestraintIndex)
If IToolAdminRight.RestraintReg = False Then
btnReg.Enabled = False
Else
btnReg.Enabled = True
End If
If IToolAdminRight.RestraintRelease = False Then
btnBlockClose.Enabled = False
Else
btnBlockClose.Enabled = True
End If
End Sub
Private Sub CharRestraint_UnLoad(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Closed
ProcessPacket.ICharRestraint = Nothing
ProcessPacket.IRylMDI.ICharRestraint = Nothing
End Sub
'searching ...
Private Sub btnSearch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSearch.Click
If cboType.SelectedIndex = 1 And txtSearchID.Text = "" Then
MsgBox(ITextMSG.msg_inputadminid, MsgBoxStyle.OKOnly, ITextMSG.msg_error)
txtSearchID.Focus()
Exit Sub
End If
ViewRestraintList()
End Sub
Public Sub ViewRestraintList()
ds.Tables(CharRestraintIndex).Clear()
Dim serverid As Byte
Select Case cboServerID.SelectedIndex
Case 0
serverid = 0
Case 1
serverid = 1
Case 2
serverid = 2
Case 3
serverid = 3
Case 4
serverid = 4
Case 5
serverid = 5
Case 6
serverid = 6
End Select
If cboType.SelectedIndex = 0 Then
' <20><><EFBFBD><EFBFBD> <20>˻<EFBFBD>
' Flag(1) / ServerID(1) / UID(4)
Dim sendb(5) As Byte
sendb(0) = 1 ' Flag
sendb(1) = serverid ' ServerID
Dim dwUID As Int32 = 0 ' UID
Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 2, 4)
IClientSocket.Send(9, sendb)
Else
'<27>κа˻<D0B0>
' <20><><EFBFBD><EFBFBD> <20>˻<EFBFBD>
' Flag(1) / ServerID(1) / UID(4)
Dim sendb(5) As Byte
sendb(0) = 2 ' Flag
sendb(1) = serverid ' ServerID
Dim dwUID As Int32 = CInt(txtSearchID.Text) ' UID
Array.Copy(BitConverter.GetBytes(dwUID), 0, sendb, 2, 4)
IClientSocket.Send(9, sendb)
End If
End Sub
Private Sub btnReg_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnReg.Click
Dim ICharRestraintReg As New CharRestraintReg()
ICharRestraintReg.ShowDialog()
End Sub
Private Sub cboType_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboType.SelectedIndexChanged
If cboType.SelectedIndex = 1 Then
lbluid.Visible = True
txtSearchID.Visible = True
Else
lbluid.Visible = False
txtSearchID.Visible = False
End If
End Sub
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Private Sub btnBlockClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBlockClose.Click
'<27><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD> row<6F><77> <20>ε<EFBFBD><CEB5><EFBFBD><EFBFBD><EFBFBD>ȣ(0<><30><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ѵ<EFBFBD>.)
Dim SelectedCellText As String = grdResult.Item(grdResult.CurrentCell)
Dim CurrentIndex As Integer = grdResult.CurrentRowIndex
Dim encoding As Encoding = encoding.GetEncoding(Code)
Dim serverid As Byte
Select Case cboServerID.SelectedIndex
Case 0
serverid = 0
Case 1
serverid = 1
Case 2
serverid = 2
Case 3
serverid = 3
Case 4
serverid = 4
Case 5
serverid = 5
Case 6
serverid = 6
End Select
' <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
' ServerID(1) / UID(4) / CharName(16)
Dim sendb(20) As Byte
sendb(0) = serverid ' ServerID
Dim dwDeleteUID As Int32 = CInt(grdResult.Item(CurrentIndex, 0)) ' UID - dwDeleteUID <20><> Ÿ<><C5B8><EFBFBD><EFBFBD> <20>ݵ<EFBFBD><DDB5><EFBFBD> int32<33>̾<EFBFBD><CCBE><EFBFBD> <20><>
Array.Copy(BitConverter.GetBytes(dwDeleteUID), 0, sendb, 1, 4)
Dim szDeleteCharName As String = grdResult.Item(CurrentIndex, 2) ' <20><><EFBFBD><EFBFBD> ij<><C4B3><EFBFBD><EFBFBD> <20≯<EFBFBD>
encoding.GetBytes(szDeleteCharName, 0, Min(16, szDeleteCharName.Length), sendb, 5)
IClientSocket.Send(12, sendb)
End Sub
End Class