Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

Sync Change #39

Draft
wants to merge 119 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
01abd29
:twisted_rightwards_arrows: Merge pull request #31
yanyongyu May 28, 2021
7d46eaa
:twisted_rightwards_arrows: Merge pull request #33
yanyongyu Aug 2, 2021
89eb91c
:twisted_rightwards_arrows: Merge pull request #37
yanyongyu Dec 8, 2021
25d746e
change: rewrite login.py
wyapx Mar 19, 2022
1c037d5
fix: logical of login.py
wyapx Mar 19, 2022
d776777
change: rewrite group.py
wyapx Mar 19, 2022
346fd7a
change: rewrite friend.py
wyapx Mar 19, 2022
8337fc0
change: rewrite client.py
wyapx Mar 19, 2022
80e00eb
update: cai/api
wyapx Mar 19, 2022
71b5811
update: examples/login.py
wyapx Mar 19, 2022
3ac1fc8
update: remove unused code
wyapx Mar 19, 2022
259cc94
remove: strong dependency on cai/settings
wyapx Mar 19, 2022
c134a6d
update: named logger
wyapx Mar 19, 2022
876b02f
update: logger
wyapx Mar 19, 2022
68ac10d
add: Client.status
wyapx Mar 19, 2022
06d03d6
add: more debug message
wyapx Mar 19, 2022
4097415
add: basic send group message[see example/login.py]
wyapx Mar 20, 2022
6cb9103
add: highway pb file
wyapx Mar 20, 2022
9a82405
update: todo
wyapx Mar 20, 2022
28def19
add: longmsg.proto
wyapx Mar 20, 2022
a98a144
add: Client.send_unipkg_and_wait & optimized code
wyapx Mar 20, 2022
ff083da
add: multi_apply_up_pkg handle
wyapx Mar 20, 2022
aa06c4e
add: GroupIdConverter
wyapx Mar 20, 2022
b7b3768
fix: some bugs
wyapx Mar 20, 2022
46c42c5
fix: some bugs
wyapx Mar 20, 2022
88064e4
add: cmd0x388
wyapx Mar 20, 2022
0d452b5
sync changes
wyapx Mar 21, 2022
8e41ae5
fix: struct parse error
wyapx Mar 22, 2022
c87d702
sync changes
wyapx Mar 22, 2022
6411f29
add: highway & upload image
wyapx Mar 23, 2022
1a97045
fix: send image to group
wyapx Mar 24, 2022
c318dcc
sync changes
wyapx Apr 3, 2022
646bc7b
add: reconnect & Client.closed
wyapx Apr 3, 2022
de92289
revert change
wyapx Apr 3, 2022
93279cf
update: split highway.py
wyapx Apr 3, 2022
270ed93
update: reconnect method
wyapx Apr 3, 2022
43ee0a4
remove: unused code
wyapx Apr 3, 2022
7905915
fix: login failfast
wyapx Apr 3, 2022
97ca3a4
add: FlashImage At RichMsg parse
wyapx Apr 3, 2022
398b92b
add: raise send_group_msg error
wyapx Apr 3, 2022
f73d868
add: send At & FlashImage
wyapx Apr 3, 2022
9afe298
add: send RichMsg
wyapx Apr 3, 2022
5cbafe8
fix: remove redundancy data of Reply
wyapx Apr 4, 2022
77cd27a
fix: rich_msg parse
wyapx Apr 4, 2022
ab243e0
change: heartbeat err
wyapx Apr 4, 2022
95d6d51
change: log level
wyapx Apr 4, 2022
d5fbcd8
add: AtAll recv/send
wyapx Apr 4, 2022
325e0ab
add: AtAll recv/send
wyapx Apr 4, 2022
18be327
add: Image.to_flash
wyapx Apr 4, 2022
446f383
fix: flash_image build err
wyapx Apr 4, 2022
897e78c
fix: flash_image no url
wyapx Apr 4, 2022
0054da1
add: shake_window & improve parser
wyapx Apr 4, 2022
e7d37e0
add: poke send
wyapx Apr 4, 2022
1d3f731
fix: highway bug & support send voice
wyapx Apr 5, 2022
ef0865f
add: parse voice.url
wyapx Apr 5, 2022
57617ee
:arrow_up: upgrade dependencies
yanyongyu Apr 7, 2022
0f8c524
:label: update typing for pep646
yanyongyu Apr 7, 2022
05eb52b
:art: format code
yanyongyu Apr 7, 2022
c61a84a
delete: unused file
wyapx Apr 7, 2022
23f8692
Revert "delete: unused file"
wyapx Apr 7, 2022
205a572
fix: event register
wyapx Apr 7, 2022
7e225de
fix: unsync changes
wyapx Apr 7, 2022
fdef3f9
fix: some bugs
wyapx Apr 7, 2022
3d1f263
add: more poke type
wyapx Apr 7, 2022
9f25e6b
change: PokeType
wyapx Apr 7, 2022
e0487e3
add: parse group mute/unmute,recall,nudge event
wyapx Apr 7, 2022
cff4e4c
fix: type error
wyapx Apr 7, 2022
eb17c61
add: send OnlinePush.RespPush & optimized code
wyapx Apr 7, 2022
473d8b2
sync file
wyapx Apr 7, 2022
cbb506e
:art: improve reconnect
yanyongyu Apr 8, 2022
21aa1ee
:wheelchair: fix reconnect init
yanyongyu Apr 8, 2022
55e9fac
:art: remove device handle param
yanyongyu Apr 8, 2022
4220e75
:arrow_up: upgrade protobuf gen
yanyongyu Apr 8, 2022
cc2c19b
:arrow_up: upgrade oidb proto files
yanyongyu Apr 8, 2022
7d7677a
add: reconnect fallback
wyapx Apr 8, 2022
73912ce
f**k u, tencent
wyapx Apr 8, 2022
7415cf1
update: close client when force_offline triggered
wyapx Apr 8, 2022
79ac21d
add: ignore repeat event
wyapx Apr 8, 2022
15e0728
fix: nudge event
wyapx Apr 8, 2022
3587d32
:art: rewrite reqpush
yanyongyu Apr 9, 2022
49e177b
fix: reconnect fail
wyapx Apr 9, 2022
6ce883c
fix: drop msg when reconnect
wyapx Apr 9, 2022
83f2d13
:wheelchair: refactor receiver start
yanyongyu Apr 9, 2022
7f8fb29
add: remove duplicates req
wyapx Apr 9, 2022
b4c52f2
Merge branch 'master' of https://github.com/wyapx/CAI
wyapx Apr 9, 2022
016b31e
:wheelchair: improve online push cache
yanyongyu Apr 9, 2022
e66eeef
:construction: process del msg
yanyongyu Apr 9, 2022
e099cfa
:wrench: improve account settings cache
yanyongyu Apr 9, 2022
4d4a6b0
:bug: fix delete online push seq error
yanyongyu Apr 9, 2022
0254e5a
:bug: fix incoming packet signed seq
yanyongyu Apr 9, 2022
3e6a61e
fix: unipkg seq signed
wyapx Apr 9, 2022
7752c20
change: incoming log message
wyapx Apr 9, 2022
b782fd5
Merge remote-tracking branch 'wyapx/master'
wyapx Apr 9, 2022
1d0bd82
:wrench: fix config dir error
yanyongyu Apr 10, 2022
1a819eb
:construction: process onlinepush reqpush types
yanyongyu Apr 10, 2022
a99179e
:sparkles: parse nudge event
yanyongyu Apr 11, 2022
3369b13
:sparkles: add group lucky character events
yanyongyu Apr 11, 2022
1b80059
fix: receiver bug
cincrement Apr 11, 2022
2773e55
Merge branch 'master' of https://github.com/wyapx/CAI into HEAD
cincrement Apr 11, 2022
69c097f
add: CustomDataElement
wyapx Apr 12, 2022
454f274
:construction: process event type default
yanyongyu Apr 12, 2022
c731371
:memo: update readme
yanyongyu Apr 12, 2022
60f7f84
:sparkles: add group member mute event
yanyongyu Apr 12, 2022
0799e2a
:construction: move comments
yanyongyu Apr 12, 2022
0999df1
add: part of oidb packet
wyapx Apr 13, 2022
808aa01
add: group operation
wyapx Apr 13, 2022
df052cf
fix: stupid problem
wyapx Apr 13, 2022
2dcf545
:bug: fix group mute count decode error
yanyongyu Apr 13, 2022
19dd4db
remove: unused file
wyapx Apr 7, 2022
c3b8c5a
add: image decoder
wyapx Apr 15, 2022
0c508c5
fix: image/enum.py
wyapx Apr 15, 2022
1d7efc7
update: image/enum.py
wyapx Apr 15, 2022
95df065
fix: image upload
wyapx Apr 15, 2022
ec74eda
fix: some design problem
wyapx Apr 15, 2022
abca32b
add: parse GroupFile
wyapx Apr 16, 2022
1f4d1a3
add: BMPDecoder & optimized code
wyapx Apr 16, 2022
0656836
remove: unused code
wyapx Apr 16, 2022
b3dbbb6
fix: send image fail
wyapx Apr 18, 2022
3c9c9d1
:art: improve parse message element
yanyongyu May 29, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update: logger
  • Loading branch information
