Quest Clear Timer

Special thanks to Hiroaki for this.
This commit is contained in:
xl3lackout
2022-03-31 18:56:49 -04:00
parent e07a9684c7
commit 92a09edc96

View File

@@ -2,6 +2,7 @@ package channelserver
import (
"fmt"
"math"
"strings"
"github.com/Andoryuuta/byteframe"
@@ -49,6 +50,17 @@ func sendServerChatMessage(s *Session, message string) {
func handleMsgSysCastBinary(s *Session, p mhfpacket.MHFPacket) {
pkt := p.(*mhfpacket.MsgSysCastBinary)
if pkt.BroadcastType == 0x03 && pkt.MessageType == 0x03 && len(pkt.RawDataPayload) == 0x10 {
tmp := byteframe.NewByteFrameFromBytes(pkt.RawDataPayload)
if tmp.ReadUint16() == 0x0002 && tmp.ReadUint8() == 0x18 {
_ = tmp.ReadBytes(9)
tmp.SetLE()
frame := tmp.ReadUint32()
sendServerChatMessage(s, fmt.Sprintf("TIME : %d'%d.%03d (%dframe)", frame/30/60, frame/30%60, int(math.Round(float64(frame%30*100)/3)), frame))
}
}
// Parse out the real casted binary payload
var realPayload []byte
var msgBinTargeted *binpacket.MsgBinTargeted