View Single Post
Author Message
ppalex
Senior Member
Join Date: Nov 2012
Location: Russia, near the Moscow
Old 01-30-2013 , 17:42   [ANY] SourceComms (0.9.266 - 22/11/2014)
Reply With Quote #1

Latest files and instructions you could find on GitHub
Links:
Requirements
  • Working sourcebans system (yes, you need MySQL server and web server with PHP). Currently supported versions 1.4.* (and 1.5.0 for sourcebans plugin). Integration into sourcebans 2.0 currently in development.
  • SM version 1.5.0-hg3761 or higher
  • SourceMod version 1.5.3 or 1.6 is required to compile the plugin (compiled plugin also works on sm 1.5)

Plugin based on ExtendedComms (Twisted|Panda) & SourceBans (SourceBans Development Team) plugins. Thanks them for code and idea. :wink:

Features:
  • Provides a straightforward category in the sm_admin menu where administrators can punish players as well as view current comm punishments.
    • The original BaseComm menu option still exist, and will still function. SourceComms plugin support storing history of punishments from BaseComm and another plugins
    • The category provides options for issuing new punishments, removing and viewing current punishments (categorized based on the punishment), as well as a List feature that provides information about current punishments.
    • The category also modifies the player's names in all of the options to show what their current punishment is. [ ] = None, [G] = Gagged, [M] = Muted, [S] = Silenced. I used Twisted|Panda menu code :oops:
  • All punishments (temporary, extended or permanent) are saved in MySQL database and are automatically reapplied (except temporary) when the punished player connects to the server. This allows punishments to be applied across multiple servers.
    • Extended punishments will automatically expire in-game at the designated time.
    • Permanent punishments remain on the player until an administrator removes them.
    • If the server has problems with access to the database, the punishments will store in SQLite database and would be added in the main database when connection is restored. (like in sourcebans plugin, yes)
  • Also you could apply punishments to multi-targets (such as `@all`, `@ct`, `@blue`, etc...)
    • Multi-target punishments will not be saved in db.
    • Removing punishments from multi-targets will removed punishments temporary (not from db).
    • Allowed session (temporary) punishments and extended with length less than 30 minutes and less than DefaultTime setting.
    • Permanent multi-target punishments is not available.
  • SourceComms has support for protecting current punishments based on immunity levels.
    • When a punishment is issued, the administrator responsible has their immunity level attached to the punishment. In order to remove that punishment, the second administrator must have higher immunity level or special admin flag (ADMFLAG_CUSTOM2 by default. You may change it in sourcecode). Also, punishment can be removed by console or his author.
    • Punishments issued by CONSOLE has some immunity level (which is set in config).
      Immunity checking system could be disabled by setting "DisableUnblockImmunityCheck" to value 1 in config file.
    • One more important moment. When somebody removes punishment - plugin retrieves "punishment issuer admin id" from database. If the request fails - punishment could be temporary removed (on server, not in database) only by console, admin with special flag or with higher immunity.
  • Plugin has Servers White List feature. If enabled, plugin will apply on players punishments only from current server or servers listed in White List.
  • Punishments reasons and times stored in config. More details about config listed below.
  • SourceComms supports updater

Sample of web-part you may look there http://test-bans.tf2news.ru/index.php?p=commslist (Login/pass test/test)
Web part provides the following functionality:
  • Full punishments history (includes time, server, admin, reason, block length, comments, etc)
  • Showing type of block as icon in first column
  • Showing count of other blocks for this player (steam-id) at the right end of 'Player Name' column (This allows you to quickly identify regular offenders)
  • Admins with necessary rights could edit, delete blocks, and also "ungag" or "umnute" (like unban) player.
  • If the block is still in effect, during unblocking or deleting, web-part sends command for ungag or unmute player to all servers
  • Search field for quick punishments search on all pages and advanced search options on Comms page.
  • Admin-page 'Comms' for adding new punishments.
  • Command 'Block comms' in player context menu on servers page (sweet :) )

