Projects

Find all our projects in development below.
All source code is GNU General Public License (GPL)

QuickQuery Half-Life Edition

Browsing QuickQuery HL Edition/RCONSetupForm.frm (6.24 KB)

VERSION 5.00
Begin VB.Form RCONSetupForm 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "RCON Setup"
   ClientHeight    =   2190
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   4350
   ClipControls    =   0   'False
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "RCONSetupForm.frx":0000
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2190
   ScaleWidth      =   4350
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.Timer PostLoadTimer 
      Interval        =   1
      Left            =   120
      Top             =   1560
   End
   Begin VB.CheckBox chkSavePass 
      Caption         =   "Sa&ve RCON Password"
      Height          =   255
      Left            =   1440
      TabIndex        =   6
      Top             =   1200
      Width           =   2775
   End
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "Cancel"
      Height          =   375
      Left            =   2205
      TabIndex        =   8
      Top             =   1680
      Width           =   1215
   End
   Begin VB.CommandButton Command1 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   930
      TabIndex        =   7
      Top             =   1680
      Width           =   1215
   End
   Begin VB.TextBox txtPassword 
      Height          =   315
      Left            =   1440
      MaxLength       =   100
      TabIndex        =   5
      Top             =   840
      Width           =   2775
   End
   Begin VB.TextBox txtPort 
      Height          =   315
      Left            =   1440
      MaxLength       =   5
      TabIndex        =   3
      Text            =   "27015"
      Top             =   480
      Width           =   975
   End
   Begin VB.TextBox txtAddress 
      Height          =   315
      Left            =   1440
      MaxLength       =   100
      TabIndex        =   1
      Top             =   120
      Width           =   2775
   End
   Begin VB.Label Label3 
      BackStyle       =   0  'Transparent
      Caption         =   "RCON P&assword:"
      Height          =   255
      Left            =   120
      TabIndex        =   4
      Top             =   880
      Width           =   1335
   End
   Begin VB.Label Label2 
      BackStyle       =   0  'Transparent
      Caption         =   "RCON &Port:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   520
      Width           =   1215
   End
   Begin VB.Label Label1 
      BackStyle       =   0  'Transparent
      Caption         =   "&Server Address:"
      Height          =   255
      Left            =   120
      TabIndex        =   0
      Top             =   160
      Width           =   1215
   End
End
Attribute VB_Name = "RCONSetupForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Public RCONConsoleForm As RCONForm

Private Sub Command1_Click()
Dim i As Long
Dim i2 As Long
Dim bFound As Boolean
    If txtAddress.Text = "" Then
        MsgBox "Enter the ip address or hostname of the server.", vbExclamation
        txtAddress.SetFocus
        Exit Sub
    End If
    If Val(txtPort.Text) < 1 Or Val(txtPort.Text) > 65535 Then
        MsgBox "Enter a port number between 1 and 65535.", vbExclamation
        txtPort.SetFocus
        txtPort.SelStart = 0
        txtPort.SelLength = Len(txtPort.Text)
        Exit Sub
    End If
    If txtPassword.Text = "" Then
        MsgBox "Enter the RCON password for this server.", vbExclamation
        txtPassword.SetFocus
        Exit Sub
    End If
    For i = 1 To UBound(RCONPasswordsList)
        If LCase(RCONPasswordsList(i).Address) = LCase(txtAddress.Text) Then
            If chkSavePass.Value = 0 Then
                For i2 = i + 1 To UBound(RCONPasswordsList)
                    RCONPasswordsList(i - 1).Address = RCONPasswordsList(i).Address
                    RCONPasswordsList(i - 1).Password = RCONPasswordsList(i).Password
                Next i2
                ReDim Preserve RCONPasswordsList(UBound(RCONPasswordsList) - 1)
            Else
                RCONPasswordsList(i).Password = txtPassword.Text
            End If
            bFound = True
            Exit For
        End If
    Next i
    If chkSavePass.Value = 1 And bFound = False Then
        ReDim Preserve RCONPasswordsList(UBound(RCONPasswordsList) + 1)
        RCONPasswordsList(UBound(RCONPasswordsList)).Address = txtAddress.Text
        RCONPasswordsList(UBound(RCONPasswordsList)).Password = txtPassword.Text
    End If
    RCONConsoleForm.RCON_Address = txtAddress.Text
    RCONConsoleForm.RCON_Port = CLng(Val(txtPort.Text))
    RCONConsoleForm.RCON_Password = txtPassword.Text
    Unload Me
End Sub

Private Sub Command2_Click()
    Unload Me
End Sub

Private Sub PostLoadTimer_Timer()
Dim i As Long
    PostLoadTimer.Enabled = False
    If txtAddress.Text <> "" Then
        For i = 1 To UBound(RCONPasswordsList)
            If LCase(RCONPasswordsList(i).Address) = LCase(txtAddress.Text) Then
                txtPassword.Text = RCONPasswordsList(i).Password
                chkSavePass.Value = 1
                Exit For
            End If
        Next i
        If txtPassword.Text = "" Then
            txtPassword.SetFocus
        Else
            Command1.SetFocus
        End If
    End If
End Sub


Private Sub txtAddress_LostFocus()
    If InStr(txtAddress.Text, ":") Then txtAddress.Text = Left(txtAddress.Text, InStr(txtAddress.Text, ":") - 1)
End Sub


Private Sub txtPort_KeyPress(KeyAscii As Integer)
    If KeyAscii >= 48 And KeyAscii <= 57 Or KeyAscii = 8 Then Exit Sub
    KeyAscii = 0
End Sub


Private Sub txtPort_LostFocus()
    txtPort.Text = Val(txtPort.Text)
End Sub


Download QuickQuery HL Edition/RCONSetupForm.frm

Back to file list


Back to project page