Garry's Mod

Garry's Mod

评价数不足
Total Statistics for New Custom Roles beta
   
奖励
收藏
已收藏
取消收藏
素材类型: 插件
插件类型: 服务器内容
文件大小
发表于
更新日期
31.394 KB
2021 年 6 月 28 日 上午 5:13
2021 年 7 月 19 日 下午 6:51
13 项改动说明 ( 查看 )

订阅以下载
Total Statistics for New Custom Roles beta

在 Squid Matty 的 1 个合集中
Test Serv
164 件物品
描述
Note: This addon only works with trouble in terrorist town (TTT). However, this addon works with both native TTT and new Custom Roles for TTT.

Description
This addon aims to collect data about rounds of TTT and its players. The statistics can be viewed by pressing the button which is available when a player is dead, in spectator mode or at the end of the round.

Statistics include:
Each player's % win rate as each role
Number of times each player has played each role
Each players most successful traitor pairings
Server-wide average role win rates
Number of rounds each player has played
How often each player is the first person killed
How many innocents each player has killed as the detective
How many innocents each player has killed as an innocent
How much cumulative fall damage each player has taken

Stats are collected and stored in a .txt file serverside. The client can view these stats but can't change them.

Server console commands
ttt_totalstatistics_reset (clears all currently stored data)
ttt_totalstatistics_printplayerstats (prints the a debug view of everyone's current stats to the console)

DISCLAIMER
This does not work with the old version of Custom Roles at this time.

All credit for the original mod goes to Beans?

Based on: https://psteamcommunity.yuanyoumao.com/sharedfiles/filedetails/?id=2101272062

Source: https://github.com/squidserv/TTT_Total_Statistics_CR
5 条留言
Johnny 2021 年 6 月 30 日 上午 5:08 
Most likely because gmod is dead :CunningPepeRed:
Squid Matty  [作者] 2021 年 6 月 30 日 上午 4:54 
@cdozhytb all of that was from the original code. Nothing you brought up was changed or added in this version and there haven't been any complaints or comments about that stuff on that version
Johnny 2021 年 6 月 30 日 上午 2:09 
If it's the code from that "based on" addon... I just don't want to subscribe to find out...
Johnny 2021 年 6 月 30 日 上午 2:07 
You should never send the whole table to the client (this is the DoS part). I suggest you to move your data to SQL and to only send stats of a specific player (the only one who requested them). Also implement some sort of caching mechanism or just never receive anything on server from client and send a net message on each round end - this part is also malicious in your current realization, because right now you immediately update your stats table which means that players can see whos killing counters are updated (ez traitor revealing strategy btw).
Johnny 2021 年 6 月 30 日 上午 2:07 
I don't see any reason why this should be an ENT, but it's not the main problem.
Unprotected unoptimized networking - you really shouldn't subscribe to this addon. Anyone can delete this statistics and anyone can easily DoS your server (two reasons to not only unsubscribe, but to report).
Equipment stats? Use server-side hooks and function only (because its server-side statistics). If you must use client-side - something is wrong with your realization. Literally anyone with injector can spam servers with nils or just random huge strings by your TotalStatistics_SendClientEquipmentName net message.