bobohume / gonet Goto Github PK
View Code? Open in Web Editor NEWgo分布式服务器,基于内存mmo
License: MIT License
go分布式服务器,基于内存mmo
License: MIT License
消息性能能达到对战帧同步游戏要求吗?
在ActorPool.SendMsg中
pActor := this.GetActor(head.Id)
if pActor != nil && pActor.FindCall(funcName) != nil{
pActor.Send(head, buff)
return
}
在GetActor后,其他groutine DelActor时
在pActor.Send中,Actor执行过了clear, m_CallChan被close,写入chan 发生panic
过度封装简单了,但失去灵活性,满足的用户变少了
搜了下关键字hot,没有看到相关代码
https://github.com/bobohume/gonet/blob/master/network/ServerSocketClient.go
func (s *ServerSocketClient) Stop() bool {
timer.RegisterTimer(s.timerId, timer.TICK_INTERVAL, func() {
timer.StopTimer(s.timerId)
if atomic.CompareAndSwapInt32(&s.state, SSF_RUN, SSF_STOP) {
if s.conn != nil {
s.conn.Close()
}
}
})
return false
}
Stop的 s.state s.conn 到了RegisterTimer 里面都是0,nil
建议不要在Socket的Stop函数中不要去关闭conn,因为有可能导致Run中的conn.Read会阻塞无法返回,导致无法释放
然后最好在conn.Read之前加一个读取超时,可以跟心跳测试的间隔时间一致的30秒,把conn.Stop 放在Socket.Close一起处理
让Run这个协程能够顺利执行和释放,原来的Socket的Stop只是改变一个状态,然后再Run的loop函数中针对状态,如果状态是SSF_STOP 直接退出循环,特别是在KCP模式下很容阻塞不释放。
if this.GetState() != SSF_RUN {
return false
}
this.conn.(kcp.UDPSession).SetDeadline(time.Now().Add(time.SecondHEART_TIME_OUT))
比如一个玩家在WorldA 一个玩家在WorldB 如果A里面的玩家要加B里面的玩家为自己的好友,有办法处理吗
client 编译提示
cannot find package "server/world/game/lmath"
例子都没一个,你是头一回写框架吗?
检测到 bobohume/gonet 一共引入了87个开源组件,存在2个漏洞
漏洞标题:go-yaml < 2.2.8拒绝服务漏洞
缺陷组件:gopkg.in/[email protected]
漏洞编号:CVE-2019-11254
漏洞描述:gopkg.in/yaml.v2是go语言中用于处理yaml格式的包。
在2.2.8之前的版本中,处理恶意的yaml数据时,会导致CPU资源耗尽。
漏洞由Kubernetes开发者在fuzz测试中发现并提交修复补丁。
国家漏洞库信息:https://www.cnvd.org.cn/flaw/show/CNVD-2020-35519
影响范围:(∞, 2.2.8)
最小修复版本:2.2.8
缺陷组件引入路径:main@->gopkg.in/[email protected]
另外还有2个漏洞,详细报告:https://mofeisec.com/jr?p=a2214d
W2FyZW5hXQ==
c3RhcnRUaW1lICAgICAgICAgICAgICAgICAgICAgICA9IDIwMTEtMTAtMTI=
b3BlbkRheSAgICAgICAgICAgICAgICAgICAgICAgICA9IDE0
Y2xvc2VEYXkgICAgICAgICAgICAgICAgICAgICAgICA9IDc=
WzE5Mi4xNjguMTAuMTM1XQ==
TGluZUlEICAgICAgICAgICAgICAgICAgICAgICAgICA9IDE7
R2F0ZUlEICAgICAgICAgICAgICAgICAgICAgICAgICA9IDE7
TmV0R2F0ZV9XQU5BZGRyZXNzICAgICAgICAgICAgICA9IDE5Mi4xNjguMTAuMTM1OjIxMDAxOw==
TmV0R2F0ZV9XQU5BZGRyZXNzX1NlbmQgICAgICAgICA9IDE5Mi4xNjguMTAuMTM1OjIxMDAxOw==
TmV0R2F0ZV9XQU5DbGllbnRzICAgICAgICAgICAgICA9IDEwMDAwMDs=
TmV0R2F0ZV9MQU5Qb3J0ICAgICAgICAgICAgICAgICA9IDQxMDAxOw==
RGF0YUFnZW50X0xBTlBvcnQgICAgICAgICAgICAgICA9IDYwMDAwOw==
这是什么格式?
启动 ./server netgate 加载配置文件报错
房间类型适合么
有什么使用的例子吗?线上的
https://github.com/egmkang/koala
pd是golang实现的
gateway是C#实现的
virtual actor框架是Python实现的, 逻辑也是Python编写
哪怕是一个极小的游戏示例,五子棋这种?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.