websockets: add default values for client data
Signed-off-by: Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
parent
b296444091
commit
3a21e9d6f0
|
@ -38,7 +38,7 @@ if TYPE_CHECKING:
|
||||||
RPCCallback = Callable[..., Coroutine]
|
RPCCallback = Callable[..., Coroutine]
|
||||||
AuthComp = Optional[components.authorization.Authorization]
|
AuthComp = Optional[components.authorization.Authorization]
|
||||||
|
|
||||||
CLIENT_TYPES = ["web", "mobile", "desktop", "display", "bot", "other"]
|
CLIENT_TYPES = ["web", "mobile", "desktop", "display", "bot", "agent", "other"]
|
||||||
SENTINEL = SentinelClass.get_instance()
|
SENTINEL = SentinelClass.get_instance()
|
||||||
|
|
||||||
class Subscribable:
|
class Subscribable:
|
||||||
|
@ -452,7 +452,12 @@ class WebSocket(WebSocketHandler, Subscribable):
|
||||||
self.message_buf: List[Union[str, Dict[str, Any]]] = []
|
self.message_buf: List[Union[str, Dict[str, Any]]] = []
|
||||||
self.last_pong_time: float = self.event_loop.get_loop_time()
|
self.last_pong_time: float = self.event_loop.get_loop_time()
|
||||||
self._connected_time: float = 0.
|
self._connected_time: float = 0.
|
||||||
self._client_data: Dict[str, str] = {}
|
self._client_data: Dict[str, str] = {
|
||||||
|
"name": "unknown",
|
||||||
|
"version": "",
|
||||||
|
"type": "",
|
||||||
|
"url": ""
|
||||||
|
}
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def uid(self) -> int:
|
def uid(self) -> int:
|
||||||
|
|
Loading…
Reference in New Issue