mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 16:04:38 +01:00
rewrite default Earth data
This commit is contained in:
@@ -1609,8 +1609,8 @@ func handleMsgMhfKickExportForce(s *Session, p mhfpacket.MHFPacket) {}
|
|||||||
func handleMsgMhfGetEarthStatus(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfGetEarthStatus(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgMhfGetEarthStatus)
|
pkt := p.(*mhfpacket.MsgMhfGetEarthStatus)
|
||||||
bf := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
bf.WriteUint32(uint32(TimeWeekStart().Unix())) // Start
|
bf.WriteUint32(uint32(TimeWeekStart().Add(time.Hour * -24).Unix())) // Start
|
||||||
bf.WriteUint32(uint32(TimeWeekNext().Unix())) // End
|
bf.WriteUint32(uint32(TimeWeekNext().Add(time.Hour * 24).Unix())) // End
|
||||||
bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthStatusOverride)
|
bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthStatusOverride)
|
||||||
bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthIDOverride)
|
bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthIDOverride)
|
||||||
bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthMonsterOverride)
|
bf.WriteInt32(s.server.erupeConfig.DevModeOptions.EarthMonsterOverride)
|
||||||
@@ -1624,71 +1624,42 @@ func handleMsgMhfRegistSpabiTime(s *Session, p mhfpacket.MHFPacket) {}
|
|||||||
|
|
||||||
func handleMsgMhfGetEarthValue(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfGetEarthValue(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgMhfGetEarthValue)
|
pkt := p.(*mhfpacket.MsgMhfGetEarthValue)
|
||||||
var earthValues []struct{ Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32 }
|
type EarthValues struct {
|
||||||
if pkt.ReqType == 3 {
|
Value []uint32
|
||||||
earthValues = []struct {
|
}
|
||||||
Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32
|
|
||||||
}{
|
var earthValues []EarthValues
|
||||||
// TW identical to JP
|
switch pkt.ReqType {
|
||||||
{
|
case 1:
|
||||||
Unk0: 0x03E9,
|
earthValues = []EarthValues{
|
||||||
Unk1: 0x24,
|
{[]uint32{1, 312, 0, 0, 0, 0}},
|
||||||
},
|
{[]uint32{2, 99, 0, 0, 0, 0}},
|
||||||
{
|
|
||||||
Unk0: 0x2329,
|
|
||||||
Unk1: 0x03,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Unk0: 0x232A,
|
|
||||||
Unk1: 0x0A,
|
|
||||||
Unk2: 0x012C,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
} else if pkt.ReqType == 2 {
|
case 2:
|
||||||
earthValues = []struct {
|
earthValues = []EarthValues{
|
||||||
Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32
|
{[]uint32{1, 5771, 0, 0, 0, 0}},
|
||||||
}{
|
{[]uint32{2, 1847, 0, 0, 0, 0}},
|
||||||
// JP response was empty
|
|
||||||
{
|
|
||||||
Unk0: 0x01,
|
|
||||||
Unk1: 0x168B,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Unk0: 0x02,
|
|
||||||
Unk1: 0x0737,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
} else if pkt.ReqType == 1 {
|
case 3:
|
||||||
earthValues = []struct {
|
earthValues = []EarthValues{
|
||||||
Unk0, Unk1, Unk2, Unk3, Unk4, Unk5 uint32
|
{[]uint32{1001, 36, 0, 0, 0, 0}},
|
||||||
}{
|
{[]uint32{9001, 3, 0, 0, 0, 0}},
|
||||||
// JP simply sent 01 and 02 respectively
|
{[]uint32{9002, 10, 300, 0, 0, 0}},
|
||||||
{
|
|
||||||
Unk0: 0x01,
|
|
||||||
Unk1: 0x0138,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
Unk0: 0x02,
|
|
||||||
Unk1: 0x63,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := byteframe.NewByteFrame()
|
bf := byteframe.NewByteFrame()
|
||||||
resp.WriteUint32(0x0A218EAD) // Unk shared ID. Sent in response of MSG_MHF_GET_TOWER_INFO, MSG_MHF_GET_PAPER_DATA etc.
|
bf.WriteUint32(uint32(s.server.erupeConfig.DevModeOptions.EarthIDOverride))
|
||||||
resp.WriteUint32(0) // Unk
|
bf.WriteUint32(0)
|
||||||
resp.WriteUint32(0) // Unk
|
bf.WriteUint32(0)
|
||||||
resp.WriteUint32(uint32(len(earthValues))) // value count
|
bf.WriteUint32(uint32(len(earthValues)))
|
||||||
for _, v := range earthValues {
|
for _, i := range earthValues {
|
||||||
resp.WriteUint32(v.Unk0)
|
for _, j := range i.Value {
|
||||||
resp.WriteUint32(v.Unk1)
|
bf.WriteUint32(j)
|
||||||
resp.WriteUint32(v.Unk2)
|
}
|
||||||
resp.WriteUint32(v.Unk3)
|
|
||||||
resp.WriteUint32(v.Unk4)
|
|
||||||
resp.WriteUint32(v.Unk5)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
doAckBufSucceed(s, pkt.AckHandle, resp.Data())
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMsgMhfDebugPostValue(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgMhfDebugPostValue(s *Session, p mhfpacket.MHFPacket) {}
|
||||||
@@ -1703,7 +1674,54 @@ func handleMsgMhfGetSenyuDailyCount(s *Session, p mhfpacket.MHFPacket) {}
|
|||||||
|
|
||||||
func handleMsgMhfGetSeibattle(s *Session, p mhfpacket.MHFPacket) {
|
func handleMsgMhfGetSeibattle(s *Session, p mhfpacket.MHFPacket) {
|
||||||
pkt := p.(*mhfpacket.MsgMhfGetSeibattle)
|
pkt := p.(*mhfpacket.MsgMhfGetSeibattle)
|
||||||
stubGetNoResults(s, pkt.AckHandle)
|
bf := byteframe.NewByteFrame()
|
||||||
|
bf.WriteUint32(0) // Unk
|
||||||
|
bf.WriteUint32(0) // Unk
|
||||||
|
bf.WriteUint32(0) // Unk
|
||||||
|
bf.WriteUint32(1) // Entries
|
||||||
|
|
||||||
|
switch pkt.Type {
|
||||||
|
case 1: // Timetable
|
||||||
|
bf.Seek(-4, 1)
|
||||||
|
bf.WriteUint32(3)
|
||||||
|
|
||||||
|
bf.WriteUint32(uint32(TimeMidnight().Unix()))
|
||||||
|
bf.WriteUint32(uint32(TimeMidnight().Add(time.Hour * 8).Unix()))
|
||||||
|
|
||||||
|
bf.WriteUint32(uint32(TimeMidnight().Add(time.Hour * 8).Unix()))
|
||||||
|
bf.WriteUint32(uint32(TimeMidnight().Add(time.Hour * 16).Unix()))
|
||||||
|
|
||||||
|
bf.WriteUint32(uint32(TimeMidnight().Add(time.Hour * 16).Unix()))
|
||||||
|
bf.WriteUint32(uint32(TimeMidnight().Add(time.Hour * 24).Unix()))
|
||||||
|
case 2: // Reward
|
||||||
|
doAckBufSucceed(s, pkt.AckHandle, make([]byte, 16))
|
||||||
|
return
|
||||||
|
case 3: // Key score?
|
||||||
|
bf.WriteUint8(0)
|
||||||
|
bf.WriteInt32(0)
|
||||||
|
case 4: // Career?
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
case 5: // Opponent?
|
||||||
|
bf.WriteInt32(1)
|
||||||
|
bf.WriteInt8(1)
|
||||||
|
case 6: // Convention result?
|
||||||
|
bf.WriteUint32(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
case 7: // Char score?
|
||||||
|
bf.WriteUint32(0)
|
||||||
|
case 8: // Cur result?
|
||||||
|
bf.WriteUint32(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
bf.WriteUint16(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
doAckBufSucceed(s, pkt.AckHandle, bf.Data())
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMsgMhfPostSeibattle(s *Session, p mhfpacket.MHFPacket) {}
|
func handleMsgMhfPostSeibattle(s *Session, p mhfpacket.MHFPacket) {}
|
||||||
|
|||||||
Reference in New Issue
Block a user