Jump to content

r17228: Channel System (replacement for @main)


Euphy

Recommended Posts


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Channel System

r17228 adds a system of chat channels with far greater versatility than the former @main chat. @main is now an alias for the @channel command.

All settings are located in trunk/conf/channels.conf.

Features

  • New atcommands, @join and @channel, to manipulate chat channels.

  • @join <#channel_name> {<password>}

    @channel join <#channel_name> {<password>}

    Joins the specified channel.

    ---------------------------------------

    @channel leave <#channel_name>

    Leaves the specified channel.

    ---------------------------------------

    @channel create <#channel_name> <channel_password>

    Creates a new channel.

    'allow_user_channel_creation' must be enabled in '/conf/channels.conf'.

    ---------------------------------------

    @channel delete <#channel_name>

    Destroys the specified channel.

    ---------------------------------------

    @channel list

    @channel list mine

    @channel list colors

    'list' displays a list of all public channels.

    'list mine' displays a list of channels you have joined.

    'list colors' displays a list of all available colors for custom channels.

    ---------------------------------------

    @channel setcolor <#channel_name> <color_name>

    Changes the text color of the specified channel.

    You must either be the channel's owner or have the channel_admin permission.

    ---------------------------------------

    @channel setopt <#channel_name> <option> <value>

    Sets an option and value for the specified channel.

    You must either be the channel's owner or have the channel_admin permission.

    Available options:

    -- 'JoinAnnounce <1|0>' : Toggles channel announcement when a new player enters.

    -- 'MessageDelay <0-10>' : Sets the delay (in seconds) for messages sent to the channel.

    ---------------------------------------

    @channel ban <#channel_name> <player>

    @channel unban <#channel_name> <player>

    @channel unbanall <#channel_name>

    @channel banlist <#channel_name>

    Bans or unbans a player from the specified channel.

    'unbanall' clears all bans from the channel.

    'banlist' displays a list of all players banned from the channel.

    ---------------------------------------

    @channel bindto <#channel_name>

    @channel unbind

    Binds or unbinds your global chat with the specified channel, which sends all global messages to the specified channel.

    ---------------------------------------

  • Speak in a #channel by either:
    • Sending a whisper to #channel.
    • Binding your global chat to the channel (@channel bindto <#channel_name>).
  • Set default channels, available when the server starts:
    	/* Default channels (available to all players) */
    	default_channels: {
    		/* channel_name : channel_messages_color */
    	 	main: "Yellow"
    		support: "Blue"
    		trade: "Red"
    		chat: "Default"
    		/* Add as many channels as you'd like. */
    	}
  • Automatically join local map channels (#map) and guild ally channels (#ally):
    	/* "map_local_channel" is an instanced channel unique to each map. */
    	map_local_channel: true
    	map_local_channel_name: "map"
    	map_local_channel_color: "Yellow"
    	map_local_channel_autojoin: true /* Disable autojoin in specific maps through mapflag 'nomapchannelautojoin'. */
    
    	/* "ally_channel" is a channel shared by all your guild allies. */
    	ally_channel_enabled: true
    	ally_channel_name: "ally"
    	ally_channel_color: "Green"
    	ally_channel_autojoin: true
    
    Use the 'nomapchannelautojoin' mapflag to disable auto-joining the #map channel on a map:
    <map_name>	mapflag	nomapchannelautojoin
    
  • Allow users to create private channels if 'allow_user_channel_creation' is true:
    	/* 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
    
  • Create a list of colors to use in channels:
    	/* Colors available */
    	colors: {
    		Default: "0xffffff" /* Custom channels will use the first in the list unless a font is selected through @channel. */
    		Red: "0xff0000"
    		Blue: "0x83cfe9"
    		Orange: "0xe57c00"
    		Cyan: "0x00b89d"
    		Yellow: "0xffff90"
    		Green: "0x28bf00"
    		Normal: "0x00ff00"
    		/* Add as many channels as you'd like. */
    	}
Credits go to @Ind for the coding, and @Lighta for helping out.  Feel free to post all suggestions or reports! Edited by Euphy
  • Upvote 10
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  37
  • Reputation:   11
  • Joined:  11/10/11
  • Last Seen:  

Nice one!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  60
  • Topics Per Day:  0.01
  • Content Count:  562
  • Reputation:   217
  • Joined:  11/22/11
  • Last Seen:  

Cool

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  81
  • Topics Per Day:  0.02
  • Content Count:  1654
  • Reputation:   583
  • Joined:  08/09/12
  • Last Seen:  

Whoah I'm stunned, great job!! /slur

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  37
  • Topics Per Day:  0.01
  • Content Count:  209
  • Reputation:   3
  • Joined:  11/28/11
  • Last Seen:  

Woagh, great news...i want to try it

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

hmm i got a problem i manually diff it working fine but when i create a Channel then try to pm the channel my mapserver crash.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  164
  • Reputation:   12
  • Joined:  01/03/12
  • Last Seen:  

@TrojamWorm

it's your diff fault, fresh rAthena channel work's fine

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

@TrojamWorm

it's your diff fault, fresh rAthena channel work's fine

sorry i already fix. but i think there's a error on @fontcolor

check it out guys try to @fontcolor <color> then try to speak with other player

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  182
  • Reputation:   36
  • Joined:  01/26/12
  • Last Seen:  

@TrojanWorm: Isn't it @channel setcolor <#channel_name> <color_name> as it is stated above?

 

Edited. Bad info. Sorry

Edited by jaBote
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  3
  • Topics Per Day:  0.00
  • Content Count:  164
  • Reputation:   12
  • Joined:  01/03/12
  • Last Seen:  

@TrojamWorm and @jaBote

/* debug only, delete after */
ACMD_FUNC(fontcolor) {
...
...
}
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  4
  • Topics Per Day:  0.00
  • Content Count:  414
  • Reputation:   102
  • Joined:  11/13/11
  • Last Seen:  

Thanks Ind! O_O

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  169
  • Topics Per Day:  0.04
  • Content Count:  1260
  • Reputation:   750
  • Joined:  11/19/11
  • Last Seen:  

I'm glad you guys liked it enough to merge, however

Credits go to @Ind for the coding

this is a unfair statement, the feature's design was the joint effort from our whole team, not only me.
  • Upvote 4
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  72
  • Topics Per Day:  0.02
  • Content Count:  2997
  • Reputation:   1130
  • Joined:  05/27/12
  • Last Seen:  

Thank you Ind, I've corrected that.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.01
  • Content Count:  182
  • Reputation:   22
  • Joined:  12/30/12
  • Last Seen:  

so cool! rAthena devs are really awesome!  /ok  

Edited by paopao
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  117
  • Reputation:   8
  • Joined:  05/07/12
  • Last Seen:  

After i updated my svn, everything was fine and the main chat was working fine also.

 

But i was afk for a while, so like 20 minutes i came back and i typed a word in the #main channel, map server crashed without any error.

 

Ima try if it happens again.

 

 

another thing i figured out

 

a player who just logged in cant read the #main channel without typing some in the channel first?

Edited by Docubo
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   8
  • Joined:  05/12/12
  • Last Seen:  

He is right, here is debug info:

 

0x08095839 in clif_chsys_msg (channel=0xad5982b4, sd=0xa47f6020, msg=0xbf99139a "[ #trade ] normali : neviete  nahodou kto tu vyvoal po meste MVP bosov?   boli tu phonovia a je tu belzebub ") at clif.c:5538

 

5538                    WFIFOHEAD(user->fd,msg_len + 12);

 


(gdb) print user->fd

$1 = -1

 

and guess what happens after calling session[-1]->wdata_size ;)

Edited by Baalberith
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  1
  • Reputation:   0
  • Joined:  12/30/11
  • Last Seen:  

errorbxl.jpg

Edited by euphoria
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   8
  • Joined:  05/12/12
  • Last Seen:  

Found a problem ... look closely into map.c:

if( sd->channel_count ) {
	for( i = 0; i < sd->channel_count; i++ ) {
		if( sd->channels[i] != NULL )
			clif_chsys_left(sd->channels[i],sd);
....

 

But after calling clif_chsys_left, sd->channel_count decreases .. this leads to not leaving half of the channels on log-out.

FIx is easy:

if( sd->channel_count ) {
	unsigned char count = sd->channel_count; 
	for( i = sd->channel_count - 1; i >= 0; i-- ) {
...

 

This fix ensures we won't run into array indexing mess once more...

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

errorbxl.jpg

you are from korea? O.O

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  209
  • Topics Per Day:  0.05
  • Content Count:  892
  • Reputation:   27
  • Joined:  12/09/11
  • Last Seen:  

After i updated my svn, everything was fine and the main chat was working fine also.

 

But i was afk for a while, so like 20 minutes i came back and i typed a word in the #main channel, map server crashed without any error.

 

Ima try if it happens again.

 

 

another thing i figured out

 

a player who just logged in cant read the #main channel without typing some in the channel first?

same problem #main channel get crash

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  399
  • Reputation:   198
  • Joined:  11/09/11
  • Last Seen:  

so cool! rAthena devs are really awesome!  /ok  

 

The channel system came from the Hercules emulation project, not rAthena itself. It was simply a merge into the source here.

 

Question though, with the inclusion of this, with other things like @fontcolor be made available here? I know it's not an "official" feature, but it'd be pretty nifty methinks!

  • Upvote 3
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  1
  • Topics Per Day:  0.00
  • Content Count:  18
  • Reputation:   8
  • Joined:  05/12/12
  • Last Seen:  

And another problem ... When player changes map server using pc_setpos, he doesn't leave channels and server crashes on first message as he was de-allocated from memory already.

Possible fix would be to move the channel leaving into unit_free() function.

Edited by Baalberith
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  87
  • Topics Per Day:  0.02
  • Content Count:  1335
  • Reputation:   932
  • Joined:  10/26/11
  • Last Seen:  

Great job

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  21
  • Topics Per Day:  0.00
  • Content Count:  345
  • Reputation:   229
  • Joined:  03/21/12
  • Last Seen:  

Very good!

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.01
  • Content Count:  59
  • Reputation:   0
  • Joined:  12/13/12
  • Last Seen:  

[Warning]: atcommand_config_read: can not set alias for non-existent command channel (conf/atcommand_athena.conf:59)
[status]: Done reading '60' command aliases in 'conf/atcommand_athena.conf'.
[Warning]: pc_groups:read_config: non-existent command name 'channel', removing... (conf/groups.conf:130)
[Warning]: pc_groups:read_config: non-existent command name 'channel', removing... (conf/groups.conf:174)
[Warning]: pc_groups:read_config: non-existent command name 'channels', removing... (conf/groups.conf:308)
[Warning]: pc_groups:read_config: non-existent permission name 'channel_admin', removing... (conf/groups.conf:320)


but i have channel.conf

im using the latest rAthena
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...