add quest coordinate print option

This commit is contained in:
wish
2022-10-17 12:38:27 +11:00
parent 25491834df
commit ef5afa3899
3 changed files with 30 additions and 16 deletions

View File

@@ -19,6 +19,7 @@
"MezFesAlt": false, "MezFesAlt": false,
"DisableMailItems": true, "DisableMailItems": true,
"DisableTokenCheck": false, "DisableTokenCheck": false,
"PrintQuestCoordinates": false,
"SaveDumps": { "SaveDumps": {
"Enabled": true, "Enabled": true,
"OutputDir": "savedata" "OutputDir": "savedata"

View File

@@ -29,22 +29,23 @@ type Config struct {
// DevModeOptions holds various debug/temporary options for use while developing Erupe. // DevModeOptions holds various debug/temporary options for use while developing Erupe.
type DevModeOptions struct { type DevModeOptions struct {
EnableLauncherServer bool // Enables the launcher server to be served on port 80 EnableLauncherServer bool // Enables the launcher server to be served on port 80
HideLoginNotice bool // Hide the Erupe notice on login HideLoginNotice bool // Hide the Erupe notice on login
LoginNotice string // MHFML string of the login notice displayed LoginNotice string // MHFML string of the login notice displayed
CleanDB bool // Automatically wipes the DB on server reset. CleanDB bool // Automatically wipes the DB on server reset.
MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds. MaxLauncherHR bool // Sets the HR returned in the launcher to HR7 so that you can join non-beginner worlds.
LogInboundMessages bool // Log all messages sent to the server LogInboundMessages bool // Log all messages sent to the server
LogOutboundMessages bool // Log all messages sent to the clients LogOutboundMessages bool // Log all messages sent to the clients
MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled MaxHexdumpLength int // Maximum number of bytes printed when logs are enabled
DivaEvent int // Diva Defense event status DivaEvent int // Diva Defense event status
FestaEvent int // Hunter's Festa event status FestaEvent int // Hunter's Festa event status
TournamentEvent int // VS Tournament event status TournamentEvent int // VS Tournament event status
MezFesEvent bool // MezFes status MezFesEvent bool // MezFes status
MezFesAlt bool // Swaps out Volpakkun for Tokotoko MezFesAlt bool // Swaps out Volpakkun for Tokotoko
DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!) DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!)
DisableMailItems bool // Hack to prevent english versions of MHF from crashing DisableMailItems bool // Hack to prevent english versions of MHF from crashing
SaveDumps SaveDumpOptions PrintQuestCoordinates bool // Prints quest coordinates to console
SaveDumps SaveDumpOptions
} }
type SaveDumpOptions struct { type SaveDumpOptions struct {

View File

@@ -19,6 +19,7 @@ import (
const ( const (
BinaryMessageTypeState = 0 BinaryMessageTypeState = 0
BinaryMessageTypeChat = 1 BinaryMessageTypeChat = 1
BinaryMessageTypeQuest = 2
BinaryMessageTypeData = 3 BinaryMessageTypeData = 3
BinaryMessageTypeMailNotify = 4 BinaryMessageTypeMailNotify = 4
BinaryMessageTypeEmote = 6 BinaryMessageTypeEmote = 6
@@ -89,6 +90,17 @@ func handleMsgSysCastBinary(s *Session, p mhfpacket.MHFPacket) {
} }
} }
if s.server.erupeConfig.DevModeOptions.PrintQuestCoordinates == true && s.server.erupeConfig.DevMode {
if pkt.BroadcastType == 0x03 && pkt.MessageType == 0x02 && len(pkt.RawDataPayload) > 32 {
tmp.ReadBytes(20)
tmp.SetLE()
x := tmp.ReadFloat32()
y := tmp.ReadFloat32()
z := tmp.ReadFloat32()
s.logger.Debug("Coord", zap.Float32s("XYZ", []float32{x, y, z}))
}
}
// Parse out the real casted binary payload // Parse out the real casted binary payload
var msgBinTargeted *binpacket.MsgBinTargeted var msgBinTargeted *binpacket.MsgBinTargeted
var authorLen, msgLen uint16 var authorLen, msgLen uint16