mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 00:15:08 +01:00
Abracted away broadcast utils
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"time"
|
||||
|
||||
"erupe-ce/network/mhfpacket"
|
||||
"erupe-ce/utils/broadcast"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/utils/db"
|
||||
"erupe-ce/utils/gametime"
|
||||
@@ -32,7 +33,7 @@ func HandleMsgMhfLoadGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
data, err := database.Queryx("SELECT id, destination, charge, depart, return, collected_by FROM guild_adventures WHERE guild_id = $1", guild.ID)
|
||||
if err != nil {
|
||||
s.Logger.Error("Failed to get guild adventures from db", zap.Error(err))
|
||||
DoAckBufSucceed(s, pkt.AckHandle, make([]byte, 1))
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, make([]byte, 1))
|
||||
return
|
||||
}
|
||||
temp := byteframe.NewByteFrame()
|
||||
@@ -54,7 +55,7 @@ func HandleMsgMhfLoadGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
bf := byteframe.NewByteFrame()
|
||||
bf.WriteUint8(uint8(count))
|
||||
bf.WriteBytes(temp.Data())
|
||||
DoAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func HandleMsgMhfRegistGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -68,7 +69,7 @@ func HandleMsgMhfRegistGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
if err != nil {
|
||||
s.Logger.Error("Failed to register guild adventure", zap.Error(err))
|
||||
}
|
||||
DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
}
|
||||
|
||||
func HandleMsgMhfAcquireGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -88,7 +89,7 @@ func HandleMsgMhfAcquireGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.Logger.Error("Failed to collect adventure in db", zap.Error(err))
|
||||
}
|
||||
}
|
||||
DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
}
|
||||
|
||||
func HandleMsgMhfChargeGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -101,7 +102,7 @@ func HandleMsgMhfChargeGuildAdventure(s *Session, p mhfpacket.MHFPacket) {
|
||||
if err != nil {
|
||||
s.Logger.Error("Failed to charge guild adventure", zap.Error(err))
|
||||
}
|
||||
DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
}
|
||||
|
||||
func HandleMsgMhfRegistGuildAdventureDiva(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -115,5 +116,5 @@ func HandleMsgMhfRegistGuildAdventureDiva(s *Session, p mhfpacket.MHFPacket) {
|
||||
if err != nil {
|
||||
s.Logger.Error("Failed to register guild adventure", zap.Error(err))
|
||||
}
|
||||
DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user