mirror of
https://github.com/WiiLink24/wfc-server.git
synced 2026-05-06 05:26:33 -05:00
GPSP: Apply lint suggestions
This commit is contained in:
parent
a700af444e
commit
5dee992b47
|
|
@ -6,11 +6,15 @@ import (
|
|||
"wwfc/logging"
|
||||
)
|
||||
|
||||
func replyError(moduleName string, connIndex uint64, err gpcm.GPError) {
|
||||
logging.Error(moduleName, "Reply error:", err.ErrorString)
|
||||
msg := err.GetMessage()
|
||||
common.SendPacket(ServerName, connIndex, []byte(msg))
|
||||
if err.Fatal {
|
||||
common.CloseConnection(ServerName, connIndex)
|
||||
func replyError(moduleName string, connIndex uint64, gpErr gpcm.GPError) {
|
||||
logging.Error(moduleName, "Reply error:", gpErr.ErrorString)
|
||||
err := common.SendPacket(ServerName, connIndex, []byte(gpErr.GetMessage()))
|
||||
if gpErr.Fatal || err != nil {
|
||||
if err != nil {
|
||||
logging.Error(moduleName, "Failed to send error message:", err)
|
||||
}
|
||||
if err := common.CloseConnection(ServerName, connIndex); err != nil {
|
||||
logging.Error(moduleName, "Failed to close connection:", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,13 +45,16 @@ func HandlePacket(index uint64, data []byte) {
|
|||
replyError(moduleName, index, gpcm.ErrParse)
|
||||
|
||||
case "ka":
|
||||
common.SendPacket(ServerName, index, []byte(`\ka\\final\`))
|
||||
err = common.SendPacket(ServerName, index, []byte(`\ka\\final\`))
|
||||
|
||||
case "otherslist":
|
||||
common.SendPacket(ServerName, index, []byte(handleOthersList(command)))
|
||||
err = common.SendPacket(ServerName, index, []byte(handleOthersList(command)))
|
||||
|
||||
case "search":
|
||||
common.SendPacket(ServerName, index, []byte(handleSearch(command)))
|
||||
err = common.SendPacket(ServerName, index, []byte(handleSearch(command)))
|
||||
}
|
||||
}
|
||||
if err != nil {
|
||||
logging.Error(moduleName, "Failed to send packet:", err)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user