Introducing Hercules Channel System

Ind

Development Administrator
Staff member
Messages
1,655
Points
113
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:
    Code:
    @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)
    Code:
    @channel create <#channel_name> <password>
  • List public channels (groups with hchsys_admin can view private channels as well)
    Code:
    @channel list
  • Change a channel's color (requires to be owner of said channel or be in a group with hchsys_admin permission)
    Code:
    @channel setcolor
  • Samples available colors and displays their keys/names
    Code:
    @channel list colors
  • Leaves a specific channel
    Code:
    @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
    Code:
    @channel bindto <#channel_name>
  • Unbinds your global chat from the current (if any) binded channel
    Code:
    @channel unbind
  • Bans a specific character from a channel
    Code:
    @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)
    Code:
    @channel banlist <#channel name>
  • Unbans a specific character from a channel
    Code:
    @channel unban <#channel name> <character name>
  • Changes a channel's options (for now, channel message delay and announce-when-someone-joins)
    Code:
    @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~!

 
Last edited by a moderator:
Yay~!
default_biggrin.png


 
I will birth your children like a male seahorse, Ind. /zomg

Thank you!
default_smile.png


 
@Ind Can i suggest to add this in the system?

in @channel create, can you add a limit of users in the channel? eg: @channel create <name><pass><no. of users>

Thank you!

EDIT:

Suggest no. 2: Can you add also a time interval on every messages to preventing spamming?

 
Last edited by a moderator:
Suggest no. 2: Can you add also a time interval on every messages to preventing spamming?
it makes use of the existent config on chat delay
Code:
	if (battle_config.min_chat_delay) {		if (DIFF_TICK(sd->cantalk_tick, gettick()) > 0) {			return;		}		sd->cantalk_tick = gettick() + battle_config.min_chat_delay;	}
as for your other suggestion im not sure the benefits, can you elaborate o-o?
 
For example if i created a channel, i can set how many user are able to join my channel, if i set to 10, only the first 10 users can join my created channel.

 
Suggest no. 2: Can you add also a time interval on every messages to preventing spamming?
it makes use of the existent config on chat delayif (battle_config.min_chat_delay) { if (DIFF_TICK(sd->cantalk_tick, gettick()) > 0) { return; } sd->cantalk_tick = gettick() + battle_config.min_chat_delay; }as for your other suggestion im not sure the benefits, can you elaborate o-o?
where i gonna add this?

 
you dont add it, its already there.
It's nice if you add a @channel ban <channel name> <name of char>

and @channel banall <name of char> [ he will get ban all channels and can't create a channel also]

ofcourse @channel unbanall/unban

 
Last edited by a moderator:
you dont add it, its already there.
It's nice if you add a @channel ban <channel name> <name of char>
and @channel banall <name of char> [ he will get ban all channels and can't create a channel also]

ofcourse @channel unbanall/unban
Very interesting. indeed it lacks the ability to kick/ban, that'd be nice.
 
you dont add it, its already there.
It's nice if you add a @channel ban <channel name> <name of char>
and @channel banall <name of char> [ he will get ban all channels and can't create a channel also]

ofcourse @channel unbanall/unban
Very interesting. indeed it lacks the ability to kick/ban, that'd be nice.
is the channel system is now fully working? no crash? cuz last time i use it it getting my server crash
default_sad.png


 
you dont add it, its already there.
It's nice if you add a @channel ban <channel name> <name of char>
and @channel banall <name of char> [ he will get ban all channels and can't create a channel also]

ofcourse @channel unbanall/unban
Very interesting. indeed it lacks the ability to kick/ban, that'd be nice.
is the channel system is now fully working? no crash? cuz last time i use it it getting my server crash
default_sad.png
we have no knowledge of any unfixed crashes, if you crash let we know through a bug report.
 
Last edited by a moderator:
It's possible have the 'You're now in the '#%s' channel for '%s' (1435)' message in the chat but remove it from above user head? How could be done?
I think it is a bit disturbing everytime you change map.
 
Back
Top