wyapx committed Mar 19, 2022
commit 876b02fa07980a764fee957ba63da142d9d9f8a4
9 changes: 6 additions & 3 deletions cai/client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
.. _LICENSE:
https://github.com/cscs181/CAI/blob/master/LICENSE
"""
import logging
import time
import struct
import asyncio
Expand Down Expand Up @@ -269,7 +270,7 @@ async def connect(self, server: Optional[SsoServer] = None) -> None:
"""
if self.connected:
raise RuntimeError("Already connected to the server")

log.network.debug("Getting Sso server")
_server = server or await get_sso_server()
log.logger.info(f"Connecting to server: {_server.host}:{_server.port}")
try:
Expand Down Expand Up @@ -318,6 +319,7 @@ async def reconnect(

async def close(self) -> None:
"""Close the client and logout."""
log.logger.warning("closing client")
if (
self.connected
and self.status
Expand Down Expand Up @@ -357,7 +359,7 @@ async def send(
Returns:
None.
"""
log.network.debug(f"--> {seq}: {command_name}")
log.network.debug(f"(send:{seq}): {command_name}")
await self.connection.awrite(packet)

async def send_and_wait(
Expand Down Expand Up @@ -410,8 +412,9 @@ async def receive(self):
self._siginfo.d2key,
self._siginfo.wt_session_ticket_key,
)
#
log.network.debug(
f"<-- {packet.seq} ({packet.ret_code}): {packet.command_name}"
f"(receive:{packet.ret_code}): {packet.command_name}"
)
# do not block receive
asyncio.create_task(self._handle_incoming_packet(packet))
Expand Down
3 changes: 2 additions & 1 deletion cai/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@

logging.basicConfig(
level=logging.DEBUG,
handlers=[logging.StreamHandler(sys.stdout)]
handlers=[logging.StreamHandler(sys.stdout)],
format="%(asctime)s %(name)s[%(levelname)s]: %(message)s"
)

logger = logging.getLogger("cai")
Expand Down