mirror of
https://github.com/FlourishingWorld/hk4e.git
synced 2026-02-14 00:02:27 +08:00
更新机器人
This commit is contained in:
2
go.mod
2
go.mod
@@ -51,7 +51,7 @@ require github.com/yuin/gopher-lua v1.0.0
|
|||||||
require github.com/pierrec/lz4/v4 v4.1.17
|
require github.com/pierrec/lz4/v4 v4.1.17
|
||||||
|
|
||||||
// dpdk-go
|
// dpdk-go
|
||||||
require github.com/FlourishingWorld/dpdk-go v1.0.1
|
require github.com/FlourishingWorld/dpdk-go v0.0.0-20230213165129-6c5bc55b1f63
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/pkg/errors v0.9.1
|
github.com/pkg/errors v0.9.1
|
||||||
|
|||||||
4
go.sum
4
go.sum
@@ -1,7 +1,7 @@
|
|||||||
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/FlourishingWorld/dpdk-go v1.0.1 h1:6PGyJ5dE8y7J/GlculPEGLrWlMVCfeThIUzfgaHse0c=
|
github.com/FlourishingWorld/dpdk-go v0.0.0-20230213165129-6c5bc55b1f63 h1:nh8fkskGiHdx7C5Tb+Cn6O1L7gddnK9lDl1r2wvLxWk=
|
||||||
github.com/FlourishingWorld/dpdk-go v1.0.1/go.mod h1:dmizWx3DB1EK9Tu1/x4o6VpeGdp9YSpRhFPqYoLlNE0=
|
github.com/FlourishingWorld/dpdk-go v0.0.0-20230213165129-6c5bc55b1f63/go.mod h1:dmizWx3DB1EK9Tu1/x4o6VpeGdp9YSpRhFPqYoLlNE0=
|
||||||
github.com/arl/statsviz v0.5.1 h1:3HY0ZEB738JtguWsD1Tf1pFJZiCcWUmYRq/3OTYKaSI=
|
github.com/arl/statsviz v0.5.1 h1:3HY0ZEB738JtguWsD1Tf1pFJZiCcWUmYRq/3OTYKaSI=
|
||||||
github.com/arl/statsviz v0.5.1/go.mod h1:zDnjgRblGm1Dyd7J5YlbH7gM1/+HRC+SfkhZhQb5AnM=
|
github.com/arl/statsviz v0.5.1/go.mod h1:zDnjgRblGm1Dyd7J5YlbH7gM1/+HRC+SfkhZhQb5AnM=
|
||||||
github.com/byebyebruce/natsrpc v0.5.5-0.20221125150611-56cd29a4e335 h1:V5qahA5kDL/TBnlwvYjemR5du/uQ7q75qkBBlTc4rXI=
|
github.com/byebyebruce/natsrpc v0.5.5-0.20221125150611-56cd29a4e335 h1:V5qahA5kDL/TBnlwvYjemR5du/uQ7q75qkBBlTc4rXI=
|
||||||
|
|||||||
@@ -24,14 +24,14 @@ func main() {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
engine.RunEngine([]int{0, 1, 2, 3}, 1, "0.0.0.0")
|
engine.RunEngine([]int{0, 1, 2, 3}, 4, 1, "0.0.0.0")
|
||||||
|
|
||||||
time.Sleep(time.Second * 30)
|
time.Sleep(time.Second * 30)
|
||||||
|
|
||||||
session := net.NewSession("192.168.199.233:22222", []byte{0x00})
|
session := net.NewSession("192.168.199.233:22222", make([]byte, 4096))
|
||||||
go func() {
|
go func() {
|
||||||
protoMsg := <-session.RecvChan
|
protoMsg := <-session.RecvChan
|
||||||
logger.Debug("%v", protoMsg)
|
logger.Debug("protoMsg: %v", protoMsg)
|
||||||
}()
|
}()
|
||||||
go func() {
|
go func() {
|
||||||
session.SendChan <- &hk4egatenet.ProtoMsg{
|
session.SendChan <- &hk4egatenet.ProtoMsg{
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ func (s *Session) recvHandle() {
|
|||||||
kcpMsgList := make([]*hk4egatenet.KcpMsg, 0)
|
kcpMsgList := make([]*hk4egatenet.KcpMsg, 0)
|
||||||
hk4egatenet.DecodeBinToPayload(recvData, &dataBuf, convId, &kcpMsgList, s.xorKey)
|
hk4egatenet.DecodeBinToPayload(recvData, &dataBuf, convId, &kcpMsgList, s.xorKey)
|
||||||
for _, v := range kcpMsgList {
|
for _, v := range kcpMsgList {
|
||||||
protoMsgList := hk4egatenet.ProtoDecode(v, nil, nil)
|
protoMsgList := hk4egatenet.ProtoDecode(v, cmd.NewCmdProtoMap(), nil)
|
||||||
for _, vv := range protoMsgList {
|
for _, vv := range protoMsgList {
|
||||||
s.RecvChan <- vv
|
s.RecvChan <- vv
|
||||||
if s.changeXorKeyFin == false && vv.CmdId == cmd.GetPlayerTokenRsp {
|
if s.changeXorKeyFin == false && vv.CmdId == cmd.GetPlayerTokenRsp {
|
||||||
|
|||||||
Reference in New Issue
Block a user