diff --git a/README.md b/README.md index 93bc19a..6c73d46 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,60 @@ -# EasyiterGame -基于easytier的简易游戏联机客户端 +# [EasyTier游戏联机启动器](https://github.com/EasyTier/EasytierGame) -1. 开发环境如何运行 - 拉取仓库,使用命令行 pnpm install 安装包 - 安装完成后, 使用 pnpm tauri dev 进行rust编译 等待启动 +## 简介 + +EasyTierGame游戏联机启动器,由`nuxt3` `typescript` `rust` `tauri` 开发 +具有简易的界面,附带最新版easytier内核,联机游玩的时候无论是心理上和使用上都能给予您最舒服的体验,同时支持自定义配置文件启动,满足各种需求 + +## 下载 + +Github +Releases: [https://github.com/EasyTier/EasytierGame/releases](https://github.com/EasyTier/EasytierGame/releases) + +- 只有绿色zip包,个人不喜欢安装包各种写注册表,解压即用就行,目录清爽干净 + +![game-step1](/assets/game-step1.png) + + +## 使用教程 + +- 第一次使用,输入一个“主机名”点击启动联机即可,后续可以自建服务器或者使用爱心群友提供的服务器 + ![game-step2](/assets/game-step2.png) + +![game-step3](/assets/game-step3.png) + +- 高级选项里有一些特殊配置,可以自行选择 + ![game-step4](/assets/game-step4.png) + +- 如果还是无法满足您的需求,可以使用配置文件进行启动,具体如何配置,可以查看文档[配置文件](/guide/network/config-file.html) + ![game-step5](/assets/game-step5.png) + +- easytier内核升级后,可以点击更新插件按钮就可以进行更新,但是需要出国,如果无法更新,可以在群里获取 + ![game-step6](/assets/game-step6.png) + +- 1.1.4更新了 配置分享功能 可以与朋友之间分享配置,方便联机 + + +![game-step7](/assets/game-step7.png) + +- 1.1.5 合并额外插件于 "增强工具" 窗口 新增了网卡跃点设置 关闭防火墙功能 ping功能 +![game-step8](/assets/game-step8.png) + +![game-step9](/assets/game-step9.png) + +## 特性 + +- 基于easytier组网工具开发,界面清晰简单 +- 自带“更新”按钮,在easytier组网工具发布新版本时,点击更新即可(需要出国工具) +- 第一次使用,输入一个“主机名”点击启动联机即可,后续可以自建服务器或者使用群友的服务器 +- 配置简单,也含有高级功能,同时也支持自定义配置文件启动 +- 默认开启 **WinIPBroadcast** 不再怕联机找不到房间(例如:无主之地3) +- 已经测试 **艾尔登法环学习版**,**无主之地3**,**深岩银河**,**怪物猎人世界** 等都可稳定联机游玩 + +## 系统支持 + +支持Windows 11 、Windows 10 、 Windows 7 + + + +## 请不要将本程序和仓库代码用于任何违法用途,由此产生的一切后果,仓库所有者和参与开发的人员不承担任何责任 -2. 生产环境发布 - 执行 pnpm tauri build - 产物位于 src-tauri/target/release 下 easytier-game.exe diff --git a/assets/game-step8.png b/assets/game-step8.png new file mode 100644 index 0000000..71c4f0b Binary files /dev/null and b/assets/game-step8.png differ diff --git a/assets/game-step9.png b/assets/game-step9.png new file mode 100644 index 0000000..04a0d43 Binary files /dev/null and b/assets/game-step9.png differ diff --git a/composables/netcard.ts b/composables/netcard.ts new file mode 100644 index 0000000..53386fa --- /dev/null +++ b/composables/netcard.ts @@ -0,0 +1,48 @@ +import { invoke } from "@tauri-apps/api/core"; +import { Command } from "@tauri-apps/plugin-shell"; +import { ElMessage, type TabPaneName } from "element-plus"; +import useMainStore from "@/stores/index"; + +const getWinIpBroadcastPid = async () => { + const mainStore = useMainStore(); + const pid = await invoke("search_pid_by_pname", { target_process_name: "WinIPBroadcast" }); + mainStore.winipBcPid = (pid as number) || 0; + if (mainStore.winipBcPid && mainStore.winipBcPid > 0) { + mainStore.winipBcStart = true; + mainStore.winIpBcAutoStart = true; + } else { + mainStore.winipBcStart = false; + mainStore.winIpBcAutoStart = false; + } +}; + +export const handleWinipBcStart = async () => { + const mainStore = useMainStore(); + if (!mainStore.winipBcStart) { + try { + await invoke("stop_command", { child_id: mainStore.winipBcPid || 0 }); + const child = await Command.create("WinIPBroadcast", ["run"]).spawn(); + mainStore.winipBcPid = child.pid || 0; + if (mainStore.winipBcPid) { + mainStore.winipBcStart = true; + } else { + ElMessage.error(`启动失败`); + } + } catch (err) { + ElMessage.error(`启动失败`); + console.log(err); + } + } else { + await invoke("stop_command", { child_id: mainStore.winipBcPid || 0 }); + await getWinIpBroadcastPid(); + } +}; + +export const initStartWinIpBroadcast = async () => { + const mainStore = useMainStore(); + await getWinIpBroadcastPid(); + // console.log(mainStore.winipBcStart, mainStore.winIpBcAutoStart) + if (!mainStore.winipBcStart && mainStore.winIpBcAutoStart) { + await handleWinipBcStart(); + } +}; \ No newline at end of file diff --git a/package.json b/package.json index 0048266..c0a3ad3 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "private": true, "author": "leizi97", "description": "A simple network initiator based on Easytier", - "version": "1.1.4", + "version": "1.1.5", "scripts": { "dev": "nuxt dev --dotenv env/.env.dev --host 0.0.0.0", "build": "nuxt generate --dotenv env/.env.prod" diff --git a/pages/index.vue b/pages/index.vue index 389098d..8cb5148 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -22,7 +22,7 @@ v-if="!data.coreVersion" @click="getCoreVersion(true)" > - 获取工具版本 + 获取内核版本 - {{ data.coreVersion ? "更新插件" : "下载插件" }} + {{ data.coreVersion ? "更新内核" : "下载内核" }} @@ -261,34 +261,23 @@
- - WinIPBroadcast - - - - - + :icon="MagicStick" + @click="handleShowToolDialog" + > + 增强工具 +
- 主页 + EasytierGame主页
@@ -383,9 +372,10 @@ import { invoke } from "@tauri-apps/api/core"; import { listen } from "@tauri-apps/api/event"; import { open, Command } from "@tauri-apps/plugin-shell"; - import { QuestionFilled, Delete, List, UserFilled, Setting, Share, RefreshRight, Link, Tools } from "@element-plus/icons-vue"; + import { QuestionFilled, Delete, List, UserFilled, Setting, Share, RefreshRight, Link, Tools, MagicStick } from "@element-plus/icons-vue"; import { reactive, onBeforeUnmount, onMounted } from "vue"; import { useTray, setTrayRunState, setTrayTooltip } from "~/composables/tray"; + import { initStartWinIpBroadcast } from "~/composables/netcard"; import useMainStore from "@/stores/index"; import { ElDropdownMenu, ElMessage, ElMessageBox } from "element-plus"; import { getCurrentWindow } from "@tauri-apps/api/window"; @@ -412,6 +402,7 @@ logVisible: false, cidrVisible: false, advanceVisible: false, + toolVisible: false, winipBcPid: 0, //WinIPBroadcast进程id winipBcStart: false, memberVisible: false, @@ -575,44 +566,6 @@ data.releaseList = list as never[]; }; - const getWinIpBroadcastPid = async () => { - const pid = await invoke("search_pid_by_pname", { target_process_name: "WinIPBroadcast" }); - data.winipBcPid = (pid as number) || 0; - if (data.winipBcPid && data.winipBcPid > 0) { - data.winipBcStart = true; - } else { - data.winipBcStart = false; - } - }; - - const handleWinipBcStart = async () => { - if (!data.winipBcStart) { - try { - await invoke("stop_command", { child_id: data.winipBcPid || 0 }); - const child = await Command.create("WinIPBroadcast", ["run"]).spawn(); - data.winipBcPid = child.pid || 0; - if (data.winipBcPid) { - data.winipBcStart = true; - } else { - ElMessage.error(`启动失败`); - } - } catch (err) { - ElMessage.error(`启动失败`); - console.log(err); - } - } else { - await invoke("stop_command", { child_id: data.winipBcPid || 0 }); - await getWinIpBroadcastPid(); - } - }; - - const initStartWinIpBroadcast = async () => { - await getWinIpBroadcastPid(); - if (!data.winipBcStart) { - await handleWinipBcStart(); - } - }; - const handleAutoStart = async () => { let is_enable = await tauriAutoStart.isEnabled(); if (!config.autoStart && !is_enable) { @@ -982,4 +935,23 @@ } ); }; + + const handleShowToolDialog = async () => { + await etWindows( + "tool", + { + title: "增强工具", + width: 460, + height: 480, + resizable: true, + url: "#/tool" + }, + (_, appWindow) => { + data.toolVisible = true; + }, + () => { + data.toolVisible = false; + } + ); + }; diff --git a/pages/member.vue b/pages/member.vue index cc73aa1..7dce83d 100644 --- a/pages/member.vue +++ b/pages/member.vue @@ -4,10 +4,13 @@ {{ "等待成员信息中..." }}