阿里云
1024开发者盛宴之Java专家问答专场
发表主题 回复主题
  • 1030阅读
  • 0回复

[其他]头脑王者版知识荣耀源码解说

级别: 新人
发帖
1
云币
2
29R_n)ne  
头脑王者版知识荣耀源码解说[size=;font-size:10.5000pt,10.5000pt](黄忆.1511.970.7084.微电.)提供头脑王者小程序源码包,集合源码解说、服务匹配安装服务等。[size=;font-size:10.5000pt,10.5000pt]  <'g0il  
[size=;font-size:10.5000pt,10.5000pt]采用:[size=;font-size:10.5000pt,10.5000pt] zb@L)%  
[size=;font-size:10.5000pt,10.5000pt]1、技术框架thinkphp5.0[size=;font-size:10.5000pt,10.5000pt] WpZy](,  
[size=;font-size:10.5000pt,10.5000pt]2php版本5.5以上、数据库是mysql5.5,即时通讯采用到workerman服务[size=;font-size:10.5000pt,10.5000pt]  JA }S{  
[size=;font-size:10.5000pt,10.5000pt] w:m'uB%W  
[size=;font-size:10.5000pt,10.5000pt]一、[size=;font-size:10.5000pt,10.5000pt]头脑王者php答题小程序源码开发[size=;font-size:10.5000pt,10.5000pt]段位源码展示 [size=;font-size:10.5000pt,10.5000pt] ({*.!ty  
[size=;font-size:10.5000pt,10.5000pt] QSqlQuery query;[size=;font-size:10.5000pt,10.5000pt] o%kSR ]V|  
[size=;font-size:10.5000pt,10.5000pt] $-C6pZN(X  
[size=;font-size:10.5000pt,10.5000pt]    // 先从数据库中获取之前的积分,将本次答题得分相加得到最新的积分[size=;font-size:10.5000pt,10.5000pt] |usnY  
[size=;font-size:10.5000pt,10.5000pt]    query.prepare("SELECT *FROM user_info  WHERE name = ? ");[size=;font-size:10.5000pt,10.5000pt] x(C]O,  
[size=;font-size:10.5000pt,10.5000pt]    query.addBindValue(name.toUtf8());[size=;font-size:10.5000pt,10.5000pt] 5A0K V7N5  
[size=;font-size:10.5000pt,10.5000pt]    query.exec();[size=;font-size:10.5000pt,10.5000pt] d_4n0Kh0  
[size=;font-size:10.5000pt,10.5000pt]    query.next();[size=;font-size:10.5000pt,10.5000pt] `77;MGg*  
[size=;font-size:10.5000pt,10.5000pt] h#(.(d  
[size=;font-size:10.5000pt,10.5000pt]    tmpScore = query.value(3).toInt() + score;[size=;font-size:10.5000pt,10.5000pt] d+gk q\  
[size=;font-size:10.5000pt,10.5000pt]    qDebug() << tmpScore;[size=;font-size:10.5000pt,10.5000pt] Ktg&G<%J0  
[size=;font-size:10.5000pt,10.5000pt] wZ (uq?3S`  
[size=;font-size:10.5000pt,10.5000pt]    switch(tmpScore / 100)[size=;font-size:10.5000pt,10.5000pt] NTpz)R  
[size=;font-size:10.5000pt,10.5000pt]    {[size=;font-size:10.5000pt,10.5000pt] y>)mSl@1y  
[size=;font-size:10.5000pt,10.5000pt]        case 0:[size=;font-size:10.5000pt,10.5000pt] J8qu]{0I"  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("青铜");[size=;font-size:10.5000pt,10.5000pt] Sa?~t3*H  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] S*~Na]nS0  
[size=;font-size:10.5000pt,10.5000pt]        case 1:[size=;font-size:10.5000pt,10.5000pt] &5kjjQ*HB  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("白银");[size=;font-size:10.5000pt,10.5000pt] Z'*G'/*  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] ~Mg8C9B?%3  
[size=;font-size:10.5000pt,10.5000pt]        case 2:[size=;font-size:10.5000pt,10.5000pt] hEdo,gF*  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("黄金");[size=;font-size:10.5000pt,10.5000pt] 18[?dV  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] \K4CbZ,.  
[size=;font-size:10.5000pt,10.5000pt]        case 3:[size=;font-size:10.5000pt,10.5000pt] 9hz7drhR;\  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("铂金");[size=;font-size:10.5000pt,10.5000pt] 2i4Dal  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] P:zEx]Y%  
[size=;font-size:10.5000pt,10.5000pt]        case 4:[size=;font-size:10.5000pt,10.5000pt] 9M-NItFos  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("钻石");[size=;font-size:10.5000pt,10.5000pt] &9jUf:gJ0  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] Oy?iAQ+  
[size=;font-size:10.5000pt,10.5000pt]        case 5:[size=;font-size:10.5000pt,10.5000pt] 0qaG#&!  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("星耀");[size=;font-size:10.5000pt,10.5000pt] H|(*$!~e  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] gZ79u  
[size=;font-size:10.5000pt,10.5000pt]        case 6:[size=;font-size:10.5000pt,10.5000pt] hg86#jq%  
[size=;font-size:10.5000pt,10.5000pt]            tmpLevel = QString("王者");[size=;font-size:10.5000pt,10.5000pt] D@YM}HXuj  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] >.k@!*  
[size=;font-size:10.5000pt,10.5000pt]         default:[size=;font-size:10.5000pt,10.5000pt] w oY)G7%  
[size=;font-size:10.5000pt,10.5000pt]            break;[size=;font-size:10.5000pt,10.5000pt] 7W>}7  
[size=;font-size:10.5000pt,10.5000pt]    }[size=;font-size:10.5000pt,10.5000pt] hQW#a]]V:  
[size=;font-size:10.5000pt,10.5000pt] #h5Hi9LKf  
[size=;font-size:10.5000pt,10.5000pt]    // 更新得分和段位[size=;font-size:10.5000pt,10.5000pt] LcQ\?]w`]  
[size=;font-size:10.5000pt,10.5000pt]    query.prepare("UPDATE user_info SET level = ?, total = ? WHERE name = ?");[size=;font-size:10.5000pt,10.5000pt] 0ghwFo  
[size=;font-size:10.5000pt,10.5000pt]    query.addBindValue(tmpLevel.toUtf8());[size=;font-size:10.5000pt,10.5000pt] P[J qJi/H  
[size=;font-size:10.5000pt,10.5000pt]    query.addBindValue(tmpScore);[size=;font-size:10.5000pt,10.5000pt] sN[@mAoH  
[size=;font-size:10.5000pt,10.5000pt]    query.addBindValue(name.toUtf8());[size=;font-size:10.5000pt,10.5000pt] ;j Y'z5PH5  
[size=;font-size:10.5000pt,10.5000pt]    query.exec();[size=;font-size:10.5000pt,10.5000pt] 9N3oVHc?  
[size=;font-size:10.5000pt,10.5000pt] K\%"RgF@&  
[size=;font-size:10.5000pt,10.5000pt]    sendToClient1.cmd   = UPDATESCORE;[size=;font-size:10.5000pt,10.5000pt] H 29 _ /  
[size=;font-size:10.5000pt,10.5000pt]    sendToClient1.level = tmpLevel;[size=;font-size:10.5000pt,10.5000pt] BYA=M*f  
[size=;font-size:10.5000pt,10.5000pt]    sendToClient1.total = tmpScore;[size=;font-size:10.5000pt,10.5000pt] JY,l#?lM{  
[size=;font-size:10.5000pt,10.5000pt] (WU~e!}  
[size=;font-size:10.5000pt,10.5000pt]    QByteArray block;[size=;font-size:10.5000pt,10.5000pt] A$Jn3Xd~!  
[size=;font-size:10.5000pt,10.5000pt]    QDataStream out(&block, QIODevice::WriteOnly);[size=;font-size:10.5000pt,10.5000pt] eJwii  
[size=;font-size:10.5000pt,10.5000pt]    out<<(qint16)0;[size=;font-size:10.5000pt,10.5000pt] e\bF_ N2VA  
[size=;font-size:10.5000pt,10.5000pt]    out<<sendToClient1;[size=;font-size:10.5000pt,10.5000pt] 1>O0Iu  
[size=;font-size:10.5000pt,10.5000pt]    out.device()->seek(0);[size=;font-size:10.5000pt,10.5000pt] `\/Wah}I  
[size=;font-size:10.5000pt,10.5000pt]    out<<(qint16)(block.size() - sizeof(qint16));[size=;font-size:10.5000pt,10.5000pt] ?;r7j V/`j  
[size=;font-size:10.5000pt,10.5000pt]    client->write(block, block.length());[size=;font-size:10.5000pt,10.5000pt] -QHzf&D?  
[size=;font-size:10.5000pt,10.5000pt] \Jj'60L^  
[size=;font-size:10.5000pt,10.5000pt]二、[size=;font-size:10.5000pt,10.5000pt]头脑王者php答题小程序源码开发[size=;font-size:10.5000pt,10.5000pt]注册页面、体型设置、赛程题目版块版块展示:[size=;font-size:10.5000pt,10.5000pt] m`4j|5  
[size=;font-size:10.5000pt,10.5000pt]public:[size=;font-size:10.5000pt,10.5000pt] zj$Z%|@$  
[size=;font-size:10.5000pt,10.5000pt]    explicit Mythread(QTcpSocket *client, QObject *parent = 0);[size=;font-size:10.5000pt,10.5000pt] Yhv`IV-s  
[size=;font-size:10.5000pt,10.5000pt]    void run();[size=;font-size:10.5000pt,10.5000pt] (UiH3Q9C]%  
[size=;font-size:10.5000pt,10.5000pt] EPUJa~4  
[size=;font-size:10.5000pt,10.5000pt]    void user_Register();       // 用户注册申请[size=;font-size:10.5000pt,10.5000pt] 4dD@lG~  
[size=;font-size:10.5000pt,10.5000pt]    void user_Login();          // 用户登录申请[size=;font-size:10.5000pt,10.5000pt] GmWQJYX\  
[size=;font-size:10.5000pt,10.5000pt]    void user_match();          // 用户匹配申请[size=;font-size:10.5000pt,10.5000pt] tGy%n[ \  
[size=;font-size:10.5000pt,10.5000pt]    void sendQues();            // 向用户分发题目[size=;font-size:10.5000pt,10.5000pt] , ?s k J  
[size=;font-size:10.5000pt,10.5000pt]                                // 重载定时器函数[size=;font-size:10.5000pt,10.5000pt] YUE 1 '}  
[size=;font-size:10.5000pt,10.5000pt]    void timerEvent(QTimerEvent *event);[size=;font-size:10.5000pt,10.5000pt] '&L   
[size=;font-size:10.5000pt,10.5000pt] ',-X#u  
[size=;font-size:10.5000pt,10.5000pt]signals:[size=;font-size:10.5000pt,10.5000pt] xN~<<PIZ  
[size=;font-size:10.5000pt,10.5000pt]    void client_match_socket(QTcpSocket *client);  // 将客户端的socket发给 主窗口保存[size=;font-size:10.5000pt,10.5000pt] '1T v1  
[size=;font-size:10.5000pt,10.5000pt] IU"!oM^  
[size=;font-size:10.5000pt,10.5000pt]    void send_user_info(QString name, QTcpSocket* client);[size=;font-size:10.5000pt,10.5000pt] uX 5B>32  
[size=;font-size:10.5000pt,10.5000pt] OsuSx^}  
[size=;font-size:10.5000pt,10.5000pt]    void send_trans_score(QTcpSocket* client, int score, QString name);[size=;font-size:10.5000pt,10.5000pt] ^ZZ@!Udy  
[size=;font-size:10.5000pt,10.5000pt] }lbx  
[size=;font-size:10.5000pt,10.5000pt]    void send_match_result(QTcpSocket* client, int score);[size=;font-size:10.5000pt,10.5000pt] ynz5Dy.d;  
[size=;font-size:10.5000pt,10.5000pt] g&20F`.N*>  
[size=;font-size:10.5000pt,10.5000pt]    void removeFromMap(QTcpSocket* client);[size=;font-size:10.5000pt,10.5000pt] Boz_*l|  
[size=;font-size:10.5000pt,10.5000pt] PyJblW  
[size=;font-size:10.5000pt,10.5000pt]public slots:[size=;font-size:10.5000pt,10.5000pt] k/f_@8  
[size=;font-size:10.5000pt,10.5000pt]    void dealClientData();[size=;font-size:10.5000pt,10.5000pt] oFA$X Y  
[size=;font-size:10.5000pt,10.5000pt] rEyMSLN  
[size=;font-size:10.5000pt,10.5000pt]private:[size=;font-size:10.5000pt,10.5000pt] ="*C&wB^  
[size=;font-size:10.5000pt,10.5000pt]    QTcpSocket *client;         // 客户端的socket[size=;font-size:10.5000pt,10.5000pt] TOP'Bmb  
[size=;font-size:10.5000pt,10.5000pt]    QSqlDatabase db;            // 数据库句柄[size=;font-size:10.5000pt,10.5000pt] !{- 3:N7  
[size=;font-size:10.5000pt,10.5000pt]    qint16 blocksize;[size=;font-size:10.5000pt,10.5000pt] e&I.kC"j6  
[size=;font-size:10.5000pt,10.5000pt]    Recv   Rec_msg;             // 接收的信息结构体[size=;font-size:10.5000pt,10.5000pt] wZolg~dg  
[size=;font-size:10.5000pt,10.5000pt] -cS4B//IK8  
[size=;font-size:10.5000pt,10.5000pt]    QVector<QString> ques;      // 题干[size=;font-size:10.5000pt,10.5000pt] _!T$|,a  
[size=;font-size:10.5000pt,10.5000pt]    QVector<QString> answer1;   // 选项 1[size=;font-size:10.5000pt,10.5000pt] .oOt(K +  
[size=;font-size:10.5000pt,10.5000pt]    QVector<QString> answer2;   // 选项 2[size=;font-size:10.5000pt,10.5000pt] uX!y,a/"  
[size=;font-size:10.5000pt,10.5000pt]    QVector<QString> answer3;   // 选项 3[size=;font-size:10.5000pt,10.5000pt] ~wV98u-N  
[size=;font-size:10.5000pt,10.5000pt]    QVector<int> correct;       // 正确答案[size=;font-size:10.5000pt,10.5000pt] iw6M3g#  
[size=;font-size:10.5000pt,10.5000pt] e5y`CXX  
[size=;font-size:10.5000pt,10.5000pt]    int timeID;                 // 定时器[size=;font-size:10.5000pt,10.5000pt] Gf$>!zXr  
[size=;font-size:10.5000pt,10.5000pt]    int num;[size=;font-size:10.5000pt,10.5000pt] 2QD B'xs3  
[size=;font-size:10.5000pt,10.5000pt]    int count;[size=;font-size:10.5000pt,10.5000pt] W5yu`Br  
[size=;font-size:10.5000pt,10.5000pt] ^,r;/c9A8  
[size=;font-size:10.5000pt,10.5000pt]};[size=;font-size:10.5000pt,10.5000pt]
发表主题 回复主题
« 返回列表上一主题下一主题

限100 字节
如果您提交过一次失败了,可以用”恢复数据”来恢复帖子内容
 
验证问题: 阿里云官网域名是什么? 正确答案:www.aliyun.com
上一个 下一个