diff --git a/cmd/main.go b/cmd/main.go index cbd71b6..7b6ec67 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -7,8 +7,8 @@ import ( "os" "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/db" - "github.com/CPunch/gopenfusion/core/redis" + "github.com/CPunch/gopenfusion/internal/db" + "github.com/CPunch/gopenfusion/internal/redis" "github.com/google/subcommands" ) diff --git a/core/db/account.go b/internal/db/account.go similarity index 97% rename from core/db/account.go rename to internal/db/account.go index f1e2f31..7b96348 100644 --- a/core/db/account.go +++ b/internal/db/account.go @@ -6,7 +6,7 @@ import ( "golang.org/x/crypto/bcrypt" - "github.com/CPunch/gopenfusion/core/protocol" + "github.com/CPunch/gopenfusion/internal/protocol" "github.com/georgysavva/scany/v2/sqlscan" ) diff --git a/core/db/inventory.go b/internal/db/inventory.go similarity index 96% rename from core/db/inventory.go rename to internal/db/inventory.go index 5376c67..d7e4e62 100644 --- a/core/db/inventory.go +++ b/internal/db/inventory.go @@ -3,7 +3,7 @@ package db import ( "database/sql" - "github.com/CPunch/gopenfusion/core/protocol" + "github.com/CPunch/gopenfusion/internal/protocol" ) type Inventory struct { diff --git a/core/db/migrations/new.sql b/internal/db/migrations/new.sql similarity index 100% rename from core/db/migrations/new.sql rename to internal/db/migrations/new.sql diff --git a/core/db/players.go b/internal/db/players.go similarity index 98% rename from core/db/players.go rename to internal/db/players.go index 2e35f9a..81b9791 100644 --- a/core/db/players.go +++ b/internal/db/players.go @@ -4,8 +4,8 @@ import ( "database/sql" "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/entity" - "github.com/CPunch/gopenfusion/core/protocol" + "github.com/CPunch/gopenfusion/internal/entity" + "github.com/CPunch/gopenfusion/internal/protocol" "github.com/blockloop/scan" ) diff --git a/core/db/schema.go b/internal/db/schema.go similarity index 100% rename from core/db/schema.go rename to internal/db/schema.go diff --git a/core/entity/chunk.go b/internal/entity/chunk.go similarity index 100% rename from core/entity/chunk.go rename to internal/entity/chunk.go diff --git a/core/entity/chunkposition.go b/internal/entity/chunkposition.go similarity index 100% rename from core/entity/chunkposition.go rename to internal/entity/chunkposition.go diff --git a/core/entity/entity.go b/internal/entity/entity.go similarity index 87% rename from core/entity/entity.go rename to internal/entity/entity.go index 27ba6a3..00b2db0 100644 --- a/core/entity/entity.go +++ b/internal/entity/entity.go @@ -1,6 +1,6 @@ package entity -import "github.com/CPunch/gopenfusion/core/protocol" +import "github.com/CPunch/gopenfusion/internal/protocol" type EntityKind int diff --git a/core/entity/npc.go b/internal/entity/npc.go similarity index 97% rename from core/entity/npc.go rename to internal/entity/npc.go index 15cf4d6..3de4725 100644 --- a/core/entity/npc.go +++ b/internal/entity/npc.go @@ -3,7 +3,7 @@ package entity import ( "sync/atomic" - "github.com/CPunch/gopenfusion/core/protocol" + "github.com/CPunch/gopenfusion/internal/protocol" ) type NPC struct { diff --git a/core/entity/player.go b/internal/entity/player.go similarity index 98% rename from core/entity/player.go rename to internal/entity/player.go index c610ebb..fde5784 100644 --- a/core/entity/player.go +++ b/internal/entity/player.go @@ -2,7 +2,7 @@ package entity import ( "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/protocol" + "github.com/CPunch/gopenfusion/internal/protocol" ) type Player struct { diff --git a/core/protocol/cnpeer.go b/internal/protocol/cnpeer.go similarity index 98% rename from core/protocol/cnpeer.go rename to internal/protocol/cnpeer.go index e75e2ff..fe263c5 100644 --- a/core/protocol/cnpeer.go +++ b/internal/protocol/cnpeer.go @@ -8,7 +8,7 @@ import ( "net" "time" - "github.com/CPunch/gopenfusion/core/protocol/pool" + "github.com/CPunch/gopenfusion/internal/protocol/pool" ) const ( diff --git a/core/protocol/encrypt.go b/internal/protocol/encrypt.go similarity index 100% rename from core/protocol/encrypt.go rename to internal/protocol/encrypt.go diff --git a/core/protocol/event.go b/internal/protocol/event.go similarity index 100% rename from core/protocol/event.go rename to internal/protocol/event.go diff --git a/core/protocol/packet.go b/internal/protocol/packet.go similarity index 100% rename from core/protocol/packet.go rename to internal/protocol/packet.go diff --git a/core/protocol/pool/pool.go b/internal/protocol/pool/pool.go similarity index 100% rename from core/protocol/pool/pool.go rename to internal/protocol/pool/pool.go diff --git a/core/protocol/structs.go b/internal/protocol/structs.go similarity index 100% rename from core/protocol/structs.go rename to internal/protocol/structs.go diff --git a/core/redis/login.go b/internal/redis/login.go similarity index 100% rename from core/redis/login.go rename to internal/redis/login.go diff --git a/core/redis/redis.go b/internal/redis/redis.go similarity index 100% rename from core/redis/redis.go rename to internal/redis/redis.go diff --git a/core/redis/shard.go b/internal/redis/shard.go similarity index 100% rename from core/redis/shard.go rename to internal/redis/shard.go diff --git a/login/login.go b/login/login.go index 502402d..3f89628 100644 --- a/login/login.go +++ b/login/login.go @@ -7,9 +7,9 @@ import ( "math/rand" "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/db" - "github.com/CPunch/gopenfusion/core/protocol" - "github.com/CPunch/gopenfusion/core/redis" + "github.com/CPunch/gopenfusion/internal/db" + "github.com/CPunch/gopenfusion/internal/protocol" + "github.com/CPunch/gopenfusion/internal/redis" ) const ( diff --git a/login/loginserver.go b/login/loginserver.go index fda73b4..d131ed3 100644 --- a/login/loginserver.go +++ b/login/loginserver.go @@ -7,10 +7,10 @@ import ( "sync" "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/db" - "github.com/CPunch/gopenfusion/core/protocol" - "github.com/CPunch/gopenfusion/core/protocol/pool" - "github.com/CPunch/gopenfusion/core/redis" + "github.com/CPunch/gopenfusion/internal/db" + "github.com/CPunch/gopenfusion/internal/protocol" + "github.com/CPunch/gopenfusion/internal/protocol/pool" + "github.com/CPunch/gopenfusion/internal/redis" ) type PacketHandler func(peer *protocol.CNPeer, pkt protocol.Packet) error diff --git a/shard/chat.go b/shard/chat.go index 0e52cc8..dc05b16 100644 --- a/shard/chat.go +++ b/shard/chat.go @@ -1,6 +1,6 @@ package shard -import "github.com/CPunch/gopenfusion/core/protocol" +import "github.com/CPunch/gopenfusion/internal/protocol" func (server *ShardServer) freeChat(peer *protocol.CNPeer, pkt protocol.Packet) error { var chat protocol.SP_CL2FE_REQ_SEND_FREECHAT_MESSAGE diff --git a/shard/entitymanager.go b/shard/entitymanager.go index fe875a5..f4fe13c 100644 --- a/shard/entitymanager.go +++ b/shard/entitymanager.go @@ -1,7 +1,7 @@ package shard import ( - "github.com/CPunch/gopenfusion/core/entity" + "github.com/CPunch/gopenfusion/internal/entity" ) func (server *ShardServer) addEntity(e entity.Entity) { diff --git a/shard/join.go b/shard/join.go index fa7d477..b3f6e5e 100644 --- a/shard/join.go +++ b/shard/join.go @@ -4,9 +4,9 @@ import ( "fmt" "log" - "github.com/CPunch/gopenfusion/core/entity" - "github.com/CPunch/gopenfusion/core/protocol" - "github.com/CPunch/gopenfusion/core/redis" + "github.com/CPunch/gopenfusion/internal/entity" + "github.com/CPunch/gopenfusion/internal/protocol" + "github.com/CPunch/gopenfusion/internal/redis" ) func (server *ShardServer) attachPlayer(peer *protocol.CNPeer, meta redis.LoginMetadata) (*entity.Player, error) { diff --git a/shard/movement.go b/shard/movement.go index 3a9d9f6..7d95c64 100644 --- a/shard/movement.go +++ b/shard/movement.go @@ -1,8 +1,8 @@ package shard import ( - "github.com/CPunch/gopenfusion/core/entity" - "github.com/CPunch/gopenfusion/core/protocol" + "github.com/CPunch/gopenfusion/internal/entity" + "github.com/CPunch/gopenfusion/internal/protocol" ) func (server *ShardServer) updatePlayerPosition(plr *entity.Player, X, Y, Z, Angle int) { diff --git a/shard/npcloader.go b/shard/npcloader.go index a7d2f89..c3afe50 100644 --- a/shard/npcloader.go +++ b/shard/npcloader.go @@ -6,7 +6,7 @@ import ( "os" "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/entity" + "github.com/CPunch/gopenfusion/internal/entity" ) type NPCData struct { diff --git a/shard/shardserver.go b/shard/shardserver.go index 6caf447..0a03ec7 100644 --- a/shard/shardserver.go +++ b/shard/shardserver.go @@ -7,11 +7,11 @@ import ( "sync" "github.com/CPunch/gopenfusion/config" - "github.com/CPunch/gopenfusion/core/db" - "github.com/CPunch/gopenfusion/core/entity" - "github.com/CPunch/gopenfusion/core/protocol" - "github.com/CPunch/gopenfusion/core/protocol/pool" - "github.com/CPunch/gopenfusion/core/redis" + "github.com/CPunch/gopenfusion/internal/db" + "github.com/CPunch/gopenfusion/internal/entity" + "github.com/CPunch/gopenfusion/internal/protocol" + "github.com/CPunch/gopenfusion/internal/protocol/pool" + "github.com/CPunch/gopenfusion/internal/redis" ) type PacketHandler func(peer *protocol.CNPeer, pkt protocol.Packet) error