📄 form1.frm
字号:
Get FileName, AdrnIndex(Index).Addr + 1, buff
CopyMemory MyReal, buff(1), 16
Close FileName
If LOF(RealFileNum) = 0 Then
Put RealFileNum, , buff
ElseIf RENEWREAL = True And LOF(RealFileNum) > RealSize Then
AdrnIndex(Index).Addr = RealSize
Put RealFileNum, AdrnIndex(Index).Addr + 1, buff
RENEWREAL = False
ElseIf Index = 0 Then
AdrnIndex(Index).Addr = LOF(RealFileNum) - 1
Put RealFileNum, AdrnIndex(Index).Addr + 1, buff
RENEWREAL = False
Else
AdrnIndex(Index).Addr = AdrnIndex(Index - 1).Addr + AdrnIndex(Index - 1).datalen
Put RealFileNum, AdrnIndex(Index).Addr + 1, buff
End If
If LOF(AdrnFileNum) = 0 Then
Put AdrnFileNum, , AdrnIndex(Index)
Else
Put AdrnFileNum, LOF(AdrnFileNum) + 1, AdrnIndex(Index)
End If
Close AdrnFileNum
Close RealFileNum
End Sub
'Private Sub SaveSprData(Index As Long, AdrnMax As Long, SpradrnMax As Long)
Private Sub SaveSprData(Index As Long, AdrnMax As Long)
Dim SprFileNum, SprAdrnFileNum As Integer '定义文件号
Dim Addr As Long
Dim NextAddr As Long
NextAddr = SpradrnIndex(Index).Addr
' SprAdrnData.AnimationNum = Index + SpradrnMax + 1
'抽取出Spr数据
SprFileNum = FreeFile '申请Spr文件号
Open Text1.Text & "\spr_115.bin" For Binary As SprFileNum
'抽取出SprAdrn数据
SprAdrnFileNum = FreeFile '申请SprAdrn文件号
Open Text1.Text & "\spradrn_115.bin" For Binary As SprAdrnFileNum
If RENEWSPR = True And LOF(SprFileNum) > SprSize Then
SpradrnIndex(Index).Addr = SprSize
RENEWSPR = False
ElseIf Index = 0 Then
SpradrnIndex(Index).Addr = LOF(SprFileNum)
RENEWSPR = False
Else
SpradrnIndex(Index).Addr = SpradrnIndex(Index - 1).Addr
End If
Put SprAdrnFileNum, LOF(SprAdrnFileNum) + 1, SpradrnIndex(Index)
Close SprAdrnFileNum
'抽取出Spr数据
Dim FileName As String
Dim TempStr As String
Dim MySpr As Spr
FileName = FreeFile
'打开文件
Open App.Path & "\data\spr.bin" For Binary Access Read As FileName
Dim i As Long
Dim j As Long
Dim ActionNum As Long
Dim PictureNo() As Long
Dim PictureNum As Long
ReDim Preserve PictureNo(0 To PictureNum)
For ActionNum = 0 To SpradrnIndex(Index).ActionNum - 1
'读指定动作
Get FileName, NextAddr + Addr + 1, MySpr
Put SprFileNum, SpradrnIndex(Index).Addr + Addr + 1, MySpr
Addr = Addr + Len(MySpr)
If MySpr.Number > 0 Then
ReDim buff(1 To 10) As Byte
ReDim MySequence(1 To MySpr.Number) As Sequence
For i = 1 To MySpr.Number
Get FileName, , buff
CopyMemory MySequence(i), buff(1), 10
For j = 0 To AdrnLine - 1
If MySequence(i).PictureNum = AdrnIndex(j).Num Then
MySequence(i).PictureNum = j + AdrnMax + 1
Exit For
End If
Next j
Put SprFileNum, SpradrnIndex(Index).Addr + Addr + 1, MySequence(i)
Addr = Addr + Len(MySequence(i))
Next i
End If
Next
SpradrnIndex(Index).Addr = SpradrnIndex(Index).Addr + Addr
Close FileName
Close SprFileNum
End Sub
Private Sub UpDataCli()
Dim AdrnNum As Long
Dim SprAdrnNum As Long
MapNum = 0
For SprAdrnNum = 0 To SpradrnIndexNum - 1
' SaveSprData SprAdrnNum, CAdrnNumMax, CSpradrnNumMax
SaveSprData SprAdrnNum, CAdrnNumMax
Next SprAdrnNum
For AdrnNum = 0 To AdrnLine - 1
SaveData AdrnNum, CAdrnNumMax, CMapIndexMax
Next AdrnNum
End Sub
Private Sub CheckCli()
Dim AdrnFileSize As Long
Dim RealFileSize As Long
Dim SrpAdrnFileSize As Long
Dim SrpFileSize As Long
Dim SprAdrnLine As Long
ReDim CAdrnIndex(0) As adrn
ReDim CSpradrnIndex(0) As Spradrn
Dim FileNum As Long
Dim AdrnLine As Long
FileNum = FreeFile
AdrnFileSize = FileLen(AdrnFilePath)
ShowInfo "adrn_136.bin大小为:" & AdrnFileSize
ShowInfo "正确..."
'检查real文件大小
RealFileSize = FileLen(RealFilePath)
ShowInfo "read_136.bin大小为:" & RealFileSize
ShowInfo "正确..."
'检查spradrn文件大小
SrpAdrnFileSize = FileLen(SrpAdrnFilePath)
ShowInfo "spradrn_115.bin大小为:" & SrpAdrnFileSize
ShowInfo "正确..."
'检查spr文件大小
SrpFileSize = FileLen(SrpFilePath)
ShowInfo "spradrn_115.bin大小为:" & SrpFileSize
ShowInfo "正确..."
ShowInfo "客户端版本正确..."
ShowInfo "正在进制客户端图像更新..."
If Option2.Value = True Then
ReDim CAdrnIndex(396937) As adrn
End If
Open AdrnFilePath For Binary Access Read Write As FileNum
ReDim Buffer(1 To 80) As Byte
'读文件
Do While Not EOF(FileNum)
Get FileNum, , Buffer
'获取Adrn数据
If Option2.Value = True Then
CopyMemory CAdrnIndex(AdrnLine), Buffer(1), 80
If CAdrnIndex(AdrnLine).Num = 376282 Then
CAdrnIndex(AdrnLine).Addr = 1525851188
End If
If CMapIndexMax < CAdrnIndex(AdrnLine).MapNum Then CMapIndexMax = CAdrnIndex(AdrnLine).MapNum
If CAdrnNumMax < CAdrnIndex(AdrnLine).Num Then CAdrnNumMax = CAdrnIndex(AdrnLine).Num
If AdrnLine = 396937 Then
Exit Do
End If
Else
CopyMemory CAdrnIndex(0), Buffer(1), 80
If CMapIndexMax < CAdrnIndex(0).MapNum Then CMapIndexMax = CAdrnIndex(0).MapNum
If CAdrnNumMax < CAdrnIndex(0).Num Then CAdrnNumMax = CAdrnIndex(0).Num
End If
AdrnLine = AdrnLine + 1
Loop
Close FileNum
ShowInfo "图片最大编号:" & CAdrnNumMax
ShowInfo "正确..."
ShowInfo "地图最大编号:" & CMapIndexMax
ShowInfo "正确..."
If Option2.Value = True Then
ReDim CSpradrnIndex(1692) As Spradrn
End If
FileNum = FreeFile
Open SrpAdrnFilePath For Binary Access Read As FileNum
ReDim Buffer(1 To 12) As Byte
'读文件
Do While Not EOF(FileNum)
Get FileNum, , Buffer
If Option2.Value = True Then
CopyMemory CSpradrnIndex(SprAdrnLine), Buffer(1), 12
If CSpradrnNumMax < CSpradrnIndex(SprAdrnLine).AnimationNum Then CSpradrnNumMax = CSpradrnIndex(SprAdrnLine).AnimationNum
If SprAdrnLine = 1692 Then
Exit Do
End If
Else
CopyMemory CSpradrnIndex(0), Buffer(1), 12
If CSpradrnNumMax < CSpradrnIndex(0).AnimationNum Then CSpradrnNumMax = CSpradrnIndex(0).AnimationNum
If SprAdrnLine > 1692 Then
If CSpradrnIndex(0).AnimationNum = SpradrnIndex(0).AnimationNum Then
ShowInfo "客户端的动画ID与补丁相冲突..."
Close FileNum
ERR = True
Exit Sub
End If
End If
End If
SprAdrnLine = SprAdrnLine + 1
Loop
Close FileNum
ShowInfo "动画一共" & SprAdrnLine & "个"
ShowInfo "正确..."
ShowInfo "动画最大编号:" & CSpradrnNumMax
ShowInfo "正确..."
If Option2.Value = True Then
FileNum = FreeFile
Kill AdrnFilePath
Open AdrnFilePath For Binary Access Write As FileNum
Put FileNum, , CAdrnIndex
Close FileNum
FileNum = FreeFile
Kill SrpAdrnFilePath
Open SrpAdrnFilePath For Binary Access Write As FileNum
Put FileNum, , CSpradrnIndex
Close FileNum
End If
ShowInfo "完成..."
End Sub
Private Sub Command3_Click()
End Sub
Private Sub Form_Load()
SetPath
End Sub
Private Sub SetPath()
'检查adrn文件路径
AdrnFilePath = Text1.Text & "\adrn_136.bin"
'检查real文件路径
RealFilePath = Text1.Text & "\real_136.bin"
'检查spradrn文件路径
SrpAdrnFilePath = Text1.Text & "\spradrn_115.bin"
'检查spr文件路径
SrpFilePath = Text1.Text & "\spr_115.bin"
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -