mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-12 23:14:36 +01:00
add AutoBackportQuest DebugOption
This commit is contained in:
@@ -36,6 +36,7 @@
|
|||||||
"TournamentOverride": 0,
|
"TournamentOverride": 0,
|
||||||
"DisableTokenCheck": false,
|
"DisableTokenCheck": false,
|
||||||
"QuestTools": false,
|
"QuestTools": false,
|
||||||
|
"AutoQuestBackport": true,
|
||||||
"ProxyPort": 0,
|
"ProxyPort": 0,
|
||||||
"CapLink": {
|
"CapLink": {
|
||||||
"Values": [51728, 20000, 51729, 1, 20000],
|
"Values": [51728, 20000, 51729, 1, 20000],
|
||||||
|
|||||||
@@ -118,6 +118,7 @@ type DebugOptions struct {
|
|||||||
TournamentOverride int // VS Tournament event status
|
TournamentOverride int // VS Tournament event status
|
||||||
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
|
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
|
||||||
QuestTools bool // Enable various quest debug logs
|
QuestTools bool // Enable various quest debug logs
|
||||||
|
AutoQuestBackport bool // Automatically backport quest files
|
||||||
ProxyPort uint16 // Forces the game to connect to a channel server proxy
|
ProxyPort uint16 // Forces the game to connect to a channel server proxy
|
||||||
CapLink CapLinkOptions
|
CapLink CapLinkOptions
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package channelserver
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
|
"encoding/binary"
|
||||||
"erupe-ce/common/byteframe"
|
"erupe-ce/common/byteframe"
|
||||||
"erupe-ce/common/decryption"
|
"erupe-ce/common/decryption"
|
||||||
ps "erupe-ce/common/pascalstring"
|
ps "erupe-ce/common/pascalstring"
|
||||||
@@ -21,6 +22,20 @@ type tuneValue struct {
|
|||||||
Value uint16
|
Value uint16
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func BackportQuest(data []byte) []byte {
|
||||||
|
wp := binary.LittleEndian.Uint32(data[0:4]) + 96
|
||||||
|
rp := wp + 4
|
||||||
|
for i := uint32(0); i < 6; i++ {
|
||||||
|
if i != 0 {
|
||||||
|
wp += 4
|
||||||
|
rp += 8
|
||||||
|
}
|
||||||
|
copy(data[wp:wp+4], data[rp:rp+4])
|
||||||
|
}
|
||||||
|
copy(data[wp:wp+180], data[rp:rp+180])
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgSysGetFile)
|
pkt := p.(*mhfpacket.MsgSysGetFile)
|
||||||
|
|
||||||
@@ -63,6 +78,9 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if _config.ErupeConfig.RealClientMode <= _config.Z1 && s.server.erupeConfig.DebugOptions.AutoQuestBackport {
|
||||||
|
data = BackportQuest(decryption.UnpackSimple(data))
|
||||||
|
}
|
||||||
doAckBufSucceed(s, pkt.AckHandle, data)
|
doAckBufSucceed(s, pkt.AckHandle, data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -124,6 +142,9 @@ func loadQuestFile(s *Session, questId int) []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
decrypted := decryption.UnpackSimple(file)
|
decrypted := decryption.UnpackSimple(file)
|
||||||
|
if _config.ErupeConfig.RealClientMode <= _config.Z1 && s.server.erupeConfig.DebugOptions.AutoQuestBackport {
|
||||||
|
decrypted = BackportQuest(decrypted)
|
||||||
|
}
|
||||||
fileBytes := byteframe.NewByteFrameFromBytes(decrypted)
|
fileBytes := byteframe.NewByteFrameFromBytes(decrypted)
|
||||||
fileBytes.SetLE()
|
fileBytes.SetLE()
|
||||||
fileBytes.Seek(int64(fileBytes.ReadUint32()), 0)
|
fileBytes.Seek(int64(fileBytes.ReadUint32()), 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user