build: 更新依赖并添加新库
- 更新 go.mod 和 go.sum 文件,添加多个新库 - 在 LoginSidInfo 结构体中添加注释说明 - 在 cmd.go 中添加 TODO 注释
This commit is contained in:
@@ -12,10 +12,14 @@ require (
|
||||
require (
|
||||
github.com/antchfx/xmlquery v1.4.4 // indirect
|
||||
github.com/antchfx/xpath v1.3.3 // indirect
|
||||
github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055 // indirect
|
||||
github.com/bits-and-blooms/bitset v1.5.0 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.3.0 // indirect
|
||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
||||
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
|
||||
github.com/pointernil/bitset32 v0.0.1 // indirect
|
||||
github.com/scylladb/termtables v1.0.0 // indirect
|
||||
github.com/yitter/idgenerator-go v1.3.3 // indirect
|
||||
)
|
||||
|
||||
|
||||
@@ -7,7 +7,11 @@ github.com/antchfx/xmlquery v1.4.4 h1:mxMEkdYP3pjKSftxss4nUHfjBhnMk4imGoR96FRY2d
|
||||
github.com/antchfx/xmlquery v1.4.4/go.mod h1:AEPEEPYE9GnA2mj5Ur2L5Q5/2PycJ0N9Fusrx9b12fc=
|
||||
github.com/antchfx/xpath v1.3.3 h1:tmuPQa1Uye0Ym1Zn65vxPgfltWb/Lxu2jeqIGteJSRs=
|
||||
github.com/antchfx/xpath v1.3.3/go.mod h1:i54GszH55fYfBmoZXapTHN8T8tkcHfRgLyVwwqzXNcs=
|
||||
github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055 h1:IkPAzP+QjchKXXFX6LCcpDKa89b/e/0gPCUbQGWtUUY=
|
||||
github.com/apcera/termtables v0.0.0-20170405184538-bcbc5dc54055/go.mod h1:8mHYHlOef9UC51cK1/WRvE/iQVM8O8QlYFa8eh8r5I8=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
github.com/bits-and-blooms/bitset v1.5.0 h1:NpE8frKRLGHIcEzkR+gZhiioW1+WbYV6fKwD6ZIpQT8=
|
||||
github.com/bits-and-blooms/bitset v1.5.0/go.mod h1:gIdJ4wp64HaoK2YrL1Q5/N7Y16edYb8uY+O0FJTyyDA=
|
||||
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
|
||||
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
|
||||
github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME=
|
||||
@@ -70,9 +74,13 @@ github.com/panjf2000/gnet/v2 v2.5.0/go.mod h1:R+X5M5YBpOGMVP/92OJ02P35SbmoHjiL7G
|
||||
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/pointernil/bitset32 v0.0.1 h1:GL7o6ehG4W5ztXic75ncAmKzSxYQRSKxyaz2wOdz2aM=
|
||||
github.com/pointernil/bitset32 v0.0.1/go.mod h1:naghmAYTkvJhKSCVPbBwLAXkHMF2WBIJ1bJpnFpmQwI=
|
||||
github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc=
|
||||
github.com/rivo/uniseg v0.4.4 h1:8TfxU8dW6PdqD27gjM8MVNuicgxIjxpm4K7x4jp8sis=
|
||||
github.com/rivo/uniseg v0.4.4/go.mod h1:FN3SvrM+Zdj16jyLfmOkMNblXMcoc8DfTHruCPUcx88=
|
||||
github.com/scylladb/termtables v1.0.0 h1:uUnesUY4V1VPCotpOQLb1LjTXVvzwy7Ramx8K8+w+8U=
|
||||
github.com/scylladb/termtables v1.0.0/go.mod h1:C1a7PQSMz9NShzorzCiG2fk9+xuCgLkPeCvMHYR2OWg=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
|
||||
|
||||
5
common/serialize/bitset/bitset.go
Normal file
5
common/serialize/bitset/bitset.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package bitset
|
||||
|
||||
func teset() {
|
||||
|
||||
}
|
||||
37
common/serialize/bitset/bitset_test.go
Normal file
37
common/serialize/bitset/bitset_test.go
Normal file
@@ -0,0 +1,37 @@
|
||||
package bitset
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/pointernil/bitset32"
|
||||
)
|
||||
|
||||
func Test_teset(t *testing.T) {
|
||||
fmt.Printf("! \n")
|
||||
var b bitset32.BitSet32
|
||||
var a bitset32.BitSet32
|
||||
// play some Go Fish
|
||||
// for i := 0; i < 100; i++ {
|
||||
// card1 := uint(rand.Intn(52))
|
||||
// card2 := uint(rand.Intn(52))
|
||||
// b.Set(card1)
|
||||
// if b.Test(card2) {
|
||||
// fmt.Println("Go Fish!")
|
||||
// }
|
||||
// b.Clear(card1)
|
||||
// }
|
||||
|
||||
// Chaining
|
||||
b.Set(10).Set(11)
|
||||
a = *bitset32.New(50)
|
||||
for i, e := b.NextSet(0); e; i, e = b.NextSet(i + 1) {
|
||||
fmt.Println("The b bit is set:", i)
|
||||
}
|
||||
a.Set(10).Set(9)
|
||||
f := b.Union(&a)
|
||||
for i, e := f.NextSet(0); e; i, e = f.NextSet(i + 1) {
|
||||
fmt.Println("The b+ bit is set:", i)
|
||||
}
|
||||
fmt.Println(b.Bytes())
|
||||
}
|
||||
5
common/serialize/log/log.go
Normal file
5
common/serialize/log/log.go
Normal file
@@ -0,0 +1,5 @@
|
||||
package log
|
||||
|
||||
func Init() {
|
||||
|
||||
}
|
||||
19
common/serialize/log/log_test.go
Normal file
19
common/serialize/log/log_test.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package log
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/apcera/termtables"
|
||||
)
|
||||
|
||||
func TestInit(t *testing.T) {
|
||||
table := termtables.CreateTable()
|
||||
|
||||
table.AddHeaders("Name", "Age")
|
||||
table.AddRow("John", "30")
|
||||
table.AddRow("Sam", 18)
|
||||
table.AddRow("Julie", 20.14)
|
||||
|
||||
fmt.Println(table.Render())
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import (
|
||||
"github.com/tnnmigga/enum"
|
||||
)
|
||||
|
||||
//TODO 实现自定义CMD,待删除
|
||||
|
||||
// Enum 辅助类型定义
|
||||
type EnumValue struct {
|
||||
Value EnumCommandID
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
// LoginSidInfo 登录携带的凭证结构体
|
||||
type LoginSidInfo struct { //这里直接使用组合来实现将传入的原始头部数据和结构体参数序列化
|
||||
Head handler.TomeeHeader `cmd:"1001" struc:"[0]pad"`
|
||||
Head handler.TomeeHeader `cmd:"1001" struc:"[0]pad"` //玩家登录
|
||||
|
||||
Sid []byte `struc:"[16]byte"` // 登录会话ID,固定长度16字节
|
||||
// NotLogin uint32 `error="10001"|struc:"[0]pad"` //返回错误码 ,不序列化,仅作为错误码
|
||||
|
||||
Reference in New Issue
Block a user