Skip to content

Commit

Permalink
0.7.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Buizz committed Sep 4, 2019
1 parent 4050ace commit fcb1db8
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 41 deletions.
33 changes: 28 additions & 5 deletions EUD Editor 3/Class/BulidData/BulidMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,8 @@ Partial Public Class BuildData
'########################### 빌드 작업 메인 함수 ############################
Private Sub BuildProgress(isEdd As Boolean)
'일단 프로그램 못끄게 막고 빌드중이라는 문구와 함께 진행 바 넣어야됨
isFreezeUse = False

pgData.IsCompilng = True
pjData.RefreshOutputWriteTime()
pgData.isEddCompile = isEdd
Expand Down Expand Up @@ -229,12 +231,24 @@ Partial Public Class BuildData
Tool.RefreshMainWindow()

If isSucces Then

If pjData.TEData.SCArchive.IsUsed Then
If Not WriteSCADataFile() Then
'If Not isFreezeUse Then
' If Not WriteSCADataFile() Then
' Tool.ErrorMsgBox(Tool.GetText("Error WriteMapFile"))
' Return
' End If
'End If

If Not WriteChecksum() Then
Tool.ErrorMsgBox(Tool.GetText("Error WriteMapFile"))
Return
End If
End If




Dim notificationSound As New SoundPlayer(My.Resources.success)
notificationSound.PlaySync()
End If
Expand All @@ -244,7 +258,7 @@ Partial Public Class BuildData




Private isFreezeUse As Boolean
Private eudplibprocess As Process
Private Function Starteds(isEdd As Boolean) As Boolean
Dim StandardOutput As String = ""
Expand All @@ -271,9 +285,19 @@ Partial Public Class BuildData

'Threading.Thread.Sleep(1000)


StandardOutput = OutputString
If StandardOutput.IndexOf("계속하려면 아무 키나 누르십시오") >= 0 Then
MsgBox("일시정지 해재")
eudplibprocess.StandardInput.Write(vbCrLf)
If StandardOutput.IndexOf("Freeze - prompt enabled") >= 0 Then
'If pjData.TEData.SCArchive.IsUsed Then
' If Not WriteSCADataFile() Then
' Tool.ErrorMsgBox(Tool.GetText("Error WriteMapFile"))
' Return False
' Else
' isFreezeUse = True
' End If
'End If
'eudplibprocess.Kill()
eudplibprocess.StandardInput.Write(vbCrLf)
End If
If eudplibShutDown Then
Expand Down Expand Up @@ -361,7 +385,6 @@ Partial Public Class BuildData
Return process
End Function
Public Sub OutputReader(sender As Object, e As DataReceivedEventArgs)
'MsgBox(e.Data)
OutputString = OutputString & e.Data & vbCrLf
End Sub

Expand Down
41 changes: 41 additions & 0 deletions EUD Editor 3/Class/BulidData/SCACheckSum.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Imports System.IO

Partial Public Class BuildData
Public Function WriteChecksum() As Boolean
'ConnectKey
Dim mapstream As New FileStream(pjData.SaveMapName, FileMode.Open)
Dim br As New BinaryReader(mapstream)
Dim bw As New BinaryWriter(mapstream)


Dim buffer As Byte()


br.ReadUInt32() '이름
br.ReadUInt32() '헤더길이
Dim fileSize As UInteger = br.ReadUInt32() 'mpq길이


mapstream.Position = 0
buffer = br.ReadBytes(fileSize)


Dim crc32 As New CRC32
Dim checksumv As UInteger = crc32.GetCRC32(Buffer)


'MsgBox(mapstream.Position & "," & mapstream.Length)
Dim checkstring As String = AESModule.EncryptString128Bit(checksumv, ConnectKey)
MsgBox(checkstring & "," & ConnectKey)

bw.Write(checkstring)


br.Close()
bw.Close()
mapstream.Close()


Return True
End Function
End Class
60 changes: 27 additions & 33 deletions EUD Editor 3/Class/BulidData/WriteSCAData.vb
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ Partial Public Class BuildData

'sw.Close()
'fs.Close()
WriteSCADataFile()
End Sub


Expand Down Expand Up @@ -162,9 +163,11 @@ Partial Public Class BuildData
sb.AppendLine("const SpaceLength = " & pjData.TEData.SCArchive.DataSpace & ";//DataBufferSize")
sb.AppendLine("const ObjectCount = " & pjData.TEData.SCArchive.CodeDatas.Count & ";//ObjectCount")


sb.AppendLine("")
sb.AppendLine("function Init(){")
'sb.AppendLine(" MPQAddFile('SCARCHIVEMAPCODE', py_open('scakeyfile', 'rb').read());")
sb.AppendLine(" MPQAddFile('SCARCHIVEMAPCODE', py_open('scakeyfile', 'rb').read());")
sb.AppendLine(" MPQAddFile('SCARCHIVEDATA', py_open('scadatafile', 'rb').read());")
'sb.AppendLine("f_eprintln(""시발 오류"", dwread_epd(EPD(ws)), "" "", dwread_epd(EPD(ws) + 1));")
sb.AppendLine(" //EntryPoint")
For i = 0 To EntryPoint.Count - 1
Expand Down Expand Up @@ -438,40 +441,38 @@ Partial Public Class BuildData


