/MotdCLI

基于NET Framework 4.7.2的命令行式Motd获取工具

Primary LanguageC#MIT LicenseMIT

Motd

基于NET Framework 4.7.2的命令行式Motd获取工具

实现参考:

Minecraft BedrockEdition Server Motd - 我的世界基岩版服务器Motd协议的API封装
MCServerPinger - A light weight project to read the motd of a minecraft sever
MCBE下基于UDP的RakNet通讯协议原理略谈及利用Python.Socket实现状态查询

许可证

MIT license

使用方法

通过使用cmd或作为子进程运行

Motd.exe <tcp|udp> <ip> [port]

port为空时,根据协议类型自动选择2556519132

使用示例

  • 在服务器中通过编写相应插件调用来获取其他服务器信息
  • 作为面板的外接功能
  • 搭配nonebot2食用搭建自己的服务器状态查询机器人

返回示例

>Motd.exe udp 127.0.0.1
MCPE;Dedicated Server;503;1.18.33;0;10;12578007761032183218;Bedrock level;Survival;1;19132;19133;
>Motd.exe tcp MinecraftOnline.com
{"description":{"text":"§bMinecraftOnline§f - §6Home of Freedonia§r\n§3Survival, Without the Grief!"},"players":{"max":120,"online":1,"sample":[{"id":"a4740a2c-1eec-4b7d-9d22-1c861e7045d7","name":"Biolord101"}]},"version":{"name":"1.12.2","protocol":340},"favicon":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAFo0lEQVR42u2bbWxTVRiAF8KP0XWl\n69puHWPXdt0XLRvdoFvZXPfp2IeVydyYSPmYS2OWbcnEAANNDAaIQWBB8TNjjQrDIToVBmhk6hDw\nB1li/GHiD2M0mmgkxvjD+OP1vU3P4ZwLvbW0WxDOSZ792e0973nO6dv3ntMmJYkmmmjz2ZJXuxYj\n+gSy8P8m4DoCCcQrBAgBd/aAsxGJkLq24Q8ECNrWGp4WL6Q0V0dEeX3KA1Wd7P2ry8xSi0tPCTRl\nSn0tFpYF8y3ge3bGin+cAdf1a5SiS+9y2D95E6xn3ohIwfQ4d73+sbXcikABgAOnoADAQbPohQAh\nYG4HnI+UMPzEBlhw6SQUXZuk5E4c5ZDeOgjZo/sjYp8ag8LP36Gk9/sh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2UeM+y8RZePvUPGx8K+IH9/+2c/Eyq7RgpT2ef\n2yhxWV4eIDvDyk+FjV5TXIVQtNPpuLfFhQAhwHU4nGhCGDzOP40VDiA0us2w1m2gPNW+BIYfyaaU\nLNV8jYOYJeCgOTZUm37tbcwAQivWDZUFqRR3bsogvq6EQfsfcsIsQ2pCT4Mx6Gl2BuWg2RmUE9l8\n7gjNexMC7jUBGJQD8RK6q4yzj95vBAK+hzlQwBUMcppBG+X+/WGpIfpbLb/s7loKBN/KtNBhCKH0\nPs0A+/2EaPdPhADudFYOip0hOVEpZkiKs7+YTobkxCgECAFz2Do86ZPs+by85zfQZqGsztdexCAm\nGcxxChgMSw+BeeVn9vsJck6QEyMhXCf4GDQJFRD1GyJzPAPzvQKFACHgZgGDSJCAAoLs+TySM8cC\nBsOJMYRcJ8jFEkF+dpAfoBikpLu5RatE5R9JCAFCgBBwVwvQInoCCtDLvwphWJAkmmiiRWr/AkzE\nQT5fo+0xAAAAAElFTkSuQmCC"}

正常获取到信息时退出返回0,否则返回1

TODO

  • 基岩版专属服务器
  • Java服务器
  • ipv6