调整用户名显示相关,只有播放录像才会强制用户名,否则都用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.draw(border,-17+150,-12)
setFont(30)
GC.mStr(P.username,300,-60)
GC.mStr(P.username or USERS.getUsername(P.uid),300,-60)
end
GC.pop()
end

View File

@@ -452,7 +452,7 @@ local function _pumpStream(d)
if res then
DATA.pumpRecording(stream,P.stream)
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
return
end

View File

@@ -722,7 +722,7 @@ function draw.norm(P,repMode)
-- Draw username
setFont(30)
gc_setColor(.97,.97,.97)
GC.mStr(P.username,300,-60)
GC.mStr(P.username or USERS.getUsername(P.uid),300,-60)
-- Draw HUD
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={}
-- User-related
P.username=""
P.uid=false
P.sid=false
@@ -209,7 +208,7 @@ local function _loadRemoteEnv(P,confStr)-- Load gameEnv
confStr=JSON.decode(confStr)
if not confStr then
confStr={}
MES.new('warn',"Bad conf from "..P.username.."#"..P.uid)
MES.new('warn',"Bad conf from "..USERS.getUsername(P.uid).."#"..P.uid)
end
P.gameEnv={}-- Current game setting environment
@@ -407,7 +406,6 @@ function PLY.newRemotePlayer(id,mini,p)
P:startStreaming()
P.uid=p.uid
P.username=USERS.getUsername(p.uid)
P.sid=NET.uid_sid[p.uid]
_loadRemoteEnv(P,p.config)
@@ -429,7 +427,6 @@ function PLY.newPlayer(id,mini)
P.type='human'
P.sound=true
P.username=USERS.getUsername(USER.uid)
P.uid=USER.uid
P.sid=NET.uid_sid[USER.uid]