Commit 3373f583553d5dd5edbb897190285b80a2956f90
Merge branch 'cn/develop' into cn/player
Showing
2 changed files
with
12 additions
and
8 deletions
Show diff stats
src/models/RoleCross.lua
... | ... | @@ -6,13 +6,13 @@ local RoleCross = {} |
6 | 6 | RoleCross.bind = function (Role) |
7 | 7 | -- 好友列表简约信息 |
8 | 8 | function Role:friendSInfo() |
9 | + local fteam = self.getProperty("friendTeam") or {} | |
9 | 10 | local info = { |
10 | 11 | name = self:getProperty("name"), |
11 | 12 | level = self:getProperty("level"), |
12 | 13 | headId = self:getProperty("headId"), |
13 | 14 | ltime = self:getProperty("ltime"), |
14 | - | |
15 | - battleV = self.getProperty("friendTeam").v or 0, | |
15 | + battleV = fteam.v or 0, | |
16 | 16 | --battleV = self:getProperty("pvpTBVC") ~= 0 and self:getProperty("pvpTBVC") or self:getProperty("hangTBV") |
17 | 17 | } |
18 | 18 | return info |
... | ... | @@ -23,7 +23,8 @@ RoleCross.bind = function (Role) |
23 | 23 | local info = self:friendSInfo() |
24 | 24 | --local team = self:getProperty("pvpTBVC") ~= 0 and self:getProperty("pvpTSC") or self:getProperty("hangTS") |
25 | 25 | --info.team = team |
26 | - info.team = self:getProperty("friendTeam").team or {} | |
26 | + local fteam = self.getProperty("friendTeam") or {} | |
27 | + info.team = fteam.team or {} | |
27 | 28 | info.heroCnt = self:getProperty("heroCnt") |
28 | 29 | info.achieveCnt = table.numbers(self:getProperty("achiveV")) |
29 | 30 | info.bgId = self:getProperty("bgId") |
... | ... | @@ -283,19 +284,21 @@ end |
283 | 284 | function CMD.friendSInfo(roleId) |
284 | 285 | --local info = CMD.getProperties(roleId, {"name", "level", "headId", "ltime", "pvpTBVC", "hangTBV"}) |
285 | 286 | local info = CMD.getProperties(roleId, {"name", "level", "headId", "ltime", "friendTeam"}) |
287 | + local fteam = info.friendTeam or {} | |
286 | 288 | return { |
287 | 289 | name = info.name, |
288 | 290 | level = info.level, |
289 | 291 | headId = info.headId, |
290 | 292 | ltime = info.ltime, |
291 | 293 | --battleV = info.pvpTBVC ~= 0 and info.pvpTBVC or info.hangTBV, |
292 | - battleV = info.friendTeam.v or 0, | |
294 | + battleV = fteam.v or 0, | |
293 | 295 | } |
294 | 296 | end |
295 | 297 | |
296 | 298 | function CMD.friendInfo(roleId) |
297 | 299 | --local info = CMD.getProperties(roleId, {"name", "level", "headId", "ltime", "pvpTBVC", "hangTBV", "pvpTSC", "hangTS"}) |
298 | 300 | local info = CMD.getProperties(roleId, {"name", "level", "headId", "ltime", "friendTeam", "heroCnt", "achiveV", "bgId", "hangPass"}) |
301 | + local fteam = info.friendTeam or {} | |
299 | 302 | return { |
300 | 303 | name = info.name, |
301 | 304 | level = info.level, |
... | ... | @@ -303,8 +306,8 @@ function CMD.friendInfo(roleId) |
303 | 306 | ltime = info.ltime, |
304 | 307 | --battleV = info.pvpTBVC ~= 0 and info.pvpTBVC or info.hangTBV, |
305 | 308 | --team = info.pvpTBVC ~= 0 and info.pvpTSC or info.hangTS |
306 | - battleV = info.friendTeam.v or 0, | |
307 | - team = info.friendTeam.team or {}, | |
309 | + battleV = fteam.v or 0, | |
310 | + team = fteam.team or {}, | |
308 | 311 | heroCnt = info.heroCnt, |
309 | 312 | achieveCnt = table.numbers(info.achiveV), |
310 | 313 | bgId = info.bgId, |
... | ... | @@ -316,7 +319,8 @@ function CMD.friendBattleInfo(roleId) |
316 | 319 | --local info = CMD.getProperties(roleId, {"pvpTBC", "hangTB"}) |
317 | 320 | local info = CMD.getProperties(roleId, {"friendTeam"}) |
318 | 321 | --return (next(info.pvpTBC) and next(info.pvpTBC.heros)) and info.pvpTBC or info.hangTB |
319 | - return info.friendTeam.bInfo or {} | |
322 | + local fteam = info.friendTeam or {} | |
323 | + return fteam.bInfo or {} | |
320 | 324 | end |
321 | 325 | |
322 | 326 | function CMD.pvpCInfo(roleId) | ... | ... |