예제 #1
0
파일: main.c 프로젝트: yangyaoweng/Afetion
int main()
{
    char Verify[4];
    char Account[20];
    char passwd[20];
    userinfo* info = fetionInit();

    printf("Account:");
    gets(Account);
    printf("Passwd:");
    gets(passwd);
    getVerify(info,"./");
    printf("Verify:");
    gets(Verify);

    login(info, Account, passwd, Verify);

    getFriendList(info);
    getFriend(info);
    toChat(info);


    sendMsgBymobileNo(info, "10086",  "zhai gan sha!");

    return 0;
}
void ChatLine::onReturnPressed()
{    
    if(!text().isEmpty())
    {
        QStringList args = text().split(" ");
        if(args.size()>1){
            bool ok;
            int id = args[1].toInt(&ok);
            ok &= id > -1 && id < dataInterface->getPlayerMax();
            if(ok && args[0] == "mute"){
                logic->muteUser(id);
                gui->chatAppend(-1, QStringLiteral("<font color=\'pink\'>玩家%1被关进小黑屋</font>").arg(QString::number(id)));
                clear();
                return;
            }
            else if(ok && args[0] == "unmute"){
                logic->unmuteUser(id);
                gui->chatAppend(-1, QStringLiteral("<font color=\'pink\'>玩家%1又放出来了</font>").arg(QString::number(id)));
                clear();
                return;
            }
        }
        network::Talk* talk = new network::Talk();
        talk->set_txt(text().toStdString());
        emit toChat(network::MSG_TALK, talk);
    }
    clear();
}