Commands:
The time parameter controls how long the player is punished. (< 0 == Temporary, 0 == Permanent, # == Minutes). If not specified it will be "DefaultTime" minutes (30 by default)
The player parameter could be Name (only as single word, without whitespaces), UserID (`#127`) or *magic* targets (like `@all` or `@red`). Look at sourcemod wiki for more details about targets.
  • sm_comms
    Shows to player their communications status. (Also may used in chat)
  • sm_mute <player> <optional:time> <optional:reason>
    Removes a player's ability to use in-game voice.
  • sm_gag <player> <optional:time> <optional:reason>
    Removes a player's ability to use in-game chat.
  • sm_silence <player> <optional:time> <optional:reason>
    Removes a player's ability to use in-game voice and chat.
  • sm_unmute <player> <optional:reason>
    Restores a player's ability to use in-game voice.
  • sm_ungag <player> <optional:reason>
    Restores a player's ability to use in-game chat.
  • sm_unsilence <player> <optional:reason>
    Restores a player's ability to use in-game voice and chat.

Cvars:
  • sourcecomms_version - plugin version

Config settings:
  • DefaultTime. When admin run sm_gag (mute, silence) command only with player name - player will be gagged on DefaultTime value minutes. (if DefaultTime setted in -1 -> player will be blocked only on session (until reconnect)). Value 0 (permanent) is not allowed.
  • DisableUnblockImmunityCheck (0, 1). Default value is 0. If setted to 1, player can be ungagged only by issuer admin, console or admin with special flag. Also, If 0 player maybe unblocked by Admin with higher immunity level than issuer admin had.
  • ConsoleImmunity. Default value is 0. Immunity Level of server console.
  • MaxLength, which works following way: Plugin will hide (for admins without ADMFLAG_CUSTOM 2) from menu all durations more than MaxLength and restricts punishments commands with time > MaxLength argument (or permanent).
  • OnlyWhiteListServers. Default value is 0. Set this option to 1 to applying on players punishments only from this server and servers listed in WhiteList. Value 0 applies on players punishments from any server.

Installation instructions
Installation of server part
A sourcecomms-srv.zip file that provide all the necessary files, which can simply be extracted to your SourceMod directory. However, this is where the files go:
Code:
- sourcecomms.smx into /sourcemod/plugins/
- sourcecomms.phrases.txt into /sourcemod/translations/
- sourcecomms.cfg into /sourcemod/configs/sourcebans/
You need to add database record "sourcecomms" to your /sourcemod/configs/databases.cfg
Database Config (sample):
Code:
	"sourcecomms"
	{
		"driver"			"mysql"
		"host"				"your_mysql_host"
		"database"			"your_sourcebans_database"
		"user"				"your_mysql_login"
		"pass"				"******"
		//"timeout"			"0"
		"port"			"3306 or your_database_port"
	}
(Optional) Edit /addons/sourcemod/configs/adminmenu_sorting.txt. Find } at the end of file and add before:
Code:
"sourcecomm_cmds" 
{ 
    "item" "sourcecomm_gag" 
    "item" "sourcecomm_mute" 
    "item" "sourcecomm_silence" 
    "item" "sourcecomm_ungag" 
    "item" "sourcecomm_unmute" 
    "item" "sourcecomm_unsilence" 
    "item" "sourcecomm_list" 
}

Installation of database part
Execute the following query below (but first - check your table prefix!! replace sb to yours, if you uses another) on your sourcebans database:
Spoiler
Also, you could import attached sb_comms.sql.txt file instead of copying code from this post.

After this, If you want to import punishments from ExtendedComm plugin, execute folowing queries on your sourcebans database (check sourcebans table prefix and extendedcomm table name. If you have different prefix or table_name - replace their in code below to your values. if extendedcomm table is in a different database - replace in code below extendedcomm to 'database_with_table'.'name_of_extendedcomm_t able'):
Code:
INSERT INTO sb_comms (authid, name, created, length, ends, reason, type) SELECT steam_id, "", mute_time, mute_length, mute_time+mute_length, mute_reason, 1 FROM extendedcomm WHERE (mute_type='1' OR mute_type='2');
INSERT INTO sb_comms (authid, name, created, length, ends, reason, type) SELECT steam_id, "", gag_time, gag_length, gag_time+gag_length, gag_reason, 2 FROM extendedcomm WHERE (gag_type='1' OR gag_type='2');
Also, you could import attached import.sql.txt file instead of copying code from this post.

Installation of Web part
Place files from sourcecomms-web.zip archive to your sourcebans web folder. Then you need to edit a few files (make backup before you doing this!!!) Instructions for edit are placed in files_to_edit.txt or under spoiler below
Spoiler


Plugin tested and works fine on TF2, CS:S, CS:Go servers.
Attached Files
File Type: txt files_to_edit.txt (20.3 KB, 3167 views)
File Type: txt import.sql.txt (421 Bytes, 2646 views)
File Type: txt sb_comms.sql.txt (855 Bytes, 2862 views)
File Type: smx sourcecomms.smx (39.0 KB, 2955 views)
File Type: sp Get Plugin or Get Source (sourcecomms.sp - 2619 views - 109.7 KB)

Last edited by ppalex; 03-20-2016 at 09:21. Reason: updated to 0.9.266
ppalex is offline