RSSy MYGO.pl Opublikowano Sierpień 24, 2018 o 10:44 RSSy Udostępnij Opublikowano Sierpień 24, 2018 o 10:44 [ANY] Source Chatter v1.0.0 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, 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. For Developers: Include file Example integration plugin View on GitHub More advanced example PHP Code: #pragma semicolon 1 #include <sourcechatter> #define SC_LIB "SourceChatter" bool g_bCoreLoaded = false; public Plugin myinfo = { name = "SourceChatter Example", author = "Phil25", description = "Example of integration with Source Chatter" }; public void OnAllPluginsLoaded(){ SetCoreLoaded(LibraryExists(SC_LIB)); } public void OnLibraryAdded(const char[] sName){ if(StrEqual(sName, SC_LIB)) SetCoreLoaded(true); } public void OnLibraryRemoved(const char[] sName){ if(StrEqual(sName, SC_LIB)) SetCoreLoaded(false); } void SetCoreLoaded(bool bSet){ if(bSet && !g_bCoreLoaded) OnSourceChatterStart(); g_bCoreLoaded = bSet; } /* 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"); // Edit a chatter //chatter.Set(Chatter_Flags, "z"); //chatter.Set(Chatter_Name, "Guy"); //chatter.Set(Chatter_TagColor, "00ff00"); //chatter.CommitEdit(); // Remove a chatter //chatter.Remove(); //delete chatter; } Compiling Following include files are required to compile the plugins: SourceChatter: Updater SourceChatter_general: Custom Chat Colors & Updater Changelog 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. Rant: UPLOADING SOON DOWNLOAD VIEW SOURCE Wyświetl pełny artykuł Odnośnik do komentarza Udostępnij na innych stronach Więcej opcji udostępniania...
Rekomendowane odpowiedzi
Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto
Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.
Zarejestruj nowe konto
Załóż nowe konto. To bardzo proste!
Zarejestruj sięZaloguj się
Posiadasz już konto? Zaloguj się poniżej.
Zaloguj się