require header match
All checks were successful
Build and Publish / BuildAndDeployAmd64 (push) Successful in 27s
Build and Publish / BuildAndDeploy (push) Successful in 2m16s

This commit is contained in:
matst80
2024-11-12 22:31:19 +01:00
parent 438358e4b3
commit e1b254668f
6 changed files with 52 additions and 7 deletions

View File

@@ -70,7 +70,7 @@ func (m *TCPCartServerMux) handleFunction(connection net.Conn, messageType CartM
m.mu.RUnlock()
if ok {
responseType, responseData, err := fn(id, data)
connection.Write(header[:])
if err != nil {
errData := []byte(err.Error())
err = binary.Write(connection, binary.LittleEndian, CartPacket{
@@ -96,6 +96,8 @@ func (m *TCPCartServerMux) handleFunction(connection net.Conn, messageType CartM
packetsSent.Inc()
_, err = connection.Write(responseData)
return true, err
} else {
log.Printf("No cart handler for type: %d\n", messageType)
}
return false, nil
}