📄 jpiserver.frm
字号:
VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form Form1
BorderStyle = 4 'Fixed ToolWindow
Caption = "JPI Server 1.0"
ClientHeight = 2175
ClientLeft = 5745
ClientTop = 3690
ClientWidth = 4095
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2175
ScaleWidth = 4095
Begin VB.CommandButton Command3
Caption = "Settings"
Height = 375
Left = 2760
TabIndex = 9
Top = 1200
Width = 1215
End
Begin VB.TextBox Text2
Height = 285
Left = 1080
TabIndex = 7
Top = 1800
Width = 495
End
Begin VB.CommandButton Command2
Caption = "Stop Server"
Enabled = 0 'False
Height = 375
Left = 1440
TabIndex = 6
Top = 1200
Width = 1215
End
Begin VB.CommandButton Command1
Caption = "Start Server"
Height = 375
Left = 120
TabIndex = 5
Top = 1200
Width = 1215
End
Begin MSWinsockLib.Winsock AnswerSock
Left = 3600
Top = 2280
_ExtentX = 741
_ExtentY = 741
End
Begin MSWinsockLib.Winsock ServerSock
Index = 0
Left = 3960
Top = 2160
_ExtentX = 741
_ExtentY = 741
End
Begin VB.Frame Frame1
Caption = "Server Settings"
Height = 975
Left = 120
TabIndex = 0
Top = 120
Width = 3855
Begin VB.ComboBox Combo1
Height = 315
ItemData = "JPIServer.frx":0000
Left = 1200
List = "JPIServer.frx":0002
Style = 2 'Dropdown List
TabIndex = 3
Top = 480
Width = 2535
End
Begin VB.TextBox Text1
Height = 285
Left = 120
TabIndex = 1
Top = 480
Width = 975
End
Begin VB.Label Label2
Caption = "Map to play"
Height = 255
Left = 1200
TabIndex = 4
Top = 240
Width = 1215
End
Begin VB.Label Label1
Caption = "Port Number"
Height = 255
Left = 120
TabIndex = 2
Top = 240
Width = 1695
End
End
Begin VB.Label Label3
Caption = "Logged On"
Height = 255
Left = 120
TabIndex = 8
Top = 1800
Width = 975
End
Begin VB.Line Line1
X1 = 120
X2 = 3960
Y1 = 1680
Y2 = 1680
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub AnswerSock_ConnectionRequest(ByVal requestID As Long)
found = False
For i = 1 To PlayersLoggedOn
If Players(i).Active = False Then
Indx = i
found = True
Exit For
End If
Next i
If found = False Then PlayersLoggedOn = PlayersLoggedOn + 1: Indx = PlayersLoggedOn
Form1.ServerSock(Indx).Accept requestID
Players(Indx).Active = True
Call StartupPlayer(Indx)
End Sub
Private Sub Command1_Click()
Call StartServer(Val(Text1.Text))
Command2.Enabled = True
Command1.Enabled = False
Call Rotation
End Sub
Private Sub Command2_Click()
Call KillServer
Form1.Text2.Text = ""
For i = 1 To MAXPLAYERS
Form1.ServerSock(i).Close
Next i
Form1.AnswerSock.Close
Command1.Enabled = True
Command2.Enabled = False
End Sub
Private Sub Command3_Click()
Form2.Show
End Sub
Private Sub Form_Load()
On Error Resume Next
Open "Server.Cfg" For Input As #1
Line Input #1, ServerData.SysopName
Line Input #1, ServerData.MotD
Close #1
Form1.Caption = "Loading Sockets..."
For i = 1 To MAXPLAYERS
Load Form1.ServerSock(i)
Next i
Form1.Text1.Text = DefaultPort
Form1.Caption = "JPI Server " & VERSION
End Sub
Private Sub Form_Unload(Cancel As Integer)
Open "Server.Cfg" For Output As #1
Print #1, ServerData.SysopName
Print #1, ServerData.MotD
Close #1
End
End Sub
Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single)
End Sub
Private Sub ServerSock_DataArrival(Index As Integer, ByVal bytesTotal As Long)
Dim SData As String
ServerSock(Index).GetData SData, vbString
Call BreakDownMessage(SData, Index)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -