Skip to content

Commit

Permalink
Merge pull request #69 from shavitush/chat
Browse files Browse the repository at this point in the history
Implement chat handler
  • Loading branch information
shavitush committed Jul 12, 2016
2 parents cf4d528 + fde3d08 commit 0fac03e
Show file tree
Hide file tree
Showing 16 changed files with 1,502 additions and 75 deletions.
20 changes: 15 additions & 5 deletions README.md
Expand Up @@ -13,9 +13,12 @@ a bhop server should be simple
# Requirements:
* [SourceMod 1.8 and above](http://www.sourcemod.net/downloads.php)
* `clientprefs` plugin/extension. Comes built-in with SourceMod.
* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) is required to *compile* `shavit-chat` and you don't need Simple Chat Processor as listed in Ther RTLer's requirements.
* [Dynamic](https://forums.alliedmods.net/showthread.php?t=270519) for compilation and runtime of `shavit-chat`.

# Optional requirements:
* [DHooks](http://users.alliedmods.net/~drifter/builds/dhooks/2.0/) - required for static 250 prestrafe (bhoptimer 1.2b and above)
* [The RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) - required for properly formatted RTL text within `shavit-chat`.

# Installation:
1. Add a database entry in addons/sourcemod/configs/databases.cfg, call it "shavit"
Expand Down Expand Up @@ -57,9 +60,9 @@ a bhop server should be simple

# Required plugins:
`shavit-core` - no other plugin will work without it.
`shavit-zones` - required for server functionality and for `shavit-misc`.
`shavit-zones` - required for `shavit-core` and for `shavit-misc`.
`shavit-wr` - required for `shavit-stats`, `shavit-replay`, `shavit-sounds`, `shavit-stats` and `shavit-rankings`.
`shavit-rankings` - required for some functionality in `shavit-chat`.
`shavit-rankings` - required for `shavit-chat`.

# Todo for 1.5b release (out of beta!)
General
Expand All @@ -68,6 +71,7 @@ General
- [x] Migrate DBI to the 1.7 transitional syntax.
- [x] Migrate events to the 1.7 transitional syntax.
- [x] Migrate ADT_Arrays to ArrayList.
- [ ] **ENDGAME**: Migrate all the cached stuff (timer variables, HUD, chat cache) to Dynamic if I find it good and simple enough.

Core
--
Expand Down Expand Up @@ -111,10 +115,12 @@ Stats
- [x] Make style names editable from shavit.inc (like I did to the rest of modules) (dynamic!)
- [x] Make a submenu per style, for aesthetics.
- [x] [rankings] Points implementation.
- [ ] Make MVP count the amount of WRs the player has.

Miscellaneous
--
- [x] Allow changing the prespeed limitation.
- [x] Add weapon cleanup.

Sounds **(NEW!)**
--
Expand Down Expand Up @@ -144,6 +150,10 @@ Web Interface

Chat **(NEW!)**
--
- [ ] Add logic that processes chat without requiring an external plugin such as `Simple Chat Processor (Redux)`. (might cancel this one)
- [ ] Custom chat titles/colors for rank ranges. (will require shavit-rankings)
- [ ] Custom chat titles/colors per individual player.
- [x] Add logic that processes chat without requiring an external plugin such as `Simple Chat Processor (Redux)`.
- [x] [RTLer](https://forums.alliedmods.net/showthread.php?p=1649882) support.
- [x] Custom chat titles/colors per individual player.
- [x] Custom chat titles/colors for rank ranges.
- [x] Update cache for a player when his rank updates.
- [x] Add `sm_ranks` `sm_chatranks`.
- [x] Add `Shavit_FormatChat` native.
106 changes: 106 additions & 0 deletions configs/shavit-chat.cfg
@@ -0,0 +1,106 @@
// Use SteamID3 for a value if you want a per-client setting.
// "Custom" is for per-client settings.
// "Ranks" is for rank range settings. It is limited to 64 entries and the way you sort this file will be also sorted in-game when a player uses /ranks.
//
// Available settings:
// "rank_from" - rank range to start with
// "rank_to" - rank range to end with; you can use "infinity" if it's for every player below "rank_from".
//
// "prefix" - prefix before the name (don't add a space after it)
// "name" - custom name appearance (color from prefix will be applied here too)
// "message" - the message itself
//
// Global variables:
// {default} - default color
// {team} - team color
// {green} - green color
// {name} - player name
// {clan} - clan tag
// {message} - message text
//
// If you use variables that aren't compatible with the game, it might break some stuff.
// The default config will work with both CS:S and CS:GO, you can modify it for your needs.
// Use `sm_reloadchat` in your server to reload this config.
//
// For CS:S, you have the following variables available: (NOTE: The format for colors is like HTML. RRGGBBAA)
// {RGB} - like \x07, usage: "{RGB}FF0000" for red
// {RGBA} - like \x08, usage: "{RGBA}FF0000FE" for 254 alpha red
//
// CS:GO colors:
// {team} will become purple for spectators
// {blue}
// {bluegrey}
// {darkblue}
// {darkred}
// {gold}
// {grey}
// {grey2}
// {lightgreen}
// {lightred}
// {lime}
// {orchid}
// {yellow}
//
"Chat"
{
"[U:1:204506329]" // my steamid for example, use steamid3
{
"prefix" "{green}/dev{green}/"
"name" "{default}{team}{clan}{name}"
}

"-1" // lookup is due, shouldn't happen unless there's some error!
{
"rank_from" "-1"
"rank_to" "-1"

"prefix" ""
"name" "{team}{name}"
"message" "{message}"
}

"0" // unranked
{
"rank_from" "0"
"rank_to" "0"

"prefix" "[Unranked]"
"name" "{team}{name}"
"message" "{message}"
}

"1"
{
"rank_from" "1"
"rank_to" "1"

"prefix" "{green}ONE TRUE GOD"
"name" "{clan}{team}{name}"
}

"2"
{
"rank_from" "2"
"rank_to" "2"

"prefix" "LEGENDARY"
"name" "{name}"
}

"3"
{
"rank_from" "3"
"rank_to" "3"

"prefix" "HERO"
"name" "{team}{name}"
}

"4"
{
"rank_from" "4"
"rank_to" "infinity"

"prefix" "scrub!"
}
}
2 changes: 2 additions & 0 deletions scripting/include/dhooks.inc
@@ -1,3 +1,5 @@
// code by Dr!fter https://forums.alliedmods.net/showthread.php?t=180114

#if defined _dhooks_included
#endinput
#endif
Expand Down

0 comments on commit 0fac03e

Please sign in to comment.