Mojang-API-Monitor 1.0.0

dotnet add package Mojang-API-Monitor --version 1.0.0
                    
NuGet\Install-Package Mojang-API-Monitor -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Mojang-API-Monitor" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Mojang-API-Monitor" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Mojang-API-Monitor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Mojang-API-Monitor --version 1.0.0
                    
#r "nuget: Mojang-API-Monitor, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=Mojang-API-Monitor&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Mojang-API-Monitor&version=1.0.0
                    
Install as a Cake Tool

Mojang API 监控器

这是一个.NET Standard 2.0类库,用于监控Mojang API的状态。当玩家在Minecraft中遇到登录错误时,可以使用此工具检查是否为Mojang服务器的问题。

功能

  • 监控9个Mojang服务的状态
  • 检测服务是否在线
  • 测量响应时间
  • 将结果导出为JSON文件

监控的服务

# 服务名称 URL
1 Minecraft.net https://minecraft.net/
2 Session Minecraft http://session.minecraft.net/
3 Account Mojang http://account.mojang.com/
4 Auth Mojang https://auth.mojang.com/
5 Skins Minecraft http://skins.minecraft.net/
6 Authserver Mojang https://authserver.mojang.com/
7 Sessionserver Mojang https://sessionserver.mojang.com/
8 API Mojang https://api.mojang.com/
9 Textures Minecraft http://textures.minecraft.net/

项目结构

  • MojangApiMonitor/ - 主要类库项目
    • MojangService.cs - 表示一个Mojang服务及其状态
    • MojangApiStatus.cs - 表示所有Mojang服务的状态
    • MojangMonitor.cs - 核心功能类,负责检查服务状态
    • MojangApiMonitorExample.cs - 示例代码
  • MojangApiMonitorTest/ - 控制台应用程序,用于测试类库

使用方法

安装

将此项目添加为您的项目的引用。

基本用法

// 创建监控器实例
var monitor = new MojangMonitor();

// 检查所有服务的状态
var status = await monitor.CheckServicesStatusAsync();

// 导出结果到JSON文件
monitor.ExportToJson(status, "mojang_status.json");

JSON输出格式

{
  "services": [
    {
      "name": "Minecraft.net",
      "url": "https://minecraft.net/",
      "display_url": "https://minecraft.net",
      "status": "ONLINE",
      "last_checked": "2025-05-29T16:41:41.0165483Z",
      "response_time_ms": 3249
    },
    // 其他服务...
  ],
  "timestamp": "2025-05-29T16:41:37.7543238Z"
}

构建项目

使用Visual Studio或dotnet CLI构建项目:

dotnet build

运行测试程序

dotnet run --project MojangApiMonitorTest/MojangApiMonitorTest.csproj

依赖项

  • .NET Standard 2.0
  • Newtonsoft.Json (13.0.3+)

许可证

基于MIT许可证提供

免责声明

本项目不隶属于Mojang Studios或Microsoft。Minecraft、Mojang是Mojang Studios的商标。

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 139 5/29/2025

1. 添加了Mojang API状态监控功能。
     2. 添加了玩家登录错误检测功能。
     3. 添加了API响应时间监控功能。
     4. 添加了API可用性监控功能。
     5. 添加了API错误监控功能。