dming / lodos Goto Github PK
View Code? Open in Web Editor NEWlodos
License: Apache License 2.0
lodos
License: Apache License 2.0
今天检查了safemap的问题。
1、明天开始看beego和casbin里的关于go auth的问题,争取两天内完成代码的检查和迁移,把目标代码整合到自己的项目里去。
2、这一步完成以后就进一步检查网关的问题,可以参考那个心动网络的网关要求,封装好网关的接口。
3、这一步也完成以后就把go-redis整合进代码框架里去,让数据储存落地。
。。。后续的计划后续再写
游戏客户端,我是用C#写的。
从客户端来的MQTT RPC调用,所写的函数的参数第一个需要是session gate.Session,
such as:
m.GetServer().RegisterGo("HD_Test", m.Test)
func (m *Login) Test(session gate.Session, msg string) error {
a := uuid.Rand()
log.Info("Get a test request from mqtt client,\n uuid: %s \n message is %s", a, msg)
return nil
}
遇到一个很奇怪的事情,
项目的origin是https://github.com/dming/lodos的时候
$ git remote -v
origin https://github.com/dming/lodos (fetch)
origin https://github.com/dming/lodos (push)
使用git push,什么反应都没有,不工作,控制台也没有任何反馈
然后找了很多资料都解决不了,最后使用命令:
$ git remote set-url origin [email protected]:dming/lodos
$ git remote -v
origin [email protected]:dming/lodos (fetch)
origin [email protected]:dming/lodos (push)
把origin改了以后,就一切都正常了,可以正常git push。
怀疑是ssh的问题,因为在ssh里,ssh [email protected] 是正常的,
但是不知道是不是因为https://github.com这个域名没法解析??
记录下来吧,现在问题暂时解决了。
golang的goroutine,或者说go的所有函数,都只能在内部用return结束,不能在外部显式的结束go的函数。
对于一些对时间不敏感的函数,我们需要对其进行设定一个时间,timeout了以后就不管函数进行到哪里,都结束掉这个函数。那么可以参考一下这样的结构体:
func myFunc() (result []reflect.Value, success bool) {
fn := reflect.Value{}
in := make([]reflect.Value, 1)
out_chan := make(chan []reflect.Value)
_func := func() {
out_chan <- fn.Call(in)
}
go _func()
select {
case _out := <-out_chan:
return _out, true
case <-time.After(time.Second * 2):
return nil, false
}
}
PS:下面这段代码为原来的函数
func myFunc() (result []reflect.Value, success bool) {
fn := reflect.Value{}
in := make([]reflect.Value, 1)
return fn.Call(in), true
}
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.