搜索
查看: 30912|回复: 93

[技术类]快速建立windows下的排行榜 Psychostats2.3.1 -投机取巧篇

[复制链接]
发表于 2005-7-6 14:42:28 | 显示全部楼层 |阅读模式 来自 中国–北京–北京
声明:文档中的很多内容都是引用的SongSong的原创文章"[技术类][原创讲义]:Psychostats2.2.b调试、安装、使用帮助[国内首发] "http://www.dt-club.net/showthread.php?t=14826,而且SongSong为PS提供了中文语言包,再加上最初本人也是收益于该原创文章,所以特别声明表示感谢 :D

1. Ps2.3.1和Ps2.2的区别
     使用方法上都相同,Ps2.3.1对Mysql数据库中的表进行了优化,将Ps记录统计到的玩家的概括信息和Player登陆排行榜的密码和个性设置分别存储在两个数据表中.而在Ps2.2中是存储在一个plr表中.
     在Ps2.3.1中
数据表plr记录了Ps统计到的所有玩家的基本信息 数据表plr_profile记录了开通登陆权限的玩家的密码、accesslevel 个人签名、头像等信息,这样的结构改变的好处是节省数据库存储空间和提供了单独保存具有登陆权限的玩家的数据的方法.适合我这样基本不会数据库的初级选手.

2. 建立windows下的Ps2.3排行榜需要的软件
1. ActivePerl 下载地址自己找吧,我没记录下.
2. PsychoStats 2.3.1
http://www.psychostats.com/getfile/psychostats2.3.1.zip
3.EasyAPM-Server 1.2.3 集成了下列组件,最新版本是2.0.1
   Apache v1.3.33 (Win32) mod_gzip v1.3.26.1a
   PHP v4.3.10 (Win32)
   Zend Optimizer v2.5.10 (Win32)
   MySQL v4.0.24 (Win32)
   phpMyAdmin v2.6.2-pl1
http://www.micronsky.net/easyapm/easyapm_v1.2.3.exe

3. 安装过程

3.1 先安装EasyAPM-Server套件,跟普通安装程序没什么区别,略过安装步骤,安装完以后,你的windows Pc就会自动运行Apache和Mysql服务了.

3.2 安装ActivePerl(引用SongSong的)
安装后开始/程序/ActiveSate ActivePerl5.8/Perl Package Manager执行
ppm> install TermReadKey
耐心等待完成,然后
ppm> install DBI
耐心等待完成,然后
ppm> install DBD-mysql
耐心等待完成,然后
ppm> quit

3.3 安装PsyChostats2.3.1第一步,其实就是解压的过程,解压的目录不要是web可以访问到的,否则会不安全.

3.4 安装PsyChostats2.3.1 (引用SongSong的步骤,少许修改)

执行安装程序
通过附件/命令提示符进入DOS模式,例如到D:\ps2.3下执行install.pl -resetdb -profiles (第一次安装需要加上参数,是Ps2.3.1的bug,否则安装后的数据库会缺少plr_profile表,如果不能运行,请在windows下把pl和安装的ActivePerl进行关联,这样才能调用它来进行解释pl文件)

注释,因为在DOS下拷贝文字有点麻烦,所以在Linux通过SSH命令执行install.pl以拷贝文字,其步骤及解释与在win2000下完全一致

Linux/Unix detected (Perl v5.8.1)
Loaded language file 'english' successfully.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The PsychoStats v2.3 installation has several steps, all of which will be
handled automatically by this setup wizard. The wizard is interactive and will
ask you several questions along the way. New and veteran users will both find
this setup quick, easy and helpful.

*** UPGRADE NOTES ***
If you are upgrading from the previous version 2.1 and everything is currently
working for you, DO NOT run this install wizard. Run the 'upgrade.pl' script
instead. That will alter your database to the new format w/o losing any of
your current stats and will update your PsychoStats files on your website.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Press enter to continue ...
按回车继续

Before we begin installing PsychoStats v2.2 on your system I need to know
where your web server is located. If your web server shown below is set to
'localhost' this means the web server will be considered local to the machine
that you're running this install wizard.

Web server host: localhost [127.0.0.1]
Do you want to change your settings? [Y,n]:
是否要更改您的服务器类型设定,不要管127.0.0.1这个IP,一般选择n,如果是远程则选择Y,进行修改

Press enter to continue with next step
按回车继续下一步

