调整用户名显示相关,只有播放录像才会强制用户名,否则都用uid获取

This commit is contained in:
MrZ_26
2022-10-24 19:15:05 +08:00
parent 04559efaca
commit 7b1df65e64
4 changed files with 4 additions and 7 deletions

View File

@@ -33,7 +33,7 @@ return{
GC.rectangle('line',488,20,100,80,5) GC.rectangle('line',488,20,100,80,5)
GC.draw(border,-17+150,-12) GC.draw(border,-17+150,-12)
setFont(30) setFont(30)
GC.mStr(P.username,300,-60) GC.mStr(P.username or USERS.getUsername(P.uid),300,-60)
end end
GC.pop() GC.pop()
end end

View File

@@ -452,7 +452,7 @@ local function _pumpStream(d)
if res then if res then
DATA.pumpRecording(stream,P.stream) DATA.pumpRecording(stream,P.stream)
else else
MES.new('error',"Bad stream from "..P.username.."#"..P.uid,.1) MES.new('error',"Bad stream from "..USERS.getUsername(P.uid).."#"..P.uid,.1)
end end
return return
end end

View File

@@ -722,7 +722,7 @@ function draw.norm(P,repMode)
-- Draw username -- Draw username
setFont(30) setFont(30)
gc_setColor(.97,.97,.97) gc_setColor(.97,.97,.97)
GC.mStr(P.username,300,-60) GC.mStr(P.username or USERS.getUsername(P.uid),300,-60)
-- Draw HUD -- Draw HUD
if ENV.nextCount>0 then _drawNext(P,repMode) end if ENV.nextCount>0 then _drawNext(P,repMode) end

View File

@@ -119,7 +119,6 @@ local function _newEmptyPlayer(id,mini)
P.atker,P.atking,P.lastRecv={} P.atker,P.atking,P.lastRecv={}
-- User-related -- User-related
P.username=""
P.uid=false P.uid=false
P.sid=false P.sid=false
@@ -209,7 +208,7 @@ local function _loadRemoteEnv(P,confStr)-- Load gameEnv
confStr=JSON.decode(confStr) confStr=JSON.decode(confStr)
if not confStr then if not confStr then
confStr={} confStr={}
MES.new('warn',"Bad conf from "..P.username.."#"..P.uid) MES.new('warn',"Bad conf from "..USERS.getUsername(P.uid).."#"..P.uid)
end end
P.gameEnv={}-- Current game setting environment P.gameEnv={}-- Current game setting environment
@@ -407,7 +406,6 @@ function PLY.newRemotePlayer(id,mini,p)
P:startStreaming() P:startStreaming()
P.uid=p.uid P.uid=p.uid
P.username=USERS.getUsername(p.uid)
P.sid=NET.uid_sid[p.uid] P.sid=NET.uid_sid[p.uid]
_loadRemoteEnv(P,p.config) _loadRemoteEnv(P,p.config)
@@ -429,7 +427,6 @@ function PLY.newPlayer(id,mini)
P.type='human' P.type='human'
P.sound=true P.sound=true
P.username=USERS.getUsername(USER.uid)
P.uid=USER.uid P.uid=USER.uid
P.sid=NET.uid_sid[USER.uid] P.sid=NET.uid_sid[USER.uid]