fztcjjl / metoo Goto Github PK
View Code? Open in Web Editor NEWA game engine based on skynet
A game engine based on skynet
https://github.com/fztcjjl/metoo/blob/master/game/msgagent.lua#L165
local data = netpack.tostring(msg, sz, 0) -- 必须为0, 否则会产生double free
第三个参数0有用到吗?另外,调用了这句就会产生double free,我觉得应该去掉。
local record
if self.recordset[uid] then
if not field then
record = self.recordset[uid][id] or {}
elseif type(field) == "string" then
if not self.recordset[uid][id] then return end
record = self.recordset[uid][id][field]
elseif type(field) == "table" then
record = {}
local t = self.recordset[uid][id]
if not t then return record end
for i=1, #field do
record[field[i]] = t[field[i]]
end
end
--此处不应该直接return
--调用方如果第一次有传的id,那么slef.recordset[uid]中仅会有一个记录,会导致后续的其他记录均无法查询到,应判断如果不存在,尝试去redis\mysql加载一次
return record
end
if (inst.written_bytes >= inst.rollsize)
{
fclose(inst.handle);
continue;
}
rollfile后,并没有将written_bytes置0,次数会导致一直在while(1)中无限创建文件,直到磁盘inode不足
1.makefile里面的平台是macosx,但是编译时log模块包含的Lua头文件找不到报错
2.log里面的fwrite_unlocked找不到
Load中加载玩家数据的时候,应该是get_user_xxx,而不应该是load_user_xxx,否则每次加载玩家数据都会从mysql读取,应该先从redis读取。
metoo/game/main.lua
中 common
中有字段 columns
,我理解只加载common
中table
的指定字段值到redis
和内存中,可是metoo/common/dbmgr.lua
中load_data_impl
方法里,却用的是config.fields
,是否为错误?
另外metoo/userdc.lua
中check_rolename_exists
方法,用于判断名字是否重复,记得metoo
稍早的版本用到了该方法,当前的版本去掉了,不知道作者何用意? 实际应用中,此逻辑是有必要的,但是response.roleinit
方法中就有必要在user_dc.req.add
方法中更新entUserCustom
的值,但是CommonEntity:add
和CommonEntity:update
方法都需要row
参数里包含pk
,这是否和columns = "name"
矛盾,应该为columns = "name, uid"
?
编译这个需要其他什么条件吗,skynet可以编过
make 时报下面错误,请问需要改哪里呢?
cc -g -O2 -Wall -fPIC --shared lualib-src/lua-log.c -o luaclib/log.so
lualib-src/lua-log.c:1:10: fatal error: lua.h: No such file or directory
#include <lua.h>
^~~~~~~
compilation terminated.
make: *** [luaclib/log.so] Error 1
已经把Makefile中的PLAT ?= linux 修改成PLAT ?= macosx执行make 出错,提示:
gcc -O2 -fPIC -Wall -shared -o protobuf.so -I../.. -I/usr/local/include -L../../build pbc-lua53.c -lpbc
Undefined symbols for architecture x86_64:
"_luaL_buffinit", referenced from:
__pattern_pack in pbc-lua53-d7329b.o
……
好像是64位的问题,请问有什么办法解决吗?
在work_func中,对new_buffer2赋值时,应该是new_buffer2 = buffers_to_write.head; 而不是new_buffer2 = buffers_to_write.head->next;
在append时,当前端写速度超过一块buffer时,对curr_buffer赋值时,应先指定next,否则会在work_func中发生core
sql执行失败的话如何同步redis?框架中未做处理
luaext.lua
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.