>>> STEP: Verifying required perl modules ...
Searching for required perl modules ...
x = module installed
[x] DBI v1.37
[x] DBD::mysql v2.9002
[x] Data:umper v2.121
All required perl modules are installed! Congratulations!

Press enter to continue with next step
检测系统是否支持DBI及DBD::mysql,如果全部为[x]则为通过,按回车继续下一步

>>> STEP: Database initialization and setup ...
SQL initialization file successfully loaded (34 tables).

A database needs to be setup for PsychoStats to use. In order to verify and
create the database you need to provide a user that has admin privileges on
the DB server. Follow the prompts below to setup the database. Each prompt
will show its current setting in [brackets]. If you do not want to change a
setting just press enter at the prompt.

WARNING: Your password, if given, will be echoed to the screen!

Most databases will require a username to connect with. If a default username
appears in the [] brackets and you need to use a blank username type in 'none'
(w/o quotes) at the prompt.
DB Username []: root
数据库用户,输入root或者您的帐号

Most databases will require a password to connect with. If a default password appears in the [] brackets and you need to use

a blank password type in 'none' (w/o quotes) at the prompt.
DB Password []: xxxxxx
数据库密码,输入上步骤用户所使用的密码

Where is the MYSQL server? Enter 'localhost' if its on this same machine
otherwise enter the IP or hostname of the server.
DB Hostname [localhost]: localhost
数据库连接类型,一般使用localhost

Each database on a server has a different name. Which name will you use for
PsychoStats? We will try to create this DB later if it doesn't already exist.
DB Name [ps_stats]: ps23
Psychostats使用的数据库,不用预先建立,安装过程中会自动建立.

Choose a table name prefix. The default prefix is "pstats_" this helps keep
all related tables in the DB together. Each table in the DB will start with
this prefix. Just accept the default if you're not sure.
DB Table prefix [pstats_]: pstats_
ps23数据库的表前缀,便于数据库操作,可以采用pstats_或者您喜欢的

Should compression be used for your DB connection? This may or may not help performance (especially if your DB server is

remote). If you experience any problems disable this.
DB Compression [0]: 0
数据库连接时是否压缩,建议为0

Checking for DB ps22@localhost ...DB EXISTS!
Preparing to create database 'ps23' table structure ...

If a table already exists with the same name in the 'ps22' database should it
be deleted and replaced with a new empty table? (any data in the original
table will be lost).
Delete existing tables first? [y,N]:
是否删除已经存在的,如果你已经建立过ps23的数据库了就选择Y,否则不会有该提示.(后面介绍怎么更新ps2.3.1的时候会在叙述这个地方)

Creating table 'pstatsclans' ...OK
Creating table 'pstatsdefs_awards' ...OK
Creating table 'pstatsdefs_events' ...OK
-----------------省略-----------------
Creating table 'pstatsplrvictims' ...OK
Creating table 'pstatsplrweapons' ...OK
Creating table 'pstatsrcons' ...OK
Creating table 'pstatssessions' ...OK

Congratulations! DB 'ps22' has been fully initialized!

Press enter to continue with next step
按回车继续下一步

>>> STEP: Basic Configuration ...

Each question will show your current config setting in [brackets], If you do
not want to change the current setting just press <enter> at the prompt.

The 'logsource' option specifies where your logs are stored for your game
server. You can specify multiple log directories and each will be scanned in
the order given. Enter a blank line if you do not want to enter any more log
directories. To delete a directory from the list enter the number shown next
to it and press enter.

Current log sources (enter a blank line to stop).
An asterix '*' in front of the directory means the directory does not exist!
0. * none *
LOGSOURCE 1: D:\cstrike1\logs
您的第一日志地址(填写您自己的地址)

Current log sources (enter a blank line to stop).
An asterix '*' in front of the directory means the directory does not exist!
1. /root/old_logs
LOGSOURCE 2: D:\cstrike2\logs
您的第二日志地址(填写您自己的地址)

Current log sources (enter a blank line to stop).
An asterix '*' in front of the directory means the directory does not exist!
1. /root/old_logs
2. * /root/old
LOGSOURCE 3:
如果您有第三个日志地址,可以继续填写,直到您满意,否则就回车退出日志地址填写

The 'modtype' option specifies what MOD of the primary 'gametype' you're
playing.
Valid mods: cstrike, dod, ns
MODTYPE [cstrike]: cstrike
游戏类型,选择您的类型

