diff --git a/AutoLoad.cs b/AutoLoad.cs index 05aafe5..09e425d 100644 --- a/AutoLoad.cs +++ b/AutoLoad.cs @@ -8,7 +8,7 @@ public partial class AutoLoad : Node internal int port=1145; internal int popup=0; internal bool is_connection_lost=false; - internal string version="v2024.1.8"; + internal string version="v2024.3.3"; public override void _Ready() { } diff --git a/ChatRoom/ChatRoom.cs b/ChatRoom/ChatRoom.cs index ac3b9b8..e46b4db 100644 --- a/ChatRoom/ChatRoom.cs +++ b/ChatRoom/ChatRoom.cs @@ -25,11 +25,15 @@ public override void _Ready() { Rpc("Joined",autoload.name,Multiplayer.MultiplayerPeer.GetUniqueId()); RpcId(MultiplayerPeer.TargetPeerServer,"SyncFromServer",Multiplayer.MultiplayerPeer.GetUniqueId()); - if (OS.GetName()=="Windows" ||OS.GetName()=="macOS"||OS.GetName()=="Linux") + //if (OS.GetName()=="Windows" || OS.GetName()=="macOS" || OS.GetName()=="Linux") + if (OS.HasFeature("pc")) { - RpcId(MultiplayerPeer.TargetPeerServer,"Sha256Check",Multiplayer.MultiplayerPeer.GetUniqueId(),FileAccess.GetSha256(OS.GetExecutablePath()),OS.GetName()); + RpcId(MultiplayerPeer.TargetPeerServer,"Sha256Check",Multiplayer.MultiplayerPeer.GetUniqueId(),FileAccess.GetSha256(OS.GetExecutablePath()),OS.GetName(),OS.HasFeature("64"),OS.HasFeature("32"),OS.HasFeature("x86"),OS.HasFeature("arm"),OS.HasFeature("riscv"),OS.HasFeature("ppc"),OS.HasFeature("wasm")); + } + else + { + RpcId(MultiplayerPeer.TargetPeerServer,"VersionCheck",Multiplayer.MultiplayerPeer.GetUniqueId(),autoload.version); } - RpcId(MultiplayerPeer.TargetPeerServer,"VersionCheck",Multiplayer.MultiplayerPeer.GetUniqueId(),autoload.version); } SendSystemMessage(autoload.name+TranslationServer.Translate("locJoined")); Rpc("SendSystemMessage",autoload.name+TranslationServer.Translate("locJoined")); @@ -135,7 +139,11 @@ internal void ClientDisconnected(int id,string name,int normal) [Rpc(MultiplayerApi.RpcMode.AnyPeer)] internal void SendMessage(int peer,string name,string time,string message) { - GetNode("AudioStreamPlayer").Play(); + if (peer != Multiplayer.MultiplayerPeer.GetUniqueId()) + { + DisplayServer.WindowRequestAttention(); + GetNode("AudioStreamPlayer").Play(); + } GD.Print(name+"("+peer.ToString()+")"+": "+message); var ins=message_packed.Instantiate(); ins.id=message_id_next; @@ -241,9 +249,9 @@ internal void SetMemberList(Dictionary member_lista) member_list=member_lista; } [Rpc(MultiplayerApi.RpcMode.AnyPeer)] - internal void Sha256Check(int peer,string sha256,string os) + internal void Sha256Check(int peer,string sha256,string os,bool x64,bool x32,bool x86,bool arm,bool riscv,bool ppc,bool wasm) { - if (os==OS.GetName() && sha256 != FileAccess.GetSha256(OS.GetExecutablePath())) + if (os == OS.GetName() && OS.HasFeature("64") == x64 && OS.HasFeature("32") == x32 && OS.HasFeature("x86") == x86 && OS.HasFeature("arm") == arm && OS.HasFeature("riscv") == riscv && OS.HasFeature("ppc") == ppc && OS.HasFeature("wasm") == wasm && sha256 != FileAccess.GetSha256(OS.GetExecutablePath())) { RpcId(peer,"Sha256DoesntMatch"); } diff --git a/Locale/Locale.csv b/Locale/Locale.csv index 985dba8..9abd1da 100644 --- a/Locale/Locale.csv +++ b/Locale/Locale.csv @@ -30,5 +30,5 @@ locDelete;Delete;刪除;删除;削除 locRemoveMember;Remove;移出;移出;除去 locYouWasRemoved;You was removed from the\nChat Room by the Host;你被主机移出了聊天室;你被主機移出了聊天室;あなたは司会者にチャットルーム\nから除去されました locConnectionLost;Connection Lost;连接已丢失;連線已丟失;接続が失われました -locSha256DoesntMatch;Sha256 doesn't match with Host\nMake sure you are using the\nsame version as Host;与主机的 Sha256 不匹配\n请确保你使用的是与主机相同的版本;與主機的 Sha256 不匹配\n請確保你是用的是與主機相同的版本;Sha256とホストの不一致\nホストと同じバージョンを使用していることを確認します -locVersionDoesntMatch;Version doesn't match with Host\nMake sure you are using the\nsame version as Host;与主机的版本号不匹配\n请确保你使用的是与主机相同的版本;與主機的版本號不匹配\n請確保你是用的是與主機相同的版本;バージョン番号の不一致\nホストと同じバージョンを使用していることを確認してく \ No newline at end of file +locSha256DoesntMatch;Sha256 doesn't match with Host\nMake sure you are using the\nsame version as Host;与主机的 Sha256 不匹配\n请确保你使用的是与主机相同的版本;與主機的 Sha256 不匹配\n請確保你是用的是與主機相同的版本;Sha256とホストの不一致\nホストと同じバージョンを\n使用していることを確認します +locVersionDoesntMatch;Version doesn't match with Host\nMake sure you are using the\nsame version as Host;与主机的版本号不匹配\n请确保你使用的是与主机相同的版本;與主機的版本號不匹配\n請確保你是用的是與主機相同的版本;バージョン番号の不一致\nホストと同じバージョンを\n使用していることを確認してく \ No newline at end of file diff --git a/Locale/Locale.en.translation b/Locale/Locale.en.translation index fabbd24..f853ede 100644 Binary files a/Locale/Locale.en.translation and b/Locale/Locale.en.translation differ diff --git a/Locale/Locale.ja.translation b/Locale/Locale.ja.translation index fc245bf..bc441a3 100644 Binary files a/Locale/Locale.ja.translation and b/Locale/Locale.ja.translation differ diff --git a/Locale/Locale.zh_CN.translation b/Locale/Locale.zh_CN.translation index 934a32b..5d2e932 100644 Binary files a/Locale/Locale.zh_CN.translation and b/Locale/Locale.zh_CN.translation differ diff --git a/Locale/Locale.zh_TW.translation b/Locale/Locale.zh_TW.translation index f39534e..7897a67 100644 Binary files a/Locale/Locale.zh_TW.translation and b/Locale/Locale.zh_TW.translation differ diff --git a/README.md b/README.md index b4a236c..9be3cce 100644 --- a/README.md +++ b/README.md @@ -25,5 +25,7 @@ MIT License - [x] Add Version Check - [x] Add Sha256 Check - [x] Add Installer +- [x] Taskbar alert when received new message +- [ ] Roll to bottom when received new message - [ ] Sending Image - [ ] ~~Sending Files~~ Use [LocalSend](https://localsend.org) instead \ No newline at end of file diff --git a/WindowsInstaller_x86_32.iss b/WindowsInstaller_x86_32.iss index 7a352d6..d25424a 100644 --- a/WindowsInstaller_x86_32.iss +++ b/WindowsInstaller_x86_32.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "LocalChat" -#define MyAppVersion "2024.1.8" +#define MyAppVersion "2024.3.3" #define MyAppPublisher "SheepYhangCN" #define MyAppURL "https://github.com/SheepYhangCN/LocalChat" #define MyAppExeName "LocalChat.exe" diff --git a/WindowsInstaller_x86_64.iss b/WindowsInstaller_x86_64.iss index 905492b..0a3ec6e 100644 --- a/WindowsInstaller_x86_64.iss +++ b/WindowsInstaller_x86_64.iss @@ -2,7 +2,7 @@ ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! #define MyAppName "LocalChat" -#define MyAppVersion "2024.1.8" +#define MyAppVersion "2024.3.3" #define MyAppPublisher "SheepYhangCN" #define MyAppURL "https://github.com/SheepYhangCN/LocalChat" #define MyAppExeName "LocalChat.exe" diff --git a/export_presets.cfg b/export_presets.cfg index dae1b0c..da94ca4 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -35,8 +35,8 @@ application/modify_resources=true application/icon="" application/console_wrapper_icon="" application/icon_interpolation=4 -application/file_version="2024.1.8" -application/product_version="2024.1.8" +application/file_version="2024.3.3" +application/product_version="2024.3.3" application/company_name="SheepYhangCN" application/product_name="LocalChat" application/file_description="An application that allows you to chat with others in LAN." @@ -101,8 +101,8 @@ application/modify_resources=true application/icon="" application/console_wrapper_icon="" application/icon_interpolation=4 -application/file_version="2024.1.8" -application/product_version="2024.1.8" +application/file_version="2024.3.3" +application/product_version="2024.3.3" application/company_name="SheepYhangCN" application/product_name="LocalChat" application/file_description="An application that allows you to chat with others in LAN." @@ -159,7 +159,7 @@ architectures/arm64-v8a=false architectures/x86=false architectures/x86_64=true version/code=1 -version/name="2024.1.8" +version/name="2024.3.3" package/unique_name="com.sheepyuhang.localchat" package/name="LocalChat" package/signed=true @@ -364,7 +364,7 @@ architectures/arm64-v8a=true architectures/x86=false architectures/x86_64=false version/code=1 -version/name="2024.1.8" +version/name="2024.3.3" package/unique_name="com.sheepyuhang.localchat" package/name="LocalChat" package/signed=true @@ -539,3 +539,132 @@ permissions/write_user_dictionary=false dotnet/include_scripts_content=false dotnet/include_debug_symbols=true dotnet/embed_build_outputs=false + +[preset.4] + +name="Linux/X11 x86_64" +platform="Linux/X11" +runnable=true +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Exports/LocalChat/LocalChat_Linux_x86_64/LocalChat.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.4.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false + +[preset.5] + +name="Linux/X11 x86_32" +platform="Linux/X11" +runnable=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Exports/LocalChat/LocalChat_Linux_x86_32/LocalChat.x86_32" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.5.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="x86_32" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false + +[preset.6] + +name="Linux/X11 arm64" +platform="Linux/X11" +runnable=false +dedicated_server=false +custom_features="" +export_filter="all_resources" +include_filter="" +exclude_filter="" +export_path="../Exports/LocalChat/LocalChat_Linux_arm64/LocalChat.arm64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false + +[preset.6.options] + +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=true +texture_format/bptc=true +texture_format/s3tc=true +texture_format/etc=false +texture_format/etc2=false +binary_format/architecture="arm64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" +dotnet/include_scripts_content=false +dotnet/include_debug_symbols=true +dotnet/embed_build_outputs=false