Page 2 of 3

Re: Chat Filter example

PostPosted: 09 Apr 2012, 14:20
by creativemagic
ok, so I added the references MCDzienny_.dll and MySql.Data.dll, and chose System.Data from .NET
I feel like i;m missing a obvious step. I can't seem to find that huge compile button (sarcasm)

Re: Chat Filter example

PostPosted: 09 Apr 2012, 17:50
by dzienny
creativemagic wrote:ok, so I added the references MCDzienny_.dll and MySql.Data.dll, and chose System.Data from .NET
I feel like i;m missing a obvious step. I can't seem to find that huge compile button (sarcasm)


References to MCDzienny_.dll would be sufficient, because MySql.Data.dll etc. are used for MySQL database access, still you can leave it this way. Now when you have the reference added build the solution(Build -> Build Solution). And there you are, you got a compiled dll library. If you don't know where the file was created look at Output window(View -> Output), you should find there a full path to your compilation. Copy the file to 'extra\commands\dll' , rename it to Cmd[command name].dll and use /cmdload [command name]. Also you can add the command to '\text\cmdautoload.txt' file, so that it will be loaded automatically when the software starts.

Re: Chat Filter example

PostPosted: 12 Apr 2012, 12:42
by creativemagic
Thanks ! It works now. I did have to enable the expert settings Tools>settings>Expert settings to make the "Build" tab show, but then it all worked.

Re: Chat Filter example

PostPosted: 15 Apr 2012, 13:17
by creativemagic
Code: Select all
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }

What would you have to change in order to allow OP+ to bypass the chatfilter in the normal chat?

Re: Chat Filter example

PostPosted: 16 Apr 2012, 08:51
by Ultima
Filter isn't made to bypass anything.
You should add a check if permission < OP around the whole command.

Re: Chat Filter example

PostPosted: 16 Apr 2012, 20:36
by dzienny
creativemagic wrote:
Code: Select all
public override LevelPermission defaultRank { get { return LevelPermission.Banned; } }

What would you have to change in order to allow OP+ to bypass the chatfilter in the normal chat?


It's easy, like Ultima said you have to write a code that checks player rank. For example:
Code: Select all
if (p.group.Permission >= LevelPermission.Operator)
                    return;

Add the above code at the beginning at FilterChat method. So it will look similar to this:
Code: Select all
private void FilterChat(Player p, ref string message, ref bool stopIt)
{
       if (p.group.Permission >= LevelPermission.Operator)
                 return;

       [the rest of the code...]
}

Re: Chat Filter example

PostPosted: 22 Apr 2012, 17:14
by creativemagic
^ I'll try that.

Re: Chat Filter example

PostPosted: 29 Nov 2012, 14:53
by LogicaLucidity
I wanted to thank everyone in this thread.

I very much appreciate your work.

-Logic

Re: Chat Filter example

PostPosted: 17 Jan 2013, 14:51
by toystory_justin
where to add the chat filter? is it like a cmd where u save the code in extra>commands>source folder?

Re: Chat Filter example

PostPosted: 09 Feb 2013, 11:35
by Ultima
toystory_justin wrote:where to add the chat filter? is it like a cmd where u save the code in extra>commands>source folder?


The DDL goes into extra > commands > ddl
The source goes into extra > commands > source

If you only have the source, run "compile <filename>" first.

To load the file type "cmdload <filename>"