mirror of
https://github.com/AlignPixel-Dev/Pixel-Chat-App.git
synced 2025-07-07 08:37:00 +08:00
Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
63aea9f91c | |||
4cd862183b |
6
.idea/inspectionProfiles/profiles_settings.xml
generated
6
.idea/inspectionProfiles/profiles_settings.xml
generated
@ -1,6 +0,0 @@
|
||||
<component name="InspectionProjectProfileManager">
|
||||
<settings>
|
||||
<option name="USE_PROJECT_PROFILE" value="false" />
|
||||
<version value="1.0" />
|
||||
</settings>
|
||||
</component>
|
4
.idea/misc.xml
generated
4
.idea/misc.xml
generated
@ -1,4 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.12" project-jdk-type="Python SDK" />
|
||||
</project>
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
59
.idea/workspace.xml
generated
59
.idea/workspace.xml
generated
@ -1,59 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="AutoImportSettings">
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="7e072936-42bd-40bd-986b-5e8a7b6b42ab" name="更改" comment="更新了安全命令,修复了一个服务端交互问题" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitHubPullRequestSearchHistory"><![CDATA[{
|
||||
"lastFilter": {
|
||||
"state": "OPEN",
|
||||
"assignee": "FrederickBun"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="GithubPullRequestsUISettings"><![CDATA[{
|
||||
"selectedUrlAndAccountId": {
|
||||
"url": "https://github.com/AlignPixel/Pixel-Chat-App.git",
|
||||
"accountId": "0284ff40-abc5-4cf0-9b08-d15211eef50e"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="ProjectColorInfo">{
|
||||
"associatedIndex": 0
|
||||
}</component>
|
||||
<component name="ProjectId" id="2kHhADg8uMNyRHttZUg04VcxrPn" />
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"git-widget-placeholder": "dev"
|
||||
}
|
||||
}]]></component>
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-python-sdk-975db3bf15a3-31b6be0877a2-com.jetbrains.pycharm.community.sharedIndexes.bundled-PC-241.18034.82" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="应用程序级" UseSingleDictionary="true" transferred="true" />
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="默认任务">
|
||||
<changelist id="7e072936-42bd-40bd-986b-5e8a7b6b42ab" name="更改" comment="更新了安全命令,修复了一个服务端交互问题" />
|
||||
<created>1722946264814</created>
|
||||
<option name="number" value="Default" />
|
||||
<option name="presentableId" value="Default" />
|
||||
<updated>1722946264814</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
</project>
|
@ -1,7 +1,5 @@
|
||||

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