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