Introducing Hercules' Channel System Hello~! - What?!
1st, it is a replacement for the old @main
2nd, it is a super ultra mega improvement compared to the functionality @main provided.
3rd, whops. there is no 3rd.
channels.conf format
/* default channels (available on boot) */
default_channels: {
/* channel_name : channel_messages_color */
main: "Orange" /* available as #main */
support: "Blue" /* available as #support */
trade: "Red" /* available as #trade */
offtopic: "Cyan" /* available as #offtopic */
/* as many channels as you like */
}
/* colors available */
colors: {
Default: "0xffffff" /* custom channels will use the first in the list unless a font is selected thru @channel */
Red: "0xff0000"
Blue: "0x83cfe9"
Orange: "0xe57c00"
Cyan: "0x00b89d"
Yellow: "0xffff90"
Green: "0x28bf00"
Normal: "0x00ff00"
/* as many colors as you like */
}
/* allow users to create their own (private) channels through @channels command? */
/* (must also allow players to use @channels in groups.conf) */
allow_user_channel_creation: true
/* "map_local_channel" is a instanced channel unique to each map */
map_local_channel: true
map_local_channel_name: "map" /* available as #map */
map_local_channel_color: "Yellow"
map_local_channel_autojoin: true /* can disable autojoin in specific maps through mapflag or zone: nomapchannelautojoin */
/* "ally_channel" is a channel shared by all your guild allies */
ally_channel_enabled: true
ally_channel_name: "ally" /* available as #ally */
ally_channel_color: "Green"
ally_channel_autojoin: true
Notes on the format/configuration
default_channels is the list of reboot-persistent channels, you can setup as many as you like and each can have its own color for chat, which you can specify in colors (again, you can setup as many as you like)
map_local_channel is a feature that grants each map its own instanced channel (available, by default as #map -- which can be changed as per map_local_channel_name)
map_local_channel_autojoin whether users will autojoin the local channel when they load a map with it enabled
map_local_channel_autojoin can be disabled on selected maps (e.g. if you dont want it on gvg maps) through a mapflag (with a horribly long name D:)
'<map name><tab>mapflag<tab>nomapchannelautojoin'
ally_channel_enabled is a feature that grants a instanced channel for each guild's allies (as well as their own members), available by default as #ally -- which can be changed as per map_local_channel_name
ally_channel_autojoin whether users will autojoin their respective ally chats upon login.
New Commands Explained
@join
Simple:
@join <#channel_name>or, for password-protected rooms:
@join <#channel_name> <password>
@channel
Does a number of things.
Create a new channel (option available as long as allow_user_channel_creation is enabled)
@channel create <#channel_name> <password>
List public channels (groups with hchsys_admin can view private channels as well)
@channel list
Change a channel's color (requires to be owner of said channel or be in a group with hchsys_admin permission)
@channel setcolor
Samples available colors and displays their keys/names
@channel list colors
Leaves a specific channel
@channel leave <#channel_name>
Binds your global chat to a specific channel, making everything you type that'd normally be displayed to nearby characters be redirected to that channel instead
@channel bindto <#channel_name>
Unbinds your global chat from the current (if any) binded channel
@channel unbind
Bans a specific character from a channel
@channel ban <#channel name> <character name>
Lists all banned characters from a channel (groups with channel system admin permission can also see their account id)
@channel banlist <#channel name>
Unbans a specific character from a channel
@channel unban <#channel name> <character name>
Changes a channel's options (for now, channel message delay and announce-when-someone-joins)
@channel setopt <#channel name> <option name> <option value>
How to speak in a #channel
You can either bind a channel to your global chat (see @channel bindto above) or PM the channel you want to speak to, if you attempt to send a pm to a non-password protected channel that you have not joined, you'll autojoin.
Other stuff
as I coded this feature I also improved overall guild processing/lookup, extremely, extremely faster (did I already say its ridiculously faster? WoE overhead probably more than halved with this). over a hundred lookups were replaced by a cached guild state that takes only 4~8 bytes per player.
The commit also fixed a "wearing-garment-removed-costume-garment-look" bug - special thanks to jTynne for letting me know~!
Groups with channel admin permission can bypass the channel message delay
Special Thanks
to Streusel for proposing an idea that'd end up as the @channel bindto feature.
to Frost for proposing the per-channel message delay limitation
to Fatalis for proposing what'd end up as the @channel ban, @channel unban and @channel unbanall
to Zopokx for proposing an improvement to how the map/local channels function
Links~!
Commit
Commit (update)