Description:
Source Chatter allows you to monitor and interact with chat and scoreboard of your servers through the browser. After you log in through Steam and have access, you may see everything, chat along and issue commands with respect for SourceMod admin flags.
Features:
Logging in through Steam used as authentication.
Manually add users with access.
Supports arbitrary amount of servers.
Messages stored in database, allowing for showing short history after joining chat.
Automatic clean up: every 5 minutes, messages older than 5 minutes are deleted.
Updater support for plugins.
Live chat feed:
Join in with your actual Steam name, and defined tag.
Displaying some core events, such as players joining or name changing.
Plugins can push their own messages with BBCode support.
Custom Chat Colors support.
Live scoreboard:
Showing avatar, name, country code, statuses, user ID, class (TF2), score and ping.
Statuses are: is dead, is in group (optional), is voicechatting (upcoming)
Team colored (TF2 default, may be altered).
Names linked to steamcommunity accounts for easy access.
Players ordered by team and score, replicating the in-game scoreboard.
Commands:
Type in commands with ! or /, where / hides your message.
Commands respect SourceMod admin flags, that are assigned to the user.
Responses are feedbacked in the field below the chat.
Requirements:
SourceMod 1.9+
Webserver with PHP 5+ and MySQL database
Event Scheduler enabled in the database
Technically not required, but better be enabled.
Installation & Configuration:
Webserver
Prepare MySQL database and user, from now referred to as sc_database and sc_dbuser respectively.
Make sure sc_dbuser is granted ALL PRIVILEGES on sc_database.
Copy contents of web/ to your desired webserver directory, from now referred to as sc_root.com.
Copy config.template.php as config.php and configure it:
Provide access information of sc_dbuser for sc_database.
Set domainname to sc_root.com.
You may skip configuring group_path and servers at this stage.
Go to sc_root.com/install to have all needed tables and events created.
IMPORTANT: The above script shows whether Event Scheduler is enabled. If yours is OFF, login as root user and enable it manually, then go to install directory again. If you can't login as root, ticket your database provider to enable it for you.
PHP Code:
SET GLOBAL event_scheduler = ON
After you're done, delete install/ directory.
Plugin & Integration
Go to your SourceMod directory and add sc_database to configs/databases.cfg.
From game/addons/sourcemod/plugins/, copy SourceChatter.smx and SourceChatter_generic.smx to your plugins/ directory.
SourceChatter_generic.smx displays some generic Source events using the base plugin, such as chat or joining.
Reload or load them with sm plugins (re)load SourceChatter and SourceChatter_generic
For each of your servers, set the sm_sourcechatter_token ConVar.
This should be a short identifier (16 char max), without spaces, unique per server.
Example: Name - My Super Server, Token - superserver
Remember to save this ConVar in your servers' server.cfg
Go back to your webserver's config.php and configure servers using the tokens.
OPTIONAL: Install Updater to keep the plugins automatically up to date.
(optional) Show group members in scoreboard
Source Chatter can identify group members by an admin flag.
On the webserver, put your group's emblem to assets/img/ and reference it in config.php at group_path.
Set sm_sourcechatter_group ConVar to the appropriate flag(s) that are given to members.
You should now see the emblem appear next to group members on the scoreboard.
Managing users:
There is no website to manage chatters, you do it from the game server's side using the following commands. Developers can use natives to edit chatters, for more information, check out the For Developers section.
sm_addchatter - add a chatter (root flag). Parameters:
<steamid64/name> - if steamid64 is deemed invalid, a match against online players is made.
<flags>* - admin flags used to gain access to commands. (defaults to nothing)
<name>* - mock name used when browsing chatters only. (defaults to unspecified)
<tag>* - tag of the player. (defaults to nothing)
<tag_color>* - color of the tag in hex. (defaults to ffffff)
sm_removechatter - remove a chatter (root flag). Parameter:
<steamid64/name> - if steamid64 is deemed invalid, a match against online players is made.
sm_editchatter - edit a chatter (root flag). Parameters:
<steamid64> - steamid64 of the chatter.
<attributename:value> - attribute you want to edit and value, separated by double colon.
...* - specify arbitrary amount of attributes to edit.
More Info
Attribute names must be corresponding to ones in the database, i.e. flags, name, tag, tag_color, added_by.
Examples: sm_editchatter 12345 "flags:z" - Set chatter admin flags of steamid64 to root. sm_editchatter 12345 "tag:[FunGuy] " "tag_color:ff0000" - Change chatter's of steamid64 12345 tag and color.
/* Source Chatter was found */
void OnSourceChatterStart(){
SC_PushMessage("This is a message from external plugin.");
// Set individual team color, initially set to Team Fortress 2 colors
//SC_SetTeamColor(0, StringToInt("ffffff", 16));
//SC_SetTeamColor(1, StringToInt("ff0000", 16));
//SC_SetTeamColor(2, StringToInt("00ff00", 16));
//SC_SetTeamColor(3, StringToInt("0000ff", 16));
// Add a chatter: instantiate with steamid64. Can be set later, but the filed must exist
//Chatter chatter = new Chatter("123456789"); // steamid can be altered with Chatter_Auth
//chatter.Set(Chatter_Flags, "abc");
//chatter.Set(Chatter_Name, "Test Dude");
//chatter.Set(Chatter_Tag, "[Test] ");
//chatter.Set(Chatter_TagColor, "ff0000");
//chatter.Set(Chatter_Addedby, "123456789");
Fixed missing m_iTotalScore error for mods other than Team Fortress 2..
Removed unnecessary socket dependency.
v1.0.0: (24 Aug 2018)
Initial release.
FAQ
I initially started this project about 2 years ago, so I have no idea what to write about.
Can this show which players have a certain flag?
Yes!
Source Chatter has an option to show whether a certain player on the scoreboard is in your group. It's doing that by reading whether the player has a flag assigned, namely the one you define in sm_sourcechatter_group. If they do so, the group emblem defined in the webserver config.php under group_path is displayed on the scoreboard by the player. This image can be whatever you want, of course, and it doesn't need to identify a group per se.
The drawback is that you have only a single flag at your disposal. If it's a requested feature, I may look into implementing such a functionality.
Commands from this respect admin flags, but do they respect immunity levels?
Unfortunately, no.
So if a person is given access to Source Chatter and somebody else of higher immunity is on the server, as long as they can access a command, they can target that person.
This is something I will be implementing in the future. It's not in priorities as of now, unless heavily requested.
Do tag colors support opacity?
No.
What is token used for?
Token acts as an identifier for different servers. It is assosiated with every message and player data that is uploaded to the database from the game server. The website then knows how to fetch the data belonging to only a single game server.
If you're using Source Chatter only for a single server, you may set the token in config.php to none and don't bother setting the ConVar. However, it is recommended to set the token anyway for scalability reasons.
Why is the webpage so ugly?
I am not a web developer, I bothered to go only as far as to make it fit as much information and be readable.
(dev) Why aren't you hooking TextMsg user message to capture any chat message?
I gave it a long thought, and decided not to for the following reasons:
There aren't events producing chat messages which can't be hooked individually.
Hooking the events individually makes it possible to format them in BBCode.
For plugin-related events, the maintainer can add support for Source Chatter.
Decent plugins usually have a forward associated with their events, making it possible to create a module for Source Chatter.
Colors for chat messages would have to be parsed manually.
Could this be integrated into an exe rather than a web file?
Edit: should also specify that a token needs to be a max of 16 characters.
EDIT2: Getting this error on CSGO:
Code:
L 08/28/2018 - 02:56:46: [SM] Exception reported: Property "m_iTotalScore" not found (entity 70/cs_player_manager)
L 08/28/2018 - 02:56:46: [SM] Blaming: sourcechatter.smx
L 08/28/2018 - 02:56:46: [SM] Call stack trace:
L 08/28/2018 - 02:56:46: [SM] [0] GetEntProp
L 08/28/2018 - 02:56:46: [SM] [1] Line 1025, SourceChatter.sp::GetScore
L 08/28/2018 - 02:56:46: [SM] [2] Line 971, SourceChatter.sp::FetchAttrib
L 08/28/2018 - 02:56:46: [SM] [3] Line 636, SourceChatter.sp::CheckAndAppendAttribute
L 08/28/2018 - 02:56:46: [SM] [4] Line 614, SourceChatter.sp::UpdatePlayer
L 08/28/2018 - 02:56:46: [SM] [5] Line 592, SourceChatter.sp::UpdatePlayers
L 08/28/2018 - 02:56:46: [SM] [6] Line 583, SourceChatter.sp::Timer_UpdatePlayers
Last edited by Notifications; 08-27-2018 at 22:02.
Could this be integrated into an exe rather than a web file?
Edit: should also specify that a token needs to be a max of 16 characters.
EDIT2: Getting this error on CSGO:
-snip-
An application working in a similar manner to the website can be managed, but this is not in plans at the moment. It wouldn't also be a good time to this unless the way the scoreboard is fetched is improved.
I added the token character limit to the first post.
I haven't realized getting score of all things would be different across mods, I will look into it and release a patch shortly.
An application working in a similar manner to the website can be managed, but this is not in plans at the moment. It wouldn't also be a good time to this unless the way the scoreboard is fetched is improved.
I added the token character limit to the first post.
I haven't realized getting score of all things would be different across mods, I will look into it and release a patch shortly.
Thanks for getting back to me on the first one, understandable that it wouldn't be on the agenda.
And for the third one, I believe this may be related to Panorama. Looking forward to getting this running on CSGO as it looks impressive and much more convenient for admins to check chat and ban without logging in.
Last edited by Notifications; 08-28-2018 at 21:30.