【服务器端】RankMe Kento Edition插件的web端使用教程

注意:本文主要面对那些使用了RankMe Kento Edition插件,Centos7系列系统下,并且希望在web端显示用户数据信息的服务器主。Web端读取游戏端RankMe插件数据的前提,是游戏端已安装了Mysql。


  1. 插件介绍及下载地址:
    [CS:GO] RankMe Kento Edition (3.0.3.Kento.25 | 2017-4-4)
  2. Web Interface

注意:插件平台sourcemod+metamod的安装不在本文的讨论中,我将视情况决定是否写一个插件平台安装教程


游戏服务器端的设置原文

Install

  1. Upload smx and translation files to your server.
  2. Plugin will auto crate config file “cfg/sourcemod/kento_rankme.cfg”.
  3. If you want to use mysql, change “rankme_mysql” to 1, and add this in your databases.cfg
    Code:
    "rankme" 
     {        
      "driver"  "mysql"        
      "host"   "your_host"  //填入你的游戏服务器ip      
      "database"  "hello"
      "user"   "pig"        
      "pass"   "123456"        
      //"timeout"   "0"
      "port"   "3306" 
     }
  4. If mysql is not working for you, please check sourcemod extention “dbi.mysql.ext” is working or not.

简要中文翻译

  1. 将smx插件放入addons/sourcemod/plugins目录中
  2. 插件会自动生成”cfg/sourcemod/kento_rankme.cfg”文件
  3. 修改kento_rankme.cfg文件中的”rankme_mysql” 的值为1(默认值为0)
  4. 在addons/sourcemod/configs中的databse.cfg文件中加入
"rankme"
 {        
  "driver"  "mysql"        
  "host"   "your_host"  //填入你的游戏服务器ip (也就是你安装了mysql的游戏服务器ip)     
  "database"  "hello"
  "user"   "pig"        
  "pass"   "123456"        
  //"timeout"   "0"
  "port"   "3306" 
 }
注意:我推荐大家使用mysql,这样在安装web端时将会有极大的便利,而且数据可以不用再从sqlite导出至mysql。

Centos7安装Mysql(注意centos7系统中的mysql不叫mysql,而叫做MariaDB)

安装步骤:

  1. # yum install mariadb-server -y
  2. # systemctl start mariadb.service
  3. # systemctl enable mariadb.service
  4. # mysql
  5. 创建插件所需的数据库,我这里以创建名为hello的数据库为例

Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.44-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the current input statement. MariaDB [(none)]>

附录:mysql的相关命令(资料1资料2

  • 查看当前数据库:SHOW DATABASES ;(注意后面的分号;)
  • 创建新数据库:CREATE DATABASE hello;
  • 创建用户:CREATE USER ‘pig’@’%’ IDENTIFIED BY ‘123456’;(表示创建一个叫pig的用户,任意远程主机登陆,密码是123456)
  • 用户授权:GRANT ALL ON *.* TO ‘pig’@’%’;(表示赋予用户pig对所有数据库的操作权限)

Web interface配置,以rankme web 2016 PHP 7 / mysqli fix by de_suspect为例

  1. 修改rankmeweb-mysqli/bd.php,在其中修改为

$bd_user = “pig”; // DATABASE USER
$bd_password = “123456”;// DATABASE PASS
$bd = “hello”;// DATABASE
$host = “游戏服务器ip”; // DATABASE HOST

2.修改rankemeweb-mysqli/config.php,在其中修改为

$sqlite_server = false; // ARE YOUR SERVER RUNNING THE PLUGIN AS SQLITE?

//(IF THE PLUGIN IS RUNNING AS MYSQL, PUT BELOW THE DATA FOR CONNECTING TO THE DATABASE THAT IS BEING USED BY THE PLUGIN)
$bd_user = “pig”; // DATABASE USER
$bd_password = “123456”;// DATABASE PASS
$bd = “hello”;// DATABASE
$host = “游戏服务器ip”; // DATABASE HOST
$bd_table = “rankme”; // DATABASE TABLE BEING USED AT THE PLUGIN. (rankme_sql_table cvar). Default: rankme.

$ftp_server = “游戏服务器ip”; //FTP HOST
$ftp_user_name = ” “; // FTP USER NAME
$ftp_user_pass = “”; // FTP PASS
$ftpDIR = “/home/serverfiles/csgo”; // CSTRIKE FOLDER ON FTP

3.完毕后将rankemeweb-mysqli文件夹内的所有文件上传至web服务器即可


整个教程完毕,如有问题,欢迎留言。

我不当学长

CS:GO娱乐玩家,乐于为爱好CS:GO的朋友提供各种有价值的教程~

You may also like...