MCPcopy Create free account
hub / github.com/Loping151/RoverSign / hide_uid

Function hide_uid

RoverSign/utils/util.py:120–135  ·  view source on GitHub ↗

user_pref: 该 uid 对应 WavesUser.hide_uid_self_value, 由 caller 传入。 "on" 强制隐藏 / "off" 强制不隐藏 / "" 跟随全局 HideUid。

(uid, user_pref: str = "")

Source from the content-addressed store, hash-verified

118
119
120def hide_uid(uid, user_pref: str = "") -> str:
121 """user_pref: 该 uid 对应 WavesUser.hide_uid_self_value, 由 caller 传入。
122
123 "on" 强制隐藏 / "off" 强制不隐藏 / "" 跟随全局 HideUid。
124 """
125 from ..roversign_config.roversign_config import RoverSignConfig
126
127 uid_str = str(uid) if uid is not None else ""
128 if user_pref == "off":
129 return uid_str
130 if user_pref != "on":
131 if not RoverSignConfig.get_config("HideUid").data:
132 return uid_str
133 if len(uid_str) < 2:
134 return uid_str
135 return uid_str[:2] + "*" * 4 + uid_str[-2:]
136
137
138async def get_hide_uid_pref(uid: str, user_id: str, bot_id: str, game_id=None) -> str:

Callers 6

set_pgr_config_funcFunction · 0.85
open_switch_funcFunction · 0.85
mask_waves_uidFunction · 0.85
mask_pgr_uidFunction · 0.85
rover_sign_up_handlerFunction · 0.85
single_taskFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected