mirror of
https://github.com/Mezeporta/Erupe.git
synced 2026-03-27 10:03:06 +01:00
refactor(config): rename package _config to config with cfg alias
The config package used `package _config` with a leading underscore, which is unconventional in Go. Rename to `package config` (matching the directory name) and use `cfg` as the standard import alias across all 93 importing files.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"erupe-ce/common/mhfmon"
|
||||
ps "erupe-ce/common/pascalstring"
|
||||
"erupe-ce/common/stringsupport"
|
||||
_config "erupe-ce/config"
|
||||
cfg "erupe-ce/config"
|
||||
"erupe-ce/network/mhfpacket"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -422,7 +422,7 @@ const (
|
||||
|
||||
func handleMsgSysRecordLog(s *Session, p mhfpacket.MHFPacket) {
|
||||
pkt := p.(*mhfpacket.MsgSysRecordLog)
|
||||
if s.server.erupeConfig.RealClientMode == _config.ZZ {
|
||||
if s.server.erupeConfig.RealClientMode == cfg.ZZ {
|
||||
bf := byteframe.NewByteFrameFromBytes(pkt.Data)
|
||||
_, _ = bf.Seek(killLogHeaderSize, 0)
|
||||
var val uint8
|
||||
@@ -580,7 +580,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
resp.WriteUint16(uint16(len(r.userBin3)))
|
||||
|
||||
// TODO: This case might be <=G2
|
||||
if s.server.erupeConfig.RealClientMode <= _config.G1 {
|
||||
if s.server.erupeConfig.RealClientMode <= cfg.G1 {
|
||||
resp.WriteBytes(make([]byte, 8))
|
||||
} else {
|
||||
resp.WriteBytes(make([]byte, 40))
|
||||
@@ -610,7 +610,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
case 0:
|
||||
values := bf.ReadUint8()
|
||||
for i := uint8(0); i < values; i++ {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
findPartyParams.RankRestriction = bf.ReadInt16()
|
||||
} else {
|
||||
findPartyParams.RankRestriction = int16(bf.ReadInt8())
|
||||
@@ -619,7 +619,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
case 1:
|
||||
values := bf.ReadUint8()
|
||||
for i := uint8(0); i < values; i++ {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
findPartyParams.Targets = append(findPartyParams.Targets, bf.ReadInt16())
|
||||
} else {
|
||||
findPartyParams.Targets = append(findPartyParams.Targets, int16(bf.ReadInt8()))
|
||||
@@ -629,7 +629,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
values := bf.ReadUint8()
|
||||
for i := uint8(0); i < values; i++ {
|
||||
var value int16
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
value = bf.ReadInt16()
|
||||
} else {
|
||||
value = int16(bf.ReadInt8())
|
||||
@@ -650,7 +650,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
case 3: // Unknown
|
||||
values := bf.ReadUint8()
|
||||
for i := uint8(0); i < values; i++ {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
findPartyParams.Unk0 = append(findPartyParams.Unk0, bf.ReadInt16())
|
||||
} else {
|
||||
findPartyParams.Unk0 = append(findPartyParams.Unk0, int16(bf.ReadInt8()))
|
||||
@@ -659,7 +659,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
case 4: // Looking for n or already have n
|
||||
values := bf.ReadUint8()
|
||||
for i := uint8(0); i < values; i++ {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
findPartyParams.Unk1 = append(findPartyParams.Unk1, bf.ReadInt16())
|
||||
} else {
|
||||
findPartyParams.Unk1 = append(findPartyParams.Unk1, int16(bf.ReadInt8()))
|
||||
@@ -668,7 +668,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
case 5:
|
||||
values := bf.ReadUint8()
|
||||
for i := uint8(0); i < values; i++ {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
findPartyParams.QuestID = append(findPartyParams.QuestID, bf.ReadInt16())
|
||||
} else {
|
||||
findPartyParams.QuestID = append(findPartyParams.QuestID, int16(bf.ReadInt8()))
|
||||
@@ -705,15 +705,15 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
_, _ = sb3.Seek(4, 0)
|
||||
|
||||
stageDataParams := 7
|
||||
if s.server.erupeConfig.RealClientMode <= _config.G10 {
|
||||
if s.server.erupeConfig.RealClientMode <= cfg.G10 {
|
||||
stageDataParams = 4
|
||||
} else if s.server.erupeConfig.RealClientMode <= _config.Z1 {
|
||||
} else if s.server.erupeConfig.RealClientMode <= cfg.Z1 {
|
||||
stageDataParams = 6
|
||||
}
|
||||
|
||||
var stageData []int16
|
||||
for i := 0; i < stageDataParams; i++ {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
stageData = append(stageData, sb3.ReadInt16())
|
||||
} else {
|
||||
stageData = append(stageData, int16(sb3.ReadInt8()))
|
||||
@@ -790,7 +790,7 @@ func handleMsgMhfTransitMessage(s *Session, p mhfpacket.MHFPacket) {
|
||||
resp.WriteUint8(uint8(len(sr.rawBinData1)))
|
||||
|
||||
for i := range sr.stageData {
|
||||
if s.server.erupeConfig.RealClientMode >= _config.Z1 {
|
||||
if s.server.erupeConfig.RealClientMode >= cfg.Z1 {
|
||||
resp.WriteInt16(sr.stageData[i])
|
||||
} else {
|
||||
resp.WriteInt8(int8(sr.stageData[i]))
|
||||
|
||||
Reference in New Issue
Block a user