Lianzhong Upgrade Agreement Analysis Continue (6) Cloud Network (Jimzj@21cn.com) Connected to the top 6, the bottom card command has said so much, finally a game has come to the end, that is, after completion, the server returns the last The basement information is. This directive also includes some other instructions, but even if you don't know, it doesn't matter, because a round is over, huh, if you are win, don't publish too much fierce words, or you will not be with you with you. Play, huh, J
0x0100 15 20 00 00 08 01 00 00-08 00 00 00 02 01 00 00. .............. 0x0110 00 00 00 00 01 00 00 00-78 00 00 00 00 00 00 00 ........ x ....... 0x0120 02 00 00 00 Fe FF FF-02 00 00 00 Fe FF FF ....? ....? 0x0130 17 00 00 00 03 00 00 00-0B 00 00 00 00 00 00 00 ................ 0x0140 00 00 00 00 01 00 00 00-01 00 00 00 14 00 00 00 ..............
The information of the base card As long as you look at your score, it is easy to know that the score is in that one. Here, the score is 120 = 0x78, it is easy to see that it is that a score is a score. There is also the information of the base card. This and the information is almost the same, one is color, card number, which can be represented by the following data structure:
Typedef struct _tagshjifinishinfo {int nflag0; int NFLAG1;
Int nflag2; int nflag3; int nscore; // score int NFLAG4;
Int nflag5; int nflag6; int nflag7; int NFLAG8;} shjifinishinfo, * lpshjifinishinfo;
Typedef struct _tagshjifinishcard {int NFLAG0; Char ccolor; // brand color charg1; char cflag2; char cflag3;
CHAR CCARD; / Brand number Char cflag4; char cflag5; char cflag6;
Int nflag7; int NFLAG8; int NFLAG9; int NFLAG10;} shjifinishcard, * lpshjifinishcard;
In this data structure is divided into two parts, if it is two pay cards, then the resulting card information is also 8, and there is also no such information, like this information, and only the above deduction information. Give the number of baselines. Here is the basement information void __fastcall tfrmmain :: RevfinishInfo (Char * PPackContent) {shjifinishinfo * Pinfo = (shjifinishinfo *) PPackContent;
// Benke information for (int i = 0; i
/ / Calculate the next round of hitting level IF (Pinfo-> nscore == 0) // 0 points {if (m_zhangjia == pOS_LEFT || M_ZHANGJIA == POS_RIGHT) {m_cdaji02 = m_cdaji02 3;} else {m_cdaji13 = m_cDaJi13 3;}} else if (pInfo-> nScore <20 * m_nPaiNum) {if (m_ZhangJia == POS_LEFT || m_ZhangJia == POS_RIGHT) {m_cDaJi02 = m_cDaJi02 2;} else {m_cDaJi13 = m_cDaJi13 2;} } else if (pInfo-> nScore <40 * m_nPaiNum) {if (m_ZhangJia == POS_LEFT || m_ZhangJia == POS_RIGHT) {m_cDaJi02 = m_cDaJi02 1;} else {m_cDaJi13 = m_cDaJi13 1;}} else {int nShenji = (PINFO-> NSCORE - 40 * m_npainum) / (20 * m_npainum); nshenji = (nshenji <0? 0: nshenji);
IF (m_zhangjia == pos_left || m_zhangjia == pOS_RIGHT) {m_cdaji13 = m_cdaji13 nshenji;} else {m_cdaji02 = m_cdaji02 nshenji;}
m_zhangjia = m_zhangjia 1; if (m_zhangjia> pOS_BOT) m_zhangjia = pos_left;}
IF (m_zhangjia == pOS_LEFT || M_ZHANGJIA == POS_Right) {m_cdaji = m_cdaji02;} else {m_cdaji = m_cdaji13;}} When the basement information is obtained, the last score can also be analyzed to analyze the next level. What is playing, and there is a user is the user, and the above process contains this analysis process, some of the comments, I believe everyone can see it.
At this point, the agreement analysis I have to do is finished, and some of the core code I have done will be given. Everyone should see the combination of analysis and implementation from these codes, try to do one. Explea, for advanced players may not be accomplished, but what I did here is just learning and discussing with everyone, of course, I can contact me Jimzj@21cn.com.
At the time of the agreement analysis, I also thought of another problem, because the game is almost the format of the game, so I believe that you have the experience of the above upgrade, you can try to analyze other bridge cards. , The landlord, double copy and other chess games, I know the port of these games to set the following: // Game port enum out {port_chat = 2002, // Lian Tian Port_Dodz = 3003, // Dou Gloss Port_shji = 3004, // Upgrade Port_shko = 3008 // Double copy}; there are several problems, I don't have time to implement, but here to talk to everyone: 1. When playing in Internet cafes, if you know the IP of the home, you Setting up the plug-in capture when setting up only capturing the other party's bag, so you can get the information of the other party (because all the package information you can receive, huh, huh J); 2, Lianzhong upgrade When chatting, chat is often dead, you can use the 2002 port to send Lian Tian information directly to the server, so you don't have to die for chat programs; 3. If you know the IP of home, you can hang in the network Do a C / S port, used to pass the information of the card, which can also achieve the purpose of understanding the card information of the home; 4, the Lianzhong can let other players go to the side, so if you are playing, You can use a plug-in to generate an IP package to apply for an additional section of several other users, so you can get the information of the player who played with you, this way you want to look at someone's card, is it? Very despicable, huh, huh ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - This article is over ----------------------------------------- by this level Where there is any mistake, please point out, learn, discuss, my contact email address is: jimzj@21cn.com.