mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-15 16:34:51 +01:00
go fmt
This commit is contained in:
@@ -20,7 +20,7 @@ func (m *MsgMhfAddKouryouPoint) Opcode() network.PacketID {
|
||||
func (m *MsgMhfAddKouryouPoint) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
m.KouryouPoints = bf.ReadUint32()
|
||||
return nil;
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -18,7 +18,7 @@ func (m *MsgMhfEnumerateRengokuRanking) Opcode() network.PacketID {
|
||||
// Parse parses the packet from binary
|
||||
func (m *MsgMhfEnumerateRengokuRanking) Parse(bf *byteframe.ByteFrame) error {
|
||||
m.AckHandle = bf.ReadUint32()
|
||||
return nil;
|
||||
return nil
|
||||
}
|
||||
|
||||
// Build builds a binary packet from the current data.
|
||||
|
||||
@@ -11,7 +11,6 @@ type MsgMhfGetTenrouirai struct{
|
||||
Unk0 uint16
|
||||
Unk1 uint32
|
||||
Unk2 uint16
|
||||
|
||||
}
|
||||
|
||||
// Opcode returns the ID associated with this packet type.
|
||||
|
||||
@@ -6,9 +6,9 @@ import (
|
||||
"encoding/base64"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -60,7 +60,7 @@ func saveDataDiff(b []byte, save []byte) []byte {
|
||||
var seekBytes []byte
|
||||
seekOperation := 0
|
||||
write := byte(0)
|
||||
for(len(b) > 2){
|
||||
for len(b) > 2 {
|
||||
if bytes.IndexRune(b, 2) != 0 {
|
||||
seekBytes = b[:bytes.IndexRune(b, 2)+1]
|
||||
} else {
|
||||
@@ -161,7 +161,7 @@ func saveCompress(rawData []byte) ([]byte, error) {
|
||||
}
|
||||
nullCount++
|
||||
|
||||
if(nullCount == 255){
|
||||
if nullCount == 255 {
|
||||
output = append(output, []byte{0xFF, 0x00}...)
|
||||
nullCount = 0
|
||||
}
|
||||
@@ -174,7 +174,6 @@ func saveCompress(rawData []byte) ([]byte, error) {
|
||||
return output, nil
|
||||
}
|
||||
|
||||
|
||||
func updateRights(s *Session) {
|
||||
update := &mhfpacket.MsgSysUpdateRight{
|
||||
Unk0: 0,
|
||||
@@ -1891,7 +1890,7 @@ func handleMsgMhfLoadDecoMyset(s *Session, p mhfpacket.MHFPacket) {
|
||||
} else {
|
||||
// set first byte to 1 to avoid pop up every time without save
|
||||
body := make([]byte, 0x226)
|
||||
body[0] = 1;
|
||||
body[0] = 1
|
||||
doSizedAckResp(s, pkt.AckHandle, body)
|
||||
}
|
||||
}
|
||||
@@ -1907,11 +1906,15 @@ func handleMsgMhfSaveDecoMyset(s *Session, p mhfpacket.MHFPacket) {
|
||||
} else {
|
||||
numSets := bf.ReadUint8() // sets being written
|
||||
// empty save
|
||||
if len(loadData) == 0{ loadData = []byte{0x01, 0x00} }
|
||||
if len(loadData) == 0 {
|
||||
loadData = []byte{0x01, 0x00}
|
||||
}
|
||||
|
||||
savedSets := loadData[1] // existing saved sets
|
||||
// no sets, new slice with just first 2 bytes for appends later
|
||||
if savedSets == 0{ loadData = []byte{0x01, 0x00} }
|
||||
if savedSets == 0 {
|
||||
loadData = []byte{0x01, 0x00}
|
||||
}
|
||||
for i := 0; i < int(numSets); i++ {
|
||||
writeSet := bf.ReadUint16()
|
||||
dataChunk := bf.ReadBytes(76)
|
||||
@@ -1981,7 +1984,7 @@ func handleMsgMhfLoadHunterNavi(s *Session, p mhfpacket.MHFPacket) {
|
||||
} else {
|
||||
// set first byte to 1 to avoid pop up every time without save
|
||||
body := make([]byte, 0x226)
|
||||
body[0] = 1;
|
||||
body[0] = 1
|
||||
doSizedAckResp(s, pkt.AckHandle, body)
|
||||
}
|
||||
}
|
||||
@@ -2143,7 +2146,6 @@ func handleMsgMhfGetPaperData(s *Session, p mhfpacket.MHFPacket) {
|
||||
doSizedAckResp(s, pkt.AckHandle, data)
|
||||
// s.QueueAck(pkt.AckHandle, data)
|
||||
|
||||
|
||||
}
|
||||
|
||||
func handleMsgMhfGetNotice(s *Session, p mhfpacket.MHFPacket) {}
|
||||
|
||||
Reference in New Issue
Block a user