Example #1
0
void GameChatQueue::pushLineFromKeyboardToGame(std::string line)
{
	// Messages beginning with !t or !team are team messages
	if (line.substr(0, 3) == "!t " || line.substr(0, 6) == "!team ")
	{
		if (!Server::Chat::SendTeamMessage(line.substr(line.find(' ') + 1)))
			pushLineFromGameToUI("(Failed to send message! Are you in a game with teams enabled?)");
	}
	else
	{
		if (!Server::Chat::SendGlobalMessage(line))
			pushLineFromGameToUI("(Failed to send message! Are you in a game?)");
	}	
}
Example #2
0
void ConsoleQueue::pushLineFromGameToUIMultipleLines(std::string multipleLines)
{
	std::vector<std::string> linesVector;
	split(multipleLines, '\n', linesVector);

	for (std::string line : linesVector)
	{
		pushLineFromGameToUI(line);
	}
}
Example #3
0
void GameChatQueue::pushLineFromKeyboardToGame(std::string line)
{
	auto& ircBackend = IRCBackend::Instance();
	auto& console = GameConsole::Instance();
	ircBackend.sendMessageToChannel(ircBackend.gameChatChannel, &console.gameChatQueue, line);

	std::string preparedLineForUI = GameConsole::Instance().playerName;
	preparedLineForUI = preparedLineForUI.substr(preparedLineForUI.find_first_of("|") + 1, std::string::npos);
	preparedLineForUI += ": ";
	preparedLineForUI += line;
	pushLineFromGameToUI(preparedLineForUI);
}
Example #4
0
void GlobalChatQueue::pushLineFromKeyboardToGame(std::string line)
{
	auto& ircBackend = IRCBackend::Instance();
	auto& console = GameConsole::Instance();
	ircBackend.sendMessageToChannel(ircBackend.globalChatChannel, &console.globalChatQueue, line);

	std::string preparedLineForUI = GameConsole::Instance().ircName;
	preparedLineForUI = "<" + preparedLineForUI.substr(preparedLineForUI.find_first_of("|") + 1, std::string::npos);
	preparedLineForUI += "> ";
	preparedLineForUI += line;
	Utils::String::RemoveCharsFromString(preparedLineForUI, "\t\r\n");
	pushLineFromGameToUI(preparedLineForUI);
}
Example #5
0
void ConsoleQueue::pushLineFromKeyboardToGame(std::string line)
{
	pushLineFromGameToUI(">" + line);
	pushLineFromGameToUIMultipleLines(Modules::CommandMap::Instance().ExecuteCommand(line, true));
}