mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 08:25:09 +01:00
Add config option to log outbound messages
This commit is contained in:
@@ -14,18 +14,19 @@ type Config struct {
|
|||||||
DevMode bool
|
DevMode bool
|
||||||
|
|
||||||
DevModeOptions DevModeOptions
|
DevModeOptions DevModeOptions
|
||||||
Database Database
|
Database Database
|
||||||
Launcher Launcher
|
Launcher Launcher
|
||||||
Sign Sign
|
Sign Sign
|
||||||
Channel Channel
|
Channel Channel
|
||||||
Entrance Entrance
|
Entrance Entrance
|
||||||
}
|
}
|
||||||
|
|
||||||
// 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 {
|
||||||
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 HR9 so that you can join non-beginner worlds.
|
MaxLauncherHR bool // Sets the HR returned in the launcher to HR9 so that you can join non-beginner worlds.
|
||||||
FixedStageID bool // Causes all move_stage to use the ID sl1Ns200p0a0u0 to get you into all stages
|
FixedStageID bool // Causes all move_stage to use the ID sl1Ns200p0a0u0 to get you into all stages
|
||||||
|
LogOutboundMessages bool // Log all messages sent to the clients
|
||||||
}
|
}
|
||||||
|
|
||||||
// Database holds the postgres database config.
|
// Database holds the postgres database config.
|
||||||
|
|||||||
@@ -59,8 +59,10 @@ func (s *Session) Start() {
|
|||||||
|
|
||||||
// QueueSend queues a packet (raw []byte) to be sent.
|
// QueueSend queues a packet (raw []byte) to be sent.
|
||||||
func (s *Session) QueueSend(data []byte) {
|
func (s *Session) QueueSend(data []byte) {
|
||||||
fmt.Printf("Sending To CharID: '%x'\n", s.charID)
|
if s.server.erupeConfig.DevMode && s.server.erupeConfig.DevModeOptions.LogOutboundMessages {
|
||||||
fmt.Printf("Sent Data:\n%s\n", hex.Dump(data))
|
fmt.Printf("Sending To CharID: '%x'\n", s.charID)
|
||||||
|
fmt.Printf("Sent Data:\n%s\n", hex.Dump(data))
|
||||||
|
}
|
||||||
|
|
||||||
s.sendPackets <- data
|
s.sendPackets <- data
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user