The 'uniqueid' option specifies how players are tracked in the game logs.
Note: 'wonid' and 'steamid' are the same thing as 'worldid'.
Valid options: ipaddr, name, steamid, wonid, worldid
UNIQUEID [worldid]: name
统计类型,根据您的情况来决定
ipaddr适合针对IP统计
name适合针对玩家名字,比较常用,特别适合于大型网吧
steamid适合针对Steam系统,比较常用
wonid适合针对WonID系统(目前好象淘汰了)
worldid适合PS自己的全球ID系统

The [decay] 'skill' option specifies a percentage that will decay a players
skill value for each day they do not play since their last played date. It is
recommended that this value be kept low (less than 5%).
DECAY.SKILL [0%]: 2%
技巧统计对比率为2%,可以为0%-5%,不要超过5%

The [decay] 'minskill' option specifies the minimum value a players skill is
allowed to decay to. A players skill will never automatically decay lower than
this value but its still possible for a player to go lower if they simply
aren't playing that well.
DECAY.MINSKILL [1000]: 1000
技巧基础得分(每一个玩家一旦进入排名,赋予每人一个公平的起始分数),一般为1000,不要小于750

The 'servername' option should be a short name for your game server. The
themes can use this in their output.
SERVERNAME [Powered By PsychoStats v2]: Powered By PsychoStats v2
出现在页面顶部的标识,随便填

The 'serverip' option should be the IP:Port for your game server. The theme
will use this to show real-time server information by querying the server. If
you do not want this information to be displayed just leave the field blank.
SERVERIP []: 192.168.1.10:27015
监控服务器地址,这一监控是动态的,可以随时反映其在线状况,如果没有,可以为空

Very Important: You must provide a valid directory that the website files for
PsychoStats will be copied or uploaded to. This directory should be within
your web server directory tree.

'statsroot' specifies the directory where your PsychoStats website files will
be located.
THEME.STATSROOT [c:\inetpub\wwwroot\stats\]: C:\Program Files\Apache Group\Apache2\htdocs\
这是Psychostats2.2发布的主地址,这里填写上绝对地址

'statsurl' is an absolute URL pointing to the location of your stats on your
website. You do NOT put http://domain.com in front of this option. This will
usually resemble the statsroot option you entered above but w/o the phyiscal
directory path in front of it. Often only leaving the last directory name.
Example: If statsroot = '/var/www/stats/', then statsurl would be '/stats/'.
THEME.STATSURL [\stats\]: /
这是Psychostats2.2发布的文件所在的相对地址,这里是/

Updating configuration ...
Press enter to continue with next step
>>> STEP: Test PS subsystems ...
Attempting to initialize PS CORE system ...OK
Attempting to initialize PS SAVER sub-system ...OK
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Required installation is now complete!
PsychoStats should now be able to load and store logs from this system.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Press enter to continue with next step
按回车继续下一步

>>> STEP: Copying theme to web server ...

PsychoStats uses 'themes' to produce its output for the stats. Listed below
are all the themes currently available on your system. Choose the theme you'd
like to use.

Available themes: psweb
Choose your theme [psweb]: psweb
psweb是目前唯一的选择,请输入psweb然后确定
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Theme config loaded for 'psweb':
Theme name: Psychostats.com
Version: 2.2
Author: Stormtrooper
Email: stormtrooper@psychostats.com
Total files: 235 (size: 421.10 KB)
Dep. files: 12 (size: 96.07 KB)

Notes from the author:
The "psweb" theme was designed to look just like the Psychostats.com
website. It will work for any of the currently supported mods. Adding new
support for a mod is as simple as adding a few new files to the theme. No
changes would have to be made to any of the current files within the theme.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Do you want to install this theme? [Y,n]: Y
是否安装这一风格,选择Y


The files for this theme will be copied into your statsroot
'C:\Program Files\Apache Group\Apache2\htdocs\'.

Copying [ 0.08%][ 324.00 B] themes\psweb\admin.html ...OK
Copying [ 0.85%][ 3.28 KB] themes\psweb\admin_body_awards.html ...OK
Copying [ 2.37%][ 6.38 KB] themes\psweb\admin_body_db.html ...OK
-----------------省略-----------------
Copying [ 99.64%][ 442.00 B] themes\psweb\languages/slovak/usersearch.lng ...OK
Copying [ 99.87%][ 994.00 B] themes\psweb\languages/slovak/weapon.lng ...OK
Copying [100.00%][ 541.00 B] themes\psweb\languages/slovak/weaponlist.lng ...OK

