16 Commits
lite ... master

Author SHA1 Message Date
50575c2b48 Update README.md 2024-08-20 12:06:25 +07:00
d7edb3e079 Update README.md 2024-08-20 11:59:00 +07:00
cc78d2d4d0 Update README.md 2024-08-20 11:58:06 +07:00
4eb721d5ab Update README.md 2024-08-20 11:56:02 +07:00
49de09f23e Update README.md 2024-08-20 11:43:04 +07:00
8530f8f95e Update README.md 2024-08-20 11:41:58 +07:00
8a93fdc95a Update python-app.yml 2024-08-06 20:58:22 +08:00
0ed0deb843 Create python-app.yml 2024-08-06 20:55:52 +08:00
3ad1fbf770 Create translate.yml 2024-08-06 20:01:25 +08:00
6061362cdc Merge pull request #17 from AlignPixel/dev
从"dev"分支拉去更新
2024-08-06 19:59:48 +08:00
93c6eb1c74 更新了安全命令,修复了一个服务端交互问题 2024-08-06 19:53:48 +08:00
fce27cb97f Merge pull request #16 from AlignPixel/dev
Update img
2024-08-02 14:40:53 +08:00
4f79018752 Update img 2024-08-02 14:40:25 +08:00
224628e821 Merge pull request #15 from AlignPixel/dev
Update .DS_Store
2024-08-02 14:37:29 +08:00
8bbc40cc3c Update .DS_Store 2024-08-02 14:36:53 +08:00
ebb8460ca3 Merge pull request #14 from AlignPixel/lite
Merge pull request #13 from AlignPixel/master
2024-08-01 10:45:26 +08:00
6 changed files with 77 additions and 11 deletions

BIN
.DS_Store vendored

Binary file not shown.

39
.github/workflows/python-app.yml vendored Normal file
View File

@ -0,0 +1,39 @@
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: Python application
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v3
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest pyinstaller
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Pyinstaller
run: |
pyinstaller -F desktop/se-verson.py
pyinstaller -F server-client/simple-verson.py

30
.github/workflows/translate.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: 'issue and discussion translator'
on:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
discussion:
types: [created, edited]
discussion_comment:
types: [created, edited]
pull_request_target:
types: [opened, edited]
pull_request_review_comment:
types: [created, edited]
jobs:
translate:
permissions:
issues: write
discussions: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: lizheming/github-translate-action@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
IS_MODIFY_TITLE: true
APPEND_TRANSLATION: true

View File

@ -1,5 +1,7 @@
![Pixel-Chat-App](https://repository-images.githubusercontent.com/832191338/b1042f2c-3c1a-4756-b061-732923b776cd) ![Pixel-Chat-App](https://repository-images.githubusercontent.com/832191338/b1042f2c-3c1a-4756-b061-732923b776cd)
<img src="/assets/logo-final-@1x.png" align="right" width="50px" />
# 💬 Pixel-Chat App # 💬 Pixel-Chat App
一个简单、快速、开源的Python即时聊天系统涵盖了多种聊天操作需求 一个简单、快速、开源的Python即时聊天系统涵盖了多种聊天操作需求
@ -34,7 +36,7 @@
###### 需要特殊/定制版本 ###### 需要特殊/定制版本
邮件联系[seventeen@ohdragonboi.cn](mailto:seventeen@ohdragonboi.cn)探讨您需要的内容,也许会需要您支付额外费用🤔 访问[此处](https://github.com/AlignPixel/Pixel-Chat-App/wiki/%E5%AE%9A%E5%88%B6%E6%82%A8%E7%9A%84%E7%89%88%E6%9C%AC)查看方法,并邮件探讨您需要的内容,也许会需要您支付额外费用🤔
### 🎈 贡献者列表 ### 🎈 贡献者列表

BIN
assets/logo-final-@1x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

View File

@ -14,7 +14,7 @@ class PyChattingServer:
self.__msg_handler = ChattingHandler() self.__msg_handler = ChattingHandler()
def start_session(self): def start_session(self):
print('已经上线用户可通过客户端输入IP进入\r\n') print('已经上线用户可通过客户端输入IP进入,输入.help可以调出命令列表\r\n')
input_thread_handler = threading.Thread(target=self.input_thread) input_thread_handler = threading.Thread(target=self.input_thread)
input_thread_handler.daemon = True input_thread_handler.daemon = True
input_thread_handler.start() input_thread_handler.start()
@ -44,7 +44,7 @@ class ChattingThread(threading.Thread):
def run(self): def run(self):
try: try:
print('连接来自于:', self.__caddr) print('-> 连接来自于:', self.__caddr)
if self.__msg_handler.is_blacklisted(self.__caddr[0]): if self.__msg_handler.is_blacklisted(self.__caddr[0]):
self.__handle_blacklisted() self.__handle_blacklisted()
return return
@ -124,7 +124,7 @@ class ChattingHandler:
self.__socket_to_user_name.pop(cs) self.__socket_to_user_name.pop(cs)
self.__user_name_to_broadcast_state.pop(nickname) self.__user_name_to_broadcast_state.pop(nickname)
nickname += " 离开了本聊天室" nickname += " 离开了本聊天室"
if nickname != "SOMEONE": # 说明是正常退出,一个防输出卡死机制,来自 boom hack 0x3299f if nickname != "SOMEONE": # 说明是正常退出,一个防输出卡死机制,来自 boom hack 0x3299f,除非你有更好的替代方案,请勿修改此项
self.broadcast_system_msg(nickname) self.broadcast_system_msg(nickname)
def handle_msg(self, msg, cs): def handle_msg(self, msg, cs):
@ -146,7 +146,7 @@ class ChattingHandler:
'success': True, 'success': True,
'msg': '昵称建立成功,输入/checkol可查看所有在线的人,输入/help可以查看帮助(所有首字符为/的消息都不会发送)' 'msg': '昵称建立成功,输入/checkol可查看所有在线的人,输入/help可以查看帮助(所有首字符为/的消息都不会发送)'
}), cs) }), cs)
self.broadcast_系统消息_msg(js['msg'] + "加入了聊天") self.broadcast_system_msg(js['msg'] + "加入了聊天")
else: else:
self.send_to(json.dumps({ self.send_to(json.dumps({
'type': 'login', 'type': 'login',
@ -226,7 +226,7 @@ class ChattingHandler:
self.__socket_list.append(cs) self.__socket_list.append(cs)
cs.sendall(bytes(msg, 'utf-8')) cs.sendall(bytes(msg, 'utf-8'))
def broadcast_系统消息_msg(self, msg): def broadcast_system_msg(self, msg):
data = '[ %s ]\r\n[ 系统消息 ] : %s' % (ctime(), msg) data = '[ %s ]\r\n[ 系统消息 ] : %s' % (ctime(), msg)
js = json.dumps({ js = json.dumps({
'type': '系统消息_msg', 'type': '系统消息_msg',
@ -272,11 +272,6 @@ class ChattingHandler:
print(f"IP {ip} 已经被手动移除") print(f"IP {ip} 已经被手动移除")
elif ip == '.banlist': elif ip == '.banlist':
print(self.__blacklist) print(self.__blacklist)
elif ip == '.help':
print("BAN: 封禁某个IP\r\n"\
"UNBAN: 解除封禁某个IP\r\n"\
"BANLIST: 查看封禁IP列表\r\n"\
"HELP: 查看操作帮助")
elif ip == '.an': elif ip == '.an':
user = input("请输入要发布的内容:") user = input("请输入要发布的内容:")
self.broadcast_system_msg(user) self.broadcast_system_msg(user)