Changeset View
Changeset View
Standalone View
Standalone View
ksirk/kgamewinslots.cpp
Show First 20 Lines • Show All 945 Lines • ▼ Show 20 Line(s) | 944 | { | |||
---|---|---|---|---|---|
946 | 946 | | |||
947 | QString body = message.body(); | 947 | QString body = message.body(); | ||
948 | QString nick = message.from().full(); | 948 | QString nick = message.from().full(); | ||
949 | 949 | | |||
950 | if ( message.type() == "groupchat" ) | 950 | if ( message.type() == "groupchat" ) | ||
951 | { | 951 | { | ||
952 | qCDebug(KSIRK_LOG) << "my jid:" << m_groupchatRoom+'@'+m_groupchatHost+'/'+m_groupchatNick; | 952 | qCDebug(KSIRK_LOG) << "my jid:" << m_groupchatRoom+'@'+m_groupchatHost+'/'+m_groupchatNick; | ||
953 | XMPP::Jid jid ( message.from().domain() ); | 953 | XMPP::Jid jid ( message.from().domain() ); | ||
954 | if (body.startsWith("I'm starting a game with skin") | 954 | if (body.startsWith(QLatin1String("I'm starting a game with skin")) | ||
955 | && m_presents.contains(message.from().full ()) | 955 | && m_presents.contains(message.from().full ()) | ||
956 | && message.from().full() != m_groupchatRoom+'@'+m_groupchatHost+'/'+m_groupchatNick) | 956 | && message.from().full() != m_groupchatRoom+'@'+m_groupchatHost+'/'+m_groupchatNick) | ||
957 | { | 957 | { | ||
958 | qCDebug(KSIRK_LOG) << "start game message"; | 958 | qCDebug(KSIRK_LOG) << "start game message"; | ||
959 | QRegExp rxlen("I'm starting a game with skin '([^']*)' and '(\\d+)' players"); | 959 | QRegExp rxlen("I'm starting a game with skin '([^']*)' and '(\\d+)' players"); | ||
960 | // int pos = rxlen.indexIn(body); | 960 | // int pos = rxlen.indexIn(body); | ||
961 | QString skin = rxlen.cap(1); // "189" | 961 | QString skin = rxlen.cap(1); // "189" | ||
962 | int nbPlayers = rxlen.cap(2).toInt(); // "cm" | 962 | int nbPlayers = rxlen.cap(2).toInt(); // "cm" | ||
963 | qCDebug(KSIRK_LOG) << "emiting newJabberGame" << nick << nbPlayers << skin; | 963 | qCDebug(KSIRK_LOG) << "emiting newJabberGame" << nick << nbPlayers << skin; | ||
964 | emit newJabberGame(nick, nbPlayers, skin); | 964 | emit newJabberGame(nick, nbPlayers, skin); | ||
965 | } | 965 | } | ||
966 | else if (body.startsWith("Who propose online KsirK games here?")) | 966 | else if (body.startsWith(QLatin1String("Who propose online KsirK games here?"))) | ||
967 | { | 967 | { | ||
968 | qCDebug(KSIRK_LOG) << "online games question" << m_automaton->stateName(); | 968 | qCDebug(KSIRK_LOG) << "online games question" << m_automaton->stateName(); | ||
969 | if (m_automaton->startingGame()) | 969 | if (m_automaton->startingGame()) | ||
970 | { | 970 | { | ||
971 | sendGameInfoToJabber(); | 971 | sendGameInfoToJabber(); | ||
972 | } | 972 | } | ||
973 | } | 973 | } | ||
974 | } | 974 | } | ||
▲ Show 20 Lines • Show All 275 Lines • Show Last 20 Lines |