Lobby.js 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961
  1. cc.Class({
  2. extends: cc.BaseClass,
  3. properties: {
  4. },
  5. ctor: function () {
  6. this.m_BasicSound = new Array();
  7. this.m_BasicSound['BGM0'] = 'BGM0';
  8. this.m_BasicSound['BGM1'] = 'BGM1';
  9. this.m_BasicSound['BGM2'] = 'BGM2';
  10. this.m_BasicSound['Button'] = 'button';
  11. this.m_BasicSound['SendCard'] = 'sendcard';
  12. this.m_BasicSound['Jet'] = 'Jet';
  13. this.m_ClubRoomCnt = new Array();
  14. },
  15. onEnable: function () {
  16. cc.director.on('Lobby_InitShareInfo', this.OnInitShareInfo, this);
  17. },
  18. onDisable: function () {
  19. cc.director.off('Lobby_InitShareInfo', this.OnInitShareInfo, this);
  20. },
  21. onLoad: function () {
  22. cc.debug.setDisplayStats(false);
  23. FitSize(this.node);
  24. if (!this.m_Loading) this.m_Loading = this.$('loading');
  25. this.m_Loading.zIndex = 100;
  26. this.m_Loading.active = false;
  27. this.m_bTipGPS = false;
  28. window.g_CntGameGPS = 0;
  29. ShowO2I(this.node, 0.5);
  30. window.LoadSetting();
  31. cc.gSoundRes.LoadSoundArr(this.m_BasicSound, 'PublicAudio');
  32. if (cc.share.IsH5_WX()) {
  33. this.$('plazabg/NdButton/MenuBG/BtExit', this.m_MenuNode).active = false;
  34. }
  35. this.onSwitchBG();
  36. },
  37. start: function () {
  38. g_ServerListDataLast = null;
  39. g_ShowClubInfo = null;
  40. this.BindButtonInit();
  41. g_Launch = null;
  42. g_Login = null;
  43. g_Lobby = this;
  44. g_Table = null;
  45. g_CurScene = this;
  46. this.m_DlgNode = this.$('DlgFrame');
  47. this.m_MeUserCtrl = this.$('plazabg/NdButton/UserCtrl@UserCtrl');
  48. this.m_RoomCard = this.$('plazabg/NdButton/BtGetGold/L_RoomCard@Label');
  49. this.m_MenuNode = this.$('plazabg/NdButton/MenuBG');
  50. this.m_MenuNode.active == false;
  51. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  52. if (pGlobalUserData.dwUserID == 0) {
  53. this.ShowLoading();
  54. var AutoLogonAcc = getQueryString("AAcc");
  55. if (AutoLogonAcc) {
  56. window.g_PhpUserName = AutoLogonAcc;
  57. window.g_PhpPassword = getQueryString("APsw");
  58. }
  59. if (window.g_PhpUserName == '') window.g_PhpUserName = null;
  60. getLinkInfo();
  61. this.m_NeedLogin = true;
  62. } else {
  63. this.onGPLoginComplete();
  64. }
  65. if (window.POP_NOTICE > 0 && g_Table == null) {
  66. window.POP_NOTICE = 0;
  67. var ActivityPop = parseInt(cc.sys.localStorage.getItem(window.Key_ActivityPop));
  68. if (!ActivityPop) {
  69. this.scheduleOnce(this.OnClick_BtActivity, 0.5);
  70. } else {
  71. var last = new Date(ActivityPop);
  72. var cur = new Date();
  73. if (last.getFullYear() != cur.getFullYear() || last.getMonth() != cur.getMonth() || last.getDay() != cur.getDay()) {
  74. this.scheduleOnce(this.OnClick_BtActivity, 0.5);
  75. }
  76. }
  77. }
  78. this.scheduleOnce(this.ShowCustomClick, 0.5);
  79. },
  80. loginGiftDiamond: function () {
  81. console.log('loginGiftDiamond')
  82. let pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  83. let webUrl = window.PHP_HOME + '/SignIn.php?&GetMark=2&dwUserID=' + pGlobalUserData.dwUserID;
  84. WebCenter.GetData(webUrl, null, function (data) {
  85. if (data == null) return;
  86. let Res = JSON.parse(data);
  87. console.log('loginGiftDiamond--', Res)
  88. if (Res.RewardCard > 0) {
  89. this.ShowAlert(Res.Desc);
  90. //this.OnShowView(true);
  91. if (Res.Card != null) pGlobalUserData.llUserIngot = Res.Card;
  92. this.m_RoomCard.string = pGlobalUserData.llUserIngot;
  93. }
  94. }.bind(this));
  95. },
  96. ShowCustomClick: function () {
  97. this.loginGiftDiamond();
  98. this.ShowPrefabDLG('CustomClick', this.node, function (Js) {
  99. this.m_CustomClick = Js;
  100. //Js.node.zIndex = -1;
  101. }.bind(this));
  102. },
  103. OnAutoJoinClub: function (kind, allianceID) {
  104. this.ShowPrefabDLG('ClubFreeDLG', this.m_DlgNode, function (Js) {
  105. Js.ShowKind(kind)
  106. Js.AutoJoin(allianceID)
  107. });
  108. },
  109. OnInitShareInfo: function () {
  110. cc.share.InitShareInfo_H5_WX(this.GetShareInfo.bind(this));
  111. },
  112. //登陆成功
  113. onGPLoginComplete: function () {
  114. //播放背景音乐
  115. //var BGMIndex = cc.sys.localStorage.getItem(window.clientName+window.Key_TableBGM);
  116. var BGMIndex = window.g_Setting[window.SetKey_Lobby_Music]
  117. if (BGMIndex == null) BGMIndex = 0
  118. cc.gSoundRes.PlayMusic("BGM" + BGMIndex, false);
  119. //播放背景音乐
  120. this.StopLoading();
  121. //用户数据更新
  122. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  123. this.m_MeUserCtrl.SetUserByID(pGlobalUserData.dwUserID);
  124. this.m_MeUserCtrl.SetShowFullName(false, 6);
  125. this.OnBtRefeshRoomCard();
  126. if (ShowLobbyClub != 0) this.OnBtShowClub();
  127. //邀请链接房间查询
  128. // if(LinkInfo && LinkInfo.LinkRoom && LinkInfo.LinkRoom[0] != 0) {
  129. // this.OnQueryRoom(parseInt(LinkInfo.LinkRoom[0]), parseInt(LinkInfo.LinkRoom[1]));
  130. // }
  131. //微信H5分享链接
  132. if (cc.sys.browserType == cc.sys.BROWSER_TYPE_WECHAT || cc.sys.browserType == cc.sys.BROWSER_TYPE_MOBILE_QQ) {
  133. var ShareInfo = this.GetShareInfo();
  134. ThirdPartyShareMessage(ShareInfo, 0);
  135. ThirdPartyShareMessage(ShareInfo, 1);
  136. }
  137. if (!window.ClubPara) {
  138. var webUrl = window.PHP_HOME + '/League.php?&GetMark=16';
  139. WebCenter.GetData(webUrl, 999999, function (data) {
  140. window.ClubPara = JSON.parse(data);
  141. }.bind(this));
  142. }
  143. this.OnCheckLobbyShow();
  144. // this.m_bNeedUpdate = true;
  145. // this.m_FirstShare = this.m_FirstShareNode.getComponent('FirstShare');
  146. // var lasttime = cc.sys.localStorage.getItem(window.Key_ShareTime);
  147. // if(g_Lobby == null && DifDay(lasttime,new Date().getTime())) this.m_FirstShare.ShowView();
  148. //this.scheduleOnce(this.OnTimer_IDI_QueryParam, 0.001);
  149. cc.director.emit('Lobby_InitShareInfo');
  150. },
  151. OnQueryParam: function () {
  152. //邀请链接-
  153. if (!!!window.inviteRoom) {
  154. window.inviteRoom = cc.share.GetShareParam(cc.share.Type.InviteRoom);
  155. window.inviteClub = cc.share.GetShareParam(cc.share.Type.InviteClub);
  156. console.log('inviteRoom' + window.inviteRoom);
  157. console.log('inviteClub' + window.inviteClub);
  158. if (window.inviteRoom && window.inviteRoom.roomNum) { // 房间查询
  159. this.OnQueryRoom(window.inviteRoom.roomNum, window.inviteRoom.clubID);
  160. } else if (window.inviteClub && window.inviteClub.allianceID > 0) { // 联盟申请
  161. this.OnAutoJoinClub(window.inviteClub.kind, window.inviteClub.allianceID);
  162. ShowLobbyClub = 0;
  163. window.POP_NOTICE = 0;
  164. }
  165. }
  166. if (window.POP_NOTICE > 0 && g_Table == null) {
  167. window.POP_NOTICE = 0;
  168. var ActivityPop = parseInt(cc.sys.localStorage.getItem(window.Key_ActivityPop));
  169. if (!ActivityPop) {
  170. this.scheduleOnce(this.OnClick_BtActivity, 0.5);
  171. } else {
  172. var last = new Date(ActivityPop);
  173. var cur = new Date();
  174. if (last.getFullYear() != cur.getFullYear() || last.getMonth() != cur.getMonth() || last.getDay() != cur.getDay()) {
  175. this.scheduleOnce(this.OnClick_BtActivity, 0.5);
  176. }
  177. }
  178. }
  179. if (ShowLobbyClub != 0) this.OnBtShowClub();
  180. },
  181. GetLobbyShowArr: function () {
  182. var ClickArr = new Array(0, 0, 0, 0, 0, 0);
  183. var value = cc.sys.localStorage.getItem(window.clientName + 'LobbyShow');
  184. if (value != null) ClickArr = JSON.parse(value);
  185. return ClickArr;
  186. },
  187. UpdateLobbyShowArr: function (Index) {
  188. var ClickArr = this.GetLobbyShowArr();
  189. ClickArr[Index] = new Date().getTime();
  190. cc.sys.localStorage.setItem(window.clientName + 'LobbyShow', JSON.stringify(ClickArr));
  191. this.OnCheckLobbyShow();
  192. },
  193. // OnCheckLobbyShow:function(){
  194. // var pGlobalUserData=g_GlobalUserInfo.GetGlobalUserData();
  195. // var webUrl = window.PHP_HOME+'/UserFunc.php?GetMark=28&dwUserID='+pGlobalUserData.dwUserID;
  196. // WebCenter.GetData(webUrl, 3, function (data) {
  197. // var ShowList = JSON.parse(data);
  198. // var ClickArr = this.GetLobbyShowArr();
  199. // var Today = new Date().getTime();
  200. // this.$('plazabg/NdButton/BtRealName/point').active = (ShowList[0]==0 && DifDay(Today, ClickArr[0]));
  201. // // this.$('plazabg/NdButton/FirstGift').active = ShowList[1]==0;
  202. // // this.$('plazabg/NdButton/FirstGift/point').active = (ShowList[1]==0 && DifDay(Today, ClickArr[1]));
  203. // this.$('plazabg/NdButton/BtSign/point').active = (ShowList[2]==0 && DifDay(Today, ClickArr[2]));
  204. // this.$('plazabg/NdButton/BottomButton/BtInviteCode/point').active = (ShowList[3]==1 && DifDay(Today, ClickArr[3]));
  205. // // this.$('plazabg/NdButton/BtBindPhone/point').active = (ShowList[4]==0 && DifDay(Today, ClickArr[4]));
  206. // this.$('plazabg/NdButton/BtMail/point').active = ShowList[5]>0;
  207. // }.bind(this));
  208. // },
  209. OnCheckLobbyShow: function () {
  210. // 获取全局用户数据
  211. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  212. // 构建请求URL,用于获取用户在大厅的显示信息
  213. var webUrl = window.PHP_HOME + '/UserFunc.php?GetMark=28&dwUserID=' + pGlobalUserData.dwUserID;
  214. // 调用WebCenter的GetData方法,发送请求并设置回调函数以处理返回的数据
  215. WebCenter.GetData(webUrl, 3, function (data) {
  216. // 将返回的数据解析为JSON对象
  217. var ShowList = JSON.parse(data);
  218. // 获取用户在大厅中按钮的点击时间数组
  219. var ClickArr = this.GetLobbyShowArr();
  220. // 获取当前时间的时间戳
  221. var Today = new Date().getTime();
  222. // 设置实名认证按钮上的红点显示条件:当ShowList[0]为0且从上次点击时间到今天有至少一天的间隔时显示
  223. this.$('plazabg/NdButton/BtRealName/point').active = (ShowList[0] == 0 && DifDay(Today, ClickArr[0]));
  224. // 设置签到按钮上的红点显示条件:当ShowList[2]为0且从上次点击时间到今天有至少一天的间隔时显示
  225. this.$('plazabg/NdButton/BtSign/point').active = (ShowList[2] == 0 && DifDay(Today, ClickArr[2]));
  226. // 设置邀请码按钮上的红点显示条件:当ShowList[3]为1且从上次点击时间到今天有至少一天的间隔时显示
  227. this.$('plazabg/NdButton/BottomButton/BtInviteCode/point').active = (ShowList[3] == 1 && DifDay(Today, ClickArr[3]));
  228. // 设置邮件按钮上的红点显示条件:当ShowList[5]大于0时显示
  229. this.$('plazabg/NdButton/BottomButton/BtMail/point').active = ShowList[5] > 0;
  230. }.bind(this));
  231. },
  232. OnClick_BtBindPhone: function () {
  233. cc.gSoundRes.PlaySound('Button');
  234. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  235. var webUrl = window.PHP_HOME + '/UserFunc.php?GetMark=19&dwUserID=' + pGlobalUserData.dwUserID;
  236. WebCenter.GetData(webUrl, 3, function (data) {
  237. if (data == "") {
  238. this.ShowPrefabDLG('BindPhone', this.m_DlgNode);
  239. this.UpdateLobbyShowArr(4);
  240. } else {
  241. this.ShowAlert('您已綁定過手機!');
  242. }
  243. }.bind(this));
  244. },
  245. OnClick_BtSignIn: function () {
  246. cc.gSoundRes.PlaySound('Button');
  247. this.ShowPrefabDLG('Sign', this.m_DlgNode);
  248. this.UpdateLobbyShowArr(2);
  249. },
  250. OnClick_BtFirstBuy: function () {
  251. cc.gSoundRes.PlaySound('Button');
  252. this.ShowPrefabDLG('FirstBuy', this.m_DlgNode);
  253. this.UpdateLobbyShowArr(1);
  254. },
  255. GetShareInfo: function () {
  256. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  257. var ShareInfo = new Object();
  258. ShareInfo.title = `玩遊戲看這裡!`;
  259. ShareInfo.desc = `我和我身邊的朋友都在玩的競技平臺,快來一展身手!`;
  260. ShareInfo.imgUrl = `${window.PHP_HOME}/share.jpg`;
  261. ShareInfo.link = cc.share.MakeLink_Lobby();
  262. return ShareInfo;
  263. },
  264. OnClick_BtRealName: function () {
  265. cc.gSoundRes.PlaySound('Button');
  266. return;
  267. //提交
  268. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  269. var webUrl = window.PHP_HOME + '/UserFunc.php?GetMark=17&dwUserID=' + pGlobalUserData.dwUserID;
  270. this.ShowLoading();
  271. WebCenter.GetData(webUrl, null, function (data) {
  272. this.StopLoading();
  273. if (data == 1) return this.ShowAlert("無需重複認證!");
  274. this.ShowPrefabDLG('RealAuth', this.m_DlgNode);
  275. this.UpdateLobbyShowArr(0);
  276. }.bind(this));
  277. },
  278. //购买钻石按钮
  279. onClick_Bt_stone: function () {
  280. cc.gSoundRes.PlaySound('Button');
  281. this.ShowPrefabDLG("DiamondPolicy");
  282. //this.OnBtMoreStrong();
  283. return
  284. //提示信息
  285. this.ShowAlert("購買鑽石請聯系客服或代理.");
  286. },
  287. //商城按钮点击事件
  288. onClick_Bt_shop: function () {
  289. cc.gSoundRes.PlaySound('Button');
  290. //提示信息
  291. this.ShowAlert("請聯系客服微訊號:" + window.WX_SERVICE, Alert_Yes, function () {
  292. ThirdPartyCopyClipper(window.WX_SERVICE);
  293. this.ShowTips('已複製到剪貼簿')
  294. }.bind(this));
  295. },
  296. //显示商城
  297. OnBtMoreStrong: function () {
  298. cc.gSoundRes.PlaySound('Button');
  299. var self = this;
  300. self.ShowPrefabDLG('PayCountPre', self.m_DlgNode, function (Js) {
  301. Js.SetData();
  302. });
  303. return
  304. var webUrl = window.PHP_HOME + '/UserFunc.php?&GetMark=5&dwUserID=';
  305. this.ShowLoading();
  306. WebCenter.GetData(webUrl, 99999, function (data) {
  307. self.StopLoading();
  308. if (data == '') return;
  309. var res = JSON.parse(data);
  310. self.ShowPrefabDLG('PayCountPre', self.m_DlgNode, function (Js) {
  311. Js.SetData(res);
  312. });
  313. });
  314. },
  315. //设置按钮点击事件
  316. onClick_Bt_shezhi: function () {
  317. cc.gSoundRes.PlaySound('Button');
  318. this.ShowPrefabDLG('Setting', this.m_DlgNode);
  319. },
  320. //金币场入口
  321. SendTypeQuery: function (wKindID, wTypeID) {
  322. this.ShowLoading();
  323. //cc.log(wKindID,wTypeID)
  324. wKindID = 40107
  325. wTypeID = 1
  326. //预加载
  327. // cc.gPreLoader.LoadByGame(wKindID);
  328. var QueryT = new CMD_GP_C_Query_ByType();
  329. QueryT.wKindID = wKindID;
  330. QueryT.wType = wTypeID;
  331. QueryT.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  332. var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_QUERY_BYTYPE, QueryT);
  333. },
  334. //查询回连
  335. SendReLinkQuery: function () {
  336. //this.ShowLoading();
  337. var QueryRL = new CMD_GP_C_Relink();
  338. QueryRL.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  339. var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_QUERY_RELINK, QueryRL);
  340. },
  341. //创建&加入失败信息
  342. OnQueryFailed: function (FailedRes) {
  343. this.StopLoading();
  344. this.ShowTips(FailStr[FailedRes.byRes]);
  345. },
  346. //进入服务器信息
  347. OnQueryServerRes: function (ReturnServer) {
  348. this.StopLoading();
  349. if (ReturnServer.wKindID == 0) return
  350. if (!this.BeLoadRes(ReturnServer.wKindID)) return;
  351. g_ServerListDataLast = new CGameServerItem();
  352. g_ServerListDataLast.wKindID = ReturnServer.wKindID;
  353. g_ServerListDataLast.wServerPort = ReturnServer.wServerPort;
  354. g_ServerListDataLast.szServerAddr = ReturnServer.szServerAddr;
  355. g_ServerListDataLast.wServerType = ReturnServer.wServerType;
  356. g_ServerListDataLast.llEnterScore = ReturnServer.llEnterScore;
  357. g_ServerListDataLast.szServerName = "";
  358. if (ReturnServer.byTipsReturn) {
  359. var game = window.GameList[ReturnServer.wKindID];
  360. if (game == null) game = ReturnServer.wKindID;
  361. this.ShowAlert('您已在遊戲 ' + game + ' 內,點擊確定回到遊戲!', Alert_YesNo, 'EnterGameScene', this)
  362. } else {
  363. this.EnterGameScene(1);
  364. }
  365. },
  366. OnQueryRoomRes: function (ReturnServer) {
  367. this.StopLoading();
  368. if (ReturnServer.wKindID == 0) return
  369. if (!this.BeLoadRes(ReturnServer.wKindID)) return;
  370. g_ServerListDataLast = new CGameServerItem();
  371. g_ServerListDataLast.wKindID = ReturnServer.wKindID;
  372. g_ServerListDataLast.wServerPort = ReturnServer.wServerPort;
  373. g_ServerListDataLast.szServerAddr = ReturnServer.szServerAddr;
  374. g_ServerListDataLast.wServerType = ReturnServer.wServerType;
  375. g_ServerListDataLast.llEnterScore = ReturnServer.llEnterScore;
  376. g_ServerListDataLast.szServerName = "";
  377. window.g_dwRoomID = ReturnServer.dwRoomID;
  378. window.g_dwClubID = ReturnServer.dwClubID;
  379. //this.ShowLoading();
  380. this.EnterGameScene(1);
  381. },
  382. //游戏入口
  383. EnterGameScene: function (Res) {
  384. // 加载游戏
  385. if (Res && g_ServerListDataLast) {
  386. if (window.LOG_NET_DATA) console.log("地址:", g_ServerListDataLast.szServerAddr + ":" + g_ServerListDataLast.wServerPort);
  387. this.$('plazabg').active = false;
  388. this.$('DlgFrame').active = false;
  389. this.m_Loading.active = true;
  390. this.ShowPrefabDLG("UpdateManager", this.m_Loading, function (Js) {
  391. Js.StartPreload(0, g_ServerListDataLast.wKindID, function () {
  392. cc.gPreLoader.LoadRes(`Image_BG_BG${GameDef.BGIndex}`, '' + GameDef.KIND_ID, function (res) {
  393. window.gGameBG = 'loading';
  394. ChangeScene('Table');
  395. }.bind(this));
  396. }.bind(this));
  397. }.bind(this));
  398. }
  399. },
  400. //游戏资源预加载
  401. BeLoadRes: function (wKindID) {
  402. if (this.OnCheckGame(wKindID)) return false;
  403. try {
  404. //游戏自定义
  405. GameDef = new window['CMD_GAME_' + wKindID]();
  406. if (GameDef == null) {
  407. var game = window.GameList[wKindID];
  408. if (game == null) game = wKindID;
  409. this.ShowTips("本地沒有遊戲 " + game);
  410. return false;
  411. }
  412. //游戏桌布
  413. window.gGameBG = 'loading';
  414. window.LoadSetting();
  415. window.LoadSetting(wKindID);
  416. var pathInfo = window.Path_GameBG(wKindID, window.g_GameSetting[wKindID][window.SetKey_Table_BG], 0, true);
  417. GameDef.BGIndex = pathInfo.BGIndex;
  418. GameDef.BGPath = pathInfo.path;
  419. } catch (error) {
  420. this.ShowAlert("遊戲資源出錯!" + error);
  421. return false;
  422. }
  423. return true;
  424. },
  425. //显示战绩
  426. OnBtShowRecord: function () {
  427. cc.gSoundRes.PlaySound('Button');
  428. this.ShowLoading();
  429. this.ShowPrefabDLG('GameRecord', this.m_DlgNode);
  430. },
  431. //分享信息
  432. GetShareTex: function () {
  433. var TexUrl = window.PHP_HOME + '/app01/ShareRes.jpg'
  434. return TexUrl;
  435. },
  436. /////////////////////////////////////////////////////////////////////////房间
  437. //创建房间
  438. OnBtCreatRoom: function () {
  439. if (window.isAppLastVersion() == false) {
  440. this.ShowAlert("請去下載最新的版本");
  441. return;
  442. }
  443. cc.gSoundRes.PlaySound('Button');
  444. // this.ShowPrefabDLG('CreateRoom', this.m_DlgNode);
  445. this.ShowPrefabDLG('SelectGame', this.m_DlgNode, function (Js) {
  446. Js.OnSetRoomType(0);
  447. }.bind(this));
  448. },
  449. //加入房间
  450. OnBtJoinRoom: function () {
  451. if (window.isAppLastVersion() == false) {
  452. this.ShowAlert("請去下載最新的版本");
  453. return;
  454. }
  455. cc.gSoundRes.PlaySound('Button');
  456. this.SendReLinkQuery();
  457. this.ShowPrefabDLG('JoinRoom', this.m_DlgNode);
  458. },
  459. //俱乐部
  460. OnClick_BtClubMore: function (Tag, Kind) {
  461. if (window.isAppLastVersion() == false) {
  462. this.ShowAlert("請去下載最新的版本");
  463. return;
  464. }
  465. cc.gSoundRes.PlaySound('Button');
  466. this.ShowPrefabDLG('ClubFreeDLG', this.m_DlgNode, function (Js) {
  467. Js.ShowKind(Kind)
  468. });
  469. },
  470. //俱乐部
  471. OnBtShowClub: function () {
  472. if (window.isAppLastVersion() == false) {
  473. this.ShowAlert("請去下載最新的版本");
  474. return;
  475. }
  476. if (window.g_GlobalClubInfo.onGetClubInfoList().length > 0) {
  477. this.ShowPrefabDLG('ClubDLG', this.m_DlgNode, function (Js) {
  478. this.m_ClubCtrl = Js;
  479. Js.OnChangeClub(window.g_GlobalClubInfo.onGetClubInfo(ShowLobbyClub));
  480. }.bind(this));
  481. }
  482. },
  483. OnChangeClub: function (ClubInfo) {
  484. cc.gSoundRes.PlaySound('Button');
  485. ShowLobbyClub = ClubInfo.dwClubID;
  486. this.ShowPrefabDLG('ClubDLG', this.m_DlgNode, function (Js) {
  487. this.m_ClubCtrl = Js;
  488. Js.OnChangeClub(ClubInfo);
  489. }.bind(this));
  490. },
  491. OnBtShowTurntable: function () {
  492. if (window.isAppLastVersion() == false) {
  493. this.ShowAlert("請去下載最新的版本");
  494. return;
  495. }
  496. cc.gSoundRes.PlaySound('Button');
  497. this.ShowPrefabDLG('TurnTable', this.m_DlgNode, function (Js) {
  498. Js.ShowView();
  499. }.bind(this));
  500. },
  501. OnShowLeague: function () {
  502. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  503. var self = this;
  504. var webUrl = window.PHP_HOME + '/League.php?&GetMark=15&dwUserID=' + pGlobalUserData.dwUserID;
  505. this.ShowLoading();
  506. WebCenter.GetData(webUrl, null, function (data) {
  507. self.StopLoading();
  508. var LeagueInfo = JSON.parse(data);
  509. if (LeagueInfo.LeagueID == null) {
  510. self.ShowPrefabDLG('LeagueFreeDLG-V', self.m_DlgNode);
  511. } else {
  512. self.ShowPrefabDLG('LeagueDLG-V', self.m_DlgNode, function (Js) {
  513. self.m_LeagueCtrl = Js;
  514. });
  515. }
  516. });
  517. },
  518. OnBtShowDlg: function (Tag, Data) {
  519. cc.gSoundRes.PlaySound('Button');
  520. this.ShowPrefabDLG(Data, this.m_DlgNode);
  521. },
  522. //加入房间
  523. OnQueryRoom: function (RoomNum, ClubID) {
  524. if (LinkInfo && LinkInfo.LinkRoom) LinkInfo.LinkRoom[0] = 0;
  525. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  526. var QueryGR = new CMD_GP_C_GetRoom();
  527. QueryGR.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  528. QueryGR.dwRoomID = parseInt(RoomNum);
  529. QueryGR.dwClubID = parseInt(ClubID);
  530. //var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_JOIN_ROOM, QueryGR);
  531. window.gClubClientKernel.OnSendJoinRoom(this, QueryGR);
  532. },
  533. //创建房间
  534. OnCreateRoom: function (wKindID, RulesArr, ServerRules, Name) {
  535. if (this.OnCheckGame(wKindID)) return
  536. //this.ShowLoading();
  537. var QueryGR = new CMD_GP_C_CreateRoom();
  538. QueryGR.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  539. QueryGR.wKindID = wKindID;
  540. for (var i = 0; i < 5; i++) {
  541. if (RulesArr[i] == null) RulesArr[i] = 0;
  542. QueryGR.dwRules[i] = RulesArr[i];
  543. }
  544. QueryGR.dwServerRules = ServerRules;
  545. QueryGR.szRoomName = Name;
  546. window.gClubClientKernel.OnSendCreateRoom(this, QueryGR);
  547. //var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_CREATE_ROOM, QueryGR);
  548. },
  549. OnCreatRoomRes: function (RoomSuc) {//CMD_GP_S_CreatSuccess
  550. this.ShowPrefabDLG('RoomRes', this.m_DlgNode, function (Js) {
  551. Js.OnShowData(RoomSuc.dwRoomID, RoomSuc.dwClubID, RoomSuc.wKindID);
  552. }.bind(this));
  553. },
  554. //查询占用钻石
  555. OnGetUsingCard: function () {
  556. this.ShowLoading();
  557. var QueryUC = new CMD_GP_C_Query_UsingCard();
  558. QueryUC.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  559. var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_QUERY_W_ROOMCARD, QueryUC);
  560. },
  561. //赠送钻石校验
  562. OnSendCardQuery: function (lUsingCard) {
  563. this.m_SendCardCtrl.SetUsingCard(lUsingCard);
  564. },
  565. OnClick_BtActivity: function () {
  566. cc.gSoundRes.PlaySound('Button');
  567. this.ShowPrefabDLG('Activity', this.m_DlgNode, function (Js) {
  568. Js.OnShowData(0, 0);
  569. }.bind(this));
  570. },
  571. /////////////////////////////////////////////////////////////////////////
  572. OnMsgRes: function (Msg) {
  573. this.StopLoading();
  574. WebCenter.SetDataOutTime('GetMark=10');//上下分 更新
  575. this.ShowAlert(Msg, Alert_Yes, function (Res) {
  576. if (this.m_ClubCtrl) this.m_ClubCtrl.OnShowView(true);
  577. }.bind(this));
  578. },
  579. /////////////////////////////////////////////////////////////////////////
  580. OnBtRefeshRoomCard: function () {
  581. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  582. var webUrl = window.PHP_HOME + '/UserFunc.php?&GetMark=5&dwUserID=' + pGlobalUserData.dwUserID;
  583. WebCenter.GetData(webUrl, 3, function (data) {
  584. var res = JSON.parse(data);
  585. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  586. if (res.UserMedal != null) pGlobalUserData.llUserIngot = res.UserMedal;
  587. this.m_RoomCard.string = pGlobalUserData.llUserIngot;
  588. }.bind(this));
  589. },
  590. /////////////////////////////////////////////////////////////////////////////////////
  591. //游戏单热更 未完成无效接口
  592. OnCheckGame: function (wKindID) {
  593. return false;
  594. if (!cc.sys.isNative || !window.HUversion) return false;
  595. var sub = cc.sys.localStorage.getItem(window.Key_HUKey + wKindID);
  596. if (sub == 'F') return false;
  597. if (sub == null || sub == 'L') {
  598. var UpdatePrefab = cc.instantiate(this.m_UpdatePrefab);
  599. var Update = UpdatePrefab.getComponent('UpdatePrefab');
  600. this.node.addChild(UpdatePrefab);
  601. Update.CheckUpdate(wKindID);
  602. return true;
  603. }
  604. },
  605. //首次登录分享赠送相关
  606. CheckFirstShare: function () {
  607. this.m_bChecking = true;
  608. },
  609. CheckShareFunc: function () {
  610. //cc.sys.localStorage.setItem(window.Key_ShareTime, new Date().getTime());
  611. //if(this.m_bChecking == null) return
  612. this.m_bChecking = null
  613. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  614. var webUrl = window.PHP_HOME + '/UserFunc.php?&GetMark=10&dwUserID=' + pGlobalUserData.dwUserID;
  615. WebCenter.GetData(webUrl, 0, function (data) {
  616. var res = JSON.parse(data);
  617. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  618. if (res.RoomCard != null) pGlobalUserData.llUserIngot = res.RoomCard;
  619. this.m_RoomCard.string = pGlobalUserData.llUserIngot;
  620. // this.m_FirstShare.HideView();
  621. }.bind(this));
  622. },
  623. //游戏回放
  624. OnRePlayGame: function (RecordID, KindID, LookUser, Progress) {
  625. if (!this.BeLoadRes(KindID)) return;
  626. this.ShowPrefabDLG('GameRePlay', this.node, function (Js) {
  627. this.m_GameRePlay = Js;
  628. if (this.m_GameRePlay.LoadGameRes(KindID)) {
  629. this.m_GameRePlay.LoadRePlayData(LookUser, RecordID, Progress);
  630. } else {
  631. this.$('plazabg').active = false;
  632. this.$('DlgFrame').active = false;
  633. this.m_Loading.active = true;
  634. this.ShowPrefabDLG("UpdateManager", this.m_Loading, function (Js) {
  635. Js.StartPreload(0, KindID, function () {
  636. cc.gPreLoader.LoadRes(`Image_BG_BG${GameDef.BGIndex}`, '' + GameDef.KIND_ID, function (res) {
  637. window.gGameBG = 'loading';
  638. this.$('plazabg').active = true;
  639. this.$('DlgFrame').active = true;
  640. this.m_Loading.active = false;
  641. this.ShowPrefabDLG('GameRePlay', this.node, function (Js1) {
  642. if (Js1.LoadGameRes(KindID) == false) {
  643. Js1.OnDestroy();
  644. this.ShowAlert('遊戲暫不支持重播!');
  645. return
  646. }
  647. Js1.LoadRePlayData(LookUser, RecordID, Progress);
  648. }.bind(this))
  649. }.bind(this));
  650. }.bind(this));
  651. }.bind(this));
  652. }
  653. }.bind(this))
  654. },
  655. ///////////////////////////////////////////////////////////////////////////////////////绑定邀请码
  656. //检查代理绑定
  657. OnBtNewPlayer: function () {
  658. cc.gSoundRes.PlaySound('Button');
  659. var pUserInfo = g_GlobalUserInfo.GetGlobalUserData();
  660. var webUrl = window.PHP_HOME + '/UserFunc.php?GetMark=15&dwUserID=' + pUserInfo.dwUserID;
  661. webUrl += '&LogonPass=' + pUserInfo.szPassword;
  662. if (this.m_CheckNewPlayer == null) this.m_CheckNewPlayer = 0;
  663. var self = this;
  664. this.ShowLoading();
  665. WebCenter.GetData(webUrl, this.m_CheckNewPlayer, function (data) {
  666. self.m_CheckNewPlayer = 999999;
  667. self.StopLoading();
  668. var UserInfo = JSON.parse(data);
  669. if (UserInfo.Status == null) return
  670. if (1 == UserInfo.Status) {
  671. self.UpdateLobbyShowArr(3);
  672. self.ShowPrefabDLG('NewPlayer', self.m_DlgNode, function (Js) {
  673. self.m_NewPlayer = Js;
  674. });
  675. } else {
  676. self.ShowAlert("您已經完成了綁定!");
  677. }
  678. });
  679. },
  680. OnBtUnFinished: function () {
  681. this.ShowAlert("敬請期待!");
  682. },
  683. LoginAccount: function (Account, Password) {
  684. gReLogin = false;
  685. var LogonAccounts = new CMD_GP_LogonAccounts();
  686. LogonAccounts.dwPlazaVersion = cc.VERSION_PLAZA;
  687. LogonAccounts.szAccounts = Account
  688. LogonAccounts.szPassword = Password;
  689. LogonAccounts.szPassPortID = "no";
  690. var LoginMission = new CGPLoginMission(this, MDM_GP_LOGON, SUB_GP_LOGON_ACCOUNTS, LogonAccounts);
  691. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  692. pGlobalUserData.szPassword = LogonAccounts.szPassword;
  693. cc.sys.localStorage.setItem('LoginAcc', Account);
  694. cc.sys.localStorage.setItem('LoginPswT', Password);
  695. },
  696. onGPLoginSuccess: function () { },
  697. //登陆成功
  698. onGetServerListFinish: function () { },
  699. //登录失败
  700. onGPLoginFailure: function (szDescription) {
  701. this.StopLoading();
  702. //提示信息
  703. this.ShowAlert(szDescription, Alert_Yes);
  704. },
  705. OnWXErr: function (err) {
  706. this.ShowAlert('OnWXErr ' + err)
  707. },
  708. //个人信息
  709. OnBtnSelfInfo: function () {
  710. cc.gSoundRes.PlaySound("Button");
  711. // this.m_bTipGPS = true;
  712. // Gps暂时未使用
  713. this.OnBtRefeshRoomCard();
  714. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  715. var Addr = g_GlobalUserInfo.GetUserAddress(pGlobalUserData.dwUserID);
  716. if (Addr.berror) {
  717. if (cc.sys.isNative) {
  718. // ThirdPartyGetAddress(1); //获取地址先关闭
  719. } else {
  720. // var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  721. // g_GlobalUserInfo.SetUserAddress(pGlobalUserData.dwUserID, 'H5登录暂时无法获取信息!', false);
  722. // this.scheduleOnce(function(){
  723. // this.UpdateGPS('{"berror":false,"longitude": 123.434104,"latitude": 41.814169,"code": 0,"address": "沈阳市","msg": "success"}');
  724. // }.bind(this),1);
  725. this.UpdateGPS('{"berror":false,"longitude": 123.434104,"latitude": 41.814169,"code": 0,"address": "臺北市","msg": "success"}');
  726. }
  727. }
  728. this.ShowPrefabDLG('SelfInfo', this.m_DlgNode, function (Js) {
  729. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  730. Js.SetInfo(pGlobalUserData.dwUserID, pGlobalUserData.szClientIP, pGlobalUserData.llUserIngot);
  731. this.m_SelfInfo = Js;
  732. }.bind(this));
  733. },
  734. //菜单列表
  735. OnBtClickedMenu: function () {
  736. // cc.gSoundRes.PlaySound('Button');
  737. this.m_MenuNode.active = !this.m_MenuNode.active;
  738. },
  739. //退出
  740. OnBtClickedExit: function () {
  741. cc.gSoundRes.PlaySound('Button');
  742. this.ShowAlert('確定退出遊戲!', Alert_YesNo, function (Res) {
  743. if (Res) {
  744. gReLogin = true;
  745. gClientKernel.destory();
  746. window.gClubClientKernel.shutdown();
  747. ChangeScene('Launch');
  748. }
  749. })
  750. },
  751. //加入俱乐部
  752. OnBtJoinClub: function () {
  753. this.ShowPrefabDLG('ClubFreeDLG', this.m_DlgNode, function (Js) {
  754. Js.OnBtShowJoin();
  755. }.bind(this))
  756. },
  757. OnClickRoomList: function () {
  758. this.ShowPrefabDLG('RoomList', this.m_DlgNode, function (Js) {
  759. this.m_RoomList = Js;
  760. }.bind(this));
  761. },
  762. ///////////////////////////////////////////////////////////////////////////////////////
  763. OnLoadOwnRoomList: function () {
  764. //房间记录
  765. var OR = new CMD_GP_C_OwnRoom();
  766. OR.dwUserID = g_GlobalUserInfo.GetGlobalUserData().dwUserID;
  767. var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_GET_OWN_ROOM, OR);
  768. },
  769. onOwnRoomList: function (OwnRoom) {//CMD_GP_S_OwnRoomInfo
  770. if (this.m_RoomList && this.m_RoomList.onOwnRoomList) this.m_RoomList.onOwnRoomList(OwnRoom);
  771. },
  772. OnLoadRoomHistory: function () {
  773. //房间记录
  774. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  775. var webUrl = window.PHP_HOME + '/League.php?&GetMark=6&dwUserID=' + pGlobalUserData.dwUserID;
  776. WebCenter.GetData(webUrl, 3, function (data) {
  777. var ClubList = JSON.parse(data);
  778. var GRE = new CMD_GP_C_GetRoomEx();
  779. for (var i = 0; i < 10; i++) {
  780. GRE.dwClubID[i] = 0;
  781. if (ClubList[i]) GRE.dwClubID[i] = ClubList[i].ClubID;
  782. }
  783. var TempStr = cc.sys.localStorage.getItem(window.clientName + 'RoomHistory');
  784. var TempArr = new Array();
  785. if (TempStr) TempArr = JSON.parse(TempStr);
  786. for (var i = 0; i < 40; i++) {
  787. GRE.dwRoomID[i] = 0;
  788. //if(TempArr[i]) GRE.dwRoomID[i]=TempArr[i];
  789. }
  790. var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_GET_ROOMEX, GRE);
  791. }.bind(this));
  792. },
  793. OnQueryLoadRoomHistory: function (ClubList) {
  794. if (!ClubList) return;
  795. var GRE = new CMD_GP_C_GetRoomEx();
  796. for (var i = 0; i < 10; i++) {
  797. GRE.dwClubID[i] = 0;
  798. if (ClubList[i]) GRE.dwClubID[i] = ClubList[i].ClubID;
  799. }
  800. var TempStr = cc.sys.localStorage.getItem(window.clientName + 'RoomHistory');
  801. var TempArr = new Array();
  802. if (TempStr) TempArr = JSON.parse(TempStr);
  803. for (var i = 0; i < 40; i++) {
  804. GRE.dwRoomID[i] = 0;
  805. //if(TempArr[i]) GRE.dwRoomID[i]=TempArr[i];
  806. }
  807. var LoginMission = new CGPLoginMission(this, MDM_GP_GET_SERVER, SUB_GP_GET_ROOMEX, GRE);
  808. },
  809. OnGetRoomExRes: function (Res) {//CMD_GP_C_GetRoomExRes
  810. this.m_RoomArr = Res;
  811. if (this.RoomList && this.RoomList.OnGetRoomExRes) this.RoomList.OnGetRoomExRes(Res);
  812. },
  813. update: function () {
  814. // var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  815. // if (pGlobalUserData.szNickName != this.m_MeUserCtrl.m_LabNick.string) this.m_MeUserCtrl.SetUserByID(pGlobalUserData.dwUserID);
  816. //微信H5 code登录
  817. if (this.m_NeedLogin) {
  818. this.m_NeedLogin = null;
  819. if (window.g_PhpUserName != null) {
  820. this.LoginAccount(window.g_PhpUserName, hex_md5(window.g_PhpPassword));
  821. } else {
  822. var WXCode = getQueryString("code");
  823. var webUrl = window.PHP_HOME + '/UserFunc.php?&GetMark=7&code=' + WXCode;
  824. WebCenter.GetData(webUrl, null, function (data) {
  825. var Login = JSON.parse(data);
  826. if (Login.errcode != null) return this.ShowAlert("ErrCode:" + Login.errcode, Alert_Yes, function () {
  827. ThirdPartyCopyClipper(data)
  828. ThirdPartyExitGame();
  829. });
  830. this.LoginAccount(Login.Accounts, Login.LogonPass);
  831. }.bind(this));
  832. }
  833. }
  834. //显示处理
  835. if (this.m_bNeedUpdate) {
  836. this.m_bNeedUpdate = false;
  837. } else {
  838. return;
  839. }
  840. // if(!this.m_LeagueList){
  841. // this.ShowPrefabDLG('LeagueList', this.m_DlgNode, function(Js){
  842. // this.m_LeagueList = Js;
  843. // this.m_LeagueList.node.zIndex = -1;
  844. // }.bind(this));
  845. // }
  846. // if (cc.sys.isNative) {
  847. // ThirdPartyGetAddress(1);
  848. // } else {
  849. // var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  850. // g_GlobalUserInfo.SetUserAddress(pGlobalUserData.dwUserID, 'H5登录暂时无法获取信息!', false);
  851. // }
  852. },
  853. OnUpdateCard: function (obj) {
  854. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  855. this.m_RoomCard.string = pGlobalUserData.llUserIngot;
  856. },
  857. OnUpload_Success: function () {
  858. this.ShowAlert('上传完成!', Alert_Yes, function (Res) {
  859. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  860. this.m_MeUserCtrl.SetUserByID(pGlobalUserData.dwUserID, true);
  861. if (this.m_SelfInfo && this.m_SelfInfo.node.active && this.m_SelfInfo.OnUpload_Finish) {
  862. this.m_SelfInfo.OnUpload_Finish();
  863. }
  864. if (this['m_JsClubDLG'] && this['m_JsClubDLG'].node.active && this['m_JsClubDLG'].OnUpload_Finish) {
  865. this['m_JsClubDLG'].OnUpload_Finish();
  866. }
  867. }.bind(this));
  868. },
  869. OnUpload_Faild: function () {
  870. this.OnUpload_Success();
  871. },
  872. UpdateGPS: function (Info) {
  873. if (!Info || Info.length <= 0) return
  874. var Obj = JSON.parse(Info);
  875. // if(Obj.berror == true || Obj.code != 0)return this.GetSelfGPSInfo();
  876. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  877. if (Obj.berror === true) g_GlobalUserInfo.SetUserAddress(pGlobalUserData.dwUserID, '用戶運行環境無法準確獲取地理位置!', Obj.berror);
  878. else
  879. g_GlobalUserInfo.SetUserAddress(pGlobalUserData.dwUserID, Obj.address, Obj.berror);
  880. if (this.m_SelfInfo && this.m_SelfInfo.node.active) {
  881. var pGlobalUserData = g_GlobalUserInfo.GetGlobalUserData();
  882. this.m_SelfInfo.SetInfo(pGlobalUserData.dwUserID, pGlobalUserData.szClientIP, pGlobalUserData.llUserIngot);
  883. }
  884. },
  885. onSwitchBG: function (index) {
  886. if (index == null) index = window.g_Setting[window.SetKey_Lobby_BG];
  887. var bg = this.$('plazabg@Sprite');
  888. cc.resources.load("Image/BG/BG" + index, cc.SpriteFrame, function (err, spriteFrame) {
  889. bg.spriteFrame = spriteFrame;
  890. });
  891. }
  892. });