From c234b76e78d72f69ff5058e19bc741eb5f9b79f8 Mon Sep 17 00:00:00 2001 From: Snowflake Date: Mon, 8 Jun 2026 13:28:49 +0800 Subject: [PATCH] Fixed bugs. --- src/server_status_detector.rb | 2 +- src/updates.rb | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/server_status_detector.rb b/src/server_status_detector.rb index 743e8fb..3375d52 100644 --- a/src/server_status_detector.rb +++ b/src/server_status_detector.rb @@ -61,7 +61,7 @@ module ServerStatusDetector class MinecraftServer < TcpServer # rubocop:disable Metrics/MethodLength # @return [Hash{Symbol=>Boolean, Symbol=>Array, Symbol=>String}] - def self_diag + def self.self_diag res = test_port('127.0.0.1', 25_565) unless res[:error].nil? diff --git a/src/updates.rb b/src/updates.rb index ea72974..08444a7 100644 --- a/src/updates.rb +++ b/src/updates.rb @@ -20,15 +20,15 @@ require 'uri' # @type const RELEASE_SERIAL_CODE: String RELEASE_SERIAL_CODE = 'b2baee0' # @type const CHANNEL: String -CHANNEL = 'master' +CHANNEL = 'dev' # @type const VERSION_LIST_URL: String -VERSION_LIST_URL = "https://raw.giteeusercontent.com/SCU_team/mine-sentinel/#{CHANNEL}/APP_VERSIONS_LIST" +VERSION_LIST_URL = "https://gitee.com/api/v5/repos/SCU_team/mine-sentinel/contents/APP_VERSIONS_LIST?ref=#{CHANNEL}" # @type const RECURSIVE_RETRY_DEPTH: Integer RECURSIVE_RETRY_DEPTH = 3 class UpdateManager # rubocop:disable Metrics/MethodLength - # @return [String] + # @return [String, nil] def self.fetch MethodExecutor.record('debug', 'updates', "Fetching version list from #{VERSION_LIST_URL}") uri = URI(VERSION_LIST_URL) @@ -42,6 +42,7 @@ class UpdateManager end rescue StandardError => e MethodExecutor.record('error', 'updates', "Failed to fetch version list: #{e}") + nil end # rubocop:enable Metrics/MethodLength