mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 16:34:51 +01:00
revert broadcast package refactor in prep for session interface refactor
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"erupe-ce/server/channelserver/compression/deltacomp"
|
||||
"erupe-ce/server/channelserver/compression/nullcomp"
|
||||
|
||||
"erupe-ce/utils/broadcast"
|
||||
"erupe-ce/utils/byteframe"
|
||||
"erupe-ce/utils/db"
|
||||
"erupe-ce/utils/gametime"
|
||||
@@ -30,7 +29,7 @@ func handleMsgMhfLoadPartner(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.Logger.Error("Failed to load partner", zap.Error(err))
|
||||
data = make([]byte, 9)
|
||||
}
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, data)
|
||||
s.DoAckBufSucceed(pkt.AckHandle, data)
|
||||
}
|
||||
|
||||
func handleMsgMhfSavePartner(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -44,7 +43,7 @@ func handleMsgMhfSavePartner(s *Session, p mhfpacket.MHFPacket) {
|
||||
if err != nil {
|
||||
s.Logger.Error("Failed to save partner", zap.Error(err))
|
||||
}
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
}
|
||||
|
||||
func handleMsgMhfLoadLegendDispatch(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -63,7 +62,7 @@ func handleMsgMhfLoadLegendDispatch(s *Session, p mhfpacket.MHFPacket) {
|
||||
bf.WriteUint32(dispatch.Unk)
|
||||
bf.WriteUint32(dispatch.Timestamp)
|
||||
}
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
s.DoAckBufSucceed(pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfLoadHunterNavi(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -82,7 +81,7 @@ func handleMsgMhfLoadHunterNavi(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.Logger.Error("Failed to load hunternavi", zap.Error(err))
|
||||
data = make([]byte, naviLength)
|
||||
}
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, data)
|
||||
s.DoAckBufSucceed(pkt.AckHandle, data)
|
||||
}
|
||||
|
||||
func handleMsgMhfSaveHunterNavi(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -125,7 +124,7 @@ func handleMsgMhfSaveHunterNavi(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.Logger.Error("Failed to save hunternavi", zap.Error(err))
|
||||
}
|
||||
}
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
}
|
||||
|
||||
func handleMsgMhfMercenaryHuntdata(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -136,9 +135,9 @@ func handleMsgMhfMercenaryHuntdata(s *Session, p mhfpacket.MHFPacket) {
|
||||
// struct Hunt
|
||||
// uint32 HuntID
|
||||
// uint32 MonID
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, make([]byte, 1))
|
||||
s.DoAckBufSucceed(pkt.AckHandle, make([]byte, 1))
|
||||
} else {
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, make([]byte, 0))
|
||||
s.DoAckBufSucceed(pkt.AckHandle, make([]byte, 0))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +151,7 @@ func handleMsgMhfEnumerateMercenaryLog(s *Session, p mhfpacket.MHFPacket) {
|
||||
// []byte Name (len 18)
|
||||
// uint8 Unk
|
||||
// uint8 Unk
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
s.DoAckBufSucceed(pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfCreateMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -166,7 +165,7 @@ func handleMsgMhfCreateMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
_ = database.QueryRow("SELECT nextval('rasta_id_seq')").Scan(&nextID)
|
||||
database.Exec("UPDATE characters SET rasta_id=$1 WHERE id=$2", nextID, s.CharID)
|
||||
bf.WriteUint32(nextID)
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, bf.Data())
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfSaveMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -181,7 +180,7 @@ func handleMsgMhfSaveMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
database.Exec("UPDATE characters SET savemercenary=$1, rasta_id=$2 WHERE id=$3", pkt.MercData, temp.ReadUint32(), s.CharID)
|
||||
}
|
||||
database.Exec("UPDATE characters SET gcp=$1, pact_id=$2 WHERE id=$3", pkt.GCP, pkt.PactMercID, s.CharID)
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, []byte{0x00, 0x00, 0x00, 0x00})
|
||||
}
|
||||
|
||||
func handleMsgMhfReadMercenaryW(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -243,7 +242,7 @@ func handleMsgMhfReadMercenaryW(s *Session, p mhfpacket.MHFPacket) {
|
||||
bf.WriteUint32(gcp)
|
||||
}
|
||||
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||
s.DoAckBufSucceed(pkt.AckHandle, bf.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfReadMercenaryM(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -260,7 +259,7 @@ func handleMsgMhfReadMercenaryM(s *Session, p mhfpacket.MHFPacket) {
|
||||
} else {
|
||||
resp.WriteBytes(data)
|
||||
}
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, resp.Data())
|
||||
s.DoAckBufSucceed(pkt.AckHandle, resp.Data())
|
||||
}
|
||||
|
||||
func handleMsgMhfContractMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -277,7 +276,7 @@ func handleMsgMhfContractMercenary(s *Session, p mhfpacket.MHFPacket) {
|
||||
case 2: // Cancel loan
|
||||
database.Exec("UPDATE characters SET pact_id=0 WHERE id=$1", pkt.CID)
|
||||
}
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, make([]byte, 4))
|
||||
}
|
||||
|
||||
func handleMsgMhfLoadOtomoAirou(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -292,7 +291,7 @@ func handleMsgMhfLoadOtomoAirou(s *Session, p mhfpacket.MHFPacket) {
|
||||
s.Logger.Error("Failed to load otomoairou", zap.Error(err))
|
||||
data = make([]byte, 10)
|
||||
}
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, data)
|
||||
s.DoAckBufSucceed(pkt.AckHandle, data)
|
||||
}
|
||||
|
||||
func handleMsgMhfSaveOtomoAirou(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -305,7 +304,7 @@ func handleMsgMhfSaveOtomoAirou(s *Session, p mhfpacket.MHFPacket) {
|
||||
decomp, err := nullcomp.Decompress(pkt.RawDataPayload[1:])
|
||||
if err != nil {
|
||||
s.Logger.Error("Failed to decompress airou", zap.Error(err))
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, make([]byte, 4))
|
||||
return
|
||||
}
|
||||
bf := byteframe.NewByteFrameFromBytes(decomp)
|
||||
@@ -340,7 +339,7 @@ func handleMsgMhfSaveOtomoAirou(s *Session, p mhfpacket.MHFPacket) {
|
||||
comp = append([]byte{0x01}, comp...)
|
||||
database.Exec("UPDATE characters SET otomoairou=$1 WHERE id=$2", comp, s.CharID)
|
||||
}
|
||||
broadcast.DoAckSimpleSucceed(s, pkt.AckHandle, make([]byte, 4))
|
||||
s.DoAckSimpleSucceed(pkt.AckHandle, make([]byte, 4))
|
||||
}
|
||||
|
||||
func handleMsgMhfEnumerateAiroulist(s *Session, p mhfpacket.MHFPacket) {
|
||||
@@ -359,7 +358,7 @@ func handleMsgMhfEnumerateAiroulist(s *Session, p mhfpacket.MHFPacket) {
|
||||
resp.WriteUint16(cat.WeaponID)
|
||||
resp.WriteUint32(0) // 32 bit unix timestamp, either time at which the cat stops being fatigued or the time at which it started
|
||||
}
|
||||
broadcast.DoAckBufSucceed(s, pkt.AckHandle, resp.Data())
|
||||
s.DoAckBufSucceed(pkt.AckHandle, resp.Data())
|
||||
}
|
||||
|
||||
type Airou struct {
|
||||
|
||||
Reference in New Issue
Block a user