- Source of resources
- Reprinted
- Copyright link
- https://www.mcbbs.net/thread-900823-1-1.html
- API
- 1.0.8
- Language
- Chinese(Simplified)
GeoIP
GeoIP可以查找您的玩家来自哪里
基于其公共IP和公共地理数据库
[LINE][/LINE]
GeoIP可以查找您的玩家来自哪里
基于其公共IP和公共地理数据库
[LINE][/LINE]
权限:
命令 | 权限 | 描述 | 默认 |
---|---|---|---|
/geoip | geoip.show | 显示玩家的物理IP位置 | OP |
/geoip | geoip.show.fullip | 显示玩家的完整IP地址 | false |
geoip.hide | 允许拥有权限geoip.show的玩家隐藏国家和城市 | false |
config.yml
YAML:
database:
show-cities: false
download-if-missing: true
# 国家网址
download-url: "https://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz"
# 城市网址
download-url-city: "https://geolite.maxmind.com/download/geoip/database/GeoLite2-City.tar.gz"
update:
enable: true
by-every-x-days: 30
show-on-login: true
# "enable-locale" 在地理定位显示上启用区域设置
enable-locale: true
# 并非所有语言都受支持, 请参阅 https://dev.maxmind.com/geoip/geoip2/web-services/#Languages
locale: en
此插件有一个API,你可以随意调用
示例:
Java:
import cn.nukkit.Player;
import cn.nukkit.Server;
import cn.wode490390.nukkit.geoip.GeoIP;
class Example {
Example() {
Player player = Server.getInstance().getPlayer("wode490390");
if (player != null) {
String geoLocation = GeoIP.query(player); //Our API :)
player.sendMessage("Your location: " + geoLocation);
}
}
}