mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-03-01 00:35:36 +08:00
refactor
This commit is contained in:
@@ -2,7 +2,8 @@ package aoi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hk4e/logger"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
// aoi管理模块
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
package aoi
|
||||
|
||||
import (
|
||||
"hk4e/common/config"
|
||||
"hk4e/logger"
|
||||
"testing"
|
||||
|
||||
"hk4e/common/config"
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
func TestAoiManagerGetSurrGridListByGid(t *testing.T) {
|
||||
filePath := "./application.toml"
|
||||
config.InitConfig(filePath)
|
||||
logger.InitLogger("")
|
||||
logger.InitLogger("", config.CONF.Logger)
|
||||
aoiManager := NewAoiManager(
|
||||
-150, 150, 3,
|
||||
-150, 150, 3,
|
||||
|
||||
@@ -2,7 +2,8 @@ package aoi
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hk4e/logger"
|
||||
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
// 地图格子
|
||||
|
||||
@@ -2,10 +2,11 @@ package game
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/protocol/proto"
|
||||
"strings"
|
||||
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/proto"
|
||||
)
|
||||
|
||||
// CommandPerm 命令权限等级
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/alg"
|
||||
"hk4e/gate/entity/gm"
|
||||
"hk4e/gate/kcp"
|
||||
"hk4e/gs/dao"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/alg"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type GameManager struct {
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// 接口路由管理器
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"hk4e/common/utils/random"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/random"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
)
|
||||
|
||||
// 游戏服务器定时帧管理器
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/object"
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/object"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) GetAllAvatarDataConfig() map[int32]*gdc.AvatarData {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) PullRecentChatReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) CombatInvocationsNotify(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) PlayerSetPauseReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"time"
|
||||
|
||||
"hk4e/common/config"
|
||||
"hk4e/common/utils/random"
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/random"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
|
||||
"github.com/golang-jwt/jwt/v4"
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
type UserInfo struct {
|
||||
|
||||
@@ -3,7 +3,7 @@ package game
|
||||
import (
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
)
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/reflection"
|
||||
"time"
|
||||
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/reflection"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) OnLogin(userId uint32, clientSeq uint32) {
|
||||
|
||||
@@ -2,12 +2,13 @@ package game
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"hk4e/gs/dao"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/protocol/proto"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/dao"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/proto"
|
||||
)
|
||||
|
||||
type UserManager struct {
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"strconv"
|
||||
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"strconv"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) SceneTransToPointReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) PlayerApplyEnterMpReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/object"
|
||||
"hk4e/common/utils/random"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/object"
|
||||
"hk4e/pkg/random"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) EnterSceneReadyReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) GetShopmallDataReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/object"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"regexp"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/pkg/object"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) GetPlayerSocialDetailReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/endec"
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/endec"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
func (g *GameManager) ChangeAvatarReq(player *model.Player, payloadMsg pb.Message) {
|
||||
|
||||
@@ -3,7 +3,7 @@ package game
|
||||
import (
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
)
|
||||
|
||||
@@ -1,16 +1,18 @@
|
||||
package game
|
||||
|
||||
import (
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
"hk4e/common/utils/alg"
|
||||
"math"
|
||||
"time"
|
||||
|
||||
"hk4e/gs/constant"
|
||||
"hk4e/gs/game/aoi"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"hk4e/pkg/alg"
|
||||
"hk4e/pkg/logger"
|
||||
"hk4e/protocol/cmd"
|
||||
"hk4e/protocol/proto"
|
||||
"math"
|
||||
"time"
|
||||
|
||||
pb "google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// 世界管理器
|
||||
|
||||
@@ -3,11 +3,12 @@ package game
|
||||
import (
|
||||
"bytes"
|
||||
"encoding/gob"
|
||||
"hk4e/common/utils/alg"
|
||||
"unsafe"
|
||||
|
||||
gdc "hk4e/gs/config"
|
||||
"hk4e/gs/model"
|
||||
"hk4e/logger"
|
||||
"unsafe"
|
||||
"hk4e/pkg/alg"
|
||||
"hk4e/pkg/logger"
|
||||
)
|
||||
|
||||
// 世界的静态资源坐标点数据
|
||||
|
||||
Reference in New Issue
Block a user