This commit is contained in:
lu.bai committed 2022-11-24 22:47:24 +08:00
1 parent f6a161d52f
commit 71d0135d6f
3213 files changed
+583576 -216

No files matched your search

-3
View File
@@ -20,6 +20,3 @@
# Binaries file
bin
# ProtoBuf generate file
*.pb.go
+6 -1
View File
@@ -9,4 +9,9 @@ dev_tool:
.PHONY: gen
# gen 生成代码
gen:
cd protocol/proto && make gen
cd protocol/proto && make gen
.PHONY: build
# build
build:
mkdir -p bin/ && CGO_ENABLED=0 go build -ldflags "-X main.Version=$(VERSION)" -o ./bin/ ./cmd/...
File renamed without changes.
@@ -1,22 +1,23 @@
package main
import (
"hk4e/common/config"
"hk4e/dispatch/controller"
"hk4e/dispatch/dao"
"hk4e/logger"
_ "net/http/pprof"
"os"
"os/signal"
"syscall"
"time"
"hk4e/common/config"
"hk4e/dispatch/controller"
"hk4e/dispatch/dao"
"hk4e/pkg/logger"
)
func main() {
filePath := "./application.toml"
config.InitConfig(filePath)
logger.InitLogger("dispatch")
logger.InitLogger("dispatch", config.CONF.Logger)
logger.LOG.Info("dispatch start")
db := dao.NewDao()
File renamed without changes.
File renamed without changes.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

File renamed without changes.

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

File renamed without changes.
+10 -8
View File
@@ -1,26 +1,28 @@
package main
import (
"github.com/arl/statsviz"
"hk4e/common/config"
"hk4e/gate/forward"
"hk4e/gate/mq"
"hk4e/gate/net"
"hk4e/logger"
"hk4e/protocol/cmd"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"syscall"
"time"
"hk4e/common/config"
"hk4e/gate/forward"
"hk4e/gate/mq"
"hk4e/gate/net"
"hk4e/pkg/logger"
"hk4e/protocol/cmd"
"github.com/arl/statsviz"
)
func main() {
filePath := "./application.toml"
config.InitConfig(filePath)
logger.InitLogger("gate")
logger.InitLogger("gate", config.CONF.Logger)
logger.LOG.Info("gate start")
go func() {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+5 -4
View File
@@ -1,20 +1,21 @@
package main
import (
"hk4e/common/config"
"hk4e/gm/controller"
"hk4e/logger"
"os"
"os/signal"
"syscall"
"time"
"hk4e/common/config"
"hk4e/gm/controller"
"hk4e/pkg/logger"
)
func main() {
filePath := "./application.toml"
config.InitConfig(filePath)
logger.InitLogger("gm")
logger.InitLogger("gm", config.CONF.Logger)
logger.LOG.Info("gm start")
_ = controller.NewController()
+24
View File
@@ -0,0 +1,24 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib
# Test binary, built with `go test -c`
*.test
# Output of the go coverage tool, specifically when used with LiteIDE
*.out
# Dependency directories (remove the comment below to include it)
# vendor/
# GoLand
.idea
*.iml
# Binaries file
bin
GameDataConfigTable
File renamed without changes.
+12 -10
View File
@@ -1,28 +1,30 @@
package main
import (
"github.com/arl/statsviz"
"hk4e/common/config"
gdc "hk4e/gs/config"
"hk4e/gs/constant"
"hk4e/gs/dao"
"hk4e/gs/game"
"hk4e/gs/mq"
"hk4e/logger"
"hk4e/protocol/cmd"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"syscall"
"time"
"hk4e/common/config"
gdc "hk4e/gs/config"
"hk4e/gs/constant"
"hk4e/gs/dao"
"hk4e/gs/game"
"hk4e/gs/mq"
"hk4e/pkg/logger"
"hk4e/protocol/cmd"
"github.com/arl/statsviz"
)
func main() {
filePath := "./application.toml"
config.InitConfig(filePath)
logger.InitLogger("gs")
logger.InitLogger("gs", config.CONF.Logger)
logger.LOG.Info("gs start")
go func() {
+8 -12
View File
@@ -2,6 +2,9 @@ package config
import (
"fmt"
"hk4e/pkg/logger"
"github.com/BurntSushi/toml"
)
@@ -9,18 +12,11 @@ var CONF *Config = nil
// 配置
type Config struct {
HttpPort int `toml:"http_port"`
Logger Logger `toml:"logger"`
Database Database `toml:"database"`
Hk4e Hk4e `toml:"hk4e"`
MQ MQ `toml:"mq"`
}
// 日志配置
type Logger struct {
Level string `toml:"level"`
Method string `toml:"method"`
TrackLine bool `toml:"track_line"`
HttpPort int `toml:"http_port"`
Logger logger.Config `toml:"logger"`
Database Database `toml:"database"`
Hk4e Hk4e `toml:"hk4e"`
MQ MQ `toml:"mq"`
}
// 数据库配置
+6 -4
View File
@@ -2,11 +2,13 @@ package region
import (
"encoding/base64"
pb "google.golang.org/protobuf/proto"
"hk4e/common/utils/endec"
"hk4e/logger"
"hk4e/protocol/proto"
"os"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
"hk4e/protocol/proto"
pb "google.golang.org/protobuf/proto"
)
func LoadRsaKey() (signRsaKey []byte, encRsaKeyMap map[string][]byte, pwdRsaKey []byte) {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+4 -2
View File
@@ -1,10 +1,12 @@
package controller
import (
"github.com/gin-gonic/gin"
"hk4e/logger"
"net/http"
"os"
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
)
func (c *Controller) headDataVersions(context *gin.Context) {
+7 -5
View File
@@ -2,14 +2,16 @@ package controller
import (
"encoding/base64"
"github.com/gin-gonic/gin"
pb "google.golang.org/protobuf/proto"
"net/http"
"strconv"
"hk4e/common/config"
"hk4e/common/region"
"hk4e/dispatch/dao"
"hk4e/logger"
"net/http"
"strconv"
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
pb "google.golang.org/protobuf/proto"
)
type Controller struct {
+6 -4
View File
@@ -3,15 +3,17 @@ package controller
import (
"bytes"
"encoding/base64"
"github.com/gin-gonic/gin"
"hk4e/common/utils/endec"
"hk4e/dispatch/entity/api"
"hk4e/logger"
"math"
"net/http"
"os"
"regexp"
"strconv"
"hk4e/dispatch/api"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
)
func (c *Controller) query_security_file(context *gin.Context) {
+4 -2
View File
@@ -1,11 +1,13 @@
package controller
import (
"github.com/gin-gonic/gin"
"hk4e/logger"
"net/http"
"os"
"strings"
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
)
// 返回固定数据
+10 -8
View File
@@ -3,18 +3,20 @@ package controller
import (
"encoding/base64"
"encoding/json"
"github.com/gin-gonic/gin"
appConfig "hk4e/common/config"
"hk4e/common/utils/endec"
"hk4e/common/utils/httpclient"
"hk4e/common/utils/random"
"hk4e/dispatch/entity/api"
"hk4e/dispatch/entity/db"
"hk4e/logger"
"net/http"
"regexp"
"strconv"
"strings"
appConfig "hk4e/common/config"
"hk4e/dispatch/api"
db "hk4e/dispatch/model"
"hk4e/pkg/endec"
"hk4e/pkg/httpclient"
"hk4e/pkg/logger"
"hk4e/pkg/random"
"github.com/gin-gonic/gin"
)
type SdkUserLoginReq struct {
+4 -2
View File
@@ -2,12 +2,14 @@ package dao
import (
"context"
dbEntity "hk4e/dispatch/model"
"hk4e/pkg/logger"
"github.com/pkg/errors"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/bson/primitive"
"go.mongodb.org/mongo-driver/mongo"
dbEntity "hk4e/dispatch/entity/db"
"hk4e/logger"
)
func (d *Dao) GetNextYuanShenUid() (uint64, error) {
+4 -2
View File
@@ -2,10 +2,12 @@ package dao
import (
"context"
"hk4e/common/config"
"hk4e/pkg/logger"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"hk4e/common/config"
"hk4e/logger"
)
type Dao struct {
@@ -1,4 +1,4 @@
package db
package model
import "go.mongodb.org/mongo-driver/bson/primitive"
@@ -1,4 +1,4 @@
package db
package model
type PlayerIDCounter struct {
ID string `bson:"_id"`
@@ -1,4 +1,4 @@
package gm
package service
type ForbidUserInfo struct {
UserId uint32
+1 -2
View File
@@ -2,7 +2,6 @@ package service
import (
"hk4e/dispatch/dao"
"hk4e/dispatch/entity/gm"
)
type Service struct {
@@ -37,7 +36,7 @@ func (f *Service) UserPasswordChange(uid uint32) bool {
}
// 封号
func (f *Service) ForbidUser(info *gm.ForbidUserInfo) bool {
func (f *Service) ForbidUser(info *ForbidUserInfo) bool {
if info == nil {
return false
}
+6 -5
View File
@@ -1,18 +1,19 @@
package forward
import (
"os"
"runtime"
"sync"
"time"
"hk4e/common/config"
"hk4e/common/region"
"hk4e/gate/entity/gm"
"hk4e/gate/kcp"
"hk4e/gate/net"
"hk4e/logger"
"hk4e/pkg/logger"
"hk4e/protocol/cmd"
"hk4e/protocol/proto"
"os"
"runtime"
"sync"
"time"
)
const (
+6 -5
View File
@@ -4,13 +4,14 @@ import (
"bytes"
"encoding/base64"
"encoding/binary"
"hk4e/common/utils/endec"
"hk4e/gate/kcp"
"hk4e/gate/net"
"hk4e/logger"
"hk4e/protocol/proto"
"strconv"
"strings"
"hk4e/gate/kcp"
"hk4e/gate/net"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
"hk4e/protocol/proto"
)
func (f *ForwardManager) getPlayerToken(convId uint64, req *proto.GetPlayerTokenReq) (rsp *proto.GetPlayerTokenRsp) {
+4 -3
View File
@@ -1,12 +1,13 @@
package mq
import (
"hk4e/common/config"
"hk4e/pkg/logger"
"hk4e/protocol/cmd"
"github.com/nats-io/nats.go"
"github.com/vmihailenco/msgpack/v5"
pb "google.golang.org/protobuf/proto"
"hk4e/common/config"
"hk4e/logger"
"hk4e/protocol/cmd"
)
type MessageQueue struct {
+5 -4
View File
@@ -3,14 +3,15 @@ package net
import (
"bytes"
"encoding/binary"
"hk4e/common/config"
"hk4e/common/utils/random"
"hk4e/gate/kcp"
"hk4e/logger"
"os"
"strconv"
"sync"
"time"
"hk4e/common/config"
"hk4e/gate/kcp"
"hk4e/pkg/logger"
"hk4e/pkg/random"
)
type KcpXorKey struct {
+3 -2
View File
@@ -3,8 +3,9 @@ package net
import (
"bytes"
"encoding/binary"
"hk4e/common/utils/endec"
"hk4e/logger"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
)
/*
+1 -1
View File
@@ -1,6 +1,6 @@
package net
import "hk4e/logger"
import "hk4e/pkg/logger"
const (
KcpXorKeyChange = iota
+3 -2
View File
@@ -1,10 +1,11 @@
package net
import (
pb "google.golang.org/protobuf/proto"
"hk4e/logger"
"hk4e/pkg/logger"
"hk4e/protocol/cmd"
"hk4e/protocol/proto"
pb "google.golang.org/protobuf/proto"
)
type ProtoEnDecode struct {
+5 -3
View File
@@ -1,11 +1,13 @@
package controller
import (
"github.com/gin-gonic/gin"
"hk4e/common/config"
"hk4e/logger"
"net/http"
"strconv"
"hk4e/common/config"
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
)
type Controller struct {
+2 -1
View File
@@ -1,8 +1,9 @@
package controller
import (
"hk4e/pkg/logger"
"github.com/gin-gonic/gin"
"hk4e/logger"
)
type GmCmdReq struct {
+2 -1
View File
@@ -2,9 +2,10 @@ package config
import (
"encoding/json"
"hk4e/logger"
"os"
"strings"
"hk4e/pkg/logger"
)
type AvatarConfigAbility struct {
+3 -2
View File
@@ -2,10 +2,11 @@ package config
import (
"encoding/json"
"hk4e/common/utils/endec"
"hk4e/logger"
"os"
"strings"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
)
type AvatarData struct {
+3 -2
View File
@@ -2,9 +2,10 @@ package config
import (
"encoding/json"
"hk4e/gs/constant"
"hk4e/logger"
"os"
"hk4e/gs/constant"
"hk4e/pkg/logger"
)
type AvatarSkillData struct {
+4 -3
View File
@@ -2,10 +2,11 @@ package config
import (
"encoding/json"
"hk4e/common/utils/endec"
"hk4e/gs/constant"
"hk4e/logger"
"os"
"hk4e/gs/constant"
"hk4e/pkg/endec"
"hk4e/pkg/logger"
)
type InherentProudSkillOpens struct {
+4 -2
View File
@@ -1,10 +1,12 @@
package config
import (
"github.com/jszwec/csvutil"
"hk4e/logger"
"os"
"strings"
"hk4e/pkg/logger"
"github.com/jszwec/csvutil"
)
type Drop struct {
+2 -1
View File
@@ -2,8 +2,9 @@ package config
import (
"encoding/json"
"hk4e/logger"
"os"
"hk4e/pkg/logger"
)
type FetterData struct {
+3 -2
View File
@@ -2,9 +2,10 @@ package config
import (
"encoding/json"
"hk4e/gs/constant"
"hk4e/logger"
"os"
"hk4e/gs/constant"
"hk4e/pkg/logger"
)
type GadgetData struct {
+3 -2
View File
@@ -1,9 +1,10 @@
package config
import (
appConfig "hk4e/common/config"
"hk4e/logger"
"os"
appConfig "hk4e/common/config"
"hk4e/pkg/logger"
)
var CONF *GameDataConfig = nil
+2 -1
View File
@@ -2,8 +2,9 @@ package config
import (
"encoding/json"
"hk4e/logger"
"os"
"hk4e/pkg/logger"
)
type GameDepot struct {
+2 -1
View File
@@ -2,8 +2,9 @@ package config
import (
"encoding/json"
"hk4e/logger"
"os"
"hk4e/pkg/logger"
)
type GatherData struct {
+3 -2
View File
@@ -2,9 +2,10 @@ package config
import (
"encoding/json"
"hk4e/gs/constant"
"hk4e/logger"
"os"
"hk4e/gs/constant"
"hk4e/pkg/logger"
)
type ItemUseData struct {
+2 -1
View File
@@ -2,9 +2,10 @@ package config
import (
"encoding/json"
"hk4e/logger"
"os"
"strings"
"hk4e/pkg/logger"
)
type SkillPointModifier struct {
+2 -1
View File
@@ -2,10 +2,11 @@ package config
import (
"encoding/json"
"hk4e/logger"
"os"
"strconv"
"strings"
"hk4e/pkg/logger"
)
type ScenePointEntry struct {
+1 -1
View File
@@ -1,6 +1,6 @@
package constant
import "hk4e/common/utils/endec"
import "hk4e/pkg/endec"
var ElementTypeConst *ElementType
+1 -1
View File
@@ -1,6 +1,6 @@
package constant
import "hk4e/common/utils/endec"
import "hk4e/pkg/endec"
var GameConstantConst *GameConstant
+4 -2
View File
@@ -2,10 +2,12 @@ package dao
import (
"context"
"hk4e/common/config"
"hk4e/pkg/logger"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"hk4e/common/config"
"hk4e/logger"
)
type Dao struct {
+2 -1
View File
@@ -2,7 +2,8 @@ package aoi
import (
"fmt"
"hk4e/logger"
"hk4e/pkg/logger"
)
// aoi管理模块
+4 -3
View File
@@ -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 -1
View File
@@ -2,7 +2,8 @@ package aoi
import (
"fmt"
"hk4e/logger"
"hk4e/pkg/logger"
)
// 地图格子
+4 -3
View File
@@ -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 命令权限等级
+4 -3
View File
@@ -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 {
+3 -2
View File
@@ -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"
)
// 接口路由管理器
Loaded 100 of 3213 files, more files were not shown because too many files have changed in this diff. Show more