更新了埋点失败重传,scode以及分享链接更改

This commit is contained in:
YZ\249929363 2024-08-28 11:13:19 +08:00
parent 68b174183f
commit fb89a94885
52 changed files with 3620 additions and 3207 deletions

View File

@ -3,7 +3,6 @@ const {ccclass, property} = cc._decorator;
@ccclass
export default class GameData extends cc.Component {
static _instance: any;
GM_INFO: {};
GAME_DATA: any[];//备用
AudioManager: any;
BLOCK_INFO: { //难度控制
@ -56,6 +55,34 @@ export default class GameData extends cc.Component {
levelMax: number; //最高层数
difficultyMax: number; //最高难度系数
};
GM_INFO: {
// isEnd: false,
mean_Time: number; //平均放箭速度
total: number; //总共对的个数
currSeed: number; //用于随机数种子
gameId: string; userId: number;
scode: string; //用户code,从网页后缀获取
guide: boolean; //是否有引导
url: string; custom: number;
//从这开始
jumpUpTime: number; //起跳时间
jumpDownTime: number; //落地时间
jumpHeight: number; //跳跃高度
blockMin: number; //薄块增加高度
blockMax: number; //厚块增加高度(在自身高度基础上)此值可以为负值
blockScale: number; //次值满值为块种类总个数12,6为百分之50厚50薄个数增加厚度比例降低
distanceMin: number; //落地范围在百分百内必成功,可改参
distanceMax: number; //落地范围最大值,弱大于,判断脚在外面
life: number; //可复活次数
levelMax: number; //最高层数
difficultyMax: number; //最高难度系数
score: number; //总分
success: boolean; //是否成功
probation: boolean; //试用期
afkCount: number; //第一层不跳死的次数
isAFK: boolean; //是否挂机
};
@ -91,7 +118,8 @@ export default class GameData extends cc.Component {
total:0, //总共对的个数
currSeed: 203213, //用于随机数种子
gameId:'100001',
userId:"",
userId:200139,
scode: "", //用户code,从网页后缀获取
guide:true, //是否有引导
url:"https://dev.api.sparkus.cn",
custom: 0,
@ -115,6 +143,7 @@ export default class GameData extends cc.Component {
afkCount:0, //第一层不跳死的次数
isAFK:false //是否挂机
};
this.setCode(this.getKey("scode"));
}
CLICK_init(){
@ -237,5 +266,18 @@ export default class GameData extends cc.Component {
]
}
setCode(code){
this.GM_INFO.scode = code;
}
getKey(key){
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return "";
}
// update (dt) {}
}

View File

@ -66,7 +66,8 @@ export default class GameManager extends cc.Component {
onLoad () {
cc.game.setFrameRate(61);
cc.game.setFrameRate(60);
// 示例使用
var manager = cc.director.getCollisionManager();
manager.enabled = true;
@ -669,15 +670,17 @@ export default class GameManager extends cc.Component {
.start();
}
setData(){
GameData._instance.CLICK_DATA.totalScore = GameManager._instance.score;
GameData._instance.CLICK_DATA.timer = this.countTime;
GameData._instance.CLICK_DATA.level = this.round;
GameData._instance.CLICK_DATA.round = this.level;
GameData._instance.CLICK_DATA.isAFK = GameData._instance.GM_INFO.isAFK;
//CLICK_DATA 数据处理完毕后调用上传接口 上传接口内CLICK_DATA不做改变
GameTool.setGameData();
setData(result){
if(result == true || this.countTime > 0){
GameData._instance.CLICK_DATA.totalScore = GameManager._instance.score;
GameData._instance.CLICK_DATA.timer = this.countTime;
GameData._instance.CLICK_DATA.level = this.round;
GameData._instance.CLICK_DATA.round = this.level;
GameData._instance.CLICK_DATA.isAFK = GameData._instance.GM_INFO.isAFK;
//CLICK_DATA 数据处理完毕后调用上传接口 上传接口内CLICK_DATA不做改变
GameTool.setGameData();
}
}
//获取matchId 用于上传每次点击数据里面记录id方便查询
@ -740,7 +743,7 @@ export default class GameManager extends cc.Component {
}
if(this.countTime <= 0){
this.unschedule(this.updateCountDownTime);
Notification.emit("setData",null);
Notification.emit("setData",true);
this.begin = false;
this.over = true;
this.overStop();
@ -828,6 +831,10 @@ export default class GameManager extends cc.Component {
return m + ':' + miao
}
update (dt) {
var frame = cc.game.getFrameRate();
if(frame > 110) cc.game.setFrameRate(120);
else if(frame > 80) cc.game.setFrameRate(90);
else cc.game.setFrameRate(60);
if(this.cameraMove == true && this.over == false){
this.Camera.node.y = this.Player.y - this.countHeight;
if(this.Camera.node.y <= 0) this.Camera.node.y = 0;

View File

@ -300,7 +300,9 @@ export default class NewClass extends cc.Component {
if(this.block.name != "block13"){
this.block.getComponent("Block").setScore(number);
GameData._instance.GM_INFO.afkCount = 0;
Notification.emit("setData",null);
if(GameManager._instance.countTime > 0){
Notification.emit("setData",false);
}
}
setTimeout(() => {
@ -352,7 +354,10 @@ export default class NewClass extends cc.Component {
else{
GameData._instance.GM_INFO.afkCount = 0;
}
Notification.emit("setData",null);
if(GameManager._instance.countTime > 0){
Notification.emit("setData",false);
}
this.double = false;
GameData._instance.LEVEL_INFO.doubleSuccess = 3;
this.death = true;

View File

@ -3,33 +3,26 @@
import GameData from '../GameData';
import CryptoJS = require('./crypto-js.min.js'); //引用AES源码js
const BASE_URL = "https://api.sparkus.cn";
// import axios from 'axios'
const {ccclass, property} = cc._decorator;
@ccclass
export default class HttpUtil extends cc.Component {
static async getShareInfo(shareUrl: string): Promise<any> {
console.log("设置分享链接:",shareUrl);
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/share/cfg?gameId=${config.gameId}&time=${time}&url=${shareUrl}`,{})
return this.httpPost(url,null,null);
}
//排行榜type2为获取type1为上传
//排行榜
static async rankData(type,callback,data): Promise<any> {
data.gameId = GameData._instance.GM_INFO.gameId;
data.userId = GameData._instance.GM_INFO.userId;
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/get/rank/data?gameId=${config.gameId}&dataType=${type}&time=${time}`, data)
this.httpPost(url,data,callback);
this.post(url,data,callback,0);
}
static async uploadUserLogData(data,callback): Promise<any> {
data.gameId = GameData._instance.GM_INFO.gameId;
data.userId = GameData._instance.GM_INFO.userId;
const url = '/log/collect/data';
this.httpPost(url,data,callback);
this.post(url,data,callback,3);
}
//暂时用不到
static async getUserRecord(data,callback): Promise<any> {
@ -37,69 +30,62 @@ export default class HttpUtil extends cc.Component {
data.userId = GameData._instance.GM_INFO.userId;
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/get/user/data?gameId=${config.gameId}&time=${time}`, data)
this.httpPost(url,data,callback);
this.post(url,data,callback,0);
}
static httpPost(url,data,callBack){
if(data){
data.gameId = GameData._instance.GM_INFO.gameId;
data.userId = GameData._instance.GM_INFO.userId;
static async get(url, callback,count) {
let repeat = count?count:0;
const response = await this.fetchData(url, null, 'GET',repeat);
callback && callback(response);
}
static async post(url, data, callback,count) {
let repeat = count?count:0;
const response = await this.fetchData(url, data, 'POST',repeat);
callback && callback(response);
}
static async fetchData(url, data, method,repeat) {
const fullUrl = `${BASE_URL}${url}`;
const headers = { 'Content-Type': 'application/json' };
const options = {
method,
headers,
body: data ? JSON.stringify(data) : null,
};
try {
var response = await this.fetchWithTimeout(fullUrl,options);
if (!response.ok) {
throw new Error(`HTTP_______________error! status: ${response.status}`);
}
return await response.json();
} catch (error) {
console.error('Fetch_______________error:', error);
if(repeat > 0){
repeat -= 1;
const timeOut = (3-repeat)*5000;
setTimeout(async () => {
response = await this.fetchData(url, data, method,repeat);
}, timeOut);
}
else{
return null;
}
}
}
var urlData = "https://api.sparkus.cn" + url;
// console.log("params:",JSON.stringify(data));
let xhr = new XMLHttpRequest();
xhr.open('POST', urlData);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if(!data){
console.log("初始化失败");
return;
}
console.log(data);
var json = JSON.parse(data);
console.log('http success:' + json);
if(callBack)callBack(json);
}
else{
// var json = JSON.parse(data);
// console.log('http fail:' + url);
if(callBack)callBack(json);
}
};
xhr.send(JSON.stringify(data));
static async fetchWithTimeout(resource, options = {}) {
const controller = new AbortController();
const id = setTimeout(() => controller.abort(), 5000);
const response = await fetch(resource, {
...options,
signal: controller.signal
});
clearTimeout(id);
return response;
}
static httpGet(url,callBack){
var urlData = "https://api.sparkus.cn" + url;
console.log(urlData);
let xhr = new XMLHttpRequest();
xhr.open('GET', urlData);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if(data){
var json = JSON.parse(data);
console.info('http success:' + json);
if(callBack)callBack(json);
}
else{
if(callBack)callBack(json);
}
}
else{
console.info('http fail:' + url);
if(callBack)callBack(null);;
}
};
xhr.send();
}
/**
*
* @param url {string}

View File

@ -19,15 +19,32 @@ var GameTool = {
let name = "user_" + GameData._instance.GM_INFO.gameId;
var data = JSON.parse(localStorage.getItem(name));
if(data == "undifend" || data==null || data == ""){
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+
encodeURIComponent(location.href);
window.location.href = url;
}
else{
StorageMessage.setStorage(name,data);
GameData._instance.GM_INFO.userId = parseInt(data.userId);
if(!this.isNumber(data.userId)){
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+
encodeURIComponent(location.href);
console.log("链接不合法",url);
window.location.href = url;
}
else{
StorageMessage.setStorage(name,data);
GameData._instance.GM_INFO.userId = parseInt(data.userId);
}
}
},
isNumber(value) {
var result = false;
result = typeof value === 'number';
if(result) if(value < 200000) result = false;
return result;
},
//埋点上传
setGameData(){
//GAME_DATA 初始化 每次清零
@ -39,9 +56,10 @@ var GameTool = {
let matchId = this.getMatchId(GameData._instance.GAME_DATA[0].round);
let postData = {
"matchId":matchId,
"scode":GameData._instance.GM_INFO.scode,
"data": GameData._instance.GAME_DATA
};
// console.log("上传数据:",postData);
console.log("上传数据:",postData);
HttpUtil.uploadUserLogData(postData,function(){})
},

View File

@ -72,15 +72,18 @@ export class WeChat {
console.log("分享好友成功回调");
}
});
wx.updateTimelineShareData({
title: '手眼协调练习', // 分享标题
link: shareConfig.shareLine, // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://static.sparkus.cn/public/flyup.jpg', // 分享图标
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
})
setTimeout(() => {
wx.updateTimelineShareData({
title: '手眼协调练习', // 分享标题
link: shareConfig.shareLine, // 分享链接该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: 'https://static.sparkus.cn/public/flyup.jpg', // 分享图标
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
})
}, 200);
});
}
@ -92,7 +95,7 @@ export class WeChat {
static async getShareInfo(shareUrl: string, callback:Function): Promise<any> {
const time = Math.floor((new Date().getTime()) / 1000)
const url = HttpUtil.apiSign(`/api/share/cfg?gameId=${GameData._instance.GM_INFO.gameId}&time=${time}&url=${shareUrl}`,{})
return HttpUtil.httpGet(url,callback)
return HttpUtil.get(url,callback,0)
}

View File

@ -176,31 +176,35 @@
if((timestamp - data.time) > 86400){
setUserId(name);
}
}
function getUserId() {
let pathStr = window.location.search;
let arr=pathStr.split("&");
if (pathStr.length>= 0&&arr.length>0) {
let arr2=[];
arr.map(item=>{
arr2.push(item.split("=")[1])
})
window.userId = arr2[0] + "";
return arr2[0]
} else {
return null
else if(!isNumber(userId)){
console.log("缓存异常");
setUserId(name);
}
}
function isNumber(value) {
var result = false;
result = typeof value === 'number';
if(result) if(value < 200000) result = false;
return result;
}
function getKey(key){
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
function setUserId(name){
let userId = getUserId();
let userId = getKey("userId");
if(userId == null){
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+ encodeURIComponent(location.href);
window.location.href = url;
}
else{
let timestamp = parseInt(new Date().getTime()/1000 + "");
let idData = {
userId: userId,
userId: parseInt(userId),
time: timestamp
}
localStorage.setItem(name,JSON.stringify(idData));

Binary file not shown.

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -139,9 +139,9 @@
</div>
<canvas id="GameCanvas" oncontextmenu="event.preventDefault()" tabindex="0"></canvas>
<script src="src/settings.a99ca.js" charset="utf-8"></script>
<script src="src/settings.f1df6.js" charset="utf-8"></script>
<script src="main.28ccb.js" charset="utf-8"></script>
<script src="main.09708.js" charset="utf-8"></script>
<script type="text/javascript">
@ -176,31 +176,35 @@
if((timestamp - data.time) > 86400){
setUserId(name);
}
}
function getUserId() {
let pathStr = window.location.search;
let arr=pathStr.split("&");
if (pathStr.length>= 0&&arr.length>0) {
let arr2=[];
arr.map(item=>{
arr2.push(item.split("=")[1])
})
window.userId = arr2[0] + "";
return arr2[0]
} else {
return null
else if(!isNumber(userId)){
console.log("缓存异常");
setUserId(name);
}
}
function isNumber(value) {
var result = false;
result = typeof value === 'number';
if(result) if(value < 200000) result = false;
return result;
}
function getKey(key){
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return null;
}
function setUserId(name){
let userId = getUserId();
let userId = getKey("userId");
if(userId == null){
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+location.href;
let url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback="+ encodeURIComponent(location.href);
window.location.href = url;
}
else{
let timestamp = parseInt(new Date().getTime()/1000 + "");
let idData = {
userId: userId,
userId: parseInt(userId),
time: timestamp
}
localStorage.setItem(name,JSON.stringify(idData));
@ -225,7 +229,7 @@
}
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.07b7e.js', function () {
loadScript(debug ? 'cocos2d-js.js' : 'cocos2d-js-min.620a8.js', function () {
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
loadScript(debug ? 'physics.js' : 'physics-min.js', window.boot);
}

View File

@ -118,7 +118,7 @@ window.boot = function () {
if (window.jsb) {
var isRuntime = (typeof loadRuntime === 'function');
if (isRuntime) {
require('src/settings.a99ca.js');
require('src/settings.f1df6.js');
require('src/cocos2d-runtime.js');
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
require('src/physics.js');
@ -126,7 +126,7 @@ if (window.jsb) {
require('jsb-adapter/engine/index.js');
}
else {
require('src/settings.a99ca.js');
require('src/settings.f1df6.js');
require('src/cocos2d-jsb.js');
if (CC_PHYSICS_BUILTIN || CC_PHYSICS_CANNON) {
require('src/physics.js');

View File

@ -1 +1 @@
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scene/LoadScene.fire",orientation:"portrait",jsList:[],bundleVers:{internal:"d0832",resources:"8a1f5",main:"3c8a7"}};
window._CCSettings={platform:"web-mobile",groupList:["default"],collisionMatrix:[[true]],hasResourcesBundle:true,hasStartSceneBundle:false,remoteBundles:[],subpackages:[],launchScene:"db://assets/Scene/LoadScene.fire",orientation:"portrait",jsList:[],bundleVers:{internal:"d0832",resources:"8a1f5",main:"09b9e"}};

View File

@ -26,14 +26,31 @@ var GameTool = {
var name = "user_" + GameData_1.default._instance.GM_INFO.gameId;
var data = JSON.parse(localStorage.getItem(name));
if (data == "undifend" || data == null || data == "") {
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
encodeURIComponent(location.href);
window.location.href = url;
}
else {
Storage_1.StorageMessage.setStorage(name, data);
GameData_1.default._instance.GM_INFO.userId = parseInt(data.userId);
if (!this.isNumber(data.userId)) {
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
encodeURIComponent(location.href);
console.log("链接不合法", url);
window.location.href = url;
}
else {
Storage_1.StorageMessage.setStorage(name, data);
GameData_1.default._instance.GM_INFO.userId = parseInt(data.userId);
}
}
},
isNumber: function (value) {
var result = false;
result = typeof value === 'number';
if (result)
if (value < 200000)
result = false;
return result;
},
//埋点上传
setGameData: function () {
//GAME_DATA 初始化 每次清零
@ -44,9 +61,10 @@ var GameTool = {
var matchId = this.getMatchId(GameData_1.default._instance.GAME_DATA[0].round);
var postData = {
"matchId": matchId,
"scode": GameData_1.default._instance.GM_INFO.scode,
"data": GameData_1.default._instance.GAME_DATA
};
// console.log("上传数据:",postData);
console.log("上传数据:", postData);
HttpUtil_1.default.uploadUserLogData(postData, function () { });
},
setRank: function () {

File diff suppressed because one or more lines are too long

View File

@ -305,7 +305,9 @@ var NewClass = /** @class */ (function (_super) {
if (this.block.name != "block13") {
this.block.getComponent("Block").setScore(number);
GameData_1.default._instance.GM_INFO.afkCount = 0;
Notification_1.Notification.emit("setData", null);
if (GameManager_1.default._instance.countTime > 0) {
Notification_1.Notification.emit("setData", false);
}
}
setTimeout(function () {
if (GameManager_1.default._instance.guide == -1) {
@ -352,7 +354,9 @@ var NewClass = /** @class */ (function (_super) {
else {
GameData_1.default._instance.GM_INFO.afkCount = 0;
}
Notification_1.Notification.emit("setData", null);
if (GameManager_1.default._instance.countTime > 0) {
Notification_1.Notification.emit("setData", false);
}
this.double = false;
GameData_1.default._instance.LEVEL_INFO.doubleSuccess = 3;
this.death = true;

File diff suppressed because one or more lines are too long

View File

@ -96,15 +96,17 @@ var WeChat = /** @class */ (function () {
console.log("分享好友成功回调");
}
});
wx.updateTimelineShareData({
title: '手眼协调练习',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/flyup.jpg',
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
});
setTimeout(function () {
wx.updateTimelineShareData({
title: '手眼协调练习',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/flyup.jpg',
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
});
}, 200);
});
};
WeChat.getSignature = function (url) {
@ -118,7 +120,7 @@ var WeChat = /** @class */ (function () {
return __generator(this, function (_a) {
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.default.apiSign("/api/share/cfg?gameId=" + GameData_1.default._instance.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, HttpUtil_1.default.httpGet(url, callback)];
return [2 /*return*/, HttpUtil_1.default.get(url, callback, 0)];
});
});
};

File diff suppressed because one or more lines are too long

View File

@ -17,6 +17,17 @@ var __extends = (this && this.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -62,6 +73,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
Object.defineProperty(exports, "__esModule", { value: true });
var GameData_1 = require("../GameData");
var CryptoJS = require("./crypto-js.min.js"); //引用AES源码js
var BASE_URL = "https://api.sparkus.cn";
// import axios from 'axios'
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var HttpUtil = /** @class */ (function (_super) {
@ -70,18 +82,7 @@ var HttpUtil = /** @class */ (function (_super) {
return _super !== null && _super.apply(this, arguments) || this;
}
HttpUtil_1 = HttpUtil;
HttpUtil.getShareInfo = function (shareUrl) {
return __awaiter(this, void 0, Promise, function () {
var time, url;
return __generator(this, function (_a) {
console.log("设置分享链接:", shareUrl);
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/share/cfg?gameId=" + config.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, this.httpPost(url, null, null)];
});
});
};
//排行榜type2为获取type1为上传
//排行榜
HttpUtil.rankData = function (type, callback, data) {
return __awaiter(this, void 0, Promise, function () {
var time, url;
@ -90,7 +91,7 @@ var HttpUtil = /** @class */ (function (_super) {
data.userId = GameData_1.default._instance.GM_INFO.userId;
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
this.httpPost(url, data, callback);
this.post(url, data, callback, 0);
return [2 /*return*/];
});
});
@ -102,7 +103,7 @@ var HttpUtil = /** @class */ (function (_super) {
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
data.userId = GameData_1.default._instance.GM_INFO.userId;
url = '/log/collect/data';
this.httpPost(url, data, callback);
this.post(url, data, callback, 3);
return [2 /*return*/];
});
});
@ -116,71 +117,111 @@ var HttpUtil = /** @class */ (function (_super) {
data.userId = GameData_1.default._instance.GM_INFO.userId;
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
this.httpPost(url, data, callback);
this.post(url, data, callback, 0);
return [2 /*return*/];
});
});
};
HttpUtil.httpPost = function (url, data, callBack) {
if (data) {
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
data.userId = GameData_1.default._instance.GM_INFO.userId;
}
var urlData = "https://api.sparkus.cn" + url;
// console.log("params:",JSON.stringify(data));
var xhr = new XMLHttpRequest();
xhr.open('POST', urlData);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if (!data) {
console.log("初始化失败");
return;
HttpUtil.get = function (url, callback, count) {
return __awaiter(this, void 0, void 0, function () {
var repeat, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
repeat = count ? count : 0;
return [4 /*yield*/, this.fetchData(url, null, 'GET', repeat)];
case 1:
response = _a.sent();
callback && callback(response);
return [2 /*return*/];
}
console.log(data);
var json = JSON.parse(data);
console.log('http success:' + json);
if (callBack)
callBack(json);
}
else {
// var json = JSON.parse(data);
// console.log('http fail:' + url);
if (callBack)
callBack(json);
}
};
xhr.send(JSON.stringify(data));
});
});
};
HttpUtil.httpGet = function (url, callBack) {
var urlData = "https://api.sparkus.cn" + url;
console.log(urlData);
var xhr = new XMLHttpRequest();
xhr.open('GET', urlData);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if (data) {
var json = JSON.parse(data);
console.info('http success:' + json);
if (callBack)
callBack(json);
HttpUtil.post = function (url, data, callback, count) {
return __awaiter(this, void 0, void 0, function () {
var repeat, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
repeat = count ? count : 0;
return [4 /*yield*/, this.fetchData(url, data, 'POST', repeat)];
case 1:
response = _a.sent();
callback && callback(response);
return [2 /*return*/];
}
else {
if (callBack)
callBack(json);
});
});
};
HttpUtil.fetchData = function (url, data, method, repeat) {
return __awaiter(this, void 0, void 0, function () {
var fullUrl, headers, options, response, error_1, timeOut;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
fullUrl = "" + BASE_URL + url;
headers = { 'Content-Type': 'application/json' };
options = {
method: method,
headers: headers,
body: data ? JSON.stringify(data) : null,
};
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 5]);
return [4 /*yield*/, this.fetchWithTimeout(fullUrl, options)];
case 2:
response = _a.sent();
if (!response.ok) {
throw new Error("HTTP_______________error! status: " + response.status);
}
return [4 /*yield*/, response.json()];
case 3: return [2 /*return*/, _a.sent()];
case 4:
error_1 = _a.sent();
console.error('Fetch_______________error:', error_1);
if (repeat > 0) {
repeat -= 1;
timeOut = (3 - repeat) * 5000;
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.fetchData(url, data, method, repeat)];
case 1:
response = _a.sent();
return [2 /*return*/];
}
});
}); }, timeOut);
}
else {
return [2 /*return*/, null];
}
return [3 /*break*/, 5];
case 5: return [2 /*return*/];
}
}
else {
console.info('http fail:' + url);
if (callBack)
callBack(null);
;
}
};
xhr.send();
});
});
};
HttpUtil.fetchWithTimeout = function (resource, options) {
if (options === void 0) { options = {}; }
return __awaiter(this, void 0, void 0, function () {
var controller, id, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
controller = new AbortController();
id = setTimeout(function () { return controller.abort(); }, 5000);
return [4 /*yield*/, fetch(resource, __assign(__assign({}, options), { signal: controller.signal }))];
case 1:
response = _a.sent();
clearTimeout(id);
return [2 /*return*/, response];
}
});
});
};
/**
*

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,7 @@ var GameManager = /** @class */ (function (_super) {
GameManager_1 = GameManager;
// LIFE-CYCLE CALLBACKS:
GameManager.prototype.onLoad = function () {
cc.game.setFrameRate(61);
cc.game.setFrameRate(60);
// 示例使用
var manager = cc.director.getCollisionManager();
manager.enabled = true;
@ -640,14 +640,16 @@ var GameManager = /** @class */ (function (_super) {
})
.start();
};
GameManager.prototype.setData = function () {
GameData_1.default._instance.CLICK_DATA.totalScore = GameManager_1._instance.score;
GameData_1.default._instance.CLICK_DATA.timer = this.countTime;
GameData_1.default._instance.CLICK_DATA.level = this.round;
GameData_1.default._instance.CLICK_DATA.round = this.level;
GameData_1.default._instance.CLICK_DATA.isAFK = GameData_1.default._instance.GM_INFO.isAFK;
//CLICK_DATA 数据处理完毕后调用上传接口 上传接口内CLICK_DATA不做改变
GameTool_1.GameTool.setGameData();
GameManager.prototype.setData = function (result) {
if (result == true || this.countTime > 0) {
GameData_1.default._instance.CLICK_DATA.totalScore = GameManager_1._instance.score;
GameData_1.default._instance.CLICK_DATA.timer = this.countTime;
GameData_1.default._instance.CLICK_DATA.level = this.round;
GameData_1.default._instance.CLICK_DATA.round = this.level;
GameData_1.default._instance.CLICK_DATA.isAFK = GameData_1.default._instance.GM_INFO.isAFK;
//CLICK_DATA 数据处理完毕后调用上传接口 上传接口内CLICK_DATA不做改变
GameTool_1.GameTool.setGameData();
}
};
//获取matchId 用于上传每次点击数据里面记录id方便查询
GameManager.prototype.getMatchId = function () {
@ -709,7 +711,7 @@ var GameManager = /** @class */ (function (_super) {
}
if (this.countTime <= 0) {
this.unschedule(this.updateCountDownTime);
Notification_1.Notification.emit("setData", null);
Notification_1.Notification.emit("setData", true);
this.begin = false;
this.over = true;
this.overStop();
@ -791,6 +793,13 @@ var GameManager = /** @class */ (function (_super) {
return m + ':' + miao;
};
GameManager.prototype.update = function (dt) {
var frame = cc.game.getFrameRate();
if (frame > 110)
cc.game.setFrameRate(120);
else if (frame > 80)
cc.game.setFrameRate(90);
else
cc.game.setFrameRate(60);
if (this.cameraMove == true && this.over == false) {
this.Camera.node.y = this.Player.y - this.countHeight;
if (this.Camera.node.y <= 0)

File diff suppressed because one or more lines are too long

View File

@ -57,7 +57,8 @@ var GameData = /** @class */ (function (_super) {
total: 0,
currSeed: 203213,
gameId: '100001',
userId: "",
userId: 200139,
scode: "",
guide: true,
url: "https://dev.api.sparkus.cn",
custom: 0,
@ -79,6 +80,7 @@ var GameData = /** @class */ (function (_super) {
afkCount: 0,
isAFK: false //是否挂机
};
this.setCode(this.getKey("scode"));
};
GameData.prototype.CLICK_init = function () {
GameData_1._instance.CLICK_DATA =
@ -197,6 +199,17 @@ var GameData = /** @class */ (function (_super) {
},
];
};
GameData.prototype.setCode = function (code) {
this.GM_INFO.scode = code;
};
GameData.prototype.getKey = function (key) {
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return "";
};
var GameData_1;
GameData = GameData_1 = __decorate([
ccclass

File diff suppressed because one or more lines are too long

View File

@ -180,8 +180,8 @@
"relativePath": "prefab\\block0.prefab"
},
"90e4d14c-de00-4990-bcb9-4b5eb0f9c60a": {
"asset": 1721632487568,
"meta": 1721632487574,
"asset": 1724212674292,
"meta": 1724212674300,
"relativePath": "Scene\\GameScene.fire"
},
"d14c5a08-005b-467a-96bb-5cc71c00c350": {
@ -315,8 +315,8 @@
"relativePath": "Script\\Block.ts"
},
"de4a2193-73c2-43cd-8359-363f654e759f": {
"asset": 1723631148744,
"meta": 1723631148748,
"asset": 1724754704469,
"meta": 1724754704474,
"relativePath": "Scene\\LoadScene.fire"
},
"cbbdc0fe-70fe-4713-a29c-72e3ec7e2511": {
@ -331,487 +331,487 @@
},
"9836134e-b892-4283-b6b2-78b5acf3ed45": {
"asset": 1714966328642,
"meta": 1723631043814,
"meta": 1724752739359,
"relativePath": "effects"
},
"abc2cb62-7852-4525-a90d-d474487b88f2": {
"asset": 1714966328642,
"meta": 1723631043939,
"meta": 1724752739469,
"relativePath": "effects\\builtin-phong.effect"
},
"e2f00085-c597-422d-9759-52c360279106": {
"asset": 1714966328642,
"meta": 1723631043993,
"meta": 1724752739523,
"relativePath": "effects\\builtin-toon.effect"
},
"430eccbf-bf2c-4e6e-8c0c-884bbb487f32": {
"asset": 1714966328642,
"meta": 1723631044002,
"meta": 1724752739539,
"relativePath": "effects\\__builtin-editor-gizmo-line.effect"
},
"6c5cf6e1-b044-4eac-9431-835644d57381": {
"asset": 1714966328642,
"meta": 1723631044011,
"meta": 1724752739548,
"relativePath": "effects\\__builtin-editor-gizmo-unlit.effect"
},
"115286d1-2e10-49ee-aab4-341583f607e8": {
"asset": 1714966328642,
"meta": 1723631044036,
"meta": 1724752739580,
"relativePath": "effects\\__builtin-editor-gizmo.effect"
},
"f8e6b000-5643-4b86-9080-aa680ce1f599": {
"asset": 1714966328706,
"meta": 1723631043814,
"meta": 1724752739360,
"relativePath": "image"
},
"5c3eedba-6c41-4c0c-9ba7-d91f813cbd1c": {
"asset": 1714966328721,
"meta": 1723631043814,
"meta": 1724752739360,
"relativePath": "materials"
},
"fc09f9bd-2cce-4605-b630-8145ef809ed6": {
"asset": 1714966328721,
"meta": 1723631043818,
"meta": 1724752739361,
"relativePath": "misc"
},
"d81ec8ad-247c-4e62-aa3c-d35c4193c7af": {
"asset": 1714966328673,
"meta": 1723631044113,
"meta": 1724752739636,
"relativePath": "image\\default_panel.png"
},
"e851e89b-faa2-4484-bea6-5c01dd9f06e2": {
"asset": 1714966328658,
"meta": 1723631044114,
"meta": 1724752739662,
"relativePath": "image\\default_btn_normal.png"
},
"db019bf7-f71c-4111-98cf-918ea180cb48": {
"asset": 1714966328737,
"meta": 1723631043819,
"meta": 1724752739362,
"relativePath": "model"
},
"e39e96e6-6f6e-413f-bcf1-ac7679bb648a": {
"asset": 1714966328737,
"meta": 1723631044089,
"meta": 1724752739639,
"relativePath": "model\\prefab"
},
"9d60001f-b5f4-4726-a629-2659e3ded0b8": {
"asset": 1714966328673,
"meta": 1723631044121,
"meta": 1724752739664,
"relativePath": "image\\default_radio_button_on.png"
},
"d6d3ca85-4681-47c1-b5dd-d036a9d39ea2": {
"asset": 1714966328689,
"meta": 1723631044112,
"meta": 1724752739670,
"relativePath": "image\\default_scrollbar_vertical.png"
},
"71561142-4c83-4933-afca-cb7a17f67053": {
"asset": 1714966328658,
"meta": 1723631044075,
"meta": 1724752739634,
"relativePath": "image\\default_btn_disabled.png"
},
"617323dd-11f4-4dd3-8eec-0caf6b3b45b9": {
"asset": 1714966328689,
"meta": 1723631044123,
"meta": 1724752739672,
"relativePath": "image\\default_scrollbar_vertical_bg.png"
},
"cfef78f1-c8df-49b7-8ed0-4c953ace2621": {
"asset": 1714966328673,
"meta": 1723631044073,
"meta": 1724752739638,
"relativePath": "image\\default_progressbar.png"
},
"4bab67cb-18e6-4099-b840-355f0473f890": {
"asset": 1714966328689,
"meta": 1723631044119,
"meta": 1724752739674,
"relativePath": "image\\default_scrollbar_bg.png"
},
"edd215b9-2796-4a05-aaf5-81f96c9281ce": {
"asset": 1714966328658,
"meta": 1723631044081,
"meta": 1724752739629,
"relativePath": "image\\default_editbox_bg.png"
},
"f6e6dd15-71d1-4ffe-ace7-24fd39942c05": {
"asset": 1714966328752,
"meta": 1723631043819,
"meta": 1724752739363,
"relativePath": "obsolete"
},
"99170b0b-d210-46f1-b213-7d9e3f23098a": {
"asset": 1714966328673,
"meta": 1723631044110,
"meta": 1724752739660,
"relativePath": "image\\default_progressbar_bg.png"
},
"c4480a0a-6ac5-443f-8b40-361a14257fc8": {
"asset": 1714966328706,
"meta": 1723631044420,
"meta": 1724752739962,
"relativePath": "materials\\builtin-phong.mtl"
},
"f743d2b6-b7ea-4c14-a55b-547ed4d0a045": {
"asset": 1714966328752,
"meta": 1723631043821,
"meta": 1724752739364,
"relativePath": "particle"
},
"600301aa-3357-4a10-b086-84f011fa32ba": {
"asset": 1714966328642,
"meta": 1723631044083,
"meta": 1724752739631,
"relativePath": "image\\default-particle.png"
},
"a87cc147-01b2-43f8-8e42-a7ca90b0c757": {
"asset": 1714966328721,
"meta": 1723631044349,
"meta": 1724752739889,
"relativePath": "model\\prefab\\box.prefab"
},
"b43ff3c2-02bb-4874-81f7-f2dea6970f18": {
"asset": 1714966328658,
"meta": 1723631044077,
"meta": 1724752739624,
"relativePath": "image\\default_btn_pressed.png"
},
"fe1417b6-fe6b-46a4-ae7c-9fd331f33a2a": {
"asset": 1714966328737,
"meta": 1723631044349,
"meta": 1724752739893,
"relativePath": "model\\prefab\\capsule.prefab"
},
"ae6c6c98-11e4-452f-8758-75f5c6a56e83": {
"asset": 1714966328831,
"meta": 1723631043822,
"meta": 1724752739364,
"relativePath": "prefab"
},
"0291c134-b3da-4098-b7b5-e397edbe947f": {
"asset": 1714966328689,
"meta": 1723631044085,
"meta": 1724752739671,
"relativePath": "image\\default_scrollbar.png"
},
"b5fc2cf2-7942-483d-be1f-bbeadc4714ad": {
"asset": 1714966328737,
"meta": 1723631044369,
"meta": 1724752739891,
"relativePath": "model\\prefab\\cone.prefab"
},
"1c5e4038-953a-44c2-b620-0bbfc6170477": {
"asset": 1714966328737,
"meta": 1723631044359,
"meta": 1724752739894,
"relativePath": "model\\prefab\\cylinder.prefab"
},
"6e056173-d285-473c-b206-40a7fff5386e": {
"asset": 1714966328689,
"meta": 1723631044117,
"meta": 1724752739668,
"relativePath": "image\\default_sprite.png"
},
"3f376125-a699-40ca-ad05-04d662eaa1f2": {
"asset": 1714966328737,
"meta": 1723631044349,
"meta": 1724752739895,
"relativePath": "model\\prefab\\plane.prefab"
},
"de510076-056b-484f-b94c-83bef217d0e1": {
"asset": 1714966328737,
"meta": 1723631044360,
"meta": 1724752739899,
"relativePath": "model\\prefab\\torus.prefab"
},
"567dcd80-8bf4-4535-8a5a-313f1caf078a": {
"asset": 1714966328673,
"meta": 1723631044087,
"meta": 1724752739627,
"relativePath": "image\\default_radio_button_off.png"
},
"6c9ef10d-b479-420b-bfe6-39cdda6a8ae0": {
"asset": 1714966328737,
"meta": 1723631044360,
"meta": 1724752739902,
"relativePath": "model\\prefab\\quad.prefab"
},
"2d9a4b85-b0ab-4c46-84c5-18f393ab2058": {
"asset": 1714966328737,
"meta": 1723631044364,
"meta": 1724752739897,
"relativePath": "model\\prefab\\sphere.prefab"
},
"0275e94c-56a7-410f-bd1a-fc7483f7d14a": {
"asset": 1714966328705,
"meta": 1723631044116,
"meta": 1724752739665,
"relativePath": "image\\default_sprite_splash.png"
},
"70d7cdb0-04cd-41bb-9480-c06a4785f386": {
"asset": 1714966328768,
"meta": 1723631044130,
"meta": 1724752739682,
"relativePath": "prefab\\3d-camera.prefab"
},
"ed88f13d-fcad-4848-aa35-65a2cb973584": {
"asset": 1714966328768,
"meta": 1723631044135,
"meta": 1724752739687,
"relativePath": "prefab\\3d-stage.prefab"
},
"a3ee0214-b432-4865-9666-4a3211814282": {
"asset": 1714966328800,
"meta": 1723631044130,
"meta": 1724752739683,
"relativePath": "prefab\\light"
},
"897ef7a1-4860-4f64-968d-f5924b18668a": {
"asset": 1714966328752,
"meta": 1723631044128,
"meta": 1724752739681,
"relativePath": "prefab\\2d-camera.prefab"
},
"2c937608-2562-40ea-b264-7395df6f0cea": {
"asset": 1714966328768,
"meta": 1723631044139,
"meta": 1724752739690,
"relativePath": "prefab\\canvas.prefab"
},
"972b9a4d-47ee-4c74-b5c3-61d8a69bc29f": {
"asset": 1714966328768,
"meta": 1723631044137,
"meta": 1724752739685,
"relativePath": "prefab\\button.prefab"
},
"70bbeb73-6dc2-4ee4-8faf-76b3a0e34ec4": {
"asset": 1714966328768,
"meta": 1723631044132,
"meta": 1724752739689,
"relativePath": "prefab\\3d-particle.prefab"
},
"61aeb05b-3b32-452b-8eed-2b76deeed554": {
"asset": 1714966328783,
"meta": 1723631044140,
"meta": 1724752739692,
"relativePath": "prefab\\editbox.prefab"
},
"27756ebb-3d33-44b0-9b96-e858fadd4dd4": {
"asset": 1714966328783,
"meta": 1723631044144,
"meta": 1724752739699,
"relativePath": "prefab\\label.prefab"
},
"2be36297-9abb-4fee-8049-9ed5e271da8a": {
"asset": 1714966328721,
"meta": 1723631044216,
"meta": 1724752739751,
"relativePath": "misc\\default_video.mp4"
},
"785a442c-3ceb-45be-a46e-7317f625f3b9": {
"asset": 1714966328783,
"meta": 1723631044146,
"meta": 1724752739703,
"relativePath": "prefab\\layout.prefab"
},
"ca8401fe-ad6e-41a8-bd46-8e3e4e9945be": {
"asset": 1714966328800,
"meta": 1723631044151,
"meta": 1724752739705,
"relativePath": "prefab\\pageview.prefab"
},
"cd33edea-55f5-46c2-958d-357a01384a36": {
"asset": 1714966328800,
"meta": 1723631044149,
"meta": 1724752739707,
"relativePath": "prefab\\particlesystem.prefab"
},
"5965ffac-69da-4b55-bcde-9225d0613c28": {
"asset": 1714966328800,
"meta": 1723631044153,
"meta": 1724752739714,
"relativePath": "prefab\\progressBar.prefab"
},
"4a37dd57-78cd-4cec-aad4-f11a73d12b63": {
"asset": 1714966328800,
"meta": 1723631044155,
"meta": 1724752739709,
"relativePath": "prefab\\richtext.prefab"
},
"32044bd2-481f-4cf1-a656-e2b2fb1594eb": {
"asset": 1714966328800,
"meta": 1723631044159,
"meta": 1724752739712,
"relativePath": "prefab\\scrollview.prefab"
},
"0004d1cf-a0ad-47d8-ab17-34d3db9d35a3": {
"asset": 1714966328800,
"meta": 1723631044157,
"meta": 1724752739711,
"relativePath": "prefab\\slider.prefab"
},
"96083d03-c332-4a3f-9386-d03e2d19e8ee": {
"asset": 1714966328815,
"meta": 1723631044168,
"meta": 1724752739724,
"relativePath": "prefab\\sprite.prefab"
},
"b181c1e4-0a72-4a91-bfb0-ae6f36ca60bd": {
"asset": 1714966328706,
"meta": 1723631044177,
"meta": 1724752739735,
"relativePath": "image\\default_toggle_pressed.png"
},
"d8afc78c-4eac-4a9f-83dd-67bc70344d33": {
"asset": 1714966328862,
"meta": 1723631043822,
"meta": 1724752739365,
"relativePath": "resources"
},
"294c1663-4adf-4a1e-a795-53808011a38a": {
"asset": 1714966328862,
"meta": 1723631044178,
"meta": 1724752739736,
"relativePath": "resources\\effects"
},
"bbee2217-c261-49bd-a8ce-708d6bcc3500": {
"asset": 1714966328893,
"meta": 1723631044179,
"meta": 1724752739737,
"relativePath": "resources\\materials"
},
"30682f87-9f0d-4f17-8a44-72863791461b": {
"asset": 1714966328831,
"meta": 1723631044215,
"meta": 1724752739764,
"relativePath": "resources\\effects\\builtin-2d-graphics.effect"
},
"1f55e3be-b89b-4b79-88de-47fd31018044": {
"asset": 1714966328815,
"meta": 1723631044187,
"meta": 1724752739742,
"relativePath": "prefab\\sprite_splash.prefab"
},
"144c3297-af63-49e8-b8ef-1cfa29b3be28": {
"asset": 1714966328831,
"meta": 1723631044224,
"meta": 1724752739773,
"relativePath": "resources\\effects\\builtin-2d-gray-sprite.effect"
},
"d29077ba-1627-4a72-9579-7b56a235340c": {
"asset": 1714966328706,
"meta": 1723631044196,
"meta": 1724752739738,
"relativePath": "image\\default_toggle_normal.png"
},
"f18742d7-56d2-4eb5-ae49-2d9d710b37c8": {
"asset": 1714966328831,
"meta": 1723631044235,
"meta": 1724752739782,
"relativePath": "resources\\effects\\builtin-2d-label.effect"
},
"0e93aeaa-0b53-4e40-b8e0-6268b4e07bd7": {
"asset": 1714966328831,
"meta": 1723631044243,
"meta": 1724752739790,
"relativePath": "resources\\effects\\builtin-2d-spine.effect"
},
"c25b9d50-c8fc-4d27-beeb-6e7c1f2e5c0f": {
"asset": 1714966328706,
"meta": 1723631044190,
"meta": 1724752739744,
"relativePath": "image\\default_toggle_disabled.png"
},
"2874f8dd-416c-4440-81b7-555975426e93": {
"asset": 1714966328846,
"meta": 1723631044249,
"meta": 1724752739801,
"relativePath": "resources\\effects\\builtin-2d-sprite.effect"
},
"7de03a80-4457-438d-95a7-3e7cdffd6086": {
"asset": 1714966328815,
"meta": 1723631044186,
"meta": 1724752739745,
"relativePath": "prefab\\tiledmap.prefab"
},
"73a0903d-d80e-4e3c-aa67-f999543c08f5": {
"asset": 1714966328706,
"meta": 1723631044184,
"meta": 1724752739740,
"relativePath": "image\\default_toggle_checkmark.png"
},
"829a282c-b049-4019-bd38-5ace8d8a6417": {
"asset": 1714966328846,
"meta": 1723631044301,
"meta": 1724752739846,
"relativePath": "resources\\effects\\builtin-3d-particle.effect"
},
"2a7c0036-e0b3-4fe1-8998-89a54b8a2bec": {
"asset": 1714966328846,
"meta": 1723631044326,
"meta": 1724752739864,
"relativePath": "resources\\effects\\builtin-3d-trail.effect"
},
"c0040c95-c57f-49cd-9cbc-12316b73d0d4": {
"asset": 1714966328846,
"meta": 1723631044335,
"meta": 1724752739875,
"relativePath": "resources\\effects\\builtin-clear-stencil.effect"
},
"8a96b965-2dc0-4e03-aa90-3b79cb93b5b4": {
"asset": 1714966328752,
"meta": 1723631044200,
"meta": 1724752739757,
"relativePath": "obsolete\\atom.png"
},
"6d91e591-4ce0-465c-809f-610ec95019c6": {
"asset": 1714966328862,
"meta": 1723631044345,
"meta": 1724752739887,
"relativePath": "resources\\effects\\builtin-unlit.effect"
},
"0e42ba95-1fa1-46aa-b2cf-143cd1bcee2c": {
"asset": 1714966328815,
"meta": 1723631044189,
"meta": 1724752739746,
"relativePath": "prefab\\tiledtile.prefab"
},
"0d784963-d024-4ea6-a7db-03be0ad63010": {
"asset": 1714966328815,
"meta": 1723631044192,
"meta": 1724752739748,
"relativePath": "prefab\\toggle.prefab"
},
"bf0a434c-84dd-4a8e-a08a-7a36f180cc75": {
"asset": 1714966328815,
"meta": 1723631044194,
"meta": 1724752739753,
"relativePath": "prefab\\toggleContainer.prefab"
},
"8c5001fd-07ee-4a4b-a8a0-63e15195e94d": {
"asset": 1714966328831,
"meta": 1723631044310,
"meta": 1724752739849,
"relativePath": "prefab\\webview.prefab"
},
"61906da3-7003-4bda-9abc-5769c76faee4": {
"asset": 1714966328783,
"meta": 1723631044365,
"meta": 1724752739905,
"relativePath": "prefab\\light\\ambient.prefab"
},
"ddb99b39-7004-47cd-9705-751905c43c46": {
"asset": 1714966328800,
"meta": 1723631044369,
"meta": 1724752739900,
"relativePath": "prefab\\light\\directional.prefab"
},
"d1b8be49-b0a0-435c-83b7-552bed4bbe35": {
"asset": 1714966328815,
"meta": 1723631044198,
"meta": 1724752739750,
"relativePath": "prefab\\toggleGroup.prefab"
},
"232d2782-c4bd-4bb4-9e01-909f03d6d3b9": {
"asset": 1714966328815,
"meta": 1723631044203,
"meta": 1724752739754,
"relativePath": "prefab\\videoplayer.prefab"
},
"f5331fd2-bf42-4ee3-a3fd-3e1657600eff": {
"asset": 1714966328800,
"meta": 1723631044369,
"meta": 1724752739906,
"relativePath": "prefab\\light\\spot.prefab"
},
"0cf30284-9073-46bc-9eba-e62b69dbbff3": {
"asset": 1714966328800,
"meta": 1723631044365,
"meta": 1724752739904,
"relativePath": "prefab\\light\\point.prefab"
},
"6f801092-0c37-4f30-89ef-c8d960825b36": {
"asset": 1714966328862,
"meta": 1723631044439,
"meta": 1724752739994,
"relativePath": "resources\\materials\\builtin-2d-base.mtl"
},
"a153945d-2511-4c14-be7b-05d242f47d57": {
"asset": 1714966328862,
"meta": 1723631044442,
"meta": 1724752739999,
"relativePath": "resources\\materials\\builtin-2d-graphics.mtl"
},
"7afd064b-113f-480e-b793-8817d19f63c3": {
"asset": 1714966328878,
"meta": 1723631044449,
"meta": 1724752739998,
"relativePath": "resources\\materials\\builtin-2d-spine.mtl"
},
"432fa09c-cf03-4cff-a186-982604408a07": {
"asset": 1714966328878,
"meta": 1723631044445,
"meta": 1724752739997,
"relativePath": "resources\\materials\\builtin-3d-particle.mtl"
},
"cf7e0bb8-a81c-44a9-ad79-d28d43991032": {
"asset": 1714966328878,
"meta": 1723631044445,
"meta": 1724752740002,
"relativePath": "resources\\materials\\builtin-clear-stencil.mtl"
},
"3a7bb79f-32fd-422e-ada2-96f518fed422": {
"asset": 1714966328862,
"meta": 1723631044443,
"meta": 1724752739995,
"relativePath": "resources\\materials\\builtin-2d-gray-sprite.mtl"
},
"466d4f9b-e5f4-4ea8-85d5-3c6e9a65658a": {
"asset": 1714966328878,
"meta": 1723631044449,
"meta": 1724752740000,
"relativePath": "resources\\materials\\builtin-3d-trail.mtl"
},
"e02d87d4-e599-4d16-8001-e14891ac6506": {
"asset": 1714966328878,
"meta": 1723631044442,
"meta": 1724752739993,
"relativePath": "resources\\materials\\builtin-2d-label.mtl"
},
"2a296057-247c-4a1c-bbeb-0548b6c98650": {
"asset": 1714966328893,
"meta": 1723631044445,
"meta": 1724752740001,
"relativePath": "resources\\materials\\builtin-unlit.mtl"
},
"eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432": {
"asset": 1714966328878,
"meta": 1723631044445,
"meta": 1724752739997,
"relativePath": "resources\\materials\\builtin-2d-sprite.mtl"
},
"d0a82d39-bede-46c4-b698-c81ff0dedfff": {
"asset": 1714966328752,
"meta": 1723631044201,
"meta": 1724752739766,
"relativePath": "particle\\atom.png"
},
"ae860740-a9fe-4af7-b351-95e46e9ec909": {
@ -821,62 +821,62 @@
},
"b8223619-7e38-47c4-841f-9160c232495a": {
"asset": 1714966328752,
"meta": 1723631044470,
"meta": 1724752740033,
"relativePath": "obsolete\\atom.plist"
},
"b2687ac4-099e-403c-a192-ff477686f4f5": {
"asset": 1714966328752,
"meta": 1723631044468,
"meta": 1724752740032,
"relativePath": "particle\\atom.plist"
},
"954fec8b-cd16-4bb9-a3b7-7719660e7558": {
"asset": 1714966328737,
"meta": 1723631046242,
"meta": 1724752741667,
"relativePath": "model\\primitives.fbx"
},
"9ed31f56-d049-4890-9ffd-ef08fd28987c": {
"asset": 1720169819483,
"meta": 1720169867560,
"relativePath": "Script\\crypto\\HttpUtil.ts"
},
"850e9d92-5c95-43da-b719-e418ab0dcf5b": {
"asset": 1720428016793,
"meta": 1720428029894,
"relativePath": "Script\\tool\\share.ts"
},
"640c30b6-ca5e-4903-b67b-64aadd84fd86": {
"asset": 1720689043852,
"meta": 1720689091312,
"relativePath": "resources\\rank_Btn.png"
},
"35a73693-1080-4066-85ca-a7fc6eb70cd4": {
"asset": 1723631058674,
"meta": 1723631142848,
"relativePath": "Script\\tool\\GameTool.ts"
},
"9c7cc35c-f159-49f4-9cbb-a9f4cfa32d04": {
"asset": 1722566809698,
"meta": 1722566810384,
"relativePath": "Script\\RankManager.ts"
},
"9ed31f56-d049-4890-9ffd-ef08fd28987c": {
"asset": 1724224050617,
"meta": 1724225353519,
"relativePath": "Script\\crypto\\HttpUtil.ts"
},
"850e9d92-5c95-43da-b719-e418ab0dcf5b": {
"asset": 1724229872547,
"meta": 1724752742030,
"relativePath": "Script\\tool\\share.ts"
},
"f2f0b239-3ec5-48fa-8d7c-c45e86f8a55a": {
"asset": 1723022357351,
"meta": 1723022384575,
"asset": 1724225387728,
"meta": 1724225430341,
"relativePath": "Script\\GameData.ts"
},
"35a73693-1080-4066-85ca-a7fc6eb70cd4": {
"asset": 1724225667087,
"meta": 1724225667574,
"relativePath": "Script\\tool\\GameTool.ts"
},
"08fd7f48-1f83-43cb-a7b8-dc950ae0f526": {
"asset": 1724226221304,
"meta": 1724226222406,
"relativePath": "Script\\Load.ts"
},
"7fd749ea-5b80-4237-a685-6a53799e6c8b": {
"asset": 1723022427717,
"meta": 1723022428038,
"asset": 1724753021684,
"meta": 1724753053225,
"relativePath": "Script\\Player.ts"
},
"b26a4f51-0921-4f4f-80be-17bc4077adad": {
"asset": 1723630993531,
"meta": 1723631046511,
"asset": 1724754703319,
"meta": 1724754703844,
"relativePath": "Script\\GameManager.ts"
},
"08fd7f48-1f83-43cb-a7b8-dc950ae0f526": {
"asset": 1723022484332,
"meta": 1723022484835,
"relativePath": "Script\\Load.ts"
}
}

View File

@ -5,21 +5,21 @@
"main": true,
"url": "app://editor/index.html",
"windowType": "dockable",
"x": -8,
"y": -8,
"width": 1296,
"height": 688,
"x": 0,
"y": 0,
"width": 1280,
"height": 672,
"layout": {
"type": "dock-h",
"children": [
{
"width": 207.28125,
"height": 568.5,
"width": 204.5625,
"height": 556.3333740234375,
"type": "dock-v",
"children": [
{
"width": 207.28125,
"height": 282.75,
"width": 204.5625,
"height": 276.66668701171875,
"type": "panel",
"active": 0,
"children": [
@ -27,8 +27,8 @@
]
},
{
"width": 207.28125,
"height": 282.75,
"width": 204.5625,
"height": 276.66668701171875,
"type": "panel",
"active": 0,
"children": [
@ -38,8 +38,8 @@
]
},
{
"width": 758.3333740234375,
"height": 568.5,
"width": 750.0729370117188,
"height": 556.3333740234375,
"type": "panel",
"active": 0,
"children": [
@ -47,8 +47,8 @@
]
},
{
"width": 308.38543701171875,
"height": 568.5,
"width": 305.3645935058594,
"height": 556.3333740234375,
"type": "panel",
"active": 0,
"children": [
@ -65,14 +65,15 @@
"inspector",
"cocos-services"
]
}
},
" common-asset-worker-worker": {}
},
"panels": {
"builder": {
"x": 374,
"y": 0,
"width": 516,
"height": 678
"x": 418,
"y": 34,
"width": 422,
"height": 604
},
"project-settings": {
"x": -8,

View File

@ -26,13 +26,13 @@
"68bd0a7c-c549-4d7f-9f4c-5444f4e66f9d",
"b9212469-b9b0-472a-8483-6833b086ad2a",
"2dfeb128-71cd-49c1-ab46-e36f3cb3ce43",
"18361bc7-7461-4ac4-ac2b-a2e81994a63f",
"a3da91c2-21ef-4ca2-a0c6-cc9e442d0eba",
"bd15e211-f210-4e09-a9ce-1032a18cd7c5",
"01db2f22-3239-47f4-b3f3-600dbd219147",
"d844f3bb-a888-4201-be47-41b21981a214",
"90e4d14c-de00-4990-bcb9-4b5eb0f9c60a",
"92833b7e-ff21-4bab-84ea-c39509a4d2b1",
"bd15e211-f210-4e09-a9ce-1032a18cd7c5",
"a3da91c2-21ef-4ca2-a0c6-cc9e442d0eba",
"18361bc7-7461-4ac4-ac2b-a2e81994a63f",
"90e4d14c-de00-4990-bcb9-4b5eb0f9c60a",
"de4a2193-73c2-43cd-8359-363f654e759f"
]
}

View File

@ -1,8 +1,5 @@
{
"nodeFoldStates": [
"470l8xm1tCU4Dsb10rancm",
"13A74RFRlCHrCME2yKb7ag",
"76WmSmPyBFMJuhUWx5KN/K",
"57DRua7odMXprhTRJoSqn4",
"c5leZH9/BDwYPilYk2w+b6",
"b7MSJMUixCDrds3RR+88yR",
@ -431,11 +428,6 @@
"e1WoFrQ79G7r4ZuQE3HlNb",
"50p5sApvJDNbi+MzdATDzt",
"a6BOc3EGhFPbiNSiiLcBW1",
"ecasIRO2tG/4ED+0NylkSX",
"f7V64VrtxC9q9aMttksOIo",
"fbUtAVfAZIpY6KH5ZtK2fT",
"6ccG6BqC5MZ7+6LIshX2PJ",
"61VM8f3ZVATKPnKq4bCnCZ",
"cawyMT6S5BYqKwnhl59seZ",
"a5NBQZ/l5BPZrGNMQd8n8c",
"5aoLlsC4pCybOsGFnbQpKE",
@ -499,6 +491,9 @@
"42XJS51TtHdbCLLm7wWC00",
"3ajRQomHxBhpwZFRJyvAuU",
"fdoNDx6WtEqZfHXx2MyZIJ",
"9aqA0naB5JZIOcY1lV4x2E"
"9aqA0naB5JZIOcY1lV4x2E",
"0fVxaNbdFERrRwJGrntvox",
"50Pt3uF7hJPKAayaDfuXmJ",
"91V0zhL0tCzoFTnscnnfiv"
]
}

View File

@ -1,5 +1,5 @@
{
"last-module-event-record-time": 1723631064298,
"last-module-event-record-time": 1724752799241,
"group-list": [
"default"
],

View File

@ -1 +1 @@
{"version":"1.0.8","stats":{"C:/Work/Project/FlyUp/temp/quick-scripts/src/__qc_index__.js":"2024-08-14T10:25:43.090Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/crypto/HttpUtil.js":"2024-08-14T10:25:43.040Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameScene.js":"2024-08-14T10:25:43.048Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/GameTool.js":"2024-08-14T10:25:43.032Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/ListView/ItemRender.js":"2024-08-14T10:25:43.044Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js":"2024-08-14T10:25:43.036Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameOver.js":"2024-08-14T10:25:43.032Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/RankManager.js":"2024-08-14T10:25:43.040Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Load.js":"2024-08-14T10:25:43.028Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/Storage.js":"2024-08-14T10:25:43.048Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameData.js":"2024-08-14T10:25:43.052Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameManager.js":"2024-08-14T10:25:43.040Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Player.js":"2024-08-14T10:25:43.036Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Block.js":"2024-08-14T10:25:43.028Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/crypto/crypto-js.min.js":"2024-08-14T10:25:43.052Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/ListView/List.js":"2024-08-14T10:25:43.048Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/share.js":"2024-08-14T10:25:43.036Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/AudioManager.js":"2024-08-14T10:25:43.032Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Camera.js":"2024-08-14T10:25:43.044Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/Notification.js":"2024-08-14T10:25:43.044Z"}}
{"version":"1.0.8","stats":{"C:/Work/Project/FlyUp/temp/quick-scripts/src/__qc_index__.js":"2024-08-27T09:59:02.354Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/ListView/ItemRender.js":"2024-08-27T09:59:02.302Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/crypto/HttpUtil.js":"2024-08-27T09:59:02.292Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js":"2024-08-27T09:59:02.281Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Player.js":"2024-08-27T09:59:02.284Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Load.js":"2024-08-27T09:59:02.265Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/share.js":"2024-08-27T09:59:02.286Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameData.js":"2024-08-27T09:59:02.311Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameManager.js":"2024-08-27T09:59:02.294Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/Notification.js":"2024-08-27T09:59:02.299Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/RankManager.js":"2024-08-27T09:59:02.289Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameScene.js":"2024-08-27T09:59:02.303Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Block.js":"2024-08-27T09:59:02.268Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/AudioManager.js":"2024-08-27T09:59:02.278Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/Storage.js":"2024-08-27T09:59:02.307Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/ListView/List.js":"2024-08-27T09:59:02.305Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/Camera.js":"2024-08-27T09:59:02.297Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/GameOver.js":"2024-08-27T09:59:02.274Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/tool/GameTool.js":"2024-08-27T09:59:02.271Z","C:/Work/Project/FlyUp/temp/quick-scripts/src/assets/Script/crypto/crypto-js.min.js":"2024-08-27T09:59:02.308Z"}}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
(function () {
var scripts = [{"deps":{"./assets/Script/crypto/HttpUtil":1,"./assets/Script/GameScene":2,"./assets/Script/tool/GameTool":3,"./assets/Script/ListView/ItemRender":4,"./assets/migration/use_v2.1-2.2.1_cc.Toggle_event":5,"./assets/Script/GameOver":6,"./assets/Script/RankManager":7,"./assets/Script/Load":8,"./assets/Script/tool/Storage":9,"./assets/Script/GameData":10,"./assets/Script/GameManager":11,"./assets/Script/Player":12,"./assets/Script/Block":13,"./assets/Script/crypto/crypto-js.min":14,"./assets/Script/ListView/List":15,"./assets/Script/tool/share":16,"./assets/Script/tool/AudioManager":17,"./assets/Script/Camera":18,"./assets/Script/tool/Notification":19},"path":"preview-scripts/__qc_index__.js"},{"deps":{"../GameData":10,"./crypto-js.min.js":14},"path":"preview-scripts/assets/Script/crypto/HttpUtil.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameScene.js"},{"deps":{"../GameData":10,"../crypto/HttpUtil":1,"./Storage":9},"path":"preview-scripts/assets/Script/tool/GameTool.js"},{"deps":{},"path":"preview-scripts/assets/Script/ListView/ItemRender.js"},{"deps":{},"path":"preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameOver.js"},{"deps":{"./GameData":10,"./ListView/List":15,"./crypto/HttpUtil":1,"./tool/GameTool":3},"path":"preview-scripts/assets/Script/RankManager.js"},{"deps":{"./GameData":10,"./tool/GameTool":3,"./tool/share":16},"path":"preview-scripts/assets/Script/Load.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/Storage.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameData.js"},{"deps":{"./GameData":10,"./tool/GameTool":3,"./tool/Notification":19},"path":"preview-scripts/assets/Script/GameManager.js"},{"deps":{"./GameData":10,"./GameManager":11,"./tool/AudioManager":17,"./tool/Notification":19},"path":"preview-scripts/assets/Script/Player.js"},{"deps":{"./GameData":10,"./GameManager":11,"./tool/Notification":19},"path":"preview-scripts/assets/Script/Block.js"},{"deps":{},"path":"preview-scripts/assets/Script/crypto/crypto-js.min.js"},{"deps":{"./ItemRender":4},"path":"preview-scripts/assets/Script/ListView/List.js"},{"deps":{"../crypto/HttpUtil":1,"../GameData":10},"path":"preview-scripts/assets/Script/tool/share.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/AudioManager.js"},{"deps":{"./GameData":10,"./GameManager":11,"./tool/Notification":19},"path":"preview-scripts/assets/Script/Camera.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/Notification.js"}];
var scripts = [{"deps":{"./assets/Script/GameData":7,"./assets/Script/GameManager":8,"./assets/Script/GameOver":17,"./assets/Script/GameScene":11,"./assets/Script/Load":5,"./assets/Script/Player":4,"./assets/Script/RankManager":10,"./assets/Script/Block":12,"./assets/Script/ListView/List":15,"./assets/Script/ListView/ItemRender":1,"./assets/Script/crypto/crypto-js.min":19,"./assets/Script/crypto/HttpUtil":2,"./assets/Script/tool/GameTool":18,"./assets/Script/tool/Notification":9,"./assets/Script/tool/Storage":14,"./assets/Script/tool/share":6,"./assets/Script/tool/AudioManager":13,"./assets/migration/use_v2.1-2.2.1_cc.Toggle_event":3,"./assets/Script/Camera":16},"path":"preview-scripts/__qc_index__.js"},{"deps":{},"path":"preview-scripts/assets/Script/ListView/ItemRender.js"},{"deps":{"../GameData":7,"./crypto-js.min.js":19},"path":"preview-scripts/assets/Script/crypto/HttpUtil.js"},{"deps":{},"path":"preview-scripts/assets/migration/use_v2.1-2.2.1_cc.Toggle_event.js"},{"deps":{"./GameData":7,"./GameManager":8,"./tool/Notification":9,"./tool/AudioManager":13},"path":"preview-scripts/assets/Script/Player.js"},{"deps":{"./GameData":7,"./tool/GameTool":18,"./tool/share":6},"path":"preview-scripts/assets/Script/Load.js"},{"deps":{"../crypto/HttpUtil":2,"../GameData":7},"path":"preview-scripts/assets/Script/tool/share.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameData.js"},{"deps":{"./GameData":7,"./tool/Notification":9,"./tool/GameTool":18},"path":"preview-scripts/assets/Script/GameManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/Notification.js"},{"deps":{"./GameData":7,"./ListView/List":15,"./crypto/HttpUtil":2,"./tool/GameTool":18},"path":"preview-scripts/assets/Script/RankManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameScene.js"},{"deps":{"./GameData":7,"./GameManager":8,"./tool/Notification":9},"path":"preview-scripts/assets/Script/Block.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/AudioManager.js"},{"deps":{},"path":"preview-scripts/assets/Script/tool/Storage.js"},{"deps":{"./ItemRender":1},"path":"preview-scripts/assets/Script/ListView/List.js"},{"deps":{"./GameData":7,"./GameManager":8,"./tool/Notification":9},"path":"preview-scripts/assets/Script/Camera.js"},{"deps":{},"path":"preview-scripts/assets/Script/GameOver.js"},{"deps":{"../GameData":7,"../crypto/HttpUtil":2,"./Storage":14},"path":"preview-scripts/assets/Script/tool/GameTool.js"},{"deps":{},"path":"preview-scripts/assets/Script/crypto/crypto-js.min.js"}];
var entries = ["preview-scripts/__qc_index__.js"];
var bundleScript = 'preview-scripts/__qc_bundle__.js';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -57,7 +57,8 @@ var GameData = /** @class */ (function (_super) {
total: 0,
currSeed: 203213,
gameId: '100001',
userId: "",
userId: 200139,
scode: "",
guide: true,
url: "https://dev.api.sparkus.cn",
custom: 0,
@ -79,6 +80,7 @@ var GameData = /** @class */ (function (_super) {
afkCount: 0,
isAFK: false //是否挂机
};
this.setCode(this.getKey("scode"));
};
GameData.prototype.CLICK_init = function () {
GameData_1._instance.CLICK_DATA =
@ -197,6 +199,17 @@ var GameData = /** @class */ (function (_super) {
},
];
};
GameData.prototype.setCode = function (code) {
this.GM_INFO.scode = code;
};
GameData.prototype.getKey = function (key) {
var reg = new RegExp('(^|&)' + key + '=([^&]*)(&|$)', 'i');
var r = window.location.search.substr(1).match(reg);
if (r != null) {
return unescape(r[2]);
}
return "";
};
var GameData_1;
GameData = GameData_1 = __decorate([
ccclass

File diff suppressed because one or more lines are too long

View File

@ -51,7 +51,7 @@ var GameManager = /** @class */ (function (_super) {
GameManager_1 = GameManager;
// LIFE-CYCLE CALLBACKS:
GameManager.prototype.onLoad = function () {
cc.game.setFrameRate(61);
cc.game.setFrameRate(60);
// 示例使用
var manager = cc.director.getCollisionManager();
manager.enabled = true;
@ -640,14 +640,16 @@ var GameManager = /** @class */ (function (_super) {
})
.start();
};
GameManager.prototype.setData = function () {
GameData_1.default._instance.CLICK_DATA.totalScore = GameManager_1._instance.score;
GameData_1.default._instance.CLICK_DATA.timer = this.countTime;
GameData_1.default._instance.CLICK_DATA.level = this.round;
GameData_1.default._instance.CLICK_DATA.round = this.level;
GameData_1.default._instance.CLICK_DATA.isAFK = GameData_1.default._instance.GM_INFO.isAFK;
//CLICK_DATA 数据处理完毕后调用上传接口 上传接口内CLICK_DATA不做改变
GameTool_1.GameTool.setGameData();
GameManager.prototype.setData = function (result) {
if (result == true || this.countTime > 0) {
GameData_1.default._instance.CLICK_DATA.totalScore = GameManager_1._instance.score;
GameData_1.default._instance.CLICK_DATA.timer = this.countTime;
GameData_1.default._instance.CLICK_DATA.level = this.round;
GameData_1.default._instance.CLICK_DATA.round = this.level;
GameData_1.default._instance.CLICK_DATA.isAFK = GameData_1.default._instance.GM_INFO.isAFK;
//CLICK_DATA 数据处理完毕后调用上传接口 上传接口内CLICK_DATA不做改变
GameTool_1.GameTool.setGameData();
}
};
//获取matchId 用于上传每次点击数据里面记录id方便查询
GameManager.prototype.getMatchId = function () {
@ -709,7 +711,7 @@ var GameManager = /** @class */ (function (_super) {
}
if (this.countTime <= 0) {
this.unschedule(this.updateCountDownTime);
Notification_1.Notification.emit("setData", null);
Notification_1.Notification.emit("setData", true);
this.begin = false;
this.over = true;
this.overStop();
@ -791,6 +793,13 @@ var GameManager = /** @class */ (function (_super) {
return m + ':' + miao;
};
GameManager.prototype.update = function (dt) {
var frame = cc.game.getFrameRate();
if (frame > 110)
cc.game.setFrameRate(120);
else if (frame > 80)
cc.game.setFrameRate(90);
else
cc.game.setFrameRate(60);
if (this.cameraMove == true && this.over == false) {
this.Camera.node.y = this.Player.y - this.countHeight;
if (this.Camera.node.y <= 0)

File diff suppressed because one or more lines are too long

View File

@ -305,7 +305,9 @@ var NewClass = /** @class */ (function (_super) {
if (this.block.name != "block13") {
this.block.getComponent("Block").setScore(number);
GameData_1.default._instance.GM_INFO.afkCount = 0;
Notification_1.Notification.emit("setData", null);
if (GameManager_1.default._instance.countTime > 0) {
Notification_1.Notification.emit("setData", false);
}
}
setTimeout(function () {
if (GameManager_1.default._instance.guide == -1) {
@ -352,7 +354,9 @@ var NewClass = /** @class */ (function (_super) {
else {
GameData_1.default._instance.GM_INFO.afkCount = 0;
}
Notification_1.Notification.emit("setData", null);
if (GameManager_1.default._instance.countTime > 0) {
Notification_1.Notification.emit("setData", false);
}
this.double = false;
GameData_1.default._instance.LEVEL_INFO.doubleSuccess = 3;
this.death = true;

View File

@ -17,6 +17,17 @@ var __extends = (this && this.__extends) || (function () {
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
@ -62,6 +73,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
Object.defineProperty(exports, "__esModule", { value: true });
var GameData_1 = require("../GameData");
var CryptoJS = require("./crypto-js.min.js"); //引用AES源码js
var BASE_URL = "https://api.sparkus.cn";
// import axios from 'axios'
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var HttpUtil = /** @class */ (function (_super) {
@ -70,18 +82,7 @@ var HttpUtil = /** @class */ (function (_super) {
return _super !== null && _super.apply(this, arguments) || this;
}
HttpUtil_1 = HttpUtil;
HttpUtil.getShareInfo = function (shareUrl) {
return __awaiter(this, void 0, Promise, function () {
var time, url;
return __generator(this, function (_a) {
console.log("设置分享链接:", shareUrl);
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/share/cfg?gameId=" + config.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, this.httpPost(url, null, null)];
});
});
};
//排行榜type2为获取type1为上传
//排行榜
HttpUtil.rankData = function (type, callback, data) {
return __awaiter(this, void 0, Promise, function () {
var time, url;
@ -90,7 +91,7 @@ var HttpUtil = /** @class */ (function (_super) {
data.userId = GameData_1.default._instance.GM_INFO.userId;
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/get/rank/data?gameId=" + config.gameId + "&dataType=" + type + "&time=" + time, data);
this.httpPost(url, data, callback);
this.post(url, data, callback, 0);
return [2 /*return*/];
});
});
@ -102,7 +103,7 @@ var HttpUtil = /** @class */ (function (_super) {
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
data.userId = GameData_1.default._instance.GM_INFO.userId;
url = '/log/collect/data';
this.httpPost(url, data, callback);
this.post(url, data, callback, 3);
return [2 /*return*/];
});
});
@ -116,71 +117,111 @@ var HttpUtil = /** @class */ (function (_super) {
data.userId = GameData_1.default._instance.GM_INFO.userId;
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.apiSign("/api/get/user/data?gameId=" + config.gameId + "&time=" + time, data);
this.httpPost(url, data, callback);
this.post(url, data, callback, 0);
return [2 /*return*/];
});
});
};
HttpUtil.httpPost = function (url, data, callBack) {
if (data) {
data.gameId = GameData_1.default._instance.GM_INFO.gameId;
data.userId = GameData_1.default._instance.GM_INFO.userId;
}
var urlData = "https://api.sparkus.cn" + url;
// console.log("params:",JSON.stringify(data));
var xhr = new XMLHttpRequest();
xhr.open('POST', urlData);
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if (!data) {
console.log("初始化失败");
return;
HttpUtil.get = function (url, callback, count) {
return __awaiter(this, void 0, void 0, function () {
var repeat, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
repeat = count ? count : 0;
return [4 /*yield*/, this.fetchData(url, null, 'GET', repeat)];
case 1:
response = _a.sent();
callback && callback(response);
return [2 /*return*/];
}
console.log(data);
var json = JSON.parse(data);
console.log('http success:' + json);
if (callBack)
callBack(json);
}
else {
// var json = JSON.parse(data);
// console.log('http fail:' + url);
if (callBack)
callBack(json);
}
};
xhr.send(JSON.stringify(data));
});
});
};
HttpUtil.httpGet = function (url, callBack) {
var urlData = "https://api.sparkus.cn" + url;
console.log(urlData);
var xhr = new XMLHttpRequest();
xhr.open('GET', urlData);
xhr.setRequestHeader('Content-Type', 'text/plain');
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
var data = xhr.responseText;
if (data) {
var json = JSON.parse(data);
console.info('http success:' + json);
if (callBack)
callBack(json);
HttpUtil.post = function (url, data, callback, count) {
return __awaiter(this, void 0, void 0, function () {
var repeat, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
repeat = count ? count : 0;
return [4 /*yield*/, this.fetchData(url, data, 'POST', repeat)];
case 1:
response = _a.sent();
callback && callback(response);
return [2 /*return*/];
}
else {
if (callBack)
callBack(json);
});
});
};
HttpUtil.fetchData = function (url, data, method, repeat) {
return __awaiter(this, void 0, void 0, function () {
var fullUrl, headers, options, response, error_1, timeOut;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
fullUrl = "" + BASE_URL + url;
headers = { 'Content-Type': 'application/json' };
options = {
method: method,
headers: headers,
body: data ? JSON.stringify(data) : null,
};
_a.label = 1;
case 1:
_a.trys.push([1, 4, , 5]);
return [4 /*yield*/, this.fetchWithTimeout(fullUrl, options)];
case 2:
response = _a.sent();
if (!response.ok) {
throw new Error("HTTP_______________error! status: " + response.status);
}
return [4 /*yield*/, response.json()];
case 3: return [2 /*return*/, _a.sent()];
case 4:
error_1 = _a.sent();
console.error('Fetch_______________error:', error_1);
if (repeat > 0) {
repeat -= 1;
timeOut = (3 - repeat) * 5000;
setTimeout(function () { return __awaiter(_this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.fetchData(url, data, method, repeat)];
case 1:
response = _a.sent();
return [2 /*return*/];
}
});
}); }, timeOut);
}
else {
return [2 /*return*/, null];
}
return [3 /*break*/, 5];
case 5: return [2 /*return*/];
}
}
else {
console.info('http fail:' + url);
if (callBack)
callBack(null);
;
}
};
xhr.send();
});
});
};
HttpUtil.fetchWithTimeout = function (resource, options) {
if (options === void 0) { options = {}; }
return __awaiter(this, void 0, void 0, function () {
var controller, id, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
controller = new AbortController();
id = setTimeout(function () { return controller.abort(); }, 5000);
return [4 /*yield*/, fetch(resource, __assign(__assign({}, options), { signal: controller.signal }))];
case 1:
response = _a.sent();
clearTimeout(id);
return [2 /*return*/, response];
}
});
});
};
/**
*

File diff suppressed because one or more lines are too long

View File

@ -26,14 +26,31 @@ var GameTool = {
var name = "user_" + GameData_1.default._instance.GM_INFO.gameId;
var data = JSON.parse(localStorage.getItem(name));
if (data == "undifend" || data == null || data == "") {
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" + location.href;
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
encodeURIComponent(location.href);
window.location.href = url;
}
else {
Storage_1.StorageMessage.setStorage(name, data);
GameData_1.default._instance.GM_INFO.userId = parseInt(data.userId);
if (!this.isNumber(data.userId)) {
var url = "https://api.sparkus.cn/api/user/auth/login?domain=hui32579WdYPsgYq&callback=" +
encodeURIComponent(location.href);
console.log("链接不合法", url);
window.location.href = url;
}
else {
Storage_1.StorageMessage.setStorage(name, data);
GameData_1.default._instance.GM_INFO.userId = parseInt(data.userId);
}
}
},
isNumber: function (value) {
var result = false;
result = typeof value === 'number';
if (result)
if (value < 200000)
result = false;
return result;
},
//埋点上传
setGameData: function () {
//GAME_DATA 初始化 每次清零
@ -44,9 +61,10 @@ var GameTool = {
var matchId = this.getMatchId(GameData_1.default._instance.GAME_DATA[0].round);
var postData = {
"matchId": matchId,
"scode": GameData_1.default._instance.GM_INFO.scode,
"data": GameData_1.default._instance.GAME_DATA
};
// console.log("上传数据:",postData);
console.log("上传数据:", postData);
HttpUtil_1.default.uploadUserLogData(postData, function () { });
},
setRank: function () {

File diff suppressed because one or more lines are too long

View File

@ -96,15 +96,17 @@ var WeChat = /** @class */ (function () {
console.log("分享好友成功回调");
}
});
wx.updateTimelineShareData({
title: '手眼协调练习',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/flyup.jpg',
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
});
setTimeout(function () {
wx.updateTimelineShareData({
title: '手眼协调练习',
link: shareConfig.shareLine,
imgUrl: 'https://static.sparkus.cn/public/flyup.jpg',
success: function () {
// 设置成功
console.log("分享朋友圈成功回调");
}
});
}, 200);
});
};
WeChat.getSignature = function (url) {
@ -118,7 +120,7 @@ var WeChat = /** @class */ (function () {
return __generator(this, function (_a) {
time = Math.floor((new Date().getTime()) / 1000);
url = HttpUtil_1.default.apiSign("/api/share/cfg?gameId=" + GameData_1.default._instance.GM_INFO.gameId + "&time=" + time + "&url=" + shareUrl, {});
return [2 /*return*/, HttpUtil_1.default.httpGet(url, callback)];
return [2 /*return*/, HttpUtil_1.default.get(url, callback, 0)];
});
});
};

File diff suppressed because one or more lines are too long