Add troubleshooting for setup on docker and add opcode dec and hex to logger

This commit is contained in:
stratic-dev
2024-10-05 22:56:53 +01:00
parent 2d48d63263
commit ae32951671
2 changed files with 6 additions and 1 deletions

View File

@@ -64,3 +64,7 @@ if you want all the logs and you want it to be in an attached state
```bash ```bash
docker-compose up docker-compose up
``` ```
# Troubleshooting
Q: My Postgres will not populate. A: You're setup.sh is maybe saved as CRLF it needs to be saved as LF.

View File

@@ -15,6 +15,7 @@ import (
"erupe-ce/network" "erupe-ce/network"
"erupe-ce/network/clientctx" "erupe-ce/network/clientctx"
"erupe-ce/network/mhfpacket" "erupe-ce/network/mhfpacket"
"go.uber.org/zap" "go.uber.org/zap"
) )
@@ -275,7 +276,7 @@ func (s *Session) logMessage(opcode uint16, data []byte, sender string, recipien
} else { } else {
fmt.Printf("[%s] -> [%s]\n", sender, recipient) fmt.Printf("[%s] -> [%s]\n", sender, recipient)
} }
fmt.Printf("Opcode: %s\n", opcodePID) fmt.Printf("Opcode: (Dec: %d Hex: 0x%04X Name: %s) \n", opcode, opcode, opcodePID)
if s.server.erupeConfig.DebugOptions.LogMessageData { if s.server.erupeConfig.DebugOptions.LogMessageData {
if len(data) <= s.server.erupeConfig.DebugOptions.MaxHexdumpLength { if len(data) <= s.server.erupeConfig.DebugOptions.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))