AnalyzeRaioXieYi.js 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. var GameProtocol = require("RaioGameProtocol")
  2. var Global = require("Global")
  3. var BaseDefine = require("BaseDefine")
  4. cc.Class({
  5. extends: cc.Component,
  6. properties: {
  7. },
  8. statics: {
  9. analyzeData(m, s, dataview) {
  10. switch (s) {
  11. case GameProtocol.SUB_S_REBACK_LOTTERY: {//游戏开始
  12. return this.analyze_GameResult(dataview);
  13. }
  14. break;
  15. case GameProtocol.SUB_S_JACKPOT_RESET: { //下注
  16. return this.analyze_Jackpot(dataview);
  17. }
  18. break;
  19. case GameProtocol.SUB_S_SEND_CONTROL_INFO: {
  20. return this.analyze_ControlInfo(dataview);
  21. }
  22. break;
  23. default:
  24. break;
  25. }
  26. return null;
  27. },
  28. analyze_GameConfig(dataview) {//游戏状态
  29. var dataList = {};
  30. dataview.pos = 0;
  31. // dataList.lCurScore = Global.unify(Global.GetUint64(dataview));
  32. // dataList.lEnterScore = Global.unify(Global.GetUint64(dataview));
  33. // dataList.nMinJetton = Global.GetInt32(dataview);
  34. // dataList.nMaxJetton = Global.GetInt32(dataview);
  35. dataList.nJetton = [];
  36. for(let i = 0;i< GameProtocol.LUCKMAN_LIST_LENGTH;i++){
  37. dataList.nJetton[i] = Global.GetInt32(dataview);//筹码配置
  38. }
  39. dataList.mDeskDataArr = [];
  40. for(let i = 0;i < 5; ++i) {
  41. dataList.mDeskDataArr[i] = [];
  42. for(let x = 0; x < GameProtocol.MAX_ROW_NUM; ++x) {
  43. dataList.mDeskDataArr[i][x] = [];
  44. for(let y = 0; y < GameProtocol.MAX_COL_NUM; ++y) {
  45. dataList.mDeskDataArr[i][x][y] = Global.GetInt8(dataview);
  46. }
  47. }
  48. }
  49. dataList.cbTrueCnt = [];
  50. for(let i = 0; i < 5; ++i) {
  51. dataList.cbTrueCnt[i] = Global.GetInt8(dataview);
  52. }
  53. // dataList.lJackPot[i] = Global.GetUint64(dataview);
  54. // for(let i = 0;i< GameProtocol.LUCKMAN_LIST_LENGTH;i++){
  55. // dataList.szLuckymanList[i] = Global.Read2Char(dataview, 32);
  56. // }
  57. return dataList;
  58. },
  59. analyze_GameResult(dataview) {
  60. // Global.print(dataview);
  61. var dataList = {};
  62. dataview.pos = 0;
  63. dataList.m_chair_id = Global.GetInt8(dataview);
  64. dataList.m_chip_size = Global.GetInt32(dataview);
  65. dataList.m_desk_data = [];
  66. for(let i = 0;i< GameProtocol.MAX_ROW_NUM;i++){
  67. dataList.m_desk_data[i] = [];
  68. for(let j = 0; j < GameProtocol.MAX_COL_NUM; ++j) {
  69. dataList.m_desk_data[i][j] = Global.GetInt8(dataview);
  70. }
  71. }
  72. dataList.m_is_berserk = Global.GetInt8(dataview);
  73. dataList.m_line_count = Global.GetInt8(dataview);
  74. dataList.m_line_id = [];
  75. for(let i = 0;i< GameProtocol.MAX_LINE_COUNT;i++){
  76. dataList.m_line_id[i] = Global.GetInt8(dataview);
  77. }
  78. dataList.m_line_size = [];
  79. for(let i = 0;i< GameProtocol.MAX_LINE_COUNT;i++){
  80. dataList.m_line_size[i] = Global.GetInt8(dataview);
  81. }
  82. dataList.m_line_icon = [];
  83. for(let i = 0;i< GameProtocol.MAX_LINE_COUNT;i++){
  84. dataList.m_line_icon[i] = Global.GetInt8(dataview);
  85. }
  86. dataList.m_line_times = [];
  87. for(let i = 0;i< GameProtocol.MAX_LINE_COUNT;i++){
  88. dataList.m_line_times[i] = Global.GetInt8(dataview);
  89. }
  90. dataList.m_ruyi = Global.GetInt8(dataview);
  91. dataList.m_lottery_size = Global.unify(Global.GetUint64(dataview));
  92. dataList.m_deposit_lotttery = Global.unify(Global.GetUint64(dataview));
  93. dataList.lCurScore = Global.unify(Global.GetUint64(dataview));
  94. return dataList;
  95. },
  96. analyze_Jackpot(dataview) {
  97. var dataList = {};
  98. dataview.pos = 0;
  99. dataList.lJackPot = [];
  100. for(let i = 0;i < 5; ++i)
  101. dataList.lJackPot[i] = Global.unify(Global.GetUint64(dataview));
  102. return dataList;
  103. },
  104. analyze_ControlInfo(dataview) {
  105. let data = {};
  106. dataview.pos = 0;
  107. data.RoomSha = Global.GetInt16(dataview); // WORD 房间杀率
  108. data.RoomWin = Global.GetInt16(dataview); // WORD 系统赢
  109. data.RoomLost = Global.GetInt16(dataview); // WORD 系统输
  110. data.RoomSuiRate = Global.GetInt16(dataview); // WORD 当前随到
  111. data.RoomResult = Global.GetInt8(dataview); // BYTE 控制结果 0无控制 1系统赢 2系统输
  112. data.QunState = Global.GetInt8(dataview); // BYTE 是否需要判断控制 0不需要1需要
  113. data.QunStock = Global.unify(Global.Read2ll(dataview)); // SCORE 群控库存
  114. data.IsDanKong = Global.GetInt8(dataview); // BYTE 单控是否生效 1是
  115. data.DanRate = Global.GetInt16(dataview); // WORD 单控概率
  116. data.DanStocks = Global.unify(Global.GetInt32(dataview)); // int 单控库存
  117. data.DanSuiRate = Global.GetInt16(dataview); // WORD 单控随机值
  118. data.DanType = Global.GetInt8(dataview); // BYTE 控制结果0无控制 1控制系统赢 2控制系统输
  119. data.DanMinBet = Global.unify(Global.GetInt32(dataview)); // int 单控门槛
  120. data.cbControlValue = Global.GetInt8(dataview);
  121. return data;
  122. },
  123. analyze_Record(dataview) {
  124. var dataList = {};
  125. dataview.pos = 0;
  126. dataList.nBet = Global.GetInt32(dataview);
  127. dataList.nWinLost = Global.GetInt32(dataview);
  128. dataList.nTime = Global.GetInt32(dataview);
  129. return dataList;
  130. },
  131. analyze_JackpotRecord(dataview) {
  132. var dataList = {};
  133. dataview.pos = 0;
  134. dataList.cbType = Global.GetInt8(dataview);
  135. dataList.cbFaceID = Global.GetInt8(dataview);
  136. dataList.lLotteryMoney = Global.GetInt32(dataview);
  137. dataList.nLotteryTimes = Global.GetInt32(dataview);
  138. dataList.nTime = Global.GetInt32(dataview);
  139. dataList.szNickName = Global.Read2Char(dataview, BaseDefine.LEN_NICKNAME)
  140. return dataList;
  141. },
  142. },
  143. start () {
  144. },
  145. });