The theme has dependant files that need to be copied over to your website. All
paths will be created automatically starting within the statsroot specified in
your config: 'C:\Program Files\Apache Group\Apache2\htdocs\' on your web
server.

Copying [ 7.98%][ 7.67 KB] psweb.css ...OK
Copying [ 8.25%][ 270.00 B] images\arrow_blue_asc.gif ...OK
-----------------省略-----------------
Copying [ 99.64%][ 361.00 B] images\title_left.png ...OK
Copying [100.00%][ 357.00 B] images\title_right.png ...OK
Done copying files.

Press enter to continue with next step
按回车继续下一步


>>> STEP: Uploading web related files ...

Updating web/config.php based on your local config ...
done.

Copying web files to web server.
Root destination: C:\Program Files\Apache Group\Apache2\htdocs\
Copying [ 0.82%][ 4.61 KB] admin.php ...OK
-----------------省略-----------------
Copying [100.00%][ 925.00 B] smarty\plugins\shared.make_timestamp.php ...OK
Done copying files.

Copying weapon images to web server.
Root destination: C:\Program Files\Apache Group\Apache2\htdocs\images\weapons\
Copying [ 0.31%][ 1.08 KB] cstrike_ak47.gif ...OK
-----------------省略-----------------
Copying [ 97.38%][ 8.91 KB] large\cstrike_usp.jpg ...OK
Copying [100.00%][ 9.05 KB] large\cstrike_xm1014.jpg ...OK
Done copying files.

Copying map images to web server.
Root destination: C:\Program Files\Apache Group\Apache2\htdocs\images\maps\
No files to copy.
Done copying files.

Press enter to continue with next step
按回车继续下一步

*** Install has been completed ***

Now that you've installed PsychoStats v2.2 the next step would be to run a
'stats update' to scan your log direcories for game and player stats.

Linux users can run the stats update by typing "./stats.pl" at your shell
prompt (w/o the quotes).

The first time you run the stats update it may take a long time depending on
the number of logs you have. Subsequent updates will be much quicker since
only new logs (after your last update) will have to be scanned. You will need
to periodically run the stats update so new stats are collected and inserted
into your DB.

Linux users can use their crontab and have the stats.pl process run
automatically at set intervals.

Once you have data in the database you should be able to browse to your
website stats URL to view the stats. For example: http://localhost/stats/

Press enter to exit installation.

Installation completed!
安装完成

4. 后续优化工作

第一,设定apache默认访问文件为index.php,禁止浏览目录.配置文件为EasyAPM-Server 安装目录下Local\apache\conf\vhosts 下面的localhost.conf,里面内容很少,很容易修改.
修改内容:
DirectoryIndex 后面加上index.php
Options Indexes FollowSymLinks MultiViews 里面的indexes去掉.

第二,修改mysql最大连接数,默认100,mysql的配置文件my.ini位于系统c:\windos下,打开后增加max_connections=1000;如果不进行修改,当访问人数多的时候会出现 too many connections的错误.

Apache和Mysql的配置参数修改后,要重启服务才能生效,在dos下面输入net stop mysql/apache 停止服务器, net start mysql/apache 启动服务.

5. 高级个性设置,呵呵.

5.1. 开通登陆ps的登陆权限,我没有使用插件,采用先开通管理员(accesslevel=10),再由管理员给需要的玩家开通登陆口令.

引用SongSong的介绍:

首先通过游戏登陆服务器,使您的名字或者其它信息被记录然后
pspass.pl -name 玩家的名字 -password 密码
psadmin.pl -name 玩家的名字 -accesslevel 10

玩家的名字如果有空格可能会导致匹配错误,无法成功赋予

如果要给玩家设置密码,则只需要上面的第一步,然后可以登陆系统,超级管理员需要上面两步
accesslevel定义级别
1 = 普通玩家
5 = 战队管理员(管理战队内资料)
10 = 超级管理员
pspass.pl与psadmin.pl直接回车可以获得简グ镏


我根据上面的介绍始终没有成功,后来就干脆去修改后台数据库了,假设你的名字已经被ps记录到了.使用phpmyadmin打开数据库的plr_profile表格,增加一行,添加上plrprofileid name accesslevel即可,accesslevel=10,name就是你的游戏id.plrprofileid随便设置一个整数即可,注意不要添加password字段,因为是MD5加密的.

