public void SendCallResponse(string user, string name, CallResponse response, bool callChanged) { bool unnamed = string.IsNullOrEmpty(name); if (response == CallResponse.AlreadyCalled) { IRCConnection.SendMessageFormat("@{0}, you already called!", user); return; } else if (response == CallResponse.NotEnoughCalls) { if (callChanged) { IRCConnection.SendMessageFormat("@{0}, your call has been updated to {1}.", user, unnamed ? "the next queued command" : name); } GameCommands.CallCountCommand(); return; } else if (response == CallResponse.UncommonCalls) { if (callChanged) { IRCConnection.SendMessageFormat("@{0}, your call has been updated to {1}. Uncommon calls still present.", user, unnamed ? "the next queued command" : name); } else { IRCConnection.SendMessageFormat("Sorry, uncommon calls were made. Please either correct your call(s) or use “!callnow” followed by the correct command to call."); GameCommands.ListCalledPlayers(); } return; } else if (response == CallResponse.DifferentName) { CommandQueueItem call = CommandQueue.Find(item => item.Message.Text.StartsWith(name)); IRCConnection.SendMessageFormat("@{0}, module {1} is queued with the name “{2}”, please use “!call {2}” to call it.", user, name, call.Name); return; } else { unnamed = string.IsNullOrEmpty(commandToCall); if (callWaiting) { IRCConnection.SendMessageFormat("Waiting for {0} to be queued.", unnamed ? "the next unnamed queued command" : commandToCall.StartsWith("!") ? "module " + commandToCall : "the command named “" + commandToCall + "”"); } else { IRCConnection.SendMessageFormat("No {0} in the queue. Calling {1} when it is queued.", unnamed ? "unnamed commands" : commandToCall.StartsWith("!") ? "command for module " + commandToCall : "command named “" + commandToCall + "”", unnamed ? "the next unnamed queued command" : commandToCall.StartsWith("!") ? "module " + commandToCall : "the command named “" + commandToCall + "”"); callWaiting = true; } } }
public void CallUpdate(bool response) { var callResponse = CheckIfCall(true, false, "", commandToCall, out _); if (callResponse == CallResponse.Success) { GameCommands.CallQueuedCommand("", false, true, commandToCall); } else if (callResponse == CallResponse.NotPresent) { IRCConnection.SendMessageFormat("Waiting for {0} to be queued.", string.IsNullOrEmpty(commandToCall) ? "the next unnamed queued command" : commandToCall.StartsWith("!") ? "module " + commandToCall : "the command named “" + commandToCall + "”"); } else { callWaiting = false; } if (response) { GameCommands.CallCountCommand(); } }