Пример #1
0
        private static void DoMe(Pawn me, IrcClient ircClient, string userName, [NotNull] string command)
        {
            var message = new StringBuilder("@" + userName + " : ");

            command = command?.Substring(3)?.Trim()?.ToLower();
            if (!command.NullOrEmpty())
            {
                if (PawnCommand.CommonPawnCommands(me, command, message))
                {
                }
                else
                if (command.StartsWith(MeCommands.help.ToString()))
                {
                    if (helpText == null)
                    {
                        helpText = DefDatabase <HediffDef> .GetNamedSilentFail("rimtwitch_explain_me");
                    }
                    //Help Text
                    message.Append(helpText.description);
                }
                else if (command.StartsWith(MeCommands.fun.ToString()))
                {
                    foreach (var i in me.getTimeSpan(command))
                    {
                        FunTime(me, message, i);
                    }
                }

                else if (command.StartsWith(MeCommands.sleep.ToString()))
                {
                    foreach (var i in me.getTimeSpan(command))
                    {
                        SleepTime(me, message, i);
                    }
                }

                else if (command.StartsWith(MeCommands.work.ToString()))
                {
                    foreach (var i in me.getTimeSpan(command))
                    {
                        Work(me, message, i);
                    }
                }
                else
                {
                    message.Append("Sorry, What?");
                }
            }
            else
            {
                message.Append("Status: ").Append(me.Summarize());
            }

            ircClient.SendPublicChatMessage(message.ToString());
        }
Пример #2
0
        private static void DoRaider(Pawn me, IrcClient ircClient, string userName, string cmd)
        {
            var message = new StringBuilder("@" + userName + " : ");

            var command = cmd?.Substring(5)?.Trim()?.ToLower();

            if (!command.NullOrEmpty())
            {
                if (PawnCommand.CommonPawnCommands(me, command, message))
                {
                }
                else
                if (command.StartsWith(MeCommands.help.ToString()))
                {
                    if (helpText == null)
                    {
                        helpText = DefDatabase <HediffDef> .GetNamedSilentFail("rimtwitch_explain_raid");
                    }
                    //Help Text
                    message.Append(helpText.description);
                }
                else if (command.StartsWith(RaidCommands.escape.ToString()))
                {
                    Escape(me, message);
                }
                else
                {
                    message.Append("Sorry, What?");
                }
            }
            else
            {
                message.Append("Status: ").Append(me.Summarize());
            }

            ircClient.SendPublicChatMessage(message.ToString());
        }