寒服更新
This commit is contained in:
@@ -88,8 +88,9 @@ class NewTitleC {
|
||||
//查询自身称号簿数据
|
||||
ClientSocketPackFuncMap.rawset(21012001, function(SUser, Jso) {
|
||||
local SendInfo = {};
|
||||
if (data.rawin(SUser.GetCID())) {
|
||||
SendInfo = data.rawget(SUser.GetCID());
|
||||
local Cid = SUser.GetCID().tostring();
|
||||
if (data.rawin(Cid)) {
|
||||
SendInfo = data.rawget(Cid);
|
||||
}
|
||||
SUser.SendJso({
|
||||
op = 21012002,
|
||||
@@ -101,7 +102,7 @@ class NewTitleC {
|
||||
ClientSocketPackFuncMap.rawset(21012003, function(SUser, Jso) {
|
||||
local SaveInfo = Jso.SendInfo;
|
||||
local SaveId = Jso.Id;
|
||||
local Cid = SUser.GetCID();
|
||||
local Cid = SUser.GetCID().tostring();
|
||||
//因为json传输过程会导致INT key变成string 所以这里的缓存里一律要使用string 的编号
|
||||
data[Cid].rawset(SaveId.tostring(), SaveInfo);
|
||||
RefreshAreaDrawInfo(SUser);
|
||||
@@ -111,7 +112,7 @@ class NewTitleC {
|
||||
|
||||
//给玩家添加称号
|
||||
function AddTitle(SUser, TitleId) {
|
||||
local Cid = SUser.GetCID();
|
||||
local Cid = SUser.GetCID().tostring();
|
||||
if (!data.rawin(Cid)) {
|
||||
data.rawset(Cid, {});
|
||||
}
|
||||
@@ -126,7 +127,7 @@ class NewTitleC {
|
||||
|
||||
//给玩家移除称号
|
||||
function RemoveTitle(SUser, TitleId) {
|
||||
local Cid = SUser.GetCID();
|
||||
local Cid = SUser.GetCID().tostring();
|
||||
if (!data.rawin(Cid)) {
|
||||
data.rawset(Cid, {});
|
||||
}
|
||||
@@ -153,7 +154,7 @@ class NewTitleC {
|
||||
function GenerateDrawInfo(ShowCidList) {
|
||||
local ShowList = {};
|
||||
foreach(SUserObj in ShowCidList) {
|
||||
local Cid = SUserObj.GetCID();
|
||||
local Cid = SUserObj.GetCID().tostring();
|
||||
local ShowData = null;
|
||||
if (data.rawin(Cid)) {
|
||||
ShowData = data.rawget(Cid);
|
||||
@@ -191,7 +192,7 @@ class NewTitleC {
|
||||
Timer.SetCronTask(function() {
|
||||
local DataList = [];
|
||||
foreach(cid, value in data) {
|
||||
local str = format("(%d,'%s'),", cid, Json.Encode(value));
|
||||
local str = format("(%s,'%s'),", cid.tostring(), Json.Encode(value));
|
||||
DataList.push(str);
|
||||
}
|
||||
local sql = "REPLACE INTO newtitle (cid, data) VALUES";
|
||||
|
||||
Reference in New Issue
Block a user