Ignore command (need to finish)

Re: Ignore command (need to finish)

Postby dzienny » 03 Jun 2013, 19:35

You could use List<string> to make the code more robust and less error prone. An exemplary use:
Code: Select all
List<string> ignoredPlayers = new List<string>();
p.ExtraData[IgnoredKey] = ignoredPlayers;
List<string> ignored = (List<string>) p.ExtraData[IgnoredKey];


ismellike wrote:When you ignore and then unignore it sends messages 2x.

You don't have to send a message, it is handled by the default implementation. It works in a similar way to the chat filter. You can change the message but the default algorithm takes care of the displaying part. You can also tell the default algorithm that you already handled the event by setting e.Handled to true, then it won't do anything.

Also, in the switch statement, instead of current there should be e.ChatType.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Previous

Return to Help in Coding

Who is online

Users browsing this forum: No registered users and 5 guests