mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-02-05 17:47:05 +01:00
add LogMessageData DevModeOption & disable Logging by default
This commit is contained in:
@@ -18,8 +18,9 @@
|
|||||||
"AutoCreateAccount": true,
|
"AutoCreateAccount": true,
|
||||||
"CleanDB": false,
|
"CleanDB": false,
|
||||||
"MaxLauncherHR": false,
|
"MaxLauncherHR": false,
|
||||||
"LogInboundMessages": true,
|
"LogInboundMessages": false,
|
||||||
"LogOutboundMessages": true,
|
"LogOutboundMessages": false,
|
||||||
|
"LogMessageData": false,
|
||||||
"MaxHexdumpLength": 256,
|
"MaxHexdumpLength": 256,
|
||||||
"DivaEvent": 0,
|
"DivaEvent": 0,
|
||||||
"FestaEvent": -1,
|
"FestaEvent": -1,
|
||||||
|
|||||||
@@ -101,6 +101,7 @@ type DevModeOptions struct {
|
|||||||
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
|
||||||
|
LogMessageData bool // Log all bytes transferred as a hexdump
|
||||||
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
|
||||||
|
|||||||
@@ -278,11 +278,15 @@ func (s *Session) logMessage(opcode uint16, data []byte, sender string, recipien
|
|||||||
fmt.Printf("[%s] -> [%s]\n", sender, recipient)
|
fmt.Printf("[%s] -> [%s]\n", sender, recipient)
|
||||||
}
|
}
|
||||||
fmt.Printf("Opcode: %s\n", opcodePID)
|
fmt.Printf("Opcode: %s\n", opcodePID)
|
||||||
|
if s.server.erupeConfig.DevModeOptions.LogMessageData {
|
||||||
if len(data) <= s.server.erupeConfig.DevModeOptions.MaxHexdumpLength {
|
if len(data) <= s.server.erupeConfig.DevModeOptions.MaxHexdumpLength {
|
||||||
fmt.Printf("Data [%d bytes]:\n%s\n", len(data), hex.Dump(data))
|
fmt.Printf("Data [%d bytes]:\n%s\n", len(data), hex.Dump(data))
|
||||||
} else {
|
} else {
|
||||||
fmt.Printf("Data [%d bytes]: (Too long!)\n\n", len(data))
|
fmt.Printf("Data [%d bytes]: (Too long!)\n\n", len(data))
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
fmt.Printf("\n")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Session) SetObjectID() {
|
func (s *Session) SetObjectID() {
|
||||||
|
|||||||
Reference in New Issue
Block a user