public override void Build()
 {
     SendingBuffer = IRCReplyBuilder.Build(_result.UserIRCPrefix,
                                           ResponseName.PrivateMsg,
                                           _result.TargetName,
                                           _request.Message);
 }
예제 #2
0
        public override void Build()
        {
            SendingBuffer = IRCReplyBuilder.Build(
                ResponseName.WhoIsUser,
                cmdParams: $"{_result.NickName} {_result.Name} {_result.UserName} {_result.PublicIPAddress} *",
                _result.UserName);

            if (_result.JoinedChannelName.Count() != 0)
            {
                string channelNames = "";
                //todo remove last space
                foreach (var name in _result.JoinedChannelName)
                {
                    channelNames += $"@{name} ";
                }

                SendingBuffer += IRCReplyBuilder.Build(
                    ResponseName.WhoIsChannels,
                    $"{_result.NickName} {_result.Name}",
                    channelNames
                    );

                SendingBuffer += IRCReplyBuilder.Build(
                    ResponseName.EndOfWhoIs,
                    $"{_result.NickName} {_result.Name}",
                    "End of /WHOIS list."
                    );
            }
        }
예제 #3
0
 public static string BuildWelcomeReply(string nickName)
 {
     return(IRCReplyBuilder.Build(
                ResponseName.Welcome,
                cmdParams: nickName,
                tailing: "Welcome to UniSpy!"));
 }
예제 #4
0
        public override void Build()
        {
            var cmdParams = $"* {ChatCrypt.ClientKey} {ChatCrypt.ServerKey}";

            SendingBuffer = IRCReplyBuilder.Build(
                ResponseName.SecureKey, cmdParams);
        }
예제 #5
0
        public override void Build()
        {
            //CDKey is always true
            var cmdParams = $"param1 1 :Authenticated";

            SendingBuffer = IRCReplyBuilder.Build(
                ResponseName.CDKey, cmdParams);
        }
예제 #6
0
        public static string BuildWhoReply(WhoDataModel data)
        {
            var cmdParams =
                $"param1 {data.ChannelName} {data.UserName} " +
                $"{data.PublicIPAddress} param5 {data.NickName} {data.Modes} param8";

            return(IRCReplyBuilder.Build(ResponseName.WhoReply, cmdParams));
        }
예제 #7
0
 public static string BuildPartReply(string userIRCPrefix, string channelName, string message)
 {
     return(IRCReplyBuilder.Build(
                userIRCPrefix,
                ResponseName.Part,
                channelName,
                message));
 }
예제 #8
0
        public static string BuildEndOfNameReply(string nickName, string channelName)
        {
            string cmdParams = $"{nickName} {channelName}";
            string tailing   = @"End of /NAMES list.";

            return(IRCReplyBuilder.Build(
                       ResponseName.EndOfNames,
                       cmdParams,
                       tailing));
        }
예제 #9
0
        public override void Build()
        {
            var cmdParams = $"param1 {_result.ChannelName} {_request.Cookie} {_result.Values}";

            SendingBuffer = IRCReplyBuilder.Build(
                _result.ChannelUserIRCPrefix,
                ResponseName.GetChanKey,
                cmdParams,
                null);
        }
예제 #10
0
        public static string BuildEndOfWhoReply(string name)
        {
            var cmdParams = $"param1 {name} param3";
            var tailing   = "End of WHO.";

            return(IRCReplyBuilder.Build(
                       ResponseName.EndOfWho,
                       cmdParams,
                       tailing));
        }
        public static string BuildEndOfGetCKeyReply(string channelName, string cookie)
        {
            var cmdParams = $"param1 {channelName} {cookie}";
            var tailing   = "End Of /GETCKEY.";

            return(IRCReplyBuilder.Build(
                       ResponseName.EndGetCKey,
                       cmdParams,
                       tailing));
        }
        public override void Build()
        {
            SendingBuffer = "";
            foreach (var data in _result.DataResults)
            {
                SendingBuffer += IRCReplyBuilder.Build(ResponseName.GetCKey,
                                                       $"* {data.NickName} {_request.ChannelName} {_request.Cookie} {data.UserValues}");
            }

            SendingBuffer += IRCReplyBuilder.Build(ResponseName.EndGetCKey,
                                                   $"* {_request.ChannelName} {_request.Cookie}",
                                                   "End Of /GETCKEY.");
        }
예제 #13
0
        public override void Build()
        {
            SendingBuffer = "";
            foreach (var flag in _result.Flags)
            {
                string cmdParams1 = $"param1 {_result.NickName} {_request.Cookie} {flag}";
                SendingBuffer += IRCReplyBuilder.Build(ResponseName.GetKey, cmdParams1);
            }
            string cmdParams2 = $"param1 param2 {_request.Cookie} param4";
            string tailing    = "End of GETKEY.";

            SendingBuffer += IRCReplyBuilder.Build(ResponseName.EndGetKey, cmdParams2, tailing);
        }