Public Function WriteSCADataFile() As Boolean
Dim hmpq As UInteger
Dim hfile As UInteger
Dim buffer() As Byte
Dim filesize As UInteger
Dim pdwread As IntPtr
'Dim hmpq As UInteger
'Dim hfile As UInteger
'Dim buffer() As Byte
'Dim filesize As UInteger
'Dim pdwread As IntPtr



Dim openFilename As String = "staredit\scenario.chk"
'Dim openFilename As String = "staredit\scenario.chk"


System.Threading.Thread.Sleep(1000)
'System.Threading.Thread.Sleep(1000)


StormLib.SFileOpenArchive(pjData.SaveMapName, 0, 0, hmpq)
If hmpq = 0 Then
Return False
End If
StormLib.SFileOpenFileEx(hmpq, openFilename, 0, hfile)
filesize = StormLib.SFileGetFileSize(hfile, filesize)
ReDim buffer(filesize)
'StormLib.SFileOpenArchive(pjData.SaveMapName, 0, 0, hmpq)
'If hmpq = 0 Then
'Return False
'End If
'StormLib.SFileOpenFileEx(hmpq, openFilename, 0, hfile)
'filesize = StormLib.SFileGetFileSize(hfile, filesize)
'ReDim buffer(filesize)
'MsgBox("파일 크기 : " & filesize)
StormLib.SFileReadFile(hfile, buffer, filesize, pdwread, 0)
'StormLib.SFileReadFile(hfile, buffer, filesize, pdwread, 0)

Dim crc32 As New CRC32
Dim checksumv As UInteger = crc32.GetCRC32(buffer)
'Dim crc32 As New CRC32
'Dim checksumv As UInteger = crc32.GetCRC32(buffer)
'MsgBox("체크섬 값 : " & checksumv)





Dim Sb As New StringBuilder
Sb.AppendLine(checksumv)
Sb.AppendLine("SCArchive by BingSu")
Sb.AppendLine(pjData.TEData.SCArchive.DataSpace)

Dim EntryStr As String = ""
Expand Down Expand Up @@ -505,18 +506,11 @@ Partial Public Class BuildData







Dim fs As New FileStream(TempFilePath & "\scadatafile", FileMode.Create)
Dim fs As New FileStream(EudPlibFilePath & "\scadatafile", FileMode.Create)
Dim sw As New StreamWriter(fs)

sw.Write(AESModule.EncryptString128Bit(Sb.ToString, ConnectKey))




'2데이터태그 실제데이터위치 배열
'엔트리포인트(현재 시간과 제작코드 등을 이용해 만들기, 빌드 시 마다 달라짐)
'chk값
Expand All @@ -527,14 +521,14 @@ Partial Public Class BuildData
fs.Close()


StormLib.SFileAddFile(hmpq, TempFilePath & "\scadatafile", "SCARCHIVEDATA", StormLib.MPQ_FILE_COMPRESS)
'StormLib.SFileAddFile(hmpq, TempFilePath & "\scadatafile", "SCARCHIVEDATA", StormLib.MPQ_FILE_COMPRESS)

StormLib.SFileAddFile(hmpq, EudPlibFilePath & "\scakeyfile", "SCARCHIVEMAPCODE", StormLib.MPQ_FILE_COMPRESS)
'StormLib.SFileAddFile(hmpq, EudPlibFilePath & "\scakeyfile", "SCARCHIVEMAPCODE", StormLib.MPQ_FILE_COMPRESS)



StormLib.SFileCloseFile(hfile)
StormLib.SFileCloseArchive(hmpq)
'StormLib.SFileCloseFile(hfile)
'StormLib.SFileCloseArchive(hmpq)



Expand Down
2 changes: 1 addition & 1 deletion EUD Editor 3/Class/Data/ProjectData/Timer.vb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Partial Public Class ProjectData
If LastOupputModifiyTimer <> File.GetLastWriteTime(SaveMapName) Then
LastOupputModifiyTimer = File.GetLastWriteTime(SaveMapName)
If pjData.TEData.SCArchive.IsUsed Then
pjData.EudplibData.WriteSCADataFile()
pjData.EudplibData.WriteChecksum()
End If
LastCompile = True
End If
Expand Down
1 change: 1 addition & 0 deletions EUD Editor 3/EUD Editor 3.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@
<Compile Include="Class\Binding\ValidationRule\TextValidationRule.vb" />
<Compile Include="Class\Bitmap\BitmapManager.vb" />
<Compile Include="Class\BulidData\BulidPaths.vb" />
<Compile Include="Class\BulidData\SCACheckSum.vb" />
<Compile Include="Class\BulidData\WriteSCAData.vb" />
<Compile Include="Class\BulidData\WriteButtonData.vb" />
<Compile Include="Class\BulidData\WriteDatFile.vb" />
Expand Down
4 changes: 2 additions & 2 deletions EUD Editor 3/My Project/AssemblyInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ Imports System.Windows
' 지정되도록 할 수 있습니다.
' <Assembly: AssemblyVersion("1.0.*")>

<Assembly: AssemblyVersion("0.7.0.0")>
<Assembly: AssemblyFileVersion("0.7.0.0")>
<Assembly: AssemblyVersion("0.7.0.1")>
<Assembly: AssemblyFileVersion("0.7.0.1")>

0 comments on commit fcb1db8

Please sign in to comment.