然后在sql执行窗口中运行下面的代码
update pstats_plr_profile set `password`=md5('mypassword') where plrprofileid=**

这样就有了超级管理员了,超级管理员登陆排行榜以后可以给其他人设置登陆口令.....

5.2 优化IE显示中 玩家 站队等字体太小
    dt介绍过,打开你的ps发布web根目录下面的psweb.css文件,把里面所有9px和10px都改成11px即可.

5.3 更改Ps web中的banner图片和图片的链接.

打开ps发布web根目录下\themes\psweb\header.html,里面大约第5行的代码如下:

<td align="center"><a href="{$URLROOT}"><img src="{$conf.imagesurl}banner.gif" width="600" height="75" border="0"></a></td>

其中<a href=>的内容是banner图片的链接地址,默认是返回Ps的首页,可以修改成<a href=http://www.sohu.com target=_blank>,这样点击banner就会去打开sohu的主页,而且是新开窗口打开,因为target=_blank. 如果你不想要banner有超链接,删除<a href=></a>即可.

5.4  设置ps ftp 登陆数据.适合ps ftp到cs服务器下载log文件.

在stats.cfg中编辑如下(ps2.3中需要自己新加上这些,ps2.2已经有了,只是修改参数):
[downloadlogs]
binary = 0
delete = 0 是否删除服务器上的log文件
download = 1 是否下载
host = ftp地址
localpath = 本地存放log的目录
pass = ftp密码
pasv = 0
port = ftp端口
remotepath = ftp服务器上的远端log目录
skiplast = 1 跳过最后一个log文件(正在使用)
user = ftp用户名

5.5 cs服务器配合cs需要进行的设置.

server.cfg中增加下面的内容:
// 服务器是否记录文件 不记录0/记录1
mp_logfile 1
// 是否在记录文件里记录谈话内容 不记录0/记录1
mp_logmessages 1  
log on

另外如果需要统计Hitbox射击部位,就需要开启statsme或者amxmodx下的statsx插件,使用方法自己查,呵呵.

5.6 清空Ps数据的方法,同时保留开通登陆权限的玩家的信息.包括签名 头像等.

再运行一次install.pl即可,这个时候不带参数,安装过程中提示是否删除存在的数据库,例如:
Delete existing tables first? [y,N]:
选择y ,然后就会删除掉旧表,建新表,不删除plr_profile表.


5.7 另外一个问题,接了一个电话结果忘记了,什么时候想起来再补充.. :byebye:
 楼主| 发表于 2005-7-6 14:45:28 | 显示全部楼层 来自 中国–北京–北京
Ps的QQ群号2288676,可以进行交流和探讨,其他问题请找相关QQ群和人士询问.

看贴要回帖的哟.哈哈.
回复

使用道具 举报

发表于 2005-7-6 15:17:34 | 显示全部楼层 来自 中国–吉林–长春
??????
回复

使用道具 举报

发表于 2005-7-6 15:25:33 | 显示全部楼层 来自 中国–吉林–长春
刚刚把钱凑够 :cry:
回复

使用道具 举报

发表于 2005-7-6 22:57:17 | 显示全部楼层 来自 中国–辽宁–沈阳
:sweet_kis  :tongue:  :sexy_girl  :)  :embarrass  :byebye:  :(  :spiderman  :burn:
回复

使用道具 举报

发表于 2005-7-6 23:43:36 | 显示全部楼层 来自 中国–山东–济南
又一个高手了!
感谢分享!
回复

使用道具 举报

发表于 2005-7-7 21:33:38 | 显示全部楼层 来自 中国–云南–德宏傣族景颇族自治州
需要观看!!
回复

使用道具 举报

发表于 2005-7-8 00:12:25 | 显示全部楼层 来自 中国–黑龙江–齐齐哈尔
本人想做一个PS排行榜
回复

使用道具 举报

发表于 2005-7-8 18:59:06 | 显示全部楼层 来自 中国–新疆–乌鲁木齐
???????????
回复

使用道具 举报

发表于 2005-7-8 20:50:55 | 显示全部楼层 来自 中国–广西–南宁
如此好贴没人顶,实在可以楼主的一番心意。
我现在用的就是PS,感觉蛮好用。莫非大家已经有另外的好用的排行榜了吧
要是以前我架Psychostats2.3.1时能有楼主的这篇文章的话,就可以省好多事啦。呵呵。
回复

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 注个册吧

快速回复 返回顶部 返回列表