Skip to content

Commit

Permalink
moved bin 8 out and removed clientctx
Browse files Browse the repository at this point in the history
moved crypto bin8 out of entrance server

removed unused clientctx

missed import

fix accidental commit and rename ack_helpers
  • Loading branch information
stratic-dev committed Oct 9, 2024
1 parent 701d881 commit 62fe5cf
Show file tree
Hide file tree
Showing 447 changed files with 949 additions and 1,385 deletions.
4 changes: 0 additions & 4 deletions network/clientctx/clientcontext.go

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package entranceserver
package bin8

import (
"encoding/binary"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package entranceserver
package bin8

import (
"bytes"
Expand Down
5 changes: 2 additions & 3 deletions network/mhfpacket/mhfpacket.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,17 @@ package mhfpacket

import (
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

// Parser is the interface that wraps the Parse method.
type Parser interface {
Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error
Parse(bf *byteframe.ByteFrame) error
}

// Builder is the interface that wraps the Build method.
type Builder interface {
Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error
Build(bf *byteframe.ByteFrame) error
}

// Opcoder is the interface that wraps the Opcode method.
Expand Down
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_ca_exchange_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -17,11 +16,11 @@ func (m *MsgCaExchangeItem) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgCaExchangeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgCaExchangeItem) Parse(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}

// Build builds a binary packet from the current data.
func (m *MsgCaExchangeItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgCaExchangeItem) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
6 changes: 2 additions & 4 deletions network/mhfpacket/msg_head.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package mhfpacket
import (
"errors"

"erupe-ce/network/clientctx"

"erupe-ce/network"
"erupe-ce/utils/byteframe"
)
Expand All @@ -18,11 +16,11 @@ func (m *MsgHead) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgHead) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgHead) Parse(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}

// Build builds a binary packet from the current data.
func (m *MsgHead) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgHead) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
6 changes: 2 additions & 4 deletions network/mhfpacket/msg_mhf_accept_read_reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ package mhfpacket
import (
"errors"

"erupe-ce/network/clientctx"

"erupe-ce/network"
"erupe-ce/utils/byteframe"
)
Expand All @@ -18,11 +16,11 @@ func (m *MsgMhfAcceptReadReward) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcceptReadReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcceptReadReward) Parse(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcceptReadReward) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcceptReadReward) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_cafe_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
_config "erupe-ce/config"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -26,7 +25,7 @@ func (m *MsgMhfAcquireCafeItem) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.ItemType = bf.ReadUint16()
m.ItemID = bf.ReadUint16()
Expand All @@ -41,6 +40,6 @@ func (m *MsgMhfAcquireCafeItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Cl
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireCafeItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireCafeItem) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_dist_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -21,14 +20,14 @@ func (m *MsgMhfAcquireDistItem) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireDistItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireDistItem) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.DistributionType = bf.ReadUint8()
m.DistributionID = bf.ReadUint32()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireDistItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireDistItem) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_exchange_shop.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package mhfpacket

import (
"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -19,15 +18,15 @@ func (m *MsgMhfAcquireExchangeShop) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireExchangeShop) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireExchangeShop) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.DataSize = bf.ReadUint16()
m.RawDataPayload = bf.ReadBytes(uint(m.DataSize))
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireExchangeShop) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireExchangeShop) Build(bf *byteframe.ByteFrame) error {
bf.WriteUint32(m.AckHandle)
bf.WriteUint16(m.DataSize)
bf.WriteBytes(m.RawDataPayload)
Expand Down
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_festa.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -22,7 +21,7 @@ func (m *MsgMhfAcquireFesta) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireFesta) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.FestaID = bf.ReadUint32()
m.GuildID = bf.ReadUint32()
Expand All @@ -32,6 +31,6 @@ func (m *MsgMhfAcquireFesta) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Clien
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireFesta) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireFesta) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_festa_intermediate_prize.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -20,13 +19,13 @@ func (m *MsgMhfAcquireFestaIntermediatePrize) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireFestaIntermediatePrize) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireFestaIntermediatePrize) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.PrizeID = bf.ReadUint32()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireFestaIntermediatePrize) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireFestaIntermediatePrize) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_festa_personal_prize.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -20,13 +19,13 @@ func (m *MsgMhfAcquireFestaPersonalPrize) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireFestaPersonalPrize) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireFestaPersonalPrize) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.PrizeID = bf.ReadUint32()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireFestaPersonalPrize) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireFestaPersonalPrize) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_guild_adventure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -20,13 +19,13 @@ func (m *MsgMhfAcquireGuildAdventure) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireGuildAdventure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireGuildAdventure) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.ID = bf.ReadUint32()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireGuildAdventure) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireGuildAdventure) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_guild_tresure.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -21,14 +20,14 @@ func (m *MsgMhfAcquireGuildTresure) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireGuildTresure) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireGuildTresure) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.HuntID = bf.ReadUint32()
m.Unk = bf.ReadBool()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireGuildTresure) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireGuildTresure) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_guild_tresure_souvenir.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -19,12 +18,12 @@ func (m *MsgMhfAcquireGuildTresureSouvenir) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireGuildTresureSouvenir) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireGuildTresureSouvenir) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireGuildTresureSouvenir) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireGuildTresureSouvenir) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -22,7 +21,7 @@ func (m *MsgMhfAcquireItem) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint16()
m.Length = bf.ReadUint16()
Expand All @@ -33,6 +32,6 @@ func (m *MsgMhfAcquireItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.Client
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireItem) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_monthly_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -23,7 +22,7 @@ func (m *MsgMhfAcquireMonthlyItem) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
m.Unk0 = bf.ReadUint8()
m.Unk1 = bf.ReadUint8()
Expand All @@ -34,6 +33,6 @@ func (m *MsgMhfAcquireMonthlyItem) Parse(bf *byteframe.ByteFrame, ctx *clientctx
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireMonthlyItem) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireMonthlyItem) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
5 changes: 2 additions & 3 deletions network/mhfpacket/msg_mhf_acquire_monthly_reward.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"

"erupe-ce/network"
"erupe-ce/network/clientctx"
"erupe-ce/utils/byteframe"
)

Expand All @@ -19,12 +18,12 @@ func (m *MsgMhfAcquireMonthlyReward) Opcode() network.PacketID {
}

// Parse parses the packet from binary
func (m *MsgMhfAcquireMonthlyReward) Parse(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireMonthlyReward) Parse(bf *byteframe.ByteFrame) error {
m.AckHandle = bf.ReadUint32()
return nil
}

// Build builds a binary packet from the current data.
func (m *MsgMhfAcquireMonthlyReward) Build(bf *byteframe.ByteFrame, ctx *clientctx.ClientContext) error {
func (m *MsgMhfAcquireMonthlyReward) Build(bf *byteframe.ByteFrame) error {
return errors.New("NOT IMPLEMENTED")
}
Loading

0 comments on commit 62fe5cf

Please sign in to comment.