update framework

dev
cuongnm2 2024-04-05 14:45:18 +07:00
parent 2096336317
commit 93e0b340d8
3 changed files with 37 additions and 8 deletions

View File

@ -1,10 +1,3 @@
// Learn TypeScript:
// - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
// - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
// - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html
const {ccclass, property} = cc._decorator; const {ccclass, property} = cc._decorator;
@ccclass @ccclass

View File

@ -8,7 +8,7 @@ namespace Configs {
static Coin: number = 0; static Coin: number = 0;
} }
export const SERVER_IP = 'ws://13.251.151.251:3035'; export const SERVER_IP = 'ws://127.0.0.1:3035';
export const SOCKET_EVENT = { export const SOCKET_EVENT = {
//sys event--------- //sys event---------

View File

@ -266,6 +266,42 @@ export default class GameUtil {
return ip; return ip;
} }
public CSVToArray( strData, strDelimiter ) {
strDelimiter = (strDelimiter || ",");
var objPattern = new RegExp(
(
"(\\" + strDelimiter + "|\\r?\\n|\\r|^)" +
"(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|" +
"([^\"\\" + strDelimiter + "\\r\\n]*))"
),
"gi"
);
var arrData = [[]];
var arrMatches = null;
while (arrMatches = objPattern.exec( strData )){
var strMatchedDelimiter = arrMatches[ 1 ];
if (
strMatchedDelimiter.length &&
(strMatchedDelimiter != strDelimiter)
){
arrData.push( [] );
}
if (arrMatches[ 2 ]){
var strMatchedValue = arrMatches[ 2 ].replace(
new RegExp( "\"\"", "g" ),
"\""
);
} else {
var strMatchedValue = arrMatches[ 3 ];
}
arrData[ arrData.length - 1 ].push( strMatchedValue );
}
if(arrData.length>0){
arrData.pop();
}
return arrData;
}
} }
class DateUtil extends Date { class DateUtil extends Date {
customFormat = function (formatString) { customFormat = function (formatString) {