Commit 9e91460abbc203b4c01d8a55ce1d4a6633a72590
1 parent
1b555008
appid
Showing
1 changed file
with
12 additions
and
6 deletions
Show diff stats
src/models/RoleLog.lua
... | ... | @@ -543,20 +543,26 @@ local function isIos(self) |
543 | 543 | return sid == 2 |
544 | 544 | end |
545 | 545 | |
546 | -local appid, sdkId | |
546 | +local sdkId | |
547 | +local AppId = { | |
548 | + [1] = 4787, | |
549 | + [2] = 4788, | |
550 | + [3] = 4789, | |
551 | +} | |
547 | 552 | local function getBaseLog(self) |
548 | 553 | local uid = self:getProperty("uid") |
549 | - if not appid then | |
550 | - appid, sdkId = string.match(uid, "(.*)_(.*)") | |
551 | - if not appid then | |
554 | + local sid = self:getProperty("sid") | |
555 | + if not sdkId then | |
556 | + _, sdkId = string.match(uid, "(.*)_(.*)") | |
557 | + if not _ then | |
552 | 558 | sdkId = uid |
553 | - appid = 0 | |
554 | 559 | end |
555 | 560 | end |
561 | + | |
556 | 562 | local log = { |
557 | 563 | server_id = server_id, |
558 | 564 | timestamp = skynet.timex(), |
559 | - app_id = appid, | |
565 | + app_id = AppId[sid] or 0, | |
560 | 566 | plat_id = isIos(self) and 0 or 1, |
561 | 567 | sdk_uid = sdkId, |
562 | 568 | account_id = uid, | ... | ... |