It is currently November 14th, 2018, 5:55 pm


All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Staff IRC channel
PostPosted: September 10th, 2012, 2:34 am 

Joined: April 3rd, 2012, 1:08 am
Posts: 25
Have the option to have all staff-chat forwarded to a separate IRC channel. This would allow for people on IRC (which is usually mostly server staff) to communicate privately to staff members in-game without the people in-game having to switch between IRC and Minecraft. You could then set the IRC channel up to be invite-only or whatever.

_________________
nope__avi


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Staff IRC channel
PostPosted: September 10th, 2012, 7:19 am 
Trustee
User avatar

Joined: May 24th, 2011, 1:40 pm
Posts: 1766
Location: Leiden, Zuid Holland
We did that with a bot

_________________
Ferrisbuler2: i will stay but i might not post cus of ollieboy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Staff IRC channel
PostPosted: September 10th, 2012, 3:46 pm 
User avatar

Joined: October 20th, 2011, 9:20 am
Posts: 220
Location: Subnet
It's an interesting idea for sure, though it may be insecure when not configured well.

Though, the security on the IRC network end isn't really fCraft's problem.

Sanjar Khan wrote:
We did that with a bot
Sanjar, I am sometimes completely baffled and confused by your replies.

_________________
A = {x ∈ P(U) | x ∉ x}

Show
Mods:
  1. /Su - Allows players to temporarily become a different rank
  2. /Snap - Like /Line but only draws straight or diagonal lines.
  3. pre-0.630 skip/none block


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Staff IRC channel
PostPosted: September 10th, 2012, 5:00 pm 
Trustee
User avatar

Joined: May 24th, 2011, 1:40 pm
Posts: 1766
Location: Leiden, Zuid Holland
Just saying, you could use a bot to forward it like Hafnium did with HBOT.

_________________
Ferrisbuler2: i will stay but i might not post cus of ollieboy


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Staff IRC channel
PostPosted: September 10th, 2012, 7:25 pm 

Joined: April 3rd, 2012, 1:08 am
Posts: 25
Hellenion wrote:
Though, the security on the IRC network end isn't really fCraft's problem.


It would be up to the server owner to configure the IRC channel to keep it secure.

Sanjar Khan wrote:
We did that with a bot


Not everyone knows how to set up a bot to do it (I certainly don't). Also, just because you can do it with a bot doesn't mean it shouldn't be integrated with fCraft.

_________________
nope__avi


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Staff IRC channel
PostPosted: September 10th, 2012, 8:04 pm 
SupOP

Joined: June 24th, 2011, 10:27 pm
Posts: 314
If you are able to mod your fcraft and want a quick fix, this will send public messages to all the channels that do not end in "staff" and all the staff messages to channels that end in "staff" (e.g. you could have two channels #myserver and #myserver.staff).

(I'm not sure if this is the latest version, but I assume IRC code hasnt been changed recently.)

On line 570 of IRC.cs, find this:
Show
Code:
case ChatMessageType.Global:
                    if( enabled ) {
                        SendChannelMessage( args.Player.ClassyName + Color.IRCReset + ": " + args.Message );
                    } else if( args.Message.StartsWith( "#" ) ) {
                        SendChannelMessage( args.Player.ClassyName + Color.IRCReset + ": " + args.Message.Substring( 1 ) );
                    }
                    break;

and immediately after it on the next line add:
Show
Code:
case ChatMessageType.Staff:
                    if( enabled ) {
                        SendStaffChannelMessage( args.Player.ClassyName + Color.IRCReset + ": " + args.Message );
                    } else if( args.Message.StartsWith( "#" ) ) {
                        SendStaffChannelMessage( args.Player.ClassyName + Color.IRCReset + ": " + args.Message.Substring( 1 ) );
                    }
                    break;


On line 482 of the same file, find:
Show
Code:
public static void SendChannelMessage( [NotNull] string line ) {
            if( line == null ) throw new ArgumentNullException( "line" );
            if( channelNames == null ) return; // in case IRC bot is disabled.
            if( ConfigKey.IRCUseColor.Enabled() ) {
                line = Color.ToIRCColorCodes( line );
            } else {
                line = NonPrintableChars.Replace( line, "" ).Trim();
            }
            for( int i = 0; i < channelNames.Length; i++ ) {
                  SendRawMessage(IRCCommands.Privmsg(channelNames[i], line));               
            }
        }


Delete it and paste the following right there:
Show
Code:
public static void SendChannelMessage( [NotNull] string line ) {
            if( line == null ) throw new ArgumentNullException( "line" );
            if( channelNames == null ) return; // in case IRC bot is disabled.
            if( ConfigKey.IRCUseColor.Enabled() ) {
                line = Color.ToIRCColorCodes( line );
            } else {
                line = NonPrintableChars.Replace( line, "" ).Trim();
            }
            for( int i = 0; i < channelNames.Length; i++ ) {
                if (!channelNames[i].EndsWith("staff")) {
                    SendRawMessage(IRCCommands.Privmsg(channelNames[i], line));
                }
            }
        }

        public static void SendStaffChannelMessage(string line) {
            if (line == null) throw new ArgumentNullException("line");
            if (channelNames == null) return;
            if (ConfigKey.IRCUseColor.Enabled()) {
                line = Color.ToIRCColorCodes(line);
            }
            else {
                line = NonPrintableChars.Replace(line, "").Trim();
            }
            for (int i = 0; i < channelNames.Length; i++) {
                if (channelNames[i].EndsWith("staff")) {
                    SendRawMessage(IRCCommands.Privmsg(channelNames[i], line));
                }
            }
        }


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Staff IRC channel
PostPosted: September 10th, 2012, 9:15 pm 
fCraft Developer
User avatar

Joined: May 21st, 2011, 10:53 pm
Posts: 1386
(Note that modded copies of fCraft are not supported. Use at your own risk.)


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net