Modify on someone else's client to match the test's own server

Source: Internet
Author: User

1. Modify the Gamemanager::m_serverip = "192.168.1.225" in the Gamemanager class;

In the 2.SceneMain class, when you click on the room type, send your own game type ID, such as my game is 3101, so this change to 31, instead of the normal case of GAMETYPEINDEX_CD

M_scenedata.m_gameindex = 31;//GAMETYPEINDEX_CD;
M_scenedata.m_gamegrade = 0;
M_sceneroom->onrun (TRUE);
Break

3. Modify the Sceneroom class (plus case 31 matches the scene you want to enter)

voidSceneroom::onrunlogonfinish (BOOLlogin) {Gamedataref* view=NULL; Switch(m_scenedata.m_gameindex) { Case   to:     CaseGametypeindex_cd:view= (gamedataref*) (Scnencontrolphz::getinstance ()Setcurrentscene (SCENE_GAME_CD));  Break;  CaseGametypeindex_ww:view= (gamedataref*) (Scnencontrolphz::getinstance ()Setcurrentscene (SCENE_GAME_WW));  Break;  CaseGametypeindex_lhq:view= (gamedataref*) (Scnencontrolphz::getinstance ()Setcurrentscene (SCENE_GAME_LHQ));  Break;  CaseGametypeindex_zp:view= (gamedataref*) (Scnencontrolphz::getinstance ()Setcurrentscene (SCENE_GAME_ZP));  Break;  CaseGametypeindex_whz:view= (gamedataref*) (Scnencontrolphz::getinstance ()Setcurrentscene (scene_game_whz));  Break; default:         Break; }    //Friends Room does not need to login    if(login) {View->runaction (Ccsequence::create (Ccdelaytime::create (1.0f), Callfunc::create (Cc_callback_0 (Gamedataref::onlogin,view)), nullptr)); }}

4. By looking at Setcurrentscene (SCENE_GAME_CD) in the code above, we can tell that he jumps to the Cdsceneview table interface (CD indicates Changde) and then handles the game's logic messages through Ongamemessagerun.

5. Next we deal with the correspondence between our own picture and logical data, which is in Gameresbase.

6. Turn back to view the processing logic after the game start message (Onsubgamestart function)

Modify on someone else's client to match the test's own server

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.