예제 #14
0
 public override void Build()
 {
     SendingBuffer = "";
     foreach (var info in _result.ChannelInfoList)
     {
         var cmdParams = $"param1 {info.ChannelName} {info.TotalChannelUsers} {info.ChannelTopic}";
         SendingBuffer += IRCReplyBuilder.Build(
             _result.UserIRCPrefix,
             ResponseName.ListStart,
             cmdParams,
             null);
     }
     SendingBuffer += IRCReplyBuilder.Build(_result.UserIRCPrefix, ResponseName.ListEnd, null, null);
 }
예제 #15
0
 public override void Build()
 {
     if (_request.RequestType == ModeRequestType.GetChannelModes)
     {
         //channel modes reply
         string cmdParams = $"{_result.ChannelName} {_result.ChannelModes}";
         SendingBuffer = IRCReplyBuilder.Build(ResponseName.Mode, cmdParams);
     }
     else if (_request.RequestType == ModeRequestType.GetChannelUserModes)
     {
         //channel user mode reply
         string cmdParams = $"{_result.JoinerNickName} {_result.ChannelName} {_result.ChannelModes}";
         SendingBuffer = IRCReplyBuilder.Build(ResponseName.ChannelModels, cmdParams);
     }
 }
예제 #16
0
        public override void Build()
        {
            string flags = "";

            foreach (var kv in _request.KeyValue)
            {
                flags += $@"\{kv.Key}\{kv.Value}";
            }
            var cmdParams = $"param1 {_request.ChannelName} BCAST {flags}";

            SendingBuffer =
                IRCReplyBuilder.Build(
                    _result.ChannelUserIRCPrefix,
                    ResponseName.GetChanKey,
                    cmdParams,
                    null);
        }
예제 #17
0
        public override void Build()
        {
            // string modeReply = MODEResponse.BuildChannelModeReply(
            //           _request.ChannelName, _result.ChannelModes);

            // if (!_result.IsAlreadyJoinedChannel)
            // {
            //     SendingBufferOfChannelUsers = ChatIRCReplyBuilder.Build(
            //         _result.JoinerPrefix,
            //         ChatReplyName.JOIN,
            //         _request.ChannelName,
            //         null);
            //     SendingBufferOfChannelUsers += modeReply;
            // }

            SendingBuffer = IRCReplyBuilder.Build(
                _result.JoinerPrefix,
                ResponseName.Join,
                _request.ChannelName,
                null);
        }
예제 #18
0
 public void Build()
 {
     SendingBuffer = IRCReplyBuilder.Build(ErrorCode);
 }
예제 #19
0
 public override void Build()
 {
     SendingBuffer = IRCReplyBuilder.Build(_result.RequesterIRCPrefix, ResponseName.Pong, null, null);
 }
        public static string BuildGetCKeyReply(string nickname, string channelName, string cookie, string flags)
        {
            var cmdParams = $"* {channelName} {nickname} {cookie} {flags}";

            return(IRCReplyBuilder.Build(ResponseName.GetCKey, cmdParams));
        }
예제 #21
0
 public override void Build()
 {
     SendingBuffer = IRCReplyBuilder.Build(
         ResponseName.Login,
         cmdParams: $"* {_result.UserID} {_result.ProfileId}");
 }
예제 #22
0
 public static string BuildChannelUserModesReply(string nickName, string channelName, string modes)
 {
     return(IRCReplyBuilder.Build(ResponseName.ChannelModels,
                                  $"{nickName} {channelName} {modes}"));
 }
예제 #23
0
 public override void Build()
 {
     SendingBuffer = IRCReplyBuilder.Build(_result.UserIRCPrefix, ResponseName.UnderTheTableMsg, _result.Name, _request.Message);
 }
예제 #24
0
        public static string BuildChannelModeReply(string channelName, string modes)
        {
            var cmdParams = $"{channelName} {modes}";

            return(IRCReplyBuilder.Build(ResponseName.Mode, cmdParams));
        }
예제 #25
0
 public static string BuildNameReply(string nickName, string channelName, string nicksString)
 {
     return(IRCReplyBuilder.Build(
                ResponseName.NameReply,
                $"{nickName} = {channelName}", nicksString));
 }
예제 #26
0
        public override void Build()
        {
            string cmdParams = $"{_result.TargetName} {_request.Message}";

            SendingBuffer = IRCReplyBuilder.Build(_result.UserIRCPrefix, ResponseName.AboveTheTableMsg, cmdParams);
        }
예제 #27
0
 public static string BuildTopicReply(string channelName, string channelTopic)
 {
     return(IRCReplyBuilder.Build(ResponseName.ChannelTopic, channelName, channelTopic));
 }
예제 #28
0
 public static string BuildNoTopicReply(string channelName)
 {
     return(IRCReplyBuilder.Build(ResponseName.NoTopic, channelName));
 }
예제 #29
0
        public override void Build()
        {
            var cmdParams = $"{_result.ChannelName} {_result.KickerNickName} {_result.KickeeNickName}";

            SendingBuffer = IRCReplyBuilder.Build(_result.KickerIRCPrefix, ResponseName.Kick, cmdParams, null);
        }
예제 #30
0
 public static string BuildUserIPReply(string ip)
 {
     return(IRCReplyBuilder.Build(ResponseName.UserIP, null, $"@{ip}"));
 }