目录结构调整
This commit is contained in:
@@ -0,0 +1,656 @@
|
||||
(function(wnd, undef){
|
||||
|
||||
//复制json对象
|
||||
function min_copyjson(json)
|
||||
{
|
||||
return JSON.parse(JSON.stringify(json));
|
||||
}
|
||||
|
||||
//json对象转字符串
|
||||
function min_jsontostr(json) {
|
||||
return JSON.stringify(json);
|
||||
}
|
||||
|
||||
//字符串转json对象
|
||||
function min_strtojson(str) {
|
||||
return JSON.parse(str);
|
||||
}
|
||||
|
||||
//字符串转整型 def:转换失败时返回的默认值
|
||||
function min_strtoint(str, def) {
|
||||
var i = parseInt(str);
|
||||
if (i == 0) {
|
||||
return 0;
|
||||
};
|
||||
if (!i) { //=0也会进来
|
||||
if (!def) {
|
||||
def = 0;
|
||||
};
|
||||
i = def;
|
||||
}
|
||||
return i;
|
||||
};
|
||||
|
||||
//整型转字符串
|
||||
function min_inttostr(i) {
|
||||
return i.toString();
|
||||
};
|
||||
|
||||
//整除
|
||||
function min_div(i, b)
|
||||
{
|
||||
if (!b) {
|
||||
return parseInt(i);
|
||||
}
|
||||
return parseInt(i / b);
|
||||
};
|
||||
|
||||
//取余数
|
||||
function min_mod(a, b){
|
||||
return a % b;
|
||||
};
|
||||
|
||||
//取绝对值
|
||||
function min_abs(b) {
|
||||
return Math.abs(b);
|
||||
};
|
||||
|
||||
//取随机数
|
||||
function min_random(min, max) {
|
||||
var Range = max - min;
|
||||
var Rand = Math.random();
|
||||
return (min + Math.round(Rand * Range));
|
||||
};
|
||||
//取随机数1
|
||||
function min_random1(num) {
|
||||
return parseInt(Math.random()*num);
|
||||
};
|
||||
|
||||
//随机字符串
|
||||
function min_randomChar(length){
|
||||
var x = "0123456789";
|
||||
var y = "qwertyuioplkjhgfdsazxcvbnm";
|
||||
var z = "QWERTYUIOPLKJHGFDSAZXCVBNM";
|
||||
var tmp = "";
|
||||
for (var i = 0; i < length; i++) {
|
||||
switch(min_random(0, 2)) {
|
||||
case 0:
|
||||
tmp += x.charAt(Math.ceil(Math.random()*100000000)%x.length);
|
||||
break;
|
||||
case 1:
|
||||
tmp += y.charAt(Math.ceil(Math.random()*100000000)%y.length);
|
||||
break;
|
||||
case 2:
|
||||
tmp += z.charAt(Math.ceil(Math.random()*100000000)%z.length);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
// var timestamp = new Date().getTime();
|
||||
// return timestamp + tmp;
|
||||
return tmp;
|
||||
}
|
||||
|
||||
//取长度
|
||||
function min_length(key) {
|
||||
if (typeof(key) != "string") {
|
||||
var key = key + "";
|
||||
}
|
||||
return key.length;
|
||||
}
|
||||
|
||||
//字符全替换
|
||||
function min_replaceAll(str, str_old, str_new, ignoreCase)
|
||||
{
|
||||
if (!RegExp.prototype.isPrototypeOf(str_old)) {
|
||||
return str.replace(new RegExp(str_old, (ignoreCase ? "gi": "g")), str_new);
|
||||
} else {
|
||||
return str.replace(str_old, str_new);
|
||||
}
|
||||
}
|
||||
|
||||
//取本地当前时间,格式yyyy-MM-dd HH:MM:SS
|
||||
function min_now()
|
||||
{
|
||||
var date = new Date();
|
||||
var seperator1 = "-";
|
||||
var seperator2 = ":";
|
||||
var month = date.getMonth() + 1;
|
||||
var strDate = date.getDate();
|
||||
if (month >= 1 && month <= 9) {
|
||||
month = "0" + month;
|
||||
}
|
||||
if (strDate >= 0 && strDate <= 9) {
|
||||
strDate = "0" + strDate;
|
||||
}
|
||||
var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
|
||||
+ " " + date.getHours() + seperator2 + date.getMinutes()
|
||||
+ seperator2 + date.getSeconds();
|
||||
return currentdate;
|
||||
}
|
||||
|
||||
//本地存储数据
|
||||
function min_writefile_gameid(msg, gameid, fileid) {
|
||||
localStorage.setItem("file_" + gameid + "_" + fileid, msg);
|
||||
}
|
||||
|
||||
//读取本地数据
|
||||
function min_readfile_gameid(gameid, fileid) {
|
||||
return localStorage.getItem("file_" + gameid + "_" + fileid);
|
||||
}
|
||||
|
||||
//取当前页面url中的参数值 def:没取到时返回的默认值
|
||||
function min_getQueryString(name, def) {
|
||||
var self = window;
|
||||
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||
var r = self.location.search.substr(1).match(reg);
|
||||
if (r != null) {
|
||||
return unescape(r[2])
|
||||
} else {
|
||||
if (def) {
|
||||
return def;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//获取当前页面的路径
|
||||
function min_getUrlRootPath() {
|
||||
var curWwwPath = window.location.host;
|
||||
var pathName = window.location.pathname;
|
||||
return curWwwPath + pathName.substr(0,pathName.lastIndexOf('/'));
|
||||
}
|
||||
|
||||
//设置cookie
|
||||
function min_setCookie(name, value, exp_minute) {
|
||||
if (!exp_minute) {
|
||||
exp_minute = 20; //默认时效20分钟
|
||||
}
|
||||
var exp = new Date();
|
||||
exp.setTime(exp.getTime() + exp_minute*60*1000);
|
||||
document.cookie = name + "=" + value + ";expires=" + exp.toGMTString()+';path=/';
|
||||
}
|
||||
|
||||
//读取cookie
|
||||
function min_getCookie(name) {
|
||||
var arr = document.cookie.match(new RegExp("(^| )"+name+"=([^;]*)(;|$)"));
|
||||
if(arr != null)
|
||||
return arr[2];
|
||||
return null;
|
||||
}
|
||||
|
||||
//删除cookie
|
||||
function min_delCookie(name) {
|
||||
var value = min_getCookie(name);
|
||||
if (value) {
|
||||
min_setCookie(name, value, 0);
|
||||
}
|
||||
}
|
||||
|
||||
//获取一个dom
|
||||
function min_getdom(id)
|
||||
{
|
||||
return document.getElementById(id);
|
||||
};
|
||||
|
||||
//设置一个dom属性值 id:dom、或dom的id、或实列,key:属性,val:值
|
||||
function min_setdom(id, key, val) {
|
||||
var obj;
|
||||
if (typeof(id) == 'string') {
|
||||
obj = min_getdom(id);
|
||||
}
|
||||
else {
|
||||
obj = id;
|
||||
}
|
||||
obj.setAttribute(key, val);
|
||||
}
|
||||
|
||||
//添加一段innerHTML
|
||||
function min_uphtml(id, str, isadd) {
|
||||
/*
|
||||
setAttribute是设置网页元素的属性,就是在标签里内如<img />标签的src属性。
|
||||
innerHTML不是属性,只是JS里内代表一个双标记中间的文本,如:<span> </span>中间的字符。
|
||||
*/
|
||||
var obj = window.document.getElementById(id);
|
||||
if (isadd) {
|
||||
obj.innerHTML = obj.innerHTML + str;
|
||||
}
|
||||
else {
|
||||
obj.innerHTML = str;
|
||||
}
|
||||
}
|
||||
|
||||
//新建一个定时器每隔time毫秒执行一次func函数,函数返回定时器id
|
||||
function min_ontime(func, time)
|
||||
{
|
||||
return setInterval(func, time);
|
||||
}
|
||||
|
||||
//新建一个定时器time毫秒后执行一次func函数(只执行一次),函数返回定时器id
|
||||
function min_ontimeout(func, time)
|
||||
{
|
||||
return setTimeout(func, time);
|
||||
}
|
||||
|
||||
//关闭定时器id为timerid的定时器
|
||||
function min_closetime(timerid)
|
||||
{
|
||||
return clearTimeout(timerid);
|
||||
}
|
||||
|
||||
//encode转码
|
||||
function min_encode(s)
|
||||
{
|
||||
return encodeURIComponent(s);
|
||||
}
|
||||
|
||||
//decode解码
|
||||
function min_decode(s)
|
||||
{
|
||||
return decodeURIComponent(s);
|
||||
}
|
||||
|
||||
//新建一个tcp连接
|
||||
function min_tcp(config)
|
||||
{
|
||||
var ws = new WebSocket("ws://" + config.ipport); //"127.0.0.1:5414"
|
||||
|
||||
//连接上服务器后触发的事件
|
||||
if (config.onopen) {
|
||||
ws.onopen = config.onopen;
|
||||
};
|
||||
|
||||
//收到服务器发来的数据包后触发的事件,onmessage函数会有一个底层的msg参数,其中msg.data才是服务器发过来的业务数据
|
||||
if (config.onmessage) {
|
||||
ws.onmessage = config.onmessage;
|
||||
};
|
||||
|
||||
//断开与服务器的连接后触发的事件
|
||||
if (config.onclose) {
|
||||
ws.onclose = config.onclose; //断开连接的事件
|
||||
};
|
||||
|
||||
return ws;
|
||||
}
|
||||
|
||||
//http请求
|
||||
function min_http(config) {
|
||||
/*
|
||||
config =
|
||||
{
|
||||
url: "http://127.0.0.1:5414/index.html",
|
||||
type: "POST", //GET or POST 方法
|
||||
data: "", //请求的数据
|
||||
success: func_callback_succ, //请求成功后的回调函数function(data,status,callbackdata)
|
||||
error: func_callback_err, //请求失败后的回调函数function(data,status)
|
||||
callbackdata: "", //作为回调函数第三个参数带入回调函数的数据
|
||||
//enurl: 0, //是否encodeURIComponent转码, 默认0不转码
|
||||
//deurl: 0, //是否decodeURIComponent解码,默认0不解码
|
||||
debugLog: false, //是否输出debug日志,默认false
|
||||
method: "(OPTIONAL) True for async and False for Non-async | By default its Async"
|
||||
}
|
||||
*/
|
||||
if (!config.debugLog) {
|
||||
config.debugLog = false;
|
||||
}
|
||||
if (!config.enurl) {
|
||||
config.enurl = 0;
|
||||
}
|
||||
if (!config.deurl) {
|
||||
config.deurl = 0;
|
||||
}
|
||||
if (!config.method) {
|
||||
config.method = true;
|
||||
}
|
||||
|
||||
if (!config.url) {
|
||||
if (config.debugLog == true) {
|
||||
console.log("No Url!");
|
||||
}
|
||||
return;
|
||||
};
|
||||
|
||||
if (!config.type) {
|
||||
if (config.debugLog == true) {
|
||||
console.log("No Default type (GET/POST) given!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var xmlhttp = initXMLhttp();
|
||||
|
||||
xmlhttp.onreadystatechange = function() {
|
||||
if (xmlhttp.readyState == 4 && xmlhttp.status == 200 && config.success)
|
||||
{
|
||||
var responseText = mydecodeURIComponent(xmlhttp.responseText, config.deurl);
|
||||
if (!config.callbackdata) {
|
||||
config.success(responseText, xmlhttp.readyState);
|
||||
}
|
||||
else {
|
||||
config.success(responseText, xmlhttp.readyState, config.callbackdata);
|
||||
}
|
||||
if (config.debugLog == true) {
|
||||
console.log("SuccessResponse");
|
||||
}
|
||||
if (config.debugLog == true) {
|
||||
console.log("Response Data:" + xmlhttp.responseText);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xmlhttp.readyState == 4 && config.error)
|
||||
{
|
||||
if (!config.callbackdata) {
|
||||
config.error(xmlhttp.readyState, xmlhttp.status);
|
||||
}
|
||||
else {
|
||||
config.error(xmlhttp.readyState, xmlhttp.status, config.callbackdata);
|
||||
}
|
||||
}
|
||||
if (config.debugLog == true) {
|
||||
console.log("FailureResponse --> readyState:" + xmlhttp.readyState + ", Status:" + xmlhttp.status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var sendString = [],
|
||||
sendData = config.data;
|
||||
if (typeof sendData === "string") {
|
||||
var tmpArr = String.prototype.split.call(sendData, '&');
|
||||
for (var i = 0, j = tmpArr.length; i < j; i++) {
|
||||
var datum = tmpArr[i].split('=');
|
||||
if (datum[1]) {
|
||||
sendString.push(myencodeURIComponent(datum[0], config.enurl) + "=" + myencodeURIComponent(datum[1], config.enurl));
|
||||
}
|
||||
else {
|
||||
sendString.push(myencodeURIComponent(datum[0], config.enurl));
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (typeof sendData === 'object' && !(sendData instanceof String || (FormData && sendData instanceof FormData))) {
|
||||
for (var k in sendData) {
|
||||
var datum = sendData[k];
|
||||
if (Object.prototype.toString.call(datum) == "[object Array]") {
|
||||
for (var i = 0, j = datum.length; i < j; i++) {
|
||||
sendString.push(myencodeURIComponent(k, config.enurl) + "[]=" + myencodeURIComponent(datum[i], config.enurl));
|
||||
}
|
||||
}
|
||||
else {
|
||||
sendString.push(myencodeURIComponent(k, config.enurl) + "=" + myencodeURIComponent(datum, config.enurl));
|
||||
}
|
||||
}
|
||||
}
|
||||
sendString = sendString.join('&');
|
||||
|
||||
if (config.type == "GET") {
|
||||
var g;
|
||||
var i = config.url.lastIndexOf("?");
|
||||
if (i > 8) {
|
||||
g = "&";
|
||||
} else {
|
||||
g = "?";
|
||||
}
|
||||
var ddata = new Date().getMilliseconds();
|
||||
if (sendString == "") {
|
||||
sendString = '#dfw1977=' + (ddata + min_random(1, 99999) * 1000);
|
||||
} else {
|
||||
sendString = sendString + '#dfw1977=' + (ddata + min_random(1, 99999) * 1000);
|
||||
}
|
||||
xmlhttp.open("GET", config.url + g + sendString, config.method);
|
||||
xmlhttp.send();
|
||||
|
||||
if (config.debugLog == true) {
|
||||
console.log("GET fired at:" + config.url + "?" + sendString);
|
||||
}
|
||||
}
|
||||
if (config.type == "POST") {
|
||||
xmlhttp.open("POST", config.url, config.method);
|
||||
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
xmlhttp.send(sendString);
|
||||
|
||||
if (config.debugLog == true) {
|
||||
console.log("POST fired at:" + config.url + " || Data:" + sendString);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initXMLhttp() {
|
||||
var xmlhttp;
|
||||
if (window.XMLHttpRequest) {
|
||||
//code for IE7,firefox chrome and above
|
||||
xmlhttp = new XMLHttpRequest();
|
||||
} else {
|
||||
//code for Internet Explorer
|
||||
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
}
|
||||
return xmlhttp;
|
||||
}
|
||||
|
||||
//转码
|
||||
function myencodeURIComponent(s, ifif)
|
||||
{
|
||||
if (ifif == 1) {
|
||||
return min_encode(s);
|
||||
} else {
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
//解码
|
||||
function mydecodeURIComponent(s, ifif)
|
||||
{
|
||||
if (ifif == 1) {
|
||||
return min_decode(s);
|
||||
} else {
|
||||
return s;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//在数组中根据元素值查找下标
|
||||
function min_ary_indexof(array1, val, name)
|
||||
{
|
||||
for (var i = 0; i < array1.length; i++)
|
||||
{
|
||||
if (!name)
|
||||
{
|
||||
if (array1[i] == val)
|
||||
return i;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (array1[i][name] == val)
|
||||
return i;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
};
|
||||
|
||||
//在数组中根据值删除元素
|
||||
function min_ary_delval(array1, val, name)
|
||||
{
|
||||
var index = min_ary_indexof(array1, val, name);
|
||||
if (index > -1)
|
||||
{
|
||||
array1.splice(index, 1);
|
||||
}
|
||||
};
|
||||
|
||||
//在数组中根据下标删除诺干个元素
|
||||
function min_ary_delfromto(array1, from, to)
|
||||
{
|
||||
var rest = array1.slice((to || from) + 1 || array1.length);
|
||||
array1.length = from < 0 ? array1.length + from : from;
|
||||
array1.push.apply(array1, rest);
|
||||
};
|
||||
|
||||
//在数组中删除某一对象元素
|
||||
function min_ary_delobj(array1, object)
|
||||
{
|
||||
for (var i = 0; i < array1.length; ++i)
|
||||
{
|
||||
if (array1[i] === object)
|
||||
{
|
||||
array1.splice(i, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//数组包含
|
||||
function min_ary_include(aryparent, arychild){
|
||||
for (var i = 0; i < arychild.length; i++) {
|
||||
var found = false;
|
||||
for (var j = 0; j < aryparent.length; j++) {
|
||||
if (aryparent[j] == arychild[i]){
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
//数组相减
|
||||
function min_ary_deduct(aryparent, arychild){
|
||||
var re = [];
|
||||
for (var i = 0; i < aryparent.length; i++){
|
||||
var found = false;
|
||||
for (var j = 0; j < arychild.length; j++){
|
||||
if (aryparent[i] == arychild[j]){
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found){
|
||||
re.push(aryparent[i])
|
||||
}
|
||||
}
|
||||
return re;
|
||||
};
|
||||
|
||||
//是否存在指定函数
|
||||
function min_ExitsFunction(funcName)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (typeof(funcName) == "function")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
catch(e)
|
||||
{}
|
||||
return false;
|
||||
}
|
||||
|
||||
//(按顺序)加载js文件
|
||||
function min_loadJsFile(str_jsfile, func_succ, NoRandomFlag)
|
||||
{
|
||||
var domScript = document.createElement('script');
|
||||
if (!NoRandomFlag)
|
||||
{
|
||||
// str_jsfile = str_jsfile + '?' + Math.random() * 10000;
|
||||
// str_jsfile = str_jsfile + '?' + min_random(1, 10000000);
|
||||
str_jsfile = str_jsfile + '?' + min_timestamp();
|
||||
}
|
||||
domScript.src = str_jsfile;
|
||||
func_succ = func_succ || function(){};
|
||||
domScript.onload = domScript.onreadystatechange = function() {
|
||||
if (!this.readyState || 'loaded' === this.readyState || 'complete' === this.readyState) {
|
||||
func_succ();
|
||||
this.onload = this.onreadystatechange = null;
|
||||
this.parentNode.removeChild(this);
|
||||
}
|
||||
}
|
||||
document.getElementsByTagName('head')[0].appendChild(domScript);
|
||||
}
|
||||
|
||||
//生成一个GUID
|
||||
function min_guid()
|
||||
{
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
|
||||
return v.toString(16);});
|
||||
}
|
||||
|
||||
//获取时间戳
|
||||
function min_timestamp()
|
||||
{
|
||||
return new Date().getTime();
|
||||
}
|
||||
|
||||
|
||||
wnd.min_copyjson = min_copyjson; //复制json对象
|
||||
wnd.min_jsontostr = min_jsontostr; //json转字符串
|
||||
wnd.min_strtojson = min_strtojson; //字符串转json
|
||||
wnd.min_inttostr = min_inttostr; //整型转字符型
|
||||
wnd.min_strtoint = min_strtoint; //字符型转整型
|
||||
|
||||
wnd.min_div = min_div; //整除
|
||||
wnd.min_mod = min_mod; //取余数
|
||||
wnd.min_abs = min_abs; //取绝对值
|
||||
wnd.min_random = min_random; //取随机数
|
||||
wnd.min_random1 = min_random1; //取随机数1
|
||||
wnd.min_randomChar = min_randomChar; //随机字符串
|
||||
wnd.min_length = min_length; //取长度
|
||||
wnd.min_replaceAll = min_replaceAll; //字符全替换
|
||||
|
||||
wnd.min_now = min_now; //取本地当前时间
|
||||
wnd.min_guid = min_guid; //生成一个GUID
|
||||
|
||||
wnd.min_getQueryString = min_getQueryString; //取当前页面url中的参数值
|
||||
wnd.min_getUrlRootPath = min_getUrlRootPath; //获取当前页面的路径
|
||||
|
||||
wnd.min_setCookie = min_setCookie; //设置cookie
|
||||
wnd.min_getCookie = min_getCookie; //读取cookie
|
||||
wnd.min_delCookie = min_delCookie; //删除cookie
|
||||
|
||||
wnd.min_getdom = min_getdom; //获取一个dom
|
||||
wnd.min_setdom = min_setdom; //设置一个dom属性值
|
||||
wnd.min_uphtml = min_uphtml; //添加一段innerHTML
|
||||
|
||||
wnd.min_ontime = min_ontime; //新建一个周期性的定时器
|
||||
wnd.min_ontimeout = min_ontimeout; //新建一个一次性的定时器
|
||||
wnd.min_closetime = min_closetime; //关闭定时器
|
||||
|
||||
wnd.min_writefile_gameid = min_writefile_gameid; //本地存储数据
|
||||
wnd.min_readfile_gameid = min_readfile_gameid; //读取本地数据
|
||||
|
||||
wnd.min_encode = min_encode; //encodeURIComponent转码
|
||||
wnd.min_decode = min_decode; //decodeURIComponent解码
|
||||
|
||||
wnd.min_tcp = min_tcp; //新建一个tcp连接
|
||||
wnd.min_http = min_http; //http请求
|
||||
|
||||
wnd.min_ary_indexof = min_ary_indexof; //在数组中根据元素值查找下标
|
||||
wnd.min_ary_delval = min_ary_delval; //在数组中根据值删除元素
|
||||
wnd.min_ary_delfromto = min_ary_delfromto; //在数组中根据下标删除诺干个元素
|
||||
wnd.min_ary_delobj = min_ary_delobj; //在数组中删除某一对象元素
|
||||
wnd.min_ary_include = min_ary_include; //数组包含
|
||||
wnd.min_ary_deduct = min_ary_deduct; //数组相减
|
||||
|
||||
wnd.min_ExitsFunction = min_ExitsFunction; //是否存在函数
|
||||
wnd.min_loadJsFile = min_loadJsFile; //加载js文件
|
||||
|
||||
wnd.min_guid = min_guid; //生成一个GUID
|
||||
wnd.min_timestamp = min_timestamp; //获取时间戳
|
||||
})(window);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,820 @@
|
||||
var AppList = AppList||{};
|
||||
var RouteList = RouteList||{};
|
||||
var RpcList = RpcList||{};
|
||||
//--------------AppList---------------
|
||||
AppList.app = "youle";
|
||||
|
||||
//-----------RouteList-------------
|
||||
RouteList.platform = "platform";
|
||||
RouteList.agent="agent";
|
||||
RouteList.room="room";
|
||||
|
||||
|
||||
//----------------RpcList--------------
|
||||
RpcList.player_login = "player_login";
|
||||
RpcList.self_join_room = "self_join_room";
|
||||
RpcList.create_room = "create_room";
|
||||
RpcList.self_break_room = "self_break_room";
|
||||
RpcList.other_break_room = "other_break_room";
|
||||
RpcList.other_join_room = "other_join_room";
|
||||
RpcList.self_exit_room = "self_exit_room";
|
||||
RpcList.other_exit_room = "other_exit_room";
|
||||
RpcList.self_apply_free_room = "self_apply_free_room";
|
||||
RpcList.other_apply_free_room = "other_apply_free_room";
|
||||
RpcList.self_agree_free_room = "self_agree_free_room";
|
||||
RpcList.other_agree_free_room = "other_agree_free_room";
|
||||
RpcList.self_refuse_free_room = "self_refuse_free_room";
|
||||
RpcList.other_refuse_free_room = "other_refuse_free_room";
|
||||
RpcList.free_room = "free_room";
|
||||
RpcList.over_game = "over_game";
|
||||
RpcList.get_player_grade1 = "get_player_grade1";
|
||||
RpcList.get_player_grade2 = "get_player_grade2";
|
||||
RpcList.update_roomcard = "update_roomcard";
|
||||
RpcList.other_offline = "other_offline";
|
||||
RpcList.other_online = "other_online";
|
||||
RpcList.send_voice = "send_voice";
|
||||
RpcList.play_voice = "play_voice";
|
||||
RpcList.send_text = "send_text";
|
||||
RpcList.receive_chat = "receive_chat";
|
||||
RpcList.get_player_task = "get_player_task";
|
||||
RpcList.player_finish_task = "player_finish_task";
|
||||
RpcList.get_task_award = "get_task_award";
|
||||
RpcList.can_award = "can_award";
|
||||
RpcList.kick_offline = "kick_offline";
|
||||
RpcList.call_phone = "call_phone";
|
||||
RpcList.other_callphone = "other_callphone";
|
||||
RpcList.hangup_phone = "hangup_phone";
|
||||
RpcList.other_hangup = "other_hangup";
|
||||
RpcList.self_makewar = "self_makewar";
|
||||
RpcList.other_makewar = "other_makewar";
|
||||
RpcList.agentserver_game="agentserver_game";
|
||||
RpcList.send_gift="send_gift";
|
||||
RpcList.other_send_gift="other_send_gift";
|
||||
RpcList.send_voice="send_voice";
|
||||
RpcList.play_voice="play_voice";
|
||||
RpcList.connect_roomserver="connect_roomserver";
|
||||
RpcList.connect_agentserver="connect_agentserver";
|
||||
RpcList.broadcast="broadcast";
|
||||
RpcList.send_phiz="send_phiz";
|
||||
RpcList.submit_opinion = "submit_opinion";
|
||||
RpcList.kick_server = "kick_server";
|
||||
RpcList.get_paylist = "get_paylist";
|
||||
RpcList.pay_succ = "pay_succ";
|
||||
RpcList.submit_location = "submit_location";
|
||||
RpcList.binding_invitecode = "binding_invitecode";
|
||||
RpcList.update_bean = "update_bean";
|
||||
RpcList.get_player_invitecode = "get_player_invitecode";
|
||||
RpcList.beanroom_surrender = "beanroom_surrender";
|
||||
RpcList.player_prepare = "player_prepare";
|
||||
RpcList.share_room = "share_room";
|
||||
RpcList.get_share_room = "get_share_room";
|
||||
RpcList.quick_enter_share_room = "quick_enter_share_room";
|
||||
RpcList.advanced_roomlist = "advanced_roomlist";
|
||||
RpcList.advanced_createroom = "advanced_createroom";
|
||||
RpcList.change_room = "change_room";
|
||||
RpcList.change_seat = "change_seat";
|
||||
RpcList.set_bankpwd = "set_bankpwd";
|
||||
|
||||
RpcList.binding_phone = "binding_phone";
|
||||
|
||||
RpcList.send_phone_checkcode = "send_phone_checkcode";
|
||||
|
||||
RpcList.get_treasurelist = "get_treasurelist";
|
||||
RpcList.change_star = "change_star";
|
||||
|
||||
RpcList.submit_phoneinfo = "submit_phoneinfo";
|
||||
|
||||
RpcList.update_charm = "update_charm";
|
||||
|
||||
RpcList.setSign = "setSign";
|
||||
|
||||
RpcList.switchRoomList = "switchRoomList";
|
||||
|
||||
RpcList.getInfoByShortCode = "getInfoByShortCode";
|
||||
|
||||
RpcList.optBanList = "optBanList";
|
||||
RpcList.getShortCodeRankList = "getShortCodeRankList";
|
||||
|
||||
RpcList.setAllCharm = "setAllCharm";
|
||||
RpcList.getVipRankList = "getVipRankList";
|
||||
RpcList.playerBehavior = "playerBehavior";
|
||||
RpcList.setVipForbidSelect = "setVipForbidSelect";
|
||||
|
||||
RpcList.topup_card = "topup_card";
|
||||
RpcList.query_player2 = "query_player2";
|
||||
RpcList.giveCoin = "giveCoin";
|
||||
|
||||
RpcList.getPlayerWhiteList = "getPlayerWhiteList";
|
||||
RpcList.optWhiteList = "optWhiteList";
|
||||
|
||||
var h5RpcList={}
|
||||
h5RpcList.joinRoom = "joinRoom";
|
||||
//----------------------------end------------------------------
|
||||
|
||||
var ClickBtn = [3,5,7,13,14,15,10,11,12,25,17,9,47,51,53,55,58,59,76,60,61,74,75,80,115,183,150,151,153,181,201,202,183,184,185,205,206,207,208,209,210,211,212,166,167,168,169,170,124,127,130,
|
||||
133,233,245,246,247,253,248,249,253,256,257,258,259,260,261,262,263,550,177,283,375,391,392,393,394,395,396,397,
|
||||
398,399,400,401,402,403,366,367,386,464,234,345,483,484,493,509,512,513,514,515,519,520,521,568,569,570,571,572,579,
|
||||
602,626,604,656,661,662,663,664,665,666,667,668,669,670,671,3000,3004,3007,3008,3009,3010,3011,3014,3016,3017,3018,3019,
|
||||
3034,3035,3044,3045,3046,3047,3048,3049,3050,3051,3052,3053,3054,3055,3057,3043,3038,3039,3067,3068,3087,3088,3089,3096,3075,3076,3097,3111,3120,92,93,97,
|
||||
99,104,105,106,107,3133,3139,3140,3144,3145,3149,3155,3159,679,3182,3184,3175,3194,3195,3199,3214,3215,3205,3206,3210,
|
||||
3203,3216,3217,3222,3231,3232,3233,3235,3240,3251,3253,3243,3244,3245,3255,3256,3258,3260,3264,3265,3266,3268,3269,3289,3281,3276,3274];
|
||||
var C_PageOne = {
|
||||
Tag:1,
|
||||
X:1100,
|
||||
Y:160,
|
||||
H:80
|
||||
};
|
||||
var C_PageTwo = {
|
||||
Tag:1,
|
||||
X:1100,
|
||||
Y:160,
|
||||
H:80
|
||||
};
|
||||
var UnClickBtn = [8,50,225,227,228,229,699,161,162,164,165,370,426,427,428,429,430,431,432,433,434,435,446,447,448,449,450,451,452,453,454,455,468,469,470,471,472,473,474,475,476,477,498,499,500,501,
|
||||
502,503,504,505,506,507,81,573,574,575,629,630,631,632,633,3056,3040,3058,3041,3061,3062,3071,3072,3069,3070,3090,3091,3092,3093,3094,3095,3098,3104,3108,3115,3116,3118,3119,
|
||||
102,336,337,338,155,154,156,110,111,3127,3128,3141,3142,3146,3147,3151,3157,3099,3197,3212,3237,3246,3247,3248,3249,3250,3291,3280,3288,3283,3279,3292
|
||||
];
|
||||
var exceptSrc = [115,5,253,338,339,340,21,361,362,363,364,365,366,367,368,369,370,371,372,396];
|
||||
var ConstVal=ConstVal||{};
|
||||
ConstVal.Max = {
|
||||
ShowChat:2000,
|
||||
textlength:20,
|
||||
headImgTimer:200,
|
||||
heartbeat:30000
|
||||
};
|
||||
|
||||
ConstVal.Tips={
|
||||
width:30,
|
||||
time:3000,
|
||||
|
||||
};
|
||||
ConstVal.Kick={
|
||||
text:"网络出现异常!",
|
||||
tip:"(请重启游戏)"
|
||||
};
|
||||
ConstVal.screenShotParam = 0.7;
|
||||
ConstVal.ShareTaskId="TJnueK1103Xgwj2o79xM2nvSe0WN6rzp";
|
||||
|
||||
ConstVal.iMessage={
|
||||
text_y1:-60,
|
||||
text_y2:25,
|
||||
icon_x:20,
|
||||
icon_y1:-65,
|
||||
icon_y2:20,
|
||||
close_x:1205,
|
||||
close_y1:-60,
|
||||
close_y2:25,
|
||||
bg_y1:-85,
|
||||
bg_y2:0,
|
||||
time:500,
|
||||
x1:85,
|
||||
x2:1205,
|
||||
y:0,
|
||||
h:85,
|
||||
speed:0.05,
|
||||
max_length:60
|
||||
};
|
||||
ConstVal.Emotion = {
|
||||
//动画帧间隔200
|
||||
mode:1,//表情播放时间模式1->按帧数确定时间2->按照show_time_list确定
|
||||
count:20,
|
||||
f_spid:467,
|
||||
tag:1,
|
||||
rate:100,
|
||||
col_num:4,//一行上的个数
|
||||
spid_list:[528,529,530,531,532,533,534,535,536,537,538,539,540,541,542,543,544,545,546,547],//表情精灵列表序号对应
|
||||
src_list:[147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166],//表情对应资源号
|
||||
frame_list:[5,25,31,30,14,7,8,17,3,8,30,14,35,24,23,15,6,24,31,9],//表情对应帧数
|
||||
show_time_list:[147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166],//表情播放时间
|
||||
x:20,
|
||||
y:20,
|
||||
dis_x:20,
|
||||
dis_y:20,
|
||||
w:100,
|
||||
h:100,
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_h:0,
|
||||
clip_w:0
|
||||
|
||||
}
|
||||
ConstVal.Com_History = {
|
||||
//动画帧间隔200
|
||||
f_spid:696,
|
||||
head_tag:1,
|
||||
page_count:5,
|
||||
text_width:12.5,
|
||||
bubble_tag:10000,
|
||||
content_tag:20000,
|
||||
time_tag:30000,
|
||||
time_length:[10,30,60,90,120,300],
|
||||
bubble_width:[100,140,180,220,260,300,340],//气泡长度
|
||||
head_res_id:116,
|
||||
head_x:20,
|
||||
head_y:30,
|
||||
head_h:60,
|
||||
head_dis_y:35,
|
||||
time_bubble_dis_x:10,
|
||||
head_bubble_dis_x:78,
|
||||
bubble_content_dis_x:25,
|
||||
head_bubble_dis_y:0,
|
||||
head_content_1_dis_y:13,
|
||||
head_content_2_dis_y:13,
|
||||
time_bubble_dis_y:13,
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_h:0,
|
||||
clip_w:0
|
||||
|
||||
}
|
||||
ConstVal.Task = {
|
||||
f_spid:176,//父精灵
|
||||
bg_spid:120,//背景精灵
|
||||
task_des_spid:135,//任务描述精灵
|
||||
reward_des_spid:307,//任务奖励描述
|
||||
proc_bg_spid:311,//任务进度背景
|
||||
proc_spid:315,//任务进度前景
|
||||
proc_des_spid:319,//任务进度文字描述
|
||||
get_reward_btn_spid:124,//领取任务按钮
|
||||
isreward_spid:328,//已领取
|
||||
tofinish_btn_spid:125,//去完成任务
|
||||
//tag值
|
||||
bg_tag:1,
|
||||
task_des_tag:1000,
|
||||
reward_des_tag:2000,
|
||||
proc_bg_tag:3000,
|
||||
proc_tag:4000,
|
||||
proc_des_tag:5000,
|
||||
get_reward_btn_tag:6000,
|
||||
isreward_tag:7000,
|
||||
tofinish_btn_tag:8000,
|
||||
//位置
|
||||
bg_x:0,
|
||||
bg_y:0,
|
||||
bg_w:0,//动态获取
|
||||
bg_dis_x:0,
|
||||
|
||||
task_des_x:30,
|
||||
task_des_y:30,
|
||||
|
||||
reward_des_y:265,
|
||||
proc_bg_y:380,
|
||||
proc_y:380,
|
||||
proc_des_y:380,
|
||||
get_reward_btn_y:368,
|
||||
isreward_y:365,
|
||||
tofinish_btn_y:330,
|
||||
|
||||
clip_x:110,
|
||||
clip_y:170,
|
||||
clip_w:0,
|
||||
clip_h:0
|
||||
}
|
||||
ConstVal.Launch_mode={
|
||||
name:"Launchtype",
|
||||
from_hall:1,
|
||||
from_self:0
|
||||
};
|
||||
ConstVal.OS = {//操作系统类型
|
||||
apple:1,//苹果
|
||||
android:2,//安卓
|
||||
winphone:3,//windowsphone
|
||||
other:4//其他
|
||||
};
|
||||
ConstVal.InterEffSoundsList = ["00001.mp3","00002.mp3","00003.mp3","00004.mp3"];
|
||||
ConstVal.soudsSpidList = [235,13,5,6,7,9,339,11,12,14,15,249,10,376,377,378,379,380,381,382,383,384,385,150,153,151,283,181,513,233,185];
|
||||
ConstVal.Broadcast = {
|
||||
textwidth:18,
|
||||
speed:0.1,
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:0
|
||||
};
|
||||
ConstVal.Notice = {
|
||||
replaceOldWord:"#",
|
||||
replaceNewWord:"\n",
|
||||
lineHeight:60,
|
||||
textHeight:30,
|
||||
textWidth:14,
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:725,
|
||||
clip_h:450,
|
||||
img_clip_x:366,
|
||||
img_clip_y:156,
|
||||
img_clip_w:765,
|
||||
img_clip_h:483,
|
||||
};
|
||||
ConstVal.payConfig = {
|
||||
enablePay:false
|
||||
};
|
||||
|
||||
ConstVal.loginButton = {
|
||||
key:"loginimage",
|
||||
type1:[1,22],//0->类型值 1->图片资源ID
|
||||
type2:[2,203]
|
||||
}
|
||||
|
||||
ConstVal.userAgent = {
|
||||
paraName:"",
|
||||
uAgent_1:1,
|
||||
uAgent_2:2,
|
||||
uAgent_3:3
|
||||
};
|
||||
ConstVal.worldRoom = {
|
||||
f_sp_1:522,
|
||||
f_sp_2:523,
|
||||
bg_sp_1:524,
|
||||
bg_sp_2:525,
|
||||
top_sp_1:526,
|
||||
top_sp_2:563,
|
||||
des_sp_1:527,
|
||||
des_sp_2:564,
|
||||
starbg_sp_1:566,
|
||||
starbg_sp_2:567,
|
||||
star_sp_1:562,
|
||||
star_sp_2:565,
|
||||
mult_sp_1:3020,
|
||||
mult_sp_2:3021,
|
||||
join_sp_1:3022,
|
||||
join_sp_2:3023,
|
||||
pCount_sp_1:3024,
|
||||
leave_sp_2:3025,
|
||||
topImg_sp:96,
|
||||
title_sp:3165,
|
||||
|
||||
multIcon_sp:94,
|
||||
multImg_sp:95,
|
||||
imgList:[361,362,363,364,365,366,367,368,369,370,371,372],
|
||||
multIcon_y:100,
|
||||
multImg_y:119,
|
||||
topImg_y:25,
|
||||
multImgWidth:25,
|
||||
multIconImgSpace:20,
|
||||
|
||||
pCountIcon_sp_2:3026,
|
||||
pCount_sp_2:3027,
|
||||
roomCode_sp_2:3028,
|
||||
|
||||
|
||||
bg_sp_tag_1:1,
|
||||
top_sp_tag_1:2000,
|
||||
des_sp_tag_1:4000,
|
||||
starbg_sp_tag_1:6000,
|
||||
star_sp_tag_1:8000,
|
||||
mult_sp_tag_1:10000,
|
||||
pCount_sp_tag_1:12000,
|
||||
join_sp_tag_1:14000,
|
||||
multIcon_tag:16000,
|
||||
multImg_tag:18000,
|
||||
topImg_tag:20000,
|
||||
|
||||
|
||||
bg_sp_tag_2:1,
|
||||
top_sp_tag_2:2000,
|
||||
des_sp_tag_2:4000,
|
||||
starbg_sp_tag_2:6000,
|
||||
star_sp_tag_2:8000,
|
||||
mult_sp_tag_2:10000,
|
||||
leave_sp_tag_2:12000,
|
||||
roomCode_sp_tag_2:14000,
|
||||
pCountIcon_sp_tag_2:16000,
|
||||
join_sp_tag_2:18000,
|
||||
pCount_sp_tag_2:20000,
|
||||
title_tag:40000,
|
||||
|
||||
clip_x_1:0,
|
||||
clip_x_2:0,
|
||||
clip_y_1:0,
|
||||
clip_y_2:0,
|
||||
clip_w_1:1050,
|
||||
clip_w_2:1150,
|
||||
clip_h_1:512,
|
||||
clip_h_2:465,
|
||||
|
||||
bg_sp_x_1:0,
|
||||
bg_sp_x_2:0,
|
||||
bg_sp_y_1:0,
|
||||
bg_sp_y_2:0,
|
||||
//bg_sp_y_2:43,
|
||||
bg_sp_space_1:6,
|
||||
bg_sp_space_2:15,
|
||||
top_sp_x_1:25,
|
||||
top_sp_x_2:25,
|
||||
top_sp_y_1:35,
|
||||
top_sp_y_2:20,
|
||||
top_sp_width_1:20,
|
||||
top_sp_width_2:13,
|
||||
top_sp_space_1:6,
|
||||
top_sp_space_2:6,
|
||||
des_sp_x_1:25,
|
||||
des_sp_x_2:30,
|
||||
title_sp_x:20,
|
||||
title_sp_y:3,
|
||||
des_sp_y_1:80,
|
||||
des_sp_y_2:45,
|
||||
des_sp_width_1:11,
|
||||
des_sp_width_2:11,
|
||||
des_sp_space_1:6,
|
||||
des_sp_space_2:6,
|
||||
|
||||
//mult_sp_x_1:10000,
|
||||
pCount_sp_x_1:80,
|
||||
join_sp_x_1:302,//靠右显示
|
||||
mult_sp_y_1:74,
|
||||
pCount_sp_y_1:193,
|
||||
join_sp_y_1:193,
|
||||
|
||||
mult_sp_x_2:30,
|
||||
roomCode_sp_x_2:775,
|
||||
pCountIcon_sp_x_2:170,
|
||||
join_sp_x_2:700,//靠右显示
|
||||
leave_sp_x_2:700,//靠右显示
|
||||
|
||||
pCountIcon_pCount_space_2:10,
|
||||
pCount_space_2:8,
|
||||
|
||||
//mult_sp_y_2:72,
|
||||
//roomCode_sp_y_2:25,
|
||||
//pCountIcon_sp_y_2:76,
|
||||
//join_sp_y_2:72,
|
||||
//leave_sp_y_2:23,
|
||||
//pCount_sp_y_2:81,
|
||||
|
||||
mult_sp_y_2:92,
|
||||
roomCode_sp_y_2:45,
|
||||
pCountIcon_sp_y_2:96,
|
||||
join_sp_y_2:92,
|
||||
leave_sp_y_2:45,
|
||||
pCount_sp_y_2:101,
|
||||
|
||||
|
||||
starbg_sp_x_1:35,
|
||||
starbg_sp_x_2:35,
|
||||
starbg_sp_y_1:182,
|
||||
starbg_sp_y_2:182,
|
||||
starbg_sp_space_1:6,
|
||||
starbg_sp_space_2:6,
|
||||
|
||||
star_sp_x_1:35,
|
||||
star_sp_x_2:35,
|
||||
star_sp_y_1:189,
|
||||
star_sp_y_2:189,
|
||||
star_sp_space_1:6,
|
||||
star_sp_space_2:6,
|
||||
|
||||
mult_sp_w_1:13,
|
||||
join_sp_w_1:10,
|
||||
|
||||
join_sp_w_2:12,
|
||||
leave_sp_w_2:12,
|
||||
mult_sp_w_2:13,
|
||||
roomCode_sp_w_2:16,
|
||||
|
||||
bgSpaceX:438,
|
||||
bgSpaceY:250,
|
||||
};
|
||||
ConstVal.snrRoomList ={
|
||||
f_spid:611,
|
||||
bg_spid:622,
|
||||
rcode_bg_spid:623,
|
||||
rcode_spid:624,
|
||||
close_spid:625,
|
||||
update_spid:626,
|
||||
switch_spid:627,
|
||||
info_spid:600,
|
||||
profit_spid:601,
|
||||
video_spid:3138,
|
||||
|
||||
bg_tag:1,
|
||||
rcode_bg_tag:200,
|
||||
rcode_tag:400,
|
||||
close_tag:600,
|
||||
update_tag:800,
|
||||
switch_tag:1000,
|
||||
info_tag:1200,
|
||||
profit_tag:1400,
|
||||
video_tag:1600,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:900,
|
||||
clip_h:0,
|
||||
|
||||
bg_x:15,
|
||||
rcode_bg_x:33,
|
||||
rcode_x:35,
|
||||
close_x:70,
|
||||
update_x:20,
|
||||
switch_x:150,
|
||||
info_x:35,
|
||||
profit_x:150,
|
||||
video_x:420,
|
||||
|
||||
bg_y:10,
|
||||
rcode_bg_y:260,
|
||||
rcode_y:28,
|
||||
close_y:260,
|
||||
update_y:90,
|
||||
switch_y:90,
|
||||
info_y:80,
|
||||
profit_y:25,
|
||||
video_y:20,
|
||||
|
||||
profit_w:12,
|
||||
|
||||
bg_space:5,
|
||||
rcode_bg_space:35,
|
||||
rcode_space:50,
|
||||
close_space:300,
|
||||
update_space:400,
|
||||
switch_space:500,
|
||||
|
||||
bksp:3137,
|
||||
|
||||
|
||||
};
|
||||
ConstVal.rankList ={
|
||||
f_spid:609,
|
||||
bg_spid:610,
|
||||
badge_spid:629,
|
||||
headimg_spid:630,
|
||||
headfront_spid:631,
|
||||
name_spid:632,
|
||||
star_spid:633,
|
||||
|
||||
bg_tag:1,
|
||||
badge_tag:100,
|
||||
headimg_tag:200,
|
||||
headfront_tag:300,
|
||||
name_tag:400,
|
||||
star_tag:500,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:511,
|
||||
|
||||
bg_x:0,
|
||||
badge_x:-20,
|
||||
headimg_x:93,
|
||||
headfront_x:85,
|
||||
name_x:190,
|
||||
star_x:190,
|
||||
|
||||
bg_y:0,
|
||||
badge_y:-5,
|
||||
headimg_y:12,
|
||||
headfront_y:5,
|
||||
name_y:8,
|
||||
star_y:42,
|
||||
|
||||
|
||||
space:13,
|
||||
|
||||
headsrc:262
|
||||
|
||||
};
|
||||
ConstVal.MenuScene = {
|
||||
createBtn_1:[780,182],//有星星场
|
||||
joinBtn_1:[780,320],
|
||||
starBtn:[780,458],
|
||||
createBtn_2:[780,230],
|
||||
joinBtn_2:[780,405]
|
||||
};
|
||||
//仓库
|
||||
ConstVal.wareHouse = {
|
||||
tableBgX:[41,33],
|
||||
tableTextX:[57,51],
|
||||
passWordLength:6,
|
||||
};
|
||||
ConstVal.sysNotice = {
|
||||
f_spid:3109,
|
||||
bubble_spid:163,
|
||||
msg_spid:3110,
|
||||
|
||||
msg_width:11,
|
||||
msg_tag:50000,
|
||||
msg_rOld:"#",
|
||||
msg_rNew:"\n",
|
||||
lineHeight:25,
|
||||
limit:10000,
|
||||
bubble_tag:1,
|
||||
x:20,
|
||||
y:20,
|
||||
spaceX:40,
|
||||
spaceY:40,
|
||||
|
||||
bm_space_x:20,
|
||||
bm_space_y:35,
|
||||
|
||||
|
||||
lineSpace:30,// 行距
|
||||
noteSpace:40,//每条的距离
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_h:0,
|
||||
clip_w:0
|
||||
}
|
||||
ConstVal.starConfig = {
|
||||
resList:[214,214],
|
||||
}
|
||||
ConstVal.Animation = {
|
||||
time1:1200,
|
||||
time2:2000,
|
||||
fundTime:5230,
|
||||
deltaTime:1000,
|
||||
};
|
||||
ConstVal.myRoomList ={
|
||||
maxLength:5,
|
||||
fSpid:98,
|
||||
|
||||
bgSp:100,
|
||||
roomCodeSp:102,
|
||||
|
||||
bgTag:1,
|
||||
roomCodeTag:100,
|
||||
placeX:0,
|
||||
placeY:95,
|
||||
bgX:8,
|
||||
bgY:55,
|
||||
space:5,
|
||||
|
||||
rCodeX:140,
|
||||
rCodeY:85,
|
||||
//clip_x:8,
|
||||
//clip_y:160,
|
||||
//clip_w:265,
|
||||
//clip_h:450,
|
||||
|
||||
roomCodeWidth:14,
|
||||
}
|
||||
ConstVal.netType = 0;
|
||||
ConstVal.isGameHall = false;
|
||||
|
||||
ConstVal.vipRoomList1 = {
|
||||
f_spid:3172,
|
||||
bg_spid:3176,
|
||||
title_spid:3177,
|
||||
code_spid:3178,
|
||||
owner_spid:3179,
|
||||
count_spid:3180,
|
||||
del_spid:3181,
|
||||
des_spid:3189,
|
||||
enter_spid:3192,
|
||||
|
||||
bg_tag:1,
|
||||
title_tag:1000,
|
||||
code_tag:2000,
|
||||
owner_tag:3000,
|
||||
count_tag:4000,
|
||||
des_tag:5000,
|
||||
del_tag:6000,
|
||||
enter_tag:7000,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:460,
|
||||
|
||||
space:199,
|
||||
|
||||
title_x:20,
|
||||
code_x:70,
|
||||
des_x:25,
|
||||
owner_x:270,
|
||||
count_x:525,
|
||||
del_x:583,
|
||||
enter_x:514,
|
||||
|
||||
title_y:3,
|
||||
code_y:148,
|
||||
des_y:50,
|
||||
owner_y:146,
|
||||
count_y:146,
|
||||
del_y:0,
|
||||
enter_y:42,
|
||||
|
||||
}
|
||||
ConstVal.vipRoomList2 = {
|
||||
f_spid:3185,
|
||||
bg_spid:3186,
|
||||
code_spid:3187,
|
||||
count_spid:3188,
|
||||
|
||||
bg_tag:1,
|
||||
code_tag:1000,
|
||||
count_tag:2000,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:460,
|
||||
|
||||
spaceX:285,
|
||||
spaceY:145,
|
||||
|
||||
code_x:56,
|
||||
count_x:50,
|
||||
|
||||
|
||||
code_y:25,
|
||||
count_y:65,
|
||||
|
||||
countW:12,
|
||||
|
||||
}
|
||||
ConstVal.blackList = {
|
||||
f_spid:3204,
|
||||
bg_spid:3207,
|
||||
id_spid:3209,
|
||||
del_spid:3208,
|
||||
|
||||
bg_tag:1,
|
||||
id_tag:10000,
|
||||
del_tag:20000,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:0,
|
||||
|
||||
id_x:25,
|
||||
del_x:330,
|
||||
|
||||
id_y:12,
|
||||
del_y:4,
|
||||
|
||||
space:8,
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
ConstVal.vipRank = {
|
||||
f_spid:3227,
|
||||
bg_spid:3223,
|
||||
txt_spid:3229,
|
||||
rank_spid:3228,
|
||||
score_spid:3230,
|
||||
|
||||
bg_tag:1,
|
||||
txt_tag:10000,
|
||||
rank_tag:20000,
|
||||
score_tag:30000,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:0,
|
||||
|
||||
txt_x:70,
|
||||
rank_x:0,
|
||||
score_x:230,
|
||||
|
||||
txt_y:10,
|
||||
rank_y:4,
|
||||
score_y:10,
|
||||
|
||||
rank_space:10,
|
||||
|
||||
space:8,
|
||||
rank_w:25,
|
||||
|
||||
|
||||
};
|
||||
ConstVal.whiteList = {
|
||||
f_spid:3272,
|
||||
bg_spid:3277,
|
||||
id_spid:3279,
|
||||
del_spid:3278,
|
||||
charm_spid:3292,
|
||||
|
||||
bg_tag:1,
|
||||
id_tag:10000,
|
||||
del_tag:20000,
|
||||
charm_tag:30000,
|
||||
|
||||
clip_x:0,
|
||||
clip_y:0,
|
||||
clip_w:0,
|
||||
clip_h:0,
|
||||
|
||||
id_x:25,
|
||||
del_x:450,
|
||||
charm_x:200,
|
||||
|
||||
id_y:12,
|
||||
del_y:4,
|
||||
charm_y:12,
|
||||
|
||||
|
||||
space:8,
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,581 @@
|
||||
/*var returnCitySN = {"cip": "171.34.213.118", "cid": "360000", "cname": "江西省"}*/
|
||||
|
||||
var C_Player;
|
||||
var InfoSex=0;
|
||||
|
||||
|
||||
var arrBan=[];
|
||||
var RoomCode = "";
|
||||
var RoomNum = -1;
|
||||
|
||||
var CombatCount = 0;
|
||||
var CombatPage = 0;//战绩页码
|
||||
var CombatPageTwoIndex = 0;//大局标号
|
||||
var CombatPageThreeIndex = 0;//小局标号
|
||||
|
||||
var CombatInfo = [];//战绩详情
|
||||
var C_PageOneBtn = [];//战绩页一按钮id
|
||||
var C_PageTwoBtn = [];//战绩页二按钮id
|
||||
var CombatBackHeight = 0;//战绩背景高度
|
||||
|
||||
var TaskInfo = [];//任务详情
|
||||
var VoteTime=0;//投票倒计时秒
|
||||
|
||||
var GameData=GameData||{};
|
||||
GameData.HallServer="";
|
||||
GameData.Server="";
|
||||
GameData.AjaxUrl="";
|
||||
GameData.scrollmsg="";
|
||||
GameData.wechat_gzh="";
|
||||
GameData.wechat_kfh="";
|
||||
GameData.qq = "";
|
||||
GameData.tel = "";
|
||||
GameData.gzhcolor1 = "";
|
||||
GameData.gzhcolor2 = "";
|
||||
GameData.telcolor = "";
|
||||
|
||||
GameData.errorMsg = null;
|
||||
GameData.tcpConnect=true;
|
||||
GameData.tcpConnectState = false;
|
||||
GameData.TimerID=0;
|
||||
GameData.TimerID_2=0;
|
||||
GameData.timer=10000;
|
||||
GameData.time_2=15000;
|
||||
GameData.NetType=0;//是否为首次连接
|
||||
GameData.Protocol_H=1;
|
||||
GameData.ProtocolIndex=true;
|
||||
GameData.isLoad=true;
|
||||
GameData.LoadCount=0;
|
||||
GameData.Timesup=false;
|
||||
GameData.InteractPlayer = -1;
|
||||
GameData.isCallback=false;
|
||||
GameData.isBoard=true;
|
||||
GameData.ConnectType=false;//1->更换服务器不需要重连
|
||||
GameData.ConnectRpc="";//更换服务器成功后发包的RPC
|
||||
GameData.ConnectPack={};//更换服务器成功后发包数据
|
||||
GameData.Battery = 0;//电量
|
||||
GameData.NetWork = 0;//网络情况1 未连接网络 2 连接wifi 3 连接2G/3G/4G
|
||||
GameData.WifiLevel = 0;//WiFi强度
|
||||
GameData.wechat_ewm = "";//二维码
|
||||
GameData.appstate=true;//true程序前台运行false程序后台运行
|
||||
GameData.OS = ConstVal.OS.other;//1->IOS 2->Android 3->wp 4->other
|
||||
GameData.isLogin = false;//是否已登录
|
||||
GameData.leaveTime=0;//
|
||||
GameData.disType = false;
|
||||
GameData.reconnectTimer=0;
|
||||
GameData.isClose = false;
|
||||
GameData.isCloseTimer = null;
|
||||
GameData.firstConnect = true;//第一次连接
|
||||
GameData.firstConnect_Succ = false;//第一次连接成功
|
||||
GameData.firstConnect_Timer = null;//第一次连接定时器
|
||||
GameData.loginTimer = null;
|
||||
GameData.tryTimes = 0;//链接尝试次数
|
||||
GameData.isReconnect = false;
|
||||
GameData.isCreateEmotion = false;
|
||||
GameData.ChatPage = 1;
|
||||
GameData.slidEmotion = false;
|
||||
GameData.communionHistory=[];//聊天历史//二维数组[[方位,类型(1-文字2语音),内容,时长]]
|
||||
GameData.createHistoryLen = 0;//以创建的精灵的长度
|
||||
GameData.slideHistory = false;
|
||||
GameData.TcpTimer = null;//tcp连接失败判断定时器
|
||||
GameData.slideTask = false;//是否滑动任务
|
||||
GameData.copyTaskTagList = [];//任务复制精灵tag列表
|
||||
|
||||
|
||||
|
||||
GameData.versionState = 0;//苹果审核结果
|
||||
GameData.visitorserver = "";//游客服务器地址
|
||||
GameData.isVisitor = false;
|
||||
|
||||
GameData.shakeID = 0;//摇一摇事件ID
|
||||
GameData.isRecord = false;
|
||||
|
||||
GameData.LaunchMode = ConstVal.Launch_mode.from_self;
|
||||
|
||||
GameData.Multiple = "";
|
||||
GameData.OrgArr=[];
|
||||
GameData.MultiArr = [];
|
||||
|
||||
GameData.isFirstLogin = true;//是否是第一次登陆
|
||||
|
||||
GameData.payList = null;
|
||||
GameData.payData = [0,0];
|
||||
|
||||
GameData.visitorClick = 0;
|
||||
GameData.Scene = 0;
|
||||
|
||||
GameData.urlFail = false;
|
||||
GameData.BroadcastArray = [];
|
||||
GameData.isBoardcast = false;
|
||||
|
||||
GameData.tcpState = [0,0];
|
||||
GameData.Notice ={
|
||||
heigth:0,
|
||||
lineSum:0,
|
||||
width:0
|
||||
}
|
||||
GameData.marketID = 0;
|
||||
GameData.getJSONState = false;//JSON获取成功状态
|
||||
GameData.Config = null;//服务器配置json
|
||||
GameData.AgentLoginImg = "";//代理商图片
|
||||
GameData.TopUpUrl = "";//索要房卡地址
|
||||
|
||||
GameData.tryConnect = false;
|
||||
GameData.hallConfigName = ["enablePay",
|
||||
"logoffCallback",//不通知
|
||||
'worldRoomList',//星星争霸是否可用
|
||||
'max:',
|
||||
'min',
|
||||
'unit',
|
||||
'shareMsg',
|
||||
'autoWorldRoomList',//是否自动弹出星星争霸场
|
||||
'rankList',//是否显示排行榜按钮1模拟排行2真实排行
|
||||
'groupMsg',//试玩群信息
|
||||
'isReSetOwnerNote',//是否替换签名
|
||||
'activity',//是否显示活动如果显示则为[x,y,w,h/*,isOpen,btnUrl,url,actid*/]
|
||||
'actData:',//常驻活动按钮 [imgUrl,isOpen,jumpUrl,actUrl]
|
||||
'shareButton:',//是否显示分享到平台
|
||||
'enableQuickEnter',//是否隐藏快速加入
|
||||
'storeUrl',//商城url
|
||||
'bagUrl',//背包url
|
||||
'shareDesc',//平台分享描述信息
|
||||
'wareHouse',//是否开启仓库功能0->不开启1->开启保险箱不开启赠送2->开启赠送不开启保险箱3->开启星星赠送(开启保险箱)4->开启房卡赠送(开启保险箱)5->开启星星房卡赠送(开启保险箱)
|
||||
'betaText',//版本号后的beta显示内容
|
||||
'launchImgUrl',//启动页图片地址
|
||||
'shareType:',//分享朋友圈类型0->链接分享 1->图片分享
|
||||
'shareImgUrl',//分享朋友圈图片链接
|
||||
'launchWaitTime',//启动等待时间
|
||||
'shareBgUrl',//分享背景图片
|
||||
'qqLogin',//是否显示qq登录
|
||||
'androidPay',//是否开启安卓支付
|
||||
'channelKey',//支付key
|
||||
'payCSS',//支付css
|
||||
'payJS',//支付js
|
||||
'openVideo'
|
||||
];//是否开启视频];
|
||||
GameData.hallConfig = {
|
||||
enablePay:0,
|
||||
logoffCallback:0,//不通知
|
||||
worldRoomList:0,//星星争霸是否可用
|
||||
max:100,
|
||||
min:0,
|
||||
unit:1,
|
||||
shareMsg:"",
|
||||
autoWorldRoomList:0,//是否自动弹出星星争霸场
|
||||
rankList:0,//是否显示排行榜按钮1模拟排行2真实排行
|
||||
groupMsg:"",//试玩群信息
|
||||
isReSetOwnerNote:0,//是否替换签名
|
||||
activity:0,//是否显示活动如果显示则为[x,y,w,h/*,isOpen,btnUrl,url,actid*/]
|
||||
actData:0,//常驻活动按钮 [imgUrl,isOpen,jumpUrl,actUrl]
|
||||
shareButton:1,//是否显示分享到平台
|
||||
enableQuickEnter:1,//是否隐藏快速加入
|
||||
storeUrl:"",//商城url
|
||||
bagUrl:"",//背包url
|
||||
shareDesc:"",//平台分享描述信息
|
||||
wareHouse:0,//是否开启仓库功能0->不开启1->开启保险箱不开启赠送2->开启赠送不开启保险箱3->开启星星赠送(开启保险箱)4->开启房卡赠送(开启保险箱)5->开启星星房卡赠送(开启保险箱)
|
||||
betaText:"",//版本号后的beta显示内容
|
||||
launchImgUrl:"",//启动页图片地址
|
||||
shareType:0,//分享朋友圈类型0->链接分享 1->图片分享
|
||||
shareImgUrl:"",//分享朋友圈图片链接
|
||||
launchWaitTime:10,//启动等待时间
|
||||
shareBgUrl:"",//分享背景图片
|
||||
qqLogin:0,//是否显示qq登录
|
||||
androidPay:0,//是否开启安卓支付
|
||||
channelKey:"",//支付key
|
||||
payCSS:"",//支付css
|
||||
payJS:"",//支付js
|
||||
openVideo:0,//是否开启视频
|
||||
};
|
||||
GameData.starName = "星星";
|
||||
GameData.roomCardName = "房卡";
|
||||
GameData.gameConfig = {};
|
||||
|
||||
GameData.playerHeadImgState = false;//玩家主界面头像加载状态
|
||||
GameData.matchhtml = "";//比赛链接地址
|
||||
|
||||
GameData.Validator = null;
|
||||
GameData.loginBtnType = ConstVal.loginButton.type1[0];//登录按钮样式
|
||||
GameData.netWorkSate = false;
|
||||
|
||||
GameData.heartBeatTimer = null;//心跳事件定时器ID
|
||||
GameData.heartBeatStage = false;//提示框是否处于心跳提示事件
|
||||
|
||||
GameData.telSpid = 179;//拨打电话精灵号
|
||||
GameData.matchInfo = null;//比赛场信息
|
||||
|
||||
GameData.agentmode = 1;//邀请码模式
|
||||
|
||||
GameData.infMode = 0;//是否为无限局
|
||||
GameData.infClickCount = 0;//点击次数
|
||||
|
||||
GameData.checkType = 1;//确认面板事件类型 1->解散房间 2->退出房间 3->投降
|
||||
GameData.roomList = [];//房间列表
|
||||
|
||||
GameData.sendLoginTimer = null;//发送重连登录包定时器
|
||||
GameData.loginList = [];//
|
||||
GameData.isConnected = false;
|
||||
|
||||
GameData.isSendLoginState = false;//是否在等待登录包
|
||||
GameData.isSendLoginTimer = null;//登录包收包定时器
|
||||
GameData.isTcpConnect = false;//是否在连接状态
|
||||
|
||||
GameData.TcpID = 0;//tcpid
|
||||
GameData.websocketList=[];
|
||||
GameData.pack="";
|
||||
GameData.infoSeat = -1;
|
||||
|
||||
GameData.sendLoginTimes = 0;
|
||||
|
||||
GameData.backUrl = "";
|
||||
|
||||
GameData.playerid = "";
|
||||
|
||||
GameData.serverConfig = {};
|
||||
|
||||
GameData.userAgent = ConstVal.userAgent.uAgent_1;
|
||||
|
||||
GameData.getbattery = "";
|
||||
GameData.getbatteryPack = {};
|
||||
|
||||
GameData.getnetwork = "";
|
||||
GameData.getnetworkPack = {};
|
||||
|
||||
GameData.getVersionState = "";
|
||||
GameData.getVersionStatePack = {};
|
||||
|
||||
GameData.getchannelName = "";
|
||||
GameData.getchannelNamePack = {};
|
||||
|
||||
GameData.getmarketname = "";
|
||||
GameData.getmarketnamePack = {};
|
||||
|
||||
GameData.gamepastetext = "";
|
||||
GameData.gamepastetextPack = {};
|
||||
GameData.worldRoomSys=[];
|
||||
|
||||
//玩家房间数据
|
||||
GameData.worldRoomPly=[];
|
||||
|
||||
GameData.worldRoomSysSlide = false;
|
||||
GameData.worldRoomPlySlide = false;
|
||||
|
||||
GameData.menuNotice = null;
|
||||
|
||||
GameData.advertInfo_1 = {
|
||||
type:0,//是否使用默认的文字通知
|
||||
imgUrl:"",//图片地址
|
||||
imgAdUrl:"",//图片跳转链接地址
|
||||
height:1,//图片高度
|
||||
msg:"",
|
||||
url:"",
|
||||
};
|
||||
GameData.advertInfo_2 = {
|
||||
type:0,
|
||||
imgUrl:"",
|
||||
imgAdUrl:"",
|
||||
height:1,
|
||||
msg:"",
|
||||
url:"",
|
||||
};
|
||||
GameData.advertInfo_0 = {
|
||||
type:0,
|
||||
imgUrl:"",
|
||||
imgAdUrl:"",
|
||||
height:1,
|
||||
msg:"",
|
||||
url:"",
|
||||
};
|
||||
GameData.noticePage = 0;
|
||||
GameData.noticePara = [[0,0],[0,0],[0,0]];
|
||||
|
||||
GameData.snrOption = {
|
||||
profit:0,
|
||||
roomcode:"",
|
||||
};
|
||||
GameData.snrRoomList = {
|
||||
roomlist:[],
|
||||
roomtype:[],
|
||||
tea:1000,
|
||||
shortcode:888
|
||||
};
|
||||
GameData.snrRoomListSlide = false;
|
||||
GameData.snrOptionLength = 0;
|
||||
GameData.snrOptionRoomTag = 0;
|
||||
GameData.snrOptionMode = 0;
|
||||
GameData.snrOptionRoomtype = "";
|
||||
GameData.snrOptionDes = "";
|
||||
GameData.snrOptionProfit=0;
|
||||
|
||||
GameData.shortCode = "";
|
||||
|
||||
GameData.isShowWorldRoomList = true;
|
||||
GameData.shareMsg = "";
|
||||
|
||||
GameData.rankList = [];
|
||||
GameData.rankListTag = 0;
|
||||
GameData.ranListLength = 0;
|
||||
GameData.rankListSlide = false;
|
||||
|
||||
GameData.h5Version = 0;
|
||||
//
|
||||
var shareParam = {
|
||||
appid: "14936872341446",
|
||||
devkey: "14915485974028"
|
||||
}
|
||||
|
||||
GameData.shareTimeline = {//朋友圈
|
||||
title: "",
|
||||
desc: "",
|
||||
link: "",
|
||||
imgUrl: ""
|
||||
}
|
||||
GameData.shareAppMessage = {//好友
|
||||
title: "",
|
||||
desc: "",
|
||||
link: "",
|
||||
imgUrl: ""
|
||||
}
|
||||
GameData.gameData = "";
|
||||
GameData.fromH5GameData = {};
|
||||
GameData.isJoinRoomFromH5 = false;
|
||||
GameData.h5ShareImage = "";
|
||||
GameData.screenShotStage = 0;
|
||||
GameData.screenShotSpidList = [];
|
||||
|
||||
GameData.ownerNote = "";
|
||||
GameData.isDebugger = 0;
|
||||
|
||||
GameData.returnUrl = "";
|
||||
|
||||
GameData.configData = "";
|
||||
GameData.h5ShareUrl = "";
|
||||
|
||||
GameData.inputPanelData = "";
|
||||
GameData.inputCallBack = null;
|
||||
|
||||
GameData.isShowNeighbor = true;
|
||||
|
||||
GameData.nameImgFrame_1 = 1;//房卡图片帧数
|
||||
GameData.nameImgFrame_2 = 1;//星星图片帧数
|
||||
GameData.surrendCount = 0;
|
||||
|
||||
|
||||
GameData.htmlCode = "";
|
||||
GameData.htmlId = "";
|
||||
|
||||
GameData.serverIndex = 0;//连接地址下标
|
||||
GameData.tryReconnectTimes = 0;
|
||||
GameData.isChangeServer = false;
|
||||
|
||||
GameData.shareFrom = 0;//0->框架分享 1->游戏分享
|
||||
GameData.activityType = 0;//子游戏调用类型
|
||||
GameData.activityData = null;//子游戏调用类型
|
||||
GameData.shareTimes = 0;//分享次数
|
||||
|
||||
GameData.sharePostUrl = "http://localhost:4477/testurl";//截图分享链接
|
||||
//保险箱
|
||||
GameData.wareHouse = {
|
||||
page:1,//当前页
|
||||
safeInputType:1,//保险箱存入取出类型
|
||||
safeInputCount:-1,//保险箱存入取出数量
|
||||
safePassWord:-1,//保险箱存入取出密码
|
||||
inputNumber:0,//输入的数字
|
||||
selectType:1,//选择的当前输入框
|
||||
initPassWord1:-1,//初始化密码
|
||||
initPassWord2:-1,//确认初始化密码
|
||||
pId:0,//赠送id
|
||||
pImg:"",//赠送头像
|
||||
pNickName:"",//赠送昵称
|
||||
pInputType:1,//赠送类型
|
||||
pInputId:-1,//输入id
|
||||
pInputCount:-1,//赠送数量
|
||||
pInputPassWord:-1,//赠送密码
|
||||
|
||||
|
||||
};
|
||||
GameData.openVideo = 0;//是否开启视频功能
|
||||
GameData.imgAdIsSlide = false;
|
||||
GameData.launchImgLoaded = false;//启动页图片是否从网络加载完成
|
||||
GameData.configSuccess = false;//配置文件读取成功
|
||||
GameData.launchWaitTime = 0;
|
||||
GameData.adTimer = null;
|
||||
|
||||
GameData.sysNotice = [];//系统公告 {msg:"",read:false,line:1}
|
||||
GameData.sysCreateLength = 0;
|
||||
|
||||
GameData.selectSysNotice = false;//是否勾选发送系统公告
|
||||
GameData.sysNoticeCost = 0;
|
||||
GameData.sysNoticeLimit = 0;
|
||||
|
||||
|
||||
GameData.mainMenuAniTimer = null;
|
||||
GameData.worldRoomPage = 0;
|
||||
|
||||
GameData.createMyRoomListLength = 0;
|
||||
|
||||
GameData.starCount = 0;
|
||||
GameData.roomCardCount=0;
|
||||
|
||||
GameData.loginPlayerid = false;//登录是否带上playerid
|
||||
|
||||
GameData.matchId = null;
|
||||
|
||||
GameData.chatLine = null;
|
||||
GameData.chatInfo = null;
|
||||
GameData.isService = false;
|
||||
|
||||
GameData.submitLocation = false;
|
||||
GameData.submitPhoneInfo = false;
|
||||
GameData.submitAddressBook = false;
|
||||
GameData.getConfigTimer = null;
|
||||
|
||||
GameData.clickChat = 0;
|
||||
|
||||
GameData.phoneInfo = null;
|
||||
GameData.addressBook = null;
|
||||
//GameData.sysConfigName=[];
|
||||
GameData.sysConfigName=["hideEscape","charmName","hideTaskBtn","miniPro","videoConfig","ofcShortCode","ofcTips","ofcWx","ofcImg",
|
||||
"managerUrl","rebateConfig","gameNoticeShow","hallNoticeShow","ofcAutoEnter","vipFlushTime","vipWx","h5PayUrl","appShareH5",
|
||||
"vipRankLimit","behaviorList","deviceLogin","hideWxShare","hideRoomCard","hideSpid","cdKey","otherShare","avatarRange","avatarUrl","whiteListManager","nnLocal"];
|
||||
GameData.sysConfig={
|
||||
hideEscape:0,
|
||||
charmName:"魅力",
|
||||
hideTaskBtn:0,//是否隐藏任务按钮
|
||||
miniPro:0,//是否小程序/小游戏 (隐藏更多选项、分享朋友圈、聊天按钮、录音调整)
|
||||
videoConfig:null,//{type:1,profitMode:1,profit:3}
|
||||
ofcShortCode:null,//官方短号
|
||||
ofcImg:"",//官方按钮链接
|
||||
managerUrl:"",//管理后台地址
|
||||
rebateConfig:null,//抽成配置
|
||||
gameNoticeShow:0,//子游戏弹窗时间间隔 0每次都弹 -1不弹
|
||||
hallNoticeShow:0,//大厅弹窗时间间隔 0每次都弹 -1不弹
|
||||
ofcAutoEnter:0,//是否自动进入官方短号
|
||||
vipFlushTime:10000,//vip房间列表刷新间隔
|
||||
vipWx:"",//成为vip联系微信
|
||||
h5PayUrl:"",//h5支付地址
|
||||
appShareH5:"",//app分享的h5地址
|
||||
vipRankLimit:10,//vip排行显示个数
|
||||
behaviorList:null,//用户行为
|
||||
deviceLogin:0,//是否显示设备登录显示了设备登录就会显示手机号登录就会隐藏微信登录
|
||||
hideWxShare:0,//是否隐藏微信分享
|
||||
hideRoomCard:1,//隐藏主界面房卡 1 不隐藏 2隐藏
|
||||
hideSpid:null,//隐藏的精灵id
|
||||
cdKey:1,//是否显示CDKEY 1不显示 2显示
|
||||
otherShare:1,//开启新分享 1 关闭2开启
|
||||
avatarRange:[100,10000],//设备登录的头像列表
|
||||
avatarUrl:"https://projectimage.tscce.cn/image_132/",
|
||||
whiteListManager:2, //是否开启在游戏中管理白名单
|
||||
nnLocal:2,//
|
||||
|
||||
};
|
||||
GameData.inputCallBack2 = null;
|
||||
|
||||
GameData.topInfoTimer = null;
|
||||
|
||||
GameData.iscloseVideo = true;//是否开战关闭视频
|
||||
GameData.textCallback = null;
|
||||
|
||||
GameData.isLocation = false;
|
||||
GameData.otherLocation = false;//
|
||||
GameData.otherLocationTimes = 0;
|
||||
GameData.otherLocationAllTimes = 1;
|
||||
|
||||
|
||||
GameData.hallLogin = true;
|
||||
|
||||
GameData.senRoomState = 0;
|
||||
|
||||
GameData.rebateConfig = null;
|
||||
|
||||
GameData.vipRoomPage = 0;
|
||||
GameData.vipRoomCode = 0;
|
||||
GameData.vipRoomData = [];
|
||||
GameData.vipRoomTimer1 = false;
|
||||
GameData.vipRoomIsOpen = false;
|
||||
GameData.vipRoomShortList = [];
|
||||
GameData.vipRoomJump = false;
|
||||
GameData.vipRoomPageOne = {
|
||||
cLength:0,
|
||||
slide:false,
|
||||
}
|
||||
GameData.vipRoomPageTwo = {
|
||||
cLength:0,
|
||||
slide:false,
|
||||
data:null,
|
||||
}
|
||||
GameData.tipTimer1 = null;
|
||||
GameData.tipTimer2 = null;
|
||||
|
||||
GameData.initCard = 0;
|
||||
GameData.initBean = 0;
|
||||
|
||||
GameData.brNumber=0;
|
||||
|
||||
GameData.isKick = false;
|
||||
|
||||
GameData.blackList = {
|
||||
data:[],
|
||||
length:0,
|
||||
breakRoom:false,
|
||||
selectTag:0,
|
||||
slide:false,
|
||||
inputId:"",
|
||||
idWidth:12,
|
||||
}
|
||||
GameData.allCharm = 0;
|
||||
GameData.vipRank = {
|
||||
data:{
|
||||
rankList:[],
|
||||
myRank:1,
|
||||
myScore:100
|
||||
},
|
||||
length:0,
|
||||
//selectTag:0,
|
||||
slide:false,
|
||||
//inputId:"",
|
||||
//idWidth:12,
|
||||
}
|
||||
GameData.rankType = false;
|
||||
|
||||
GameData.coinMp3Time = 0;
|
||||
GameData.coinMp3Length = 3000;
|
||||
GameData.brRebateUnit = 10000;
|
||||
|
||||
GameData.phoneCodeTime = 0;
|
||||
GameData.phoneCode = "";
|
||||
GameData.phoneNumber = "";
|
||||
|
||||
GameData.phoneType = 0;
|
||||
|
||||
GameData.isGetPhoneInfo = false;
|
||||
GameData.isDeviceLogin = false;
|
||||
GameData.begin0 = false;
|
||||
|
||||
GameData.vipConfig = null;
|
||||
|
||||
GameData.feedMode = 0;
|
||||
|
||||
GameData.fromMiniProData = {};
|
||||
|
||||
|
||||
GameData.shareFriendInfo = {};
|
||||
|
||||
|
||||
GameData.deviceAvatarList = [];
|
||||
|
||||
GameData.whiteList = {
|
||||
data:[],
|
||||
length:0,
|
||||
breakRoom:false,
|
||||
selectTag:0,
|
||||
slide:false,
|
||||
inputId:"",
|
||||
inputCharm:"",
|
||||
searchId:"",
|
||||
idWidth:12,
|
||||
delPid:"",
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
4389
codes/games/client/Projects/Game_Surface_3/js/00_Surface/05_Func.js
Normal file
4389
codes/games/client/Projects/Game_Surface_3/js/00_Surface/05_Func.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,553 @@
|
||||
function Player(seat){
|
||||
this.openid = "";//id
|
||||
this.playerid = -1;//playerid
|
||||
this.nickname = "";//昵称
|
||||
this.avatar = "";//头像地址
|
||||
this.sex = 0;//性别
|
||||
this.ip = "";//ip地址
|
||||
this.province = "";//微信信息省份
|
||||
this.city = "";//微信信息城市
|
||||
this.roomcard = -1;//房卡数量
|
||||
this.taskstate = 0;//任务状态
|
||||
this.unionid = 0;//平台唯一表示
|
||||
this.seat = seat; //座位号
|
||||
this.score = 0;
|
||||
this.state = -1;//玩家状态0->默认值 -1->申请解散 1->同意解散 2->拒绝解散
|
||||
this.status = 0;//0->默认值 1->房主 2->非房主
|
||||
//this.offline = 0;//玩家是否离线0->否 1->离线
|
||||
this.canexit=1;//是否可以直接离开
|
||||
this.onstate=0;//0:在线1:离线2:通话中
|
||||
this.addr = null;
|
||||
this.invitecode = "";//邀请码
|
||||
this.isStart = false;//能否点击按钮开始游戏
|
||||
this.bean = 0;//玩家豆子数量
|
||||
this.initialBean = 0;//玩家豆子初始值
|
||||
this.isprepare = 0;//玩家是否准备
|
||||
this.advanced = 0;//玩家是否有高级选项
|
||||
this.paycode = "";//吱口令
|
||||
this.wareHouseStarCount = 0;//仓库库存星星
|
||||
this.bankpower = 0;//是否有仓库权限
|
||||
this.bankpwd = 0;//是否设置仓库密码
|
||||
this.charm = undefined;
|
||||
this.sign = "";//签名
|
||||
this.tel = "";//绑定手机号
|
||||
}
|
||||
//玩家信息初始化
|
||||
if(typeof(Player.prototype.Init) == "undefined"){
|
||||
Player.prototype.Init = function(bTemp){
|
||||
this.openid = "";//id
|
||||
this.playerid = -1;//playerid
|
||||
this.nickname = "";//昵称
|
||||
this.score = 0;
|
||||
this.avatar = "";//头像地址
|
||||
this.sex = 0;//性别
|
||||
this.ip = "";//ip地址
|
||||
this.province = "";//省份
|
||||
this.city = "";//城市
|
||||
this.roomcard = 0;//房卡数量
|
||||
this.taskstate = 0;//任务状态
|
||||
this.unionid = 0;//平台唯一表示
|
||||
if(bTemp)this.seat = -1; //座位号
|
||||
this.state = -1;//玩家状态0->默认值 1->申请解散 2->同意解散 3->拒绝解散
|
||||
this.status = 0;//0->默认值 1->房主 2->非房主
|
||||
this.offline = 0;//玩家是否离线0->否 1->离线
|
||||
this.canexit=1;//是否可以直接离开
|
||||
this.onstate=0;//0:在线1:离线2:通话中
|
||||
this.addr = null;
|
||||
this.invitecode = "";//邀请码
|
||||
this.isStart = false;//能否点击按钮开始游戏
|
||||
this.bean = 0;//玩家豆子数量
|
||||
this.initialBean = 0;//玩家豆子初始值
|
||||
this.isprepare = 0;//玩家是否准备
|
||||
this.advanced = 0;//玩家是否有高级选项
|
||||
this.paycode = "";//吱口令
|
||||
this.wareHouseStarCount = 0;//仓库库存星星
|
||||
this.bankpower = 0;//是否有仓库权限
|
||||
this.bankpwd = 0;//是否设置仓库密码
|
||||
this.charm = undefined;
|
||||
this.sign = "";//签名
|
||||
this.tel = "";//绑定手机号
|
||||
};
|
||||
}
|
||||
//玩家微信信息初始化
|
||||
if(typeof(Player.prototype.SetWxInfo) == "undefined"){
|
||||
Player.prototype.SetWxInfo = function(openid,headimgurl,nickname,sex,city,Province,unionid){
|
||||
this.openid = openid;//id
|
||||
this.nickname = nickname;//昵称
|
||||
this.avatar = headimgurl;//头像地址
|
||||
this.sex = sex;//性别
|
||||
this.city = city;//城市
|
||||
this.province = Province;//省
|
||||
this.unionid=unionid;//开放平台id
|
||||
//alert("设置玩家信息");
|
||||
};
|
||||
}
|
||||
//玩家游戏信息初始化
|
||||
if(typeof(Player.prototype.SetMyInfo) == "undefined"){
|
||||
//Player.prototype.SetMyInfo = function(_playerid,_roomcard,_taskstate,_ip,_score,_bean,_paycode){
|
||||
Player.prototype.SetMyInfo = function(object){
|
||||
this.playerid = object.playerid;
|
||||
this.roomcard = object.roomcard;
|
||||
this.taskstate = object.taskstate;
|
||||
this.ip=object.ip;
|
||||
this.score = object.score;
|
||||
this.bean = object.bean;
|
||||
this.initialBean = object.bean;
|
||||
this.bankpower = object.bankpower;
|
||||
if(object.bank){
|
||||
this.wareHouseStarCount = Number(object.bank);//仓库库存星星
|
||||
}else{
|
||||
this.wareHouseStarCount = 0;
|
||||
}
|
||||
if(object.bankpwd){
|
||||
this.bankpwd = Number(object.bankpwd);//仓库库存星星
|
||||
}else{
|
||||
this.bankpwd = 0;
|
||||
}
|
||||
this.charm = object.charm;
|
||||
this.sign = object.sign;
|
||||
this.tel = object.tel;
|
||||
//this.setTel();
|
||||
//this.bankpwd = object.bank;//是否设置仓库密码 this.bankpwd = 0;//是否设置仓库密码
|
||||
//this.paycode = _paycode;
|
||||
};
|
||||
}
|
||||
//设置玩家位置
|
||||
if(typeof(Player.prototype.SetLocationInfo) == "undefined"){
|
||||
Player.prototype.SetLocationInfo = function(_locationinfo){
|
||||
this.addr = _locationinfo;
|
||||
set_self(200,7,C_Player.addr.province+"-"+C_Player.addr.city,0,0);
|
||||
};
|
||||
}
|
||||
|
||||
//设置玩家座位
|
||||
if(typeof(Player.prototype.SetSeat) == "undefined"){
|
||||
Player.prototype.SetSeat = function(seat){
|
||||
this.seat = seat;
|
||||
};
|
||||
}
|
||||
//设置玩家邀请码
|
||||
if(typeof(Player.prototype.setInvitecod) == "undefined"){
|
||||
Player.prototype.setInvitecod = function(_invitecode){
|
||||
this.invitecode = _invitecode;
|
||||
};
|
||||
}
|
||||
//修改房卡
|
||||
if(typeof(Player.prototype.UpdateRoomcard) == "undefined"){
|
||||
Player.prototype.UpdateRoomcard = function(_msg){
|
||||
this.roomcard = _msg.data.roomcard;
|
||||
//set_self(157,7,C_Player.roomcard,0,0);
|
||||
//set_self(157,18,get_self(287,18,0,0,0)+get_self(287,20,0,0,0)/2-String(C_Player.roomcard).length*7,0,0);
|
||||
GameUI.setHallRoomCard();
|
||||
if(_msg.data.text){
|
||||
GameUI.Openupdataroomcard(_msg.data.text);
|
||||
}
|
||||
};
|
||||
}
|
||||
//修改豆豆
|
||||
if(typeof(Player.prototype.update_bean) == "undefined"){
|
||||
Player.prototype.update_bean = function(_msg){
|
||||
this.bean = _msg.data.bean;
|
||||
GameUI.setHallStar();
|
||||
//set_self(497,7,C_Player.bean,0,0);
|
||||
//set_self(497,18,get_self(496,18,0,0,0)+get_self(496,20,0,0,0)/2-String(C_Player.bean).length*7,0,0);
|
||||
set_self(510,7,GameData.starName+":"+C_Player.bean,0,0);
|
||||
GameUI.openUpdateBean(_msg.data.text);
|
||||
if(C_Player.seat>-1){//在房间内
|
||||
var pobj = Desk.GetPlayerBySeat(C_Player.seat);
|
||||
pobj.bean = C_Player.bean;
|
||||
pobj = null;
|
||||
if(C_Player.seat == GameData.infoSeat){
|
||||
set_self(511,7,GameData.starName+":"+C_Player.bean,0,0);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//修改豆豆
|
||||
if(typeof(Player.prototype.update_bean2) == "undefined"){
|
||||
Player.prototype.update_bean2 = function(_bean){
|
||||
this.bean = _bean;
|
||||
GameUI.setHallStar();
|
||||
//set_self(497,7,C_Player.bean,0,0);
|
||||
//set_self(497,18,get_self(496,18,0,0,0)+get_self(496,20,0,0,0)/2-String(C_Player.bean).length*7,0,0);
|
||||
set_self(510,7,GameData.starName+":"+C_Player.bean,0,0);
|
||||
if(C_Player.seat>-1){//在房间内
|
||||
var pobj = Desk.GetPlayerBySeat(C_Player.seat);
|
||||
pobj.bean = C_Player.bean;
|
||||
pobj = null;
|
||||
if(C_Player.seat == GameData.infoSeat){
|
||||
set_self(511,7,GameData.starName+":"+C_Player.bean,0,0);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//修改豆豆
|
||||
if(typeof(Player.prototype.changeBean) == "undefined"){
|
||||
Player.prototype.changeBean = function(_bean){
|
||||
this.bean = this.initialBean + _bean;
|
||||
GameUI.setHallStar();
|
||||
//set_self(497,7,C_Player.bean,0,0);
|
||||
//set_self(497,18,get_self(496,18,0,0,0)+get_self(496,20,0,0,0)/2-String(C_Player.bean).length*7,0,0);
|
||||
set_self(510,7,GameData.starName+":"+C_Player.bean,0,0);
|
||||
if(C_Player.seat>-1){//在房间内
|
||||
var pobj = Desk.GetPlayerBySeat(C_Player.seat);
|
||||
pobj.bean = C_Player.bean;
|
||||
pobj = null;
|
||||
if(C_Player.seat == GameData.infoSeat){
|
||||
set_self(511,7,GameData.starName+":"+C_Player.bean,0,0);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//设置房卡
|
||||
if(typeof(Player.prototype.setRoomcard) == "undefined"){
|
||||
Player.prototype.setRoomcard = function(_roomcard){
|
||||
this.roomcard = _roomcard;
|
||||
GameUI.setHallRoomCard();
|
||||
};
|
||||
}
|
||||
//设置房卡
|
||||
if(typeof(Player.prototype.addRoomCard) == "undefined"){
|
||||
Player.prototype.addRoomCard = function(value,text){
|
||||
this.roomcard += value;
|
||||
GameUI.setHallRoomCard();
|
||||
if(text){
|
||||
GameUI.Openupdataroomcard(text);
|
||||
}
|
||||
};
|
||||
}
|
||||
if(typeof(Player.prototype.setBean) == "undefined"){
|
||||
Player.prototype.setBean = function(value){
|
||||
this.bean = value;
|
||||
GameUI.setHallStar();
|
||||
};
|
||||
}
|
||||
if(typeof(Player.prototype.addBean) == "undefined"){
|
||||
Player.prototype.addBean = function(value,text){
|
||||
this.bean += value;
|
||||
GameUI.setHallStar();
|
||||
if(text){
|
||||
GameUI.Openupdataroomcard(text);
|
||||
}
|
||||
};
|
||||
}
|
||||
//设置吱口令
|
||||
if(typeof(Player.prototype.setPayCode) == "undefined"){
|
||||
Player.prototype.setPayCode = function(_paycode){
|
||||
if(_paycode){
|
||||
this.paycode = _paycode;//吱口令
|
||||
}else{
|
||||
this.paycode = "";//吱口令
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
//绑定邀请码
|
||||
if(typeof(Player.prototype.binding_invitecode) == "undefined"){
|
||||
Player.prototype.binding_invitecode = function(_msg){
|
||||
|
||||
if(_msg.data.state == 0){
|
||||
this.invitecode = _msg.data.invitecode;
|
||||
}
|
||||
GameUI.OpenTips(_msg.data.error,ConstVal.Tips.time);
|
||||
|
||||
};
|
||||
}
|
||||
//设置牌桌内玩家数据
|
||||
if(typeof(Player.prototype.SetDeskInfo) == "undefined"){
|
||||
Player.prototype.SetDeskInfo = function(_data,bTemp){
|
||||
this.playerid=_data.playerid;
|
||||
this.nickname=_data.nickname;
|
||||
this.avatar=_data.avatar;
|
||||
this.sex=_data.sex;
|
||||
this.ip=_data.ip;
|
||||
this.onstate=_data.onstate;
|
||||
this.bean = _data.bean;
|
||||
if(!bTemp){
|
||||
this.initialBean = _data.bean;//玩家豆子初始值
|
||||
}else{
|
||||
this.initialBean = _data.initialBean;//玩家豆子初始值
|
||||
}
|
||||
this.isprepare = _data.isprepare;//玩家是否准备
|
||||
if(_data.paycode){
|
||||
this.paycode = _data.paycode;
|
||||
}else{
|
||||
this.paycode = "";
|
||||
}
|
||||
this.charm = _data.charm;
|
||||
this.sign = _data.sign;
|
||||
};
|
||||
}
|
||||
//获取牌桌内玩家数据
|
||||
if(typeof(Player.prototype.getDeskInfo) == "undefined"){
|
||||
Player.prototype.getDeskInfo = function(){
|
||||
var rValue = {};
|
||||
rValue.playerid=this.playerid;
|
||||
rValue.nickname=this.nickname;
|
||||
rValue.avatar=this.avatar;
|
||||
rValue.sex=this.sex;
|
||||
rValue.ip=this.ip;
|
||||
rValue.onstate=this.onstate;
|
||||
rValue.bean = this.bean;
|
||||
rValue.initialBean = this.initialBean;//玩家豆子初始值
|
||||
rValue.isprepare = this.isprepare;//玩家是否准备
|
||||
if(this.paycode){
|
||||
rValue.paycode = _data.paycode;
|
||||
}else{
|
||||
rValue.paycode = "";
|
||||
}
|
||||
rValue.charm = this.charm;
|
||||
return rValue;
|
||||
};
|
||||
}
|
||||
//房间解散
|
||||
if(typeof(Player.prototype.BreakRoom) == "undefined"){
|
||||
Player.prototype.BreakRoom = function(){
|
||||
this.seat = -1; //座位号
|
||||
this.state = -1;//玩家状态0->默认值 1->申请解散 2->同意解散 3->拒绝解散
|
||||
this.status = 0;//0->默认值 1->房主 2->非房主
|
||||
this.isStart = false;//能否点击按钮开始游戏
|
||||
//this.paycode = "";
|
||||
};
|
||||
}
|
||||
//申请解散房间
|
||||
if(typeof(Player.prototype.ApplyBreakRoom) == "undefined"){
|
||||
Player.prototype.ApplyBreakRoom = function(){
|
||||
this.state = 0;//玩家状态0->默认值 1->申请解散 2->同意解散 3->拒绝解散
|
||||
};
|
||||
}
|
||||
//同意解散房间
|
||||
if(typeof(Player.prototype.AgreeBreakRoom) == "undefined"){
|
||||
Player.prototype.AgreeBreakRoom = function(){
|
||||
this.state = 1;//玩家状态0->默认值 1->申请解散 2->同意解散 3->拒绝解散
|
||||
};
|
||||
}
|
||||
//拒绝解散房间
|
||||
if(typeof(Player.prototype.RefuseBreakRoom) == "undefined"){
|
||||
Player.prototype.RefuseBreakRoom = function(){
|
||||
this.state = 2;//玩家状态0->默认值 1->申请解散 2->同意解散 3->拒绝解散
|
||||
};
|
||||
}
|
||||
//更改玩家是否可以直接退出
|
||||
if(typeof(Player.prototype.ChangeExit) == "undefined"){
|
||||
Player.prototype.ChangeExit = function(v){
|
||||
this.canexit = v;
|
||||
switch(v){
|
||||
case 1:
|
||||
if(this.status == 1){
|
||||
set_self(181,43,4,0,0);
|
||||
}else{
|
||||
set_self(181,43,3,0,0);
|
||||
}
|
||||
|
||||
break;
|
||||
case 0:
|
||||
GameUI.hideExitBtn();
|
||||
set_self(181,43,1,0,0);
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
//更改玩家通话状态
|
||||
if(typeof(Player.prototype.phonestate) == "undefined"){
|
||||
Player.prototype.phonestate = function(state){
|
||||
state=Number(state);
|
||||
C_Player.onstate=state;
|
||||
var pobj=Desk.GetPlayerBySeat(C_Player.seat);
|
||||
if(!pobj){return;}
|
||||
pobj.onstate=state;
|
||||
GameUI.SetOnState(C_Player.seat.seat,state);
|
||||
switch(state){
|
||||
case 0://挂断
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.gameid=GameData.GameId;
|
||||
data.playerid=C_Player.playerid;
|
||||
data.roomcode=Desk.roomcode;
|
||||
Net.Send_hangup_phone(data);
|
||||
break;
|
||||
case 1://接起电话
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.gameid=GameData.GameId;
|
||||
data.playerid=C_Player.playerid;
|
||||
data.roomcode=Desk.roomcode;
|
||||
Net.Send_call_phone(data);
|
||||
break;
|
||||
case 2://电话进来
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.gameid=GameData.GameId;
|
||||
data.playerid=C_Player.playerid;
|
||||
data.roomcode=Desk.roomcode;
|
||||
Net.Send_call_phone(data);
|
||||
break;
|
||||
case 3://去电
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.gameid=GameData.GameId;
|
||||
data.playerid=C_Player.playerid;
|
||||
data.roomcode=Desk.roomcode;
|
||||
Net.Send_call_phone(data);
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
//更改玩家任务提醒状态
|
||||
if(typeof(Player.prototype.ChangeTaskstate) == "undefined"){
|
||||
Player.prototype.ChangeTaskstate = function(v){
|
||||
this.taskstate = v;
|
||||
};
|
||||
}
|
||||
//分享回调
|
||||
if(typeof(Player.prototype.sharesuccess) == "undefined"){
|
||||
Player.prototype.sharesuccess = function(success,type){
|
||||
|
||||
if(success==2 && type == 2){//分享成功
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.playerid=this.playerid;
|
||||
data.taskid=ConstVal.ShareTaskId;
|
||||
Net.Send_player_finish_task(data);
|
||||
|
||||
}else{
|
||||
//GameUI.OpenTips("分享失败!",ConstVal.Tips.time);
|
||||
}
|
||||
if(success == 2 && GameData.shareFrom == 1){//截图分享成功
|
||||
try{
|
||||
GameData.shareTimes++;
|
||||
if(isArray(GameData.hallConfig.actData)){
|
||||
if(GameData.hallConfig.actData[1] == 0){//活动关闭
|
||||
return;
|
||||
}
|
||||
switch(GameData.activityType){//
|
||||
case 1://大赢家
|
||||
if(GameData.shareTimes == 1){
|
||||
var sendUrl = GameData.hallConfig.actData[3];
|
||||
var event = 3;
|
||||
Logic.sendToWeb2(sendUrl,event);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
//if(!isArray(GameData.hallConfig.activity)){//
|
||||
|
||||
//return;
|
||||
//}else{
|
||||
//if(GameData.hallConfig.activity.length>=5){
|
||||
//if(GameData.hallConfig.activity[4] == 0){
|
||||
//return;
|
||||
//}
|
||||
//}
|
||||
//}
|
||||
|
||||
//logmessage("大赢家截图分享成功!"+GameData.shareTimes+"、"+GameData.activityType,1);
|
||||
//switch(GameData.activityType){//
|
||||
//case 1://大赢家
|
||||
//if(GameData.shareTimes == 1){
|
||||
//var sendUrl = "http://discount.0791ts.cn/api/add_game_times";
|
||||
//var actId = 1;
|
||||
|
||||
//if(GameData.hallConfig.activity.length > 5){
|
||||
//sendUrl = GameData.hallConfig.activity[6];
|
||||
//actId = GameData.hallConfig.activity[7];
|
||||
//}
|
||||
//Logic.sendToWeb(sendUrl,actId);
|
||||
//}
|
||||
//break;
|
||||
//}
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
}
|
||||
GameData.activityType = 0;
|
||||
GameData.activityData = null;
|
||||
|
||||
};
|
||||
}
|
||||
//有
|
||||
if(typeof(Player.prototype.player_finish_task) == "undefined"){
|
||||
Player.prototype.player_finish_task = function(_msg){
|
||||
if(_msg.data.state==1 && C_Player.taskstate==0){
|
||||
C_Player.taskstate=1;
|
||||
}
|
||||
};
|
||||
}
|
||||
//领取任务奖励
|
||||
if(typeof(Player.prototype.get_task_award) == "undefined"){
|
||||
Player.prototype.get_task_award = function(_msg){
|
||||
for(var i=0;i<TaskInfo.length;i++){
|
||||
if(TaskInfo[i].taskid == _msg.data.taskid){
|
||||
TaskInfo[i].state = 2;
|
||||
}
|
||||
}
|
||||
this.taskstate=_msg.data.taskstate;
|
||||
GameUI.CloseTask();
|
||||
GameUI.OpenTask();
|
||||
|
||||
};
|
||||
}
|
||||
//设置是否已初始化密码
|
||||
if(typeof(Player.prototype.setBankPwd) == "undefined"){
|
||||
Player.prototype.setBankPwd = function(value){
|
||||
this.bankpwd = value;
|
||||
};
|
||||
}
|
||||
//设置库存星星数量
|
||||
if(typeof(Player.prototype.setWareHouseStarCOunt) == "undefined"){
|
||||
Player.prototype.setWareHouseStarCOunt = function(count){
|
||||
if(count){
|
||||
this.wareHouseStarCount = Number(count);
|
||||
}else{
|
||||
this.wareHouseStarCount = 0;
|
||||
}
|
||||
GameUI.setNumberImage(3033,C_Player.wareHouseStarCount,27);//仓库库存数量
|
||||
};
|
||||
}
|
||||
|
||||
//设置魅力值
|
||||
if(typeof(Player.prototype.setCharm) == "undefined"){
|
||||
Player.prototype.setCharm = function(count){
|
||||
this.charm = count;
|
||||
if(this.seat>-1){//在房间内
|
||||
if(this.seat == GameData.infoSeat){
|
||||
set_self(3125,7,GameData.sysConfig.charmName+":"+count,0,0);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
//设置魅力值
|
||||
if(typeof(Player.prototype.setSign) == "undefined"){
|
||||
Player.prototype.setSign = function(sign){
|
||||
this.sign = sign;
|
||||
GameUI.setSign(sign);
|
||||
GameUI.closeTextInput();
|
||||
};
|
||||
}
|
||||
if(typeof(Player.prototype.updateHallData) == "undefined"){
|
||||
Player.prototype.updateHallData = function(data){
|
||||
this.setSign(data.sign);
|
||||
this.setRoomcard(data.roomcard);
|
||||
this.update_bean2(data.bean);
|
||||
};
|
||||
}
|
||||
if(typeof(Player.prototype.returnHallData) == "undefined"){
|
||||
Player.prototype.returnHallData = function(data){
|
||||
var obj={};
|
||||
obj.sign = this.sign;
|
||||
obj.roomcard = this.roomcard;
|
||||
obj.bean = this.bean;
|
||||
return obj;
|
||||
};
|
||||
}
|
||||
|
||||
//设置手机号
|
||||
if(typeof(Player.prototype.setTel) == "undefined"){
|
||||
Player.prototype.setTel = function(val){
|
||||
this.tel = val;
|
||||
set_self(3256,43,2,0,0);
|
||||
play_ani(0,3256,35,255,100,0,1000,0,0,0,0,0,1);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
1430
codes/games/client/Projects/Game_Surface_3/js/00_Surface/07_Desk.js
Normal file
1430
codes/games/client/Projects/Game_Surface_3/js/00_Surface/07_Desk.js
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,877 @@
|
||||
var Net = Net||{};
|
||||
Net.tcp = {};
|
||||
Net.tcp.isConnected = false;//已有连接连上
|
||||
Net.tcp.tcpIDAva = 1;//用过的ID的最大值
|
||||
Net.tcp.tcpIDList = [];//TCP ID列表
|
||||
Net.tcp.connectCount = 3;//同时最多连接个数
|
||||
Net.tcp.connectList = [];//tcp连接对象池
|
||||
Net.tcp.connect = function(_id,ws){
|
||||
|
||||
}
|
||||
Net.ws_tcp;
|
||||
Net._SendData = function(_app,_route,_rpc,_data){
|
||||
|
||||
var _msg = {};
|
||||
_msg.app = _app,
|
||||
_msg.route = _route;
|
||||
_msg.rpc = _rpc;
|
||||
_msg.data = _data;
|
||||
if(ConstVal.netType == 0){
|
||||
Net.ws_tcp.send(JSON.stringify(_msg));
|
||||
}else{
|
||||
var putMsg='';
|
||||
if(_msg.rpc == RpcList.player_login){putMsg="playerLogin"}
|
||||
Func.AjaxHttp2(GameData.Server,_msg,
|
||||
function(_msg,state,input_msg){
|
||||
console.log(_msg,state,input_msg);
|
||||
if (typeof(_msg) == 'string')
|
||||
{
|
||||
_msg = JSON.parse(_msg);
|
||||
}
|
||||
if(_msg.route==RouteList.platform||_msg.route==RouteList.agent||_msg.route==RouteList.room){
|
||||
if(min_ExitsFunction(Net[_msg.rpc])){
|
||||
Net[_msg.rpc](_msg);
|
||||
}
|
||||
}else{
|
||||
Game_Modify._ReceiveData(_msg);
|
||||
}
|
||||
},function(_msg,state,input_msg){
|
||||
if(input_msg == "playerLogin"){
|
||||
GameUI.OpenTips("网络状况不好");
|
||||
|
||||
}
|
||||
|
||||
},putMsg);
|
||||
}
|
||||
|
||||
if(Game_Config.Debugger.isDebugger){
|
||||
console.log("发送数据:"+JSON.stringify(_msg));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Net.submit_error = function(_packet,_msg){
|
||||
//提交错误
|
||||
if(GameData.errorMsg != _msg){
|
||||
GameData.errorMsg = _msg;
|
||||
}else {
|
||||
return;
|
||||
}
|
||||
var msg = {
|
||||
app:"youle",
|
||||
route:"agent",
|
||||
rpc:"submit_error",
|
||||
data:{
|
||||
packet:_packet,
|
||||
msg:_msg,
|
||||
playerid:C_Player.playerid,
|
||||
agentid:GameData.AgentId,
|
||||
gameid:GameData.GameId,
|
||||
}
|
||||
}
|
||||
try{
|
||||
Net.ws_tcp.send(JSON.stringify(msg));
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Net.submit_log = function(_packet,_msg){
|
||||
var msg = {
|
||||
app:"youle",
|
||||
route:"agent",
|
||||
rpc:"submit_error",
|
||||
data:{
|
||||
packet:_packet,
|
||||
msg:_msg,
|
||||
playerid:C_Player.playerid,
|
||||
agentid:GameData.AgentId,
|
||||
gameid:GameData.GameId
|
||||
}
|
||||
}
|
||||
console.log(_packet);
|
||||
console.log(_msg);
|
||||
try{
|
||||
Net.ws_tcp.send(JSON.stringify(msg));
|
||||
}catch(e){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//发送创建房间
|
||||
Net.Send_create_room = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.create_room,_data);
|
||||
}
|
||||
//接收创建房间
|
||||
Net.create_room = function(_msg){
|
||||
//Logic.CreateRoom(_msg.data);
|
||||
Desk.create_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
Game_Modify.createRoom(_msg.data.roomtype,_msg.data.infinite);
|
||||
if(Game_Modify.onCreateRoom){
|
||||
Game_Modify.onCreateRoom(_msg.data);
|
||||
}
|
||||
|
||||
}
|
||||
//发送登录请求
|
||||
Net.Send_login = function(_data){
|
||||
//console.log(returnCitySN);
|
||||
if(typeof returnCitySN != "undefined"){
|
||||
_data.ip = returnCitySN.cip;
|
||||
}
|
||||
if(ConstVal.isGameHall){
|
||||
if(!GameData.hallLogin){
|
||||
return ;
|
||||
}
|
||||
}
|
||||
_data.machineid = Logic.getMachineId();
|
||||
_data.machineroom = Utl.getRoomcode();
|
||||
//alert("进入Net.Send_login方法");
|
||||
GameUI.StartLoad();
|
||||
if(GameData.loginPlayerid){
|
||||
var _playerid = Logic.readPlayerId();
|
||||
if(_playerid){
|
||||
_data.playerid = _playerid;
|
||||
}
|
||||
}
|
||||
GameData.loginList.push(GameData.TcpID);
|
||||
//GameData.isChangeServer = false;
|
||||
//if(ConstVal.netType == 0){
|
||||
GameData.isSendLoginState = true;
|
||||
GameData.sendLoginTimes++;
|
||||
|
||||
if(!ConstVal.isGameHall){
|
||||
if(GameData.sendLoginTimer == null){
|
||||
GameData.isSendLoginTimer = setTimeout(function(){
|
||||
|
||||
|
||||
GameData.ConnectType = false;
|
||||
GameData.disType = true;
|
||||
GameData.NetType=1;
|
||||
GameUI.StartLoad();
|
||||
GameData.isClose = true;
|
||||
Net.ws_tcp.close();
|
||||
GameData.isCloseTimer = setInterval(function(){
|
||||
if(GameData.isClose){
|
||||
Net.ws_tcp.close();
|
||||
}
|
||||
},5000);
|
||||
},4000);
|
||||
}
|
||||
}else{
|
||||
/*
|
||||
if(GameData.sendLoginTimes >3){
|
||||
if(GameData.isSendLoginTimer){
|
||||
window.clearTimeout(GameData.isSendLoginTimer);
|
||||
GameData.isSendLoginTimer = null;
|
||||
}
|
||||
GameUI.EndLoad();
|
||||
GameUI.OpenKick("网络繁忙,请退出游戏,稍后登录!");
|
||||
return;
|
||||
}
|
||||
if(GameData.sendLoginTimer == null){
|
||||
GameData.isSendLoginTimer = setTimeout(function(){
|
||||
var data={};
|
||||
data.agentid = GameData.AgentId;
|
||||
data.openid = C_Player.openid;
|
||||
data.gameid = GameData.GameId;
|
||||
data.nickname = C_Player.nickname;
|
||||
data.avatar = C_Player.avatar;
|
||||
data.sex = C_Player.sex;
|
||||
data.province = C_Player.province;
|
||||
data.unionid=C_Player.unionid;
|
||||
data.city = C_Player.city;
|
||||
data.version = GameData.versionCode;
|
||||
data.channelid = GameData.ChannelId;
|
||||
data.marketid = GameData.marketID;
|
||||
},4000);
|
||||
}
|
||||
*/
|
||||
}
|
||||
//if(GameData.sendLoginTimes>=2){
|
||||
//if(GameData.isSendLoginTimer){
|
||||
//window.clearTimeout(GameData.isSendLoginTimer);
|
||||
//GameData.isSendLoginTimer = null;
|
||||
//}
|
||||
//if(GameData.isClose){
|
||||
//GameData.isClose = false;
|
||||
//window.clearTimeout(GameData.isCloseTimer);
|
||||
//}
|
||||
//if(GameData.sendLoginTimer){
|
||||
//window.clearTimeout(GameData.sendLoginTimer);
|
||||
//GameData.sendLoginTimer = null;
|
||||
//}
|
||||
//if(GameData.sendLoginTimer == null){
|
||||
//GameData.isSendLoginTimer = setTimeout(function(){
|
||||
|
||||
|
||||
//GameData.ConnectType = false;
|
||||
//GameData.disType = true;
|
||||
//GameData.NetType=1;
|
||||
//GameUI.StartLoad();
|
||||
//GameData.isClose = true;
|
||||
//Net.ws_tcp.close();
|
||||
//GameData.isCloseTimer = setInterval(function(){
|
||||
//if(GameData.isClose){
|
||||
//Net.ws_tcp.close();
|
||||
//}
|
||||
//},5000);
|
||||
//},4000);
|
||||
//}
|
||||
////GameUI.EndLoad();
|
||||
////GameUI.OpenKick("网络繁忙,请退出游戏,稍后登录!");
|
||||
//}
|
||||
Net._SendData(AppList.app,RouteList.agent,RpcList.player_login,_data);
|
||||
|
||||
}
|
||||
//接收登录
|
||||
Net.player_login = function(_msg){
|
||||
if(GameData.isSendLoginTimer){
|
||||
window.clearTimeout(GameData.isSendLoginTimer);
|
||||
GameData.isSendLoginTimer = null;
|
||||
}
|
||||
GameUI.EndLoad();
|
||||
Desk.login(_msg);
|
||||
|
||||
}
|
||||
|
||||
//发送玩家自己进入房间请求
|
||||
Net.Send_self_join_room = function(_data){
|
||||
GameUI.StartLoad();
|
||||
GameData.shortCode = _data.roomcode;
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.self_join_room,_data);
|
||||
}
|
||||
//接收玩家自己进入房间请求
|
||||
Net.self_join_room = function(_msg){
|
||||
|
||||
Desk.self_join_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
|
||||
//发送未开局之前房主自己解散房间
|
||||
Net.Send_self_break_room = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.self_break_room,_data);
|
||||
}
|
||||
//接收未开局之前房主自己解散房间
|
||||
Net.self_break_room = function(_msg){
|
||||
Desk.self_break_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
|
||||
//接收未开局之前他人房主解散房间
|
||||
Net.other_break_room = function(_msg){
|
||||
Desk.other_break_room(_msg);
|
||||
}
|
||||
//接收其他玩家加入房间
|
||||
Net.other_join_room = function(_msg){
|
||||
if(Logic.checkRoom()){
|
||||
return;
|
||||
}
|
||||
Desk.other_join_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//发送未开局之前自己退出房间
|
||||
Net.Send_self_exit_room = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.self_exit_room,_data);
|
||||
}
|
||||
//接收未开局之前自己退出房间
|
||||
Net.self_exit_room = function(_msg){
|
||||
GameUI.closeCheck();
|
||||
Desk.self_exit_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
|
||||
//接收未开局之前其他玩家退出房间
|
||||
Net.other_exit_room = function(_msg){
|
||||
if(Logic.checkRoom()){
|
||||
return;
|
||||
}
|
||||
Desk.other_exit_room(_msg);
|
||||
}
|
||||
//发送开局之后自己申请解散房间
|
||||
Net.Send_self_apply_free_room = function(_data){
|
||||
//GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.self_apply_free_room,_data);
|
||||
}
|
||||
//接收开局之后自己申请解散房间
|
||||
Net.self_apply_free_room = function(_msg){
|
||||
Desk.self_apply_free_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
|
||||
}
|
||||
//接收开局之后其他玩家申请解散房间
|
||||
Net.other_apply_free_room = function(_msg){
|
||||
Desk.other_apply_free_room(_msg);
|
||||
}
|
||||
//发送自己同意解散房间
|
||||
Net.Send_self_agree_free_room = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.self_agree_free_room,_data);
|
||||
}
|
||||
//接收自己同意解散房间
|
||||
Net.self_agree_free_room = function(_msg){
|
||||
Desk.self_agree_free_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//接收其他玩家同意解散房间
|
||||
Net.other_agree_free_room = function(_msg){
|
||||
Desk.other_agree_free_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//发送自己拒绝解散房间
|
||||
Net.Send_self_refuse_free_room = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.self_refuse_free_room,_data);
|
||||
}
|
||||
//接收自己拒绝解散房间
|
||||
Net.self_refuse_free_room = function(_msg){
|
||||
Desk.self_refuse_free_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//接收其他玩家拒绝解散房间
|
||||
Net.other_refuse_free_room = function(_msg){
|
||||
Desk.other_refuse_free_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//接收解散房间
|
||||
Net.free_room = function(_msg){
|
||||
Desk.free_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
|
||||
//发送获取战绩
|
||||
Net.Send_get_player_grade1 = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_player_grade1,_data);
|
||||
}
|
||||
//接收获取战绩
|
||||
Net.get_player_grade1 = function(_msg){
|
||||
gameCombat.get_player_grade1(_msg);
|
||||
GameUI.EndLoad();
|
||||
//Logic.SetCombatInfo(_msg.data);
|
||||
//GameUI.OpenCombat();
|
||||
|
||||
}
|
||||
//发送获取战绩2
|
||||
Net.Send_get_player_grade2 = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_player_grade2,_data);
|
||||
}
|
||||
//接收获取战绩2
|
||||
Net.get_player_grade2 = function(_msg){
|
||||
gameCombat.get_player_grade2(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
|
||||
//接收修改房卡
|
||||
Net.update_roomcard = function(_msg){
|
||||
if(typeof _msg.data.change == "undefined"){
|
||||
C_Player.UpdateRoomcard(_msg);
|
||||
}
|
||||
}
|
||||
|
||||
//接收其他玩家离线
|
||||
Net.other_offline = function(_msg){
|
||||
Desk.other_offline(_msg);
|
||||
}
|
||||
|
||||
//接收其他玩家上线
|
||||
Net.other_online = function(_msg){
|
||||
Desk.other_online(_msg);
|
||||
}
|
||||
|
||||
//发送发送聊天消息
|
||||
Net.Send_send_text = function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.send_text,_data);
|
||||
}
|
||||
//接收发送聊天消息
|
||||
Net.send_text = function(_msg){
|
||||
Desk.send_text(_msg);
|
||||
}
|
||||
|
||||
//发送获取任务列表
|
||||
Net.Send_get_player_task = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_player_task,_data);
|
||||
}
|
||||
//接收获取任务列表
|
||||
Net.get_player_task = function(_msg){
|
||||
Desk.get_player_task(_msg);
|
||||
//GameUI.SetTaskInfo(_msg);
|
||||
GameUI.EndLoad();
|
||||
|
||||
}
|
||||
//发送完成任务
|
||||
Net.Send_player_finish_task = function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.player_finish_task,_data);
|
||||
}
|
||||
//接收完成任务
|
||||
Net.player_finish_task = function(_msg){
|
||||
C_Player.player_finish_task(_msg);
|
||||
}
|
||||
//发送领取任务奖励
|
||||
Net.Send_get_task_award = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_task_award,_data);
|
||||
|
||||
}
|
||||
//接收领取任务奖励
|
||||
Net.get_task_award = function(_msg){
|
||||
C_Player.get_task_award(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//发送有任务可领取
|
||||
Net.Send_can_award = function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.refresh_task_state,_data);
|
||||
}
|
||||
//接收有任务可领取
|
||||
Net.can_award = function(_msg){
|
||||
C_Player.can_award(_msg);
|
||||
}
|
||||
//接收踢下线
|
||||
Net.kick_offline = function(_msg){
|
||||
Desk.kick_offline(_msg);
|
||||
}
|
||||
//发送自己打电话
|
||||
Net.Send_call_phone = function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.call_phone,_data);
|
||||
}
|
||||
//接收自己打电话
|
||||
Net.call_phone = function(_msg){
|
||||
Desk.call_phone(_msg);
|
||||
}
|
||||
|
||||
//发送自己挂断电话
|
||||
Net.Send_hangup_phone = function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.hangup_phone,_data);
|
||||
}
|
||||
//接自己收挂断打电话
|
||||
Net.hangup_phone = function(_msg){
|
||||
Desk.hangup_phone(_msg);
|
||||
}
|
||||
|
||||
//发送房主开局
|
||||
Net.Send_self_makewar = function(_data){
|
||||
//GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.self_makewar,_data);
|
||||
}
|
||||
//接收房主开局
|
||||
Net.self_makewar = function(_msg){
|
||||
Desk.self_makewar(_msg);
|
||||
//GameUI.EndLoad();
|
||||
}
|
||||
//接收房主开局
|
||||
Net.other_makewar = function(_msg){
|
||||
Desk.makewar(_msg);
|
||||
}
|
||||
//自己发送互动
|
||||
Net.Send_send_gift=function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.send_gift,_data);
|
||||
}
|
||||
Net.send_gift=function(_msg){
|
||||
Desk.send_gift(_msg);
|
||||
}
|
||||
|
||||
//自己发送语音
|
||||
Net.Send_send_voice=function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.send_voice,_data);
|
||||
}
|
||||
Net.send_voice=function(_msg){
|
||||
Desk.send_voice(_msg);
|
||||
}
|
||||
|
||||
//发送切换至房间服务器
|
||||
Net.Send_connect_roomserver=function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.connect_roomserver,_data);
|
||||
}
|
||||
Net.connect_roomserver=function(_msg){
|
||||
|
||||
GameData.ConnectType=true;
|
||||
GameData.disType =false;
|
||||
GameData.ConnectPack = _msg.data;
|
||||
GameData.ConnectRpc = RpcList.connect_roomserver;
|
||||
GameData.Server=_msg.data.roomserver;
|
||||
//Logic.Connect();
|
||||
Net.ws_tcp.close();
|
||||
}
|
||||
|
||||
//发送切换至大厅服务器
|
||||
Net.Send_connect_agentserver=function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.connect_agentserver,_data);
|
||||
}
|
||||
Net.connect_agentserver=function(_msg){
|
||||
if(_msg.data.opt == RpcList.other_break_room || _msg.data.opt == RpcList.free_room){
|
||||
GameUI.StartLoad();
|
||||
}
|
||||
GameData.ConnectType=true;
|
||||
GameData.disType =false;
|
||||
GameData.ConnectRpc = RpcList.connect_agentserver;
|
||||
GameData.ConnectPack = _msg.data;
|
||||
GameData.Server=_msg.data.agentserver;
|
||||
//Logic.Connect();
|
||||
Net.ws_tcp.close();
|
||||
}
|
||||
Net.Send_broadcast=function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.broadcast,_data);
|
||||
}
|
||||
//接收即时信息
|
||||
Net.broadcast=function(_msg){
|
||||
//
|
||||
Desk.broadcast(_msg);
|
||||
}
|
||||
//发送互动
|
||||
Net.Send_send_phiz=function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.send_phiz,_data);
|
||||
}
|
||||
//接收互动
|
||||
Net.send_phiz=function(_msg){
|
||||
Desk.send_phiz(_msg);
|
||||
}
|
||||
//提交反馈
|
||||
Net.Send_submit_opinion=function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.submit_opinion,_data);
|
||||
}
|
||||
//接收反馈
|
||||
Net.submit_opinion=function(_msg){
|
||||
Desk.submit_opinion(_msg);
|
||||
}
|
||||
//踢出玩家
|
||||
Net.Send_kick_server=function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.kick_server,_data);
|
||||
}
|
||||
Net.kick_server=function(_msg){
|
||||
Desk.kick_server(_msg);
|
||||
}
|
||||
//获取支付列表
|
||||
Net.Send_get_paylist=function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_paylist,_data);
|
||||
}
|
||||
//接收支付列表
|
||||
Net.get_paylist=function(_msg){
|
||||
GameData.payList = _msg.data.paylist;
|
||||
GameUI.OpenPay();
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
//支付成功后通知服务器
|
||||
Net.Send_pay_succ=function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.pay_succ,_data);
|
||||
}
|
||||
//提交位置信息
|
||||
Net.Send_submit_location=function(_data){
|
||||
if(!ConstVal.isGameHall){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.submit_location,_data);
|
||||
}
|
||||
}
|
||||
//提交位置信息
|
||||
Net.submit_location=function(_msg){
|
||||
Game.submit_location(_msg);
|
||||
}
|
||||
//发送绑定
|
||||
Net.Send_binding_invitecode=function(_data){
|
||||
//GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.binding_invitecode,_data);
|
||||
}
|
||||
//接收绑定
|
||||
Net.binding_invitecode=function(_msg){
|
||||
//GameUI.EndLoad();
|
||||
C_Player.binding_invitecode(_msg);
|
||||
}
|
||||
|
||||
//接收修改豆豆
|
||||
Net.update_bean = function(_msg){
|
||||
//C_Player.update_bean(_msg);
|
||||
Desk.update_bean(_msg);
|
||||
}
|
||||
|
||||
Net.Send_get_player_invitecode = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_player_invitecode,_data);
|
||||
}
|
||||
Net.get_player_invitecode = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
C_Player.setInvitecod(_msg.data.invitecode);
|
||||
GameUI.OpenBind();
|
||||
}
|
||||
|
||||
Net.Send_beanroom_surrender = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.beanroom_surrender,_data);
|
||||
}
|
||||
Net.beanroom_surrender = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
GameUI.closeCheck();
|
||||
if(_msg.data.state==0){
|
||||
Game_Modify.onSurrender(_msg);
|
||||
}else{//失败
|
||||
if(_msg.data.showerror==1){
|
||||
GameUI.OpenTips(_msg.data.error);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Net.Send_player_prepare = function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.player_prepare,_data);
|
||||
}
|
||||
Net.player_prepare = function(_msg){
|
||||
Desk.player_prepare(_msg);
|
||||
}
|
||||
Net.Send_share_room = function(_data){
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.share_room,_data);
|
||||
}
|
||||
Net.share_room = function(_msg){
|
||||
Desk.share_room(_msg);
|
||||
}
|
||||
Net.Send_get_share_room = function(_data){
|
||||
if(!ConstVal.isGameHall){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_share_room,_data);
|
||||
}
|
||||
|
||||
}
|
||||
Net.get_share_room = function(_msg){
|
||||
Desk.get_share_room(_msg);
|
||||
GameUI.EndLoad();
|
||||
}
|
||||
Net.Send_quick_enter_share_room = function(_data){
|
||||
console.log(_data);
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.quick_enter_share_room,_data);
|
||||
}
|
||||
Net.show_message = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.show_message(_msg);
|
||||
}
|
||||
Net.Send_advanced_roomlist = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.advanced_roomlist,_data);
|
||||
|
||||
}
|
||||
Net.advanced_roomlist = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.advanced_roomlist(_msg);
|
||||
}
|
||||
Net.Send_advanced_createroom = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.advanced_createroom,_data);
|
||||
|
||||
}
|
||||
Net.advanced_createroom = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.advanced_createroom(_msg);
|
||||
}
|
||||
Net.Send_change_room = function(_data){
|
||||
//GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.room,RpcList.change_room,_data);
|
||||
}
|
||||
Net.change_seat = function(_msg){
|
||||
Desk.change_seat(_msg);
|
||||
}
|
||||
//财富榜
|
||||
Net.Send_get_treasurelist = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.get_treasurelist,_data);
|
||||
}
|
||||
//财富榜
|
||||
Net.get_treasurelist = function(_msg){
|
||||
Desk.get_treasurelist(_msg);
|
||||
GameUI.EndLoad();
|
||||
|
||||
}
|
||||
//设置仓库密码
|
||||
Net.Send_set_bankpwd = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.set_bankpwd,_data);
|
||||
}
|
||||
Net.set_bankpwd = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.set_bankpwd(_msg);
|
||||
}
|
||||
|
||||
//更改仓库星星
|
||||
Net.Send_change_star = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.change_star,_data);
|
||||
}
|
||||
Net.change_star = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.change_star(_msg);
|
||||
}
|
||||
|
||||
//提交手机信息
|
||||
Net.Send_submit_phoneinfo = function(_data){
|
||||
if(!ConstVal.isGameHall){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.submit_phoneinfo,_data);
|
||||
}
|
||||
}
|
||||
Net.submit_phoneinfo = function(_msg){
|
||||
//GameData.submitPhoneInfo = true;
|
||||
|
||||
}
|
||||
//提交手机信息
|
||||
Net.Send_update_charm = function(_data){
|
||||
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.update_charm,_data);
|
||||
}
|
||||
Net.update_charm = function(_msg){
|
||||
//GameData.submitPhoneInfo = true;
|
||||
Desk.update_charm(_msg);
|
||||
|
||||
}
|
||||
Net.Send_setSign = function(_data){
|
||||
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.setSign,_data);
|
||||
}
|
||||
Net.setSign = function(_msg){
|
||||
C_Player.setSign(_msg.data.sign);
|
||||
//GameUI.setSign(_msg.data.sign);
|
||||
}
|
||||
Net.Send_switchRoomList = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.switchRoomList,_data);
|
||||
}
|
||||
Net.switchRoomList = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.switchRoomList(_msg);
|
||||
//GameUI.setSign(_msg.data.sign);
|
||||
}
|
||||
|
||||
Net.Send_getInfoByShortCode = function(_data){
|
||||
//GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.getInfoByShortCode,_data);
|
||||
}
|
||||
Net.getInfoByShortCode = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.getInfoByShortCode(_msg);
|
||||
}
|
||||
Net.Send_optBanList = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.optBanList,_data);
|
||||
}
|
||||
Net.optBanList = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.optBanList(_msg);
|
||||
}
|
||||
Net.Send_getShortCodeRankList = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.getShortCodeRankList,_data);
|
||||
}
|
||||
Net.getShortCodeRankList = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.getShortCodeRankList(_msg);
|
||||
}
|
||||
|
||||
Net.Send_setAllCharm = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.setAllCharm,_data);
|
||||
}
|
||||
Net.setAllCharm = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.setAllCharm(_msg);
|
||||
}
|
||||
|
||||
Net.Send_getVipRankList = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.getVipRankList,_data);
|
||||
}
|
||||
Net.getVipRankList = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.getVipRankList(_msg);
|
||||
}
|
||||
|
||||
Net.Send_playerBehavior = function(tag){
|
||||
//GameUI.StartLoad();
|
||||
/*
|
||||
var _data={};
|
||||
_data.agentid = GameData.AgentId;
|
||||
_data.gameid = GameData.GameId;
|
||||
_data.playerid = C_Player.playerid;
|
||||
_data.tag = tag;
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.playerBehavior,_data);
|
||||
*/
|
||||
var url = "http://test3.1888day.com/api/gamedo/gamedo";
|
||||
var cfg = {};
|
||||
cfg.url = url;
|
||||
cfg.type = "GET";
|
||||
cfg.data = "agentid="+GameData.AgentId+"&gameid="+GameData.GameId+"&playerid="+C_Player.playerid+"&tag="+tag;
|
||||
|
||||
cfg.success = playerBehavior_Succ;
|
||||
cfg.error = playerBehavior_Fail;
|
||||
min_http(cfg);
|
||||
|
||||
}
|
||||
var playerBehavior_Succ = function(_msg,state,input_msg){
|
||||
console.log("Succ");
|
||||
console.log(_msg,state,input_msg);
|
||||
}
|
||||
var playerBehavior_Fail = function(_msg,state,input_msg){
|
||||
console.log("Fail");
|
||||
console.log(_msg,state,input_msg);
|
||||
}
|
||||
Net.playerBehavior = function(_msg){
|
||||
//GameUI.EndLoad();
|
||||
Desk.playerBehavior(_msg);
|
||||
}
|
||||
Net.Send_binding_phone = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.binding_phone,_data);
|
||||
}
|
||||
Net.binding_phone = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.binding_phone(_msg);
|
||||
}
|
||||
Net.Send_send_phone_checkcode = function(_data){
|
||||
//GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.send_phone_checkcode,_data);
|
||||
}
|
||||
Net.send_phone_checkcode = function(_msg){
|
||||
//GameUI.EndLoad();
|
||||
Desk.send_phone_checkcode(_msg);
|
||||
}
|
||||
|
||||
Net.Send_setVipForbidSelect = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.setVipForbidSelect,_data);
|
||||
}
|
||||
Net.setVipForbidSelect = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.setVipForbidSelect(_msg);
|
||||
}
|
||||
Net.Send_topup_card = function(_data){
|
||||
console.log(_data);
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.topup_card,_data);
|
||||
}
|
||||
Net.topup_card = function(_msg){
|
||||
Desk.topup_card(_msg);
|
||||
}
|
||||
Net.Send_query_player2 = function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.query_player2,_data);
|
||||
}
|
||||
Net.query_player2 = function(_msg){
|
||||
Desk.query_player2(_msg);
|
||||
}
|
||||
Net.Send_giveCoin = function(_data){
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.giveCoin,_data);
|
||||
}
|
||||
Net.giveCoin = function(_msg){
|
||||
Desk.giveCoin(_msg);
|
||||
}
|
||||
Net.Send_getPlayerWhiteList = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.getPlayerWhiteList,_data);
|
||||
}
|
||||
Net.getPlayerWhiteList = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.getPlayerWhiteList(_msg);
|
||||
}
|
||||
Net.Send_optWhiteList = function(_data){
|
||||
GameUI.StartLoad();
|
||||
this._SendData(AppList.app,RouteList.agent,RpcList.optWhiteList,_data);
|
||||
}
|
||||
Net.optWhiteList = function(_msg){
|
||||
GameUI.EndLoad();
|
||||
Desk.optWhiteList(_msg);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,610 @@
|
||||
var Game=Game||{};
|
||||
|
||||
Game.submit_location = function(_msg){
|
||||
GameData.submitLocation = true;
|
||||
if(_msg.data.wechat_gzh){
|
||||
GameData.wechat_gzh = _msg.data.wechat_gzh;
|
||||
set_self(340,41,0,0,0);
|
||||
set_self(340,7,GameData.wechat_gzh,0,0);
|
||||
set_self(339,20,GameData.wechat_gzh.gblen()*13,0,0);
|
||||
set_self(340,18,get_self(16,18,0,0,0)+get_self(16,20,0,0,0)/2-GameData.wechat_gzh.gblen()*6.5,0,0);
|
||||
set_self(339,18,get_self(16,18,0,0,0)+get_self(16,20,0,0,0)/2-GameData.wechat_gzh.gblen()*6.5,0,0);
|
||||
}
|
||||
if(_msg.data.wechat_ewm){
|
||||
GameData.wechat_ewm=_msg.data.wechat_ewm;
|
||||
}
|
||||
if(_msg.data.wechat_kfh){
|
||||
GameData.wechat_kfh=_msg.data.wechat_kfh;
|
||||
set_self(179,7,GameData.wechat_kfh,0,0);
|
||||
}
|
||||
if(_msg.data.qq){
|
||||
GameData.qq=_msg.data.qq;
|
||||
set_self(682,7,GameData.qq,0,0);
|
||||
}
|
||||
if(_msg.data.tel){
|
||||
GameData.tel=_msg.data.tel;
|
||||
set_self(GameData.telSpid,20,String(GameData.tel).gblen()*14,0,0);
|
||||
set_self(GameData.telSpid,7,GameData.tel,0,0);
|
||||
}
|
||||
if(_msg.data.invitecode){
|
||||
C_Player.setInvitecod(_msg.data.invitecode);
|
||||
GameUI.CloseBind();
|
||||
}
|
||||
|
||||
}
|
||||
//游戏其他信息
|
||||
//Game.mainSceneInfo = {};
|
||||
var recorderManager;
|
||||
var innerAudioContext1;
|
||||
|
||||
/**
|
||||
* ?????????? mdata ??????
|
||||
* openId,avatarUrl,nickName, gender, city, province, unionId
|
||||
*/
|
||||
function getwxuserinfo(mdata) {
|
||||
sharelogin(mdata.openId,mdata.avatarUrl,mdata.nickName,mdata.gender,mdata.city,mdata.province,mdata.unionId)
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* ????????
|
||||
*/
|
||||
function wxgameshow(mdata) {
|
||||
appservice(1);
|
||||
}
|
||||
/**
|
||||
* ????????
|
||||
*/
|
||||
function wxgamehide(mdata) {
|
||||
appservice(2);
|
||||
}
|
||||
/**
|
||||
* ?????? state ???? 1 ?? 2 ??
|
||||
*/
|
||||
function sharegameinfo(state) {
|
||||
//if (state == 1) {
|
||||
|
||||
//}
|
||||
//if (state == 2) {
|
||||
|
||||
//}
|
||||
state = Number(state);
|
||||
//type = Number(type);
|
||||
C_Player.sharesuccess(state,1);
|
||||
|
||||
|
||||
}
|
||||
//Recorderload();
|
||||
|
||||
|
||||
/**
|
||||
* ???????
|
||||
*/
|
||||
function Recorderload(){
|
||||
if(!innerAudioContext1){
|
||||
innerAudioContext1 = wx.createInnerAudioContext();
|
||||
}
|
||||
var that = this;
|
||||
recorderManager=wx.getRecorderManager()
|
||||
recorderManager.onError(function(){
|
||||
|
||||
console.log("????!");
|
||||
});
|
||||
recorderManager.onStop(function(res){
|
||||
|
||||
console.log(res.tempFilePath );
|
||||
|
||||
console.log("????!");
|
||||
//playRecord(res.tempFilePath);
|
||||
getaudiourl(res.tempFilePath,5);
|
||||
});
|
||||
|
||||
|
||||
//innerAudioContext1.onError((res) => {
|
||||
//console.log("??????!");
|
||||
|
||||
//})
|
||||
//innerAudioContext1.onEnded((res) => {
|
||||
//console.log("??????!");
|
||||
//})
|
||||
innerAudioContext1.onError(function(res){
|
||||
console.log("??????!");
|
||||
|
||||
})
|
||||
innerAudioContext1.onEnded(function(res){
|
||||
console.log("??????!");
|
||||
})
|
||||
}
|
||||
/**
|
||||
* ??????????
|
||||
*/
|
||||
function isxiaowxgame(){
|
||||
var iswxgame;
|
||||
try{
|
||||
var recorderManager = wx.getRecorderManager();
|
||||
iswxgame=true;
|
||||
}catch(e){
|
||||
iswxgame=false;
|
||||
}
|
||||
return iswxgame;
|
||||
|
||||
}
|
||||
function wxauthorize(){
|
||||
|
||||
}
|
||||
/**
|
||||
* ????
|
||||
*/
|
||||
function startRecordAac (){
|
||||
console.log("开始录音");
|
||||
recorderManager.start({
|
||||
format: 'aac'
|
||||
});
|
||||
// wx.authorize({
|
||||
// scope: 'scope.record',
|
||||
// fail: function (res) {
|
||||
// // iOS ? Android ????????? errMsg ????,?????????
|
||||
// console.log("????");
|
||||
// console.log(res);
|
||||
// if (res.errMsg.indexOf('auth deny') > -1 || res.errMsg.indexOf('fail') > -1 || res.errMsg.indexOf('auth denied') > -1 ) {
|
||||
// // ???????????
|
||||
// console.log("????");
|
||||
// wx.showModal({
|
||||
// title: '??',
|
||||
// content: '??????????????????->??(?????)->?????->??',
|
||||
// showCancel:false,
|
||||
// success: function (res) {
|
||||
// if (res.confirm) {
|
||||
// console.log('??????')
|
||||
// } else if (res.cancel) {
|
||||
// console.log('??????')
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
// }
|
||||
// },
|
||||
// success:function (res) {
|
||||
// console.log("????");
|
||||
// recorderManager.start({
|
||||
// format: 'aac'
|
||||
// });
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
}
|
||||
/**
|
||||
* ????
|
||||
*/
|
||||
|
||||
function stopRecord (){
|
||||
console.log("结束录音");
|
||||
// wx.authorize({
|
||||
// scope: 'scope.record',
|
||||
// fail: function (res) {
|
||||
// console.log("fail????");
|
||||
// },
|
||||
// success:function (res) {
|
||||
// console.log("stop????");
|
||||
|
||||
// }
|
||||
// })
|
||||
recorderManager.stop()
|
||||
}
|
||||
/***
|
||||
* ????
|
||||
*/
|
||||
function playRecord (src) {
|
||||
if(!innerAudioContext1){
|
||||
innerAudioContext1 = wx.createInnerAudioContext();
|
||||
}
|
||||
//var that = this;
|
||||
// var src = this.data.src;
|
||||
if (src == '') {
|
||||
console.log("????!");
|
||||
return;
|
||||
}
|
||||
innerAudioContext1.src = src;
|
||||
innerAudioContext1.play()
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var Wxloginbutton;
|
||||
/**
|
||||
* ?????
|
||||
*/
|
||||
function initwxgame() {
|
||||
gameshow();
|
||||
gamehide();
|
||||
}
|
||||
//initwxgame();
|
||||
/**
|
||||
* ???????
|
||||
*/
|
||||
//function gameshow() {
|
||||
//wx.onShow(data => {
|
||||
//console.log("******" + data)
|
||||
//console.log(data)
|
||||
//wxgameshow(data);
|
||||
|
||||
//});
|
||||
//}
|
||||
function gameshow() {
|
||||
wx.onShow(function(data){
|
||||
console.log("******" + data)
|
||||
console.log(data)
|
||||
wxgameshow(data);
|
||||
|
||||
});
|
||||
}
|
||||
/**
|
||||
* ???????
|
||||
*/
|
||||
//function gamehide() {
|
||||
//wx.onHide(data => {
|
||||
//wxgamehide(data)
|
||||
|
||||
//});
|
||||
//}
|
||||
function gamehide() {
|
||||
wx.onHide(function(data){
|
||||
wxgamehide(data)
|
||||
|
||||
});
|
||||
}
|
||||
/*
|
||||
* ?????????
|
||||
* wxgamew ?????? wxgameh ?????? imagex ???????? imagey ???????? imagew???? imageh ???? btnimageurl ????
|
||||
*/
|
||||
function WXgameloginbuttonshow(wxgamew, wxgameh, imagex, imagey, imagew, imageh, btnimageurl) {
|
||||
|
||||
var winh, winw;
|
||||
try {
|
||||
|
||||
|
||||
wx.getSystemInfo({
|
||||
success: function (res) {
|
||||
console.log(res.model)
|
||||
console.log(res.pixelRatio)
|
||||
console.log(res.windowWidth)
|
||||
console.log(res.windowHeight)
|
||||
winh = res.windowHeight;
|
||||
winw = res.windowWidth;
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
var sh = winh / wxgameh;
|
||||
var sw = winw / wxgamew;
|
||||
console.log("sw=" + sw + "sh=" + sh);
|
||||
|
||||
imagew = parseInt(imagew * sw);
|
||||
imageh = parseInt(imageh * sh);
|
||||
imagex = parseInt(imagex * sw);
|
||||
imagey = parseInt(imagey * sh);;
|
||||
|
||||
|
||||
if (wx.createUserInfoButton) {
|
||||
|
||||
|
||||
if (Wxloginbutton) {
|
||||
console.log("??button");
|
||||
Wxloginbutton.show();
|
||||
Wxloginbutton.offTap();//????????
|
||||
|
||||
} else {
|
||||
|
||||
console.log("????button");
|
||||
// console.log(document.title);
|
||||
|
||||
Wxloginbutton = wx.createUserInfoButton({
|
||||
type: 'image',
|
||||
image: btnimageurl,
|
||||
style: {
|
||||
left: imagex,
|
||||
top: imagey,
|
||||
width: imagew,
|
||||
height: imageh
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
//Wxloginbutton.onTap((res) => {
|
||||
|
||||
|
||||
//console.log(res)
|
||||
//if (res.errMsg.indexOf('auth deny') > -1 || res.errMsg.indexOf('auth denied') > -1 || res.errMsg.indexOf('fail') > -1 ) {
|
||||
//wx.showModal({
|
||||
//title: '??',
|
||||
//content: '??????????????????->??(?????)->?????->??',
|
||||
//showCancel: false,
|
||||
//success: function (res) {
|
||||
//if (res.confirm) {
|
||||
//console.log('??????')
|
||||
//} else if (res.cancel) {
|
||||
//console.log('??????')
|
||||
//}
|
||||
//}
|
||||
//})
|
||||
//} else {
|
||||
//WXgameLogin(res);
|
||||
//}
|
||||
//})
|
||||
Wxloginbutton.onTap(function(res){
|
||||
|
||||
|
||||
console.log(res)
|
||||
if (res.errMsg.indexOf('auth deny') > -1 || res.errMsg.indexOf('auth denied') > -1 || res.errMsg.indexOf('fail') > -1 ) {
|
||||
wx.showModal({
|
||||
title: '??',
|
||||
content: '??????????????????->??(?????)->?????->??',
|
||||
showCancel: false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('??????')
|
||||
} else if (res.cancel) {
|
||||
console.log('??????')
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
WXgameLogin(res);
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
// ???????????????????????,???????
|
||||
console.log("????????");
|
||||
wx.showModal({
|
||||
title: '??',
|
||||
content: '????????,???????,??????????????',
|
||||
showCancel:false,
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('??????')
|
||||
} else if (res.cancel) {
|
||||
console.log('??????')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
}
|
||||
/**
|
||||
* ????????
|
||||
*/
|
||||
function WXgameloginbuttonhide() {
|
||||
if (Wxloginbutton) {
|
||||
Wxloginbutton.hide();
|
||||
}
|
||||
}
|
||||
|
||||
function Decrypt(key, iv, word) {
|
||||
// var openDataContext = wx.getOpenDataContext()
|
||||
// openDataContext.postMessage({
|
||||
// text: 'hello',
|
||||
// year: (new Date()).getFullYear()
|
||||
// })
|
||||
|
||||
var murl = "https://games.tscce.cn/wechatsmallgame/encrypt.php";
|
||||
var date = {};
|
||||
date.key = encodeURIComponent(key);
|
||||
date.type = "decrypt";
|
||||
date.iv = encodeURIComponent(iv);
|
||||
date.data = encodeURIComponent(word);
|
||||
|
||||
|
||||
wx.request({
|
||||
url: murl,
|
||||
data: date,
|
||||
method: 'POST',
|
||||
header: {
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.statusCode == 200) {
|
||||
|
||||
if (res.data) {
|
||||
var mdata = decodeURIComponent(res.data);
|
||||
console.log('??------' + mdata)
|
||||
mdata = JSON.parse(mdata);
|
||||
|
||||
try {
|
||||
console.log("??");
|
||||
Wxloginbutton.hide();
|
||||
console.log("Wxloginbutton??");
|
||||
getwxuserinfo(mdata);
|
||||
} catch (e) {
|
||||
|
||||
}
|
||||
|
||||
// sharelogin(mdata.openId, mdata.avatarUrl, mdata.nickName, mdata.gender, mdata.city, mdata.province, mdata.unionId);
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
console.log('??!res.statusCode' + res.statusCode)
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('??!')
|
||||
}
|
||||
});
|
||||
}
|
||||
function WXgameLogin(uesrdata) {
|
||||
|
||||
// ??
|
||||
wx.login({
|
||||
|
||||
//success: res => {
|
||||
|
||||
//if (res.code) {
|
||||
//var murl = "https://games.tscce.cn/wechatsmallgame/code2accessToken.php?appid=wxaeeca8ffffa94105" +"&secret=639a292164680d4cd87a024edae21f41"+"&js_code="+res.code;
|
||||
|
||||
//console.log("????res.code=" + res.code);
|
||||
//wx.request({
|
||||
//url: murl,
|
||||
//method: 'GET',
|
||||
//header: {
|
||||
//'content-type': 'application/json'
|
||||
//},
|
||||
//success: function (res) {
|
||||
//console.log('??' + JSON.stringify(res));
|
||||
//console.log('res.statusCode' + res.statusCode);
|
||||
//if (res.statusCode == 200) {
|
||||
//var openid = res.data.openid;
|
||||
//var unionid = res.data.unionid;
|
||||
//var session_key = res.data.session_key;
|
||||
//Decrypt(session_key, uesrdata.iv, uesrdata.encryptedData);
|
||||
|
||||
//} else {
|
||||
//console.log('??!res.statusCode' + res.statusCode)
|
||||
//}
|
||||
//},
|
||||
//fail: function (res) {
|
||||
//console.log('??!')
|
||||
//}
|
||||
//});
|
||||
//}
|
||||
|
||||
//}
|
||||
success: function(res){
|
||||
|
||||
if (res.code) {
|
||||
var murl = "https://games.tscce.cn/wechatsmallgame/code2accessToken.php?appid=wxaeeca8ffffa94105" +"&secret=639a292164680d4cd87a024edae21f41"+"&js_code="+res.code;
|
||||
|
||||
console.log("????res.code=" + res.code);
|
||||
wx.request({
|
||||
url: murl,
|
||||
method: 'GET',
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
},
|
||||
success: function (res) {
|
||||
console.log('??' + JSON.stringify(res));
|
||||
console.log('res.statusCode' + res.statusCode);
|
||||
if (res.statusCode == 200) {
|
||||
var openid = res.data.openid;
|
||||
var unionid = res.data.unionid;
|
||||
var session_key = res.data.session_key;
|
||||
Decrypt(session_key, uesrdata.iv, uesrdata.encryptedData);
|
||||
|
||||
} else {
|
||||
console.log('??!res.statusCode' + res.statusCode)
|
||||
}
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('??!')
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
/**
|
||||
* ?????????
|
||||
*/
|
||||
function initgameshareinfo(sharetitle, shareimageurl) {
|
||||
wx.showShareMenu({ withShareTicket: true });
|
||||
//wx.onShareAppMessage(data => {
|
||||
//return {
|
||||
//title: sharetitle,
|
||||
//imageUrl: shareimageurl,
|
||||
//query: '',
|
||||
//success: function (res) {
|
||||
//console.log(res);
|
||||
//console.log('??????');
|
||||
//sharegameinfo(1);
|
||||
//},
|
||||
//fail: function (res) {
|
||||
//console.log('??????');
|
||||
//console.log(res);
|
||||
//sharegameinfo(2);
|
||||
//}
|
||||
//}
|
||||
//})
|
||||
wx.onShareAppMessage(function(data){
|
||||
return {
|
||||
title: sharetitle,
|
||||
imageUrl: shareimageurl,
|
||||
query: '',
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
console.log('??????');
|
||||
sharegameinfo(1);
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('??????');
|
||||
console.log(res);
|
||||
sharegameinfo(2);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
/**
|
||||
* ?????????
|
||||
*/
|
||||
function hidegameshareinfo(sharetitle, shareimageurl) {
|
||||
wx.hideShareMenu();
|
||||
|
||||
}
|
||||
/**
|
||||
* ??????
|
||||
*/
|
||||
function Pullupgameshare(sharetitle, shareimageurl) {
|
||||
wx.shareAppMessage({
|
||||
title: sharetitle,
|
||||
imageUrl: shareimageurl,
|
||||
query: "",
|
||||
success: function (res) {
|
||||
console.log(res);
|
||||
console.log('??????');
|
||||
sharegameinfo(1);
|
||||
|
||||
},
|
||||
fail: function (res) {
|
||||
console.log('??????');
|
||||
console.log(res);
|
||||
sharegameinfo(2);
|
||||
}
|
||||
});
|
||||
}
|
||||
/**
|
||||
* ???????
|
||||
*/
|
||||
function createGameClubButtonimage(mleft, mtop, mwidth, mheight) {
|
||||
var button = wx.createGameClubButton({
|
||||
type: 'image',
|
||||
icon: 'green',
|
||||
style: {
|
||||
left: mleft,
|
||||
top: mtop,
|
||||
width: mwidth,
|
||||
height: mheight
|
||||
}
|
||||
})
|
||||
}
|
||||
// var button = wx.createGameClubButton({
|
||||
// type: 'text',
|
||||
// icon: 'green',
|
||||
// style: {
|
||||
// left: 10,
|
||||
// top: 76,
|
||||
// width: 40,
|
||||
// height: 40
|
||||
// }
|
||||
// })
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
2371
codes/games/client/Projects/Game_Surface_3/js/00_Surface/12_Logic.js
Normal file
2371
codes/games/client/Projects/Game_Surface_3/js/00_Surface/12_Logic.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,140 @@
|
||||
var Game_Config = Game_Config||{};//相关配置
|
||||
Game_Config.Debugger={//调试配置
|
||||
isDebugger : true,// debugger模式下会将所有收发的包输出到控制台(正式发布改为false)
|
||||
AutoLogin : true,//debugger模式下是否需要记住登录状态自动登录(正式发布改为true)
|
||||
isSubmitError : false,//是否需要服务器收集错误信息调试时可根据需要(正式发布改为true)
|
||||
visitorLogin : true,//隐藏式游客登录
|
||||
visiblePay:true,//审核通过后是否显示支付按钮
|
||||
serverType:0,//0->正式服务器 1->本地服务器 http://ylyxservice1.0791ts.cn/config/update_json.txt
|
||||
//gameserver:"http://testgame.youlehdyx.com/update_json/ceshi_json.txt"+"?"+ifast_random(100000)
|
||||
//gameserver:"https://gameotherwork.ld2sw.cn/update_json/update_json_haiwai.txt"+"?"+ifast_random(100000)
|
||||
gameserver:"http://ylyxservice1.0791ts.cn/config/update_json.txt"+"?"+ifast_random(100000)
|
||||
|
||||
};
|
||||
|
||||
Game_Config.Max = {
|
||||
SumOfRoomtype:3,//创建时房间类型roomtype数组长度
|
||||
ShowChat:2000,//聊天停留时间
|
||||
PlayerCnt:10,//房间最大人数
|
||||
group:500,//游戏最大群组号
|
||||
showtime:10,//加载等待最少时间
|
||||
reconnecttime:30000,//唤醒游戏间隔(超过间隔断线重连)
|
||||
Mainnickname:10,//主界面玩家昵称显示长度(字符长度)
|
||||
Infonickname:16//个人信息显示长度(字符长度)
|
||||
};
|
||||
Game_Config.Combat = {
|
||||
height:80,//战绩页单行高度高度
|
||||
up_y:190,//战绩页裁剪y坐标
|
||||
bannerheight:60,//战绩横幅高度
|
||||
bannery:80,//战绩横幅Y左边(相对48精灵)
|
||||
btnbg:50
|
||||
};
|
||||
Game_Config.Info = {
|
||||
Mainnickname:8,//游戏主界面玩家信息显示最大长度(字符)
|
||||
textwidth_1:12.5,//昵称文字显示的宽度(未改动聊天显示文字大小无需改动无需修改)
|
||||
textwidth_2:12.5,//积分文字显示的宽度(未改动聊天显示文字大小无需改动无需修改)
|
||||
otherPositionDefault:true,//其他主界面玩家信息(昵称、积分)是否采用默认对齐方式对齐居中点为头像中点
|
||||
myPositionDefault:true,//其他主界面玩家信息(昵称、积分)是否采用默认对齐方式对齐居中点为头像中点
|
||||
myPosition:130,//自己信息对齐点(根据游戏界面自行修改)
|
||||
position:[],//其他主界面玩家信息(昵称、积分)居中对齐的x坐标 注意是其他玩家不包括自己从下家开始
|
||||
//TextContent:["1","2","3","4","5","6","7"],//常用语内容
|
||||
TextContent:["你好","2","3","4","5","6","7"],//常用语内容
|
||||
TextContentMp3:["","","","","","",""],//常用语对应音效
|
||||
};
|
||||
Game_Config.Share={//分享参数
|
||||
appdownload:"",//下载链接(无需配置,从服务器获取)
|
||||
title:"Test",//(分享标题)
|
||||
description:"hello world",//分享描述
|
||||
gameTitle:"",//游戏中的分享标题模板工程会自动将游戏名字分享出去、不必写在这个变量里
|
||||
gameDescription:""//游戏中分享描述
|
||||
};
|
||||
Game_Config.Chat={//游戏内聊天配置信息
|
||||
LimitLength:40,//聊天最大长度(字节长度)
|
||||
textwidth:12.5,//聊天显示文字的宽度(未改动聊天显示文字大小无需改动无需修改)
|
||||
ChatDis:[30,12],//聊天气泡与内容的间隔0位置左右间隔(最好不要低于30)1位置上下间隔
|
||||
isLeft:[1,0,0,1,1],//聊天气泡是否为以左边为基准线
|
||||
ChatLoc:[[35,517],[1100,315],[1100,105],[175,105],[175,315]]//聊天气泡的基准点位置(注意是基准点位置!)
|
||||
|
||||
};
|
||||
Game_Config.Voice={//游戏内聊天配置信息
|
||||
VoiceTime:600,//播放语音动画的时间一般情况无需无需修改
|
||||
VoiceDis:[30,12],//语音气泡与内容的间隔0位置左右间隔(最好不要低于30)1位置上下间隔
|
||||
isLeft:[1,0,0,1,1],//气泡是否为以左边为基准线
|
||||
VoiceLoc:[[35,517],[1100,315],[1100,105],[175,105],[175,315]]//气泡的基准点位置(注意是基准点位置!)
|
||||
};
|
||||
Game_Config.Setting={
|
||||
Ads1:"本游戏仅为娱乐休\n闲使用,道具所有\n 游戏通用\n\n游戏问题请联系微\n 信公众号:\n",
|
||||
//Ads2:"\n 或客服号:\n",
|
||||
board:"",//从后台获取设置无效
|
||||
//info:[" 客服信息","QQ:","",""],//客服QQ提醒
|
||||
info:[" 客服信息","QQ:","手机:","微信:"],//客服QQ提醒
|
||||
board_blength:24,//通知页面一行最大字节数(无需设置)
|
||||
charge:"关注友乐微信公众号充值",//充值提示
|
||||
};
|
||||
Game_Config.Protocol={
|
||||
x:270,//协议图片初始x坐标
|
||||
y:70,//协议图片初始y坐标
|
||||
h:560,//协议图片显示高度
|
||||
w:729//协议图片显示宽度
|
||||
};
|
||||
Game_Config.Help={//帮助
|
||||
x:300,//帮助图片初始x坐标
|
||||
y:165,//帮助图片初始y坐标
|
||||
w:729,//帮助图片显示高度
|
||||
h:450//帮助图片显示宽度
|
||||
};
|
||||
Game_Config.Notice={//滚动公告
|
||||
x1:0,//无需设置
|
||||
x2:0,//无需设置
|
||||
y:0,//无需设置
|
||||
h:0,//无需设置
|
||||
//以上参数用来截取滚动公告的显示,截取位置是与滚动公告底大小位置一致
|
||||
speed:0.1,//滚动公告的滚动速度
|
||||
width:15//滚动公告的内容字体的字节长度(汉字是两个字节)
|
||||
};
|
||||
Game_Config.Feedback = {//反馈配置
|
||||
maxLen:250 //反馈内容最大长度
|
||||
};
|
||||
Game_Config.shakeList ={//摇一摇事件的回调ID、需要添加时在此处添加回调事件写在Utl_Input.js中的Utl.shakeEvent()中
|
||||
nil:0,
|
||||
startwar:1
|
||||
};
|
||||
Game_Config.soundList ={//声音资源名
|
||||
MenuSceneMusic:"",//大厅界面背景音
|
||||
MainSceneMusic:""//游戏主界面背景音
|
||||
};
|
||||
Game_Config.ClickButton = {//需要设置点击音效的按钮(只有有弹窗的按钮设置此音效有效、按钮已经设置好、子游戏不允许修改)
|
||||
src_1:"",//点击时播放的声音资源文件( 不需要播放则不填,下同)
|
||||
src_2:""//弹窗时播放的音效
|
||||
}
|
||||
|
||||
Game_Config.loginButton = {//登录按钮信息
|
||||
x1:415,//非审核版本微信登录按钮x
|
||||
x2:113,//审核版本微信登录按钮x
|
||||
x3:488,//审核版本游客登录按钮x
|
||||
};
|
||||
Game_Config.sysConfig = {
|
||||
mainMenuButton:false,//是否进入主菜单界面隐藏四个按钮
|
||||
mainScenePlayerInfo:false,//是否隐藏主界面玩家信息
|
||||
mainSceneButton:false,//是否隐藏主界面按钮
|
||||
shareRoom:false,//接收到星星场是否屏蔽平台框架显示
|
||||
changeSeat:false,//是否屏蔽平台自动刷新换座后界面
|
||||
hideNotice:false,//隐藏公告栏
|
||||
vipInfinite:false,//是否为百人场
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,809 @@
|
||||
|
||||
var Game_Modify = Game_Modify||{};//子游戏可能会修改的模块
|
||||
Game_Modify.combat={
|
||||
maxPlayerCount:5,
|
||||
pageOnelimitStrLen:8,//战绩页一昵称最大长度
|
||||
pageOneDoc:false,
|
||||
pageTwolimitStrLen:16,//战绩页二昵称最大长度
|
||||
pageTwoDoc:false,
|
||||
};
|
||||
|
||||
Game_Modify.roomDes = "";
|
||||
Game_Modify.game_config={//游戏配置默认值
|
||||
|
||||
};
|
||||
Game_Modify.Type_1 = [
|
||||
{id:0,des:"10局(房卡X1)",roomcard:1,type:1},
|
||||
{id:1,des:"20局(房卡X2)",roomcard:2,type:2}
|
||||
];
|
||||
Game_Modify.Type_2 = [
|
||||
{id:0,des:"房主扣卡",type:1},
|
||||
{id:1,des:"每人扣卡",type:2}
|
||||
];
|
||||
|
||||
Game_Modify.CreateRoomData = {//发送创建房间数据roomtype
|
||||
//Roomcard:0,
|
||||
Type_1:0,
|
||||
Type_2:0,
|
||||
//增加房间类型时在下面添加
|
||||
};
|
||||
Game_Modify.utlmousedown = function(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6){
|
||||
|
||||
}
|
||||
Game_Modify.utlmousedown_nomove = function(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5){
|
||||
switch(spid){
|
||||
|
||||
}
|
||||
}
|
||||
Game_Modify.mouseup=function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2){
|
||||
if(spid_down==spid_up){
|
||||
switch(spid_up){
|
||||
case 25://????
|
||||
var data={};
|
||||
data.agentid = GameData.AgentId;
|
||||
data.playerid = C_Player.playerid;
|
||||
data.gameid = GameData.GameId;
|
||||
//data.roomtype = [[1,[1,2,3]],[1,[1,2]],[1,[1,2,3]],[1,[1,2,3,4,5]],[1,[1,2]],[[0,0,0,0,0],[1,5,3],[100,10000,0.01,1,500,0.02]]];
|
||||
//data.roomtype = [1,1,1,1,1,[1,5,3]];
|
||||
data.roomtype = [1,4,1,2,2,[1,1,[1,2000,10],null,null,1],[1,0,5]];
|
||||
Net.Send_create_room(data);
|
||||
break;
|
||||
case 150://???????
|
||||
GameUI.OpenHelp();
|
||||
break;
|
||||
}
|
||||
if(spid_up>=20&&spid_up<=21){//
|
||||
Game_Modify.CreateRoomData.Type_1 = spid_up-20;
|
||||
|
||||
}
|
||||
if(spid_up>=139&&spid_up<=140){
|
||||
Game_Modify.CreateRoomData.Type_2 = spid_up-139;
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
Game_Modify.utlmousemove = function(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1){
|
||||
|
||||
}
|
||||
Game_Modify.utlgamemydrawbegin = function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||||
|
||||
|
||||
}
|
||||
Game_Modify.gamemydraw = function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||||
switch(spid){
|
||||
//勾选状态的钩钩是画上去的(如果需要改动勾选图片的尺寸、绘画时的参数自己调整)
|
||||
//------------------- begin --------------
|
||||
case 248://协议勾选
|
||||
if(GameData.ProtocolIndex){
|
||||
ifast_mydrawbmp(spid,4,5,5,40,40,0,0,40,40);
|
||||
}
|
||||
break;
|
||||
case 139://创建房间时的勾选
|
||||
if(Game_Modify.CreateRoomData.Type_2 == 0){
|
||||
ifast_mydrawbmp(spid,4,2,2,40,40,0,0,40,40);
|
||||
}
|
||||
break;
|
||||
case 140://创建房间时的勾选
|
||||
if(Game_Modify.CreateRoomData.Type_2 == 1){
|
||||
ifast_mydrawbmp(spid,4,2,2,40,40,0,0,40,40);
|
||||
}
|
||||
break;
|
||||
case 20://创建房间时的勾选
|
||||
if(Game_Modify.CreateRoomData.Type_1 == 0){
|
||||
ifast_mydrawbmp(spid,4,2,2,40,40,0,0,40,40);
|
||||
}
|
||||
break;
|
||||
case 21://创建房间时的勾选
|
||||
if(Game_Modify.CreateRoomData.Type_1 == 1){
|
||||
ifast_mydrawbmp(spid,4,2,2,40,40,0,0,40,40);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
//------------------- end ------------------
|
||||
|
||||
}
|
||||
}
|
||||
Game_Modify.OpenCreateRoom=function(){
|
||||
Utl.playSound(Game_Config.ClickButton.src_2);
|
||||
var roomty = Utl.getRoomtype();
|
||||
if(roomty){
|
||||
Game_Modify.CreateRoomData.Type_1 = roomty[0]-1;
|
||||
Game_Modify.CreateRoomData.Type_2 = roomty[1]-1;
|
||||
}else{
|
||||
Game_Modify.CreateRoomData.Type_1 = 0;
|
||||
Game_Modify.CreateRoomData.Type_2 = 0;
|
||||
}
|
||||
set_self(672,7,Game_Modify.Type_1[0].des,0,0);
|
||||
set_self(673,7,Game_Modify.Type_1[1].des,0,0);
|
||||
set_self(674,7,Game_Modify.Type_2[0].des,0,0);
|
||||
set_self(675,7,Game_Modify.Type_2[1].des,0,0);
|
||||
|
||||
set_group(4,37,1,0,0);
|
||||
}
|
||||
Game_Modify.CloseCreateRoom=function(){
|
||||
set_group(4,37,0,0,0);
|
||||
}
|
||||
Game_Modify.setRoomDes = function(roomcode,asetcount,roomtype){
|
||||
Game_Modify.roomDes = "描述:"+roomcode+"("+asetcount+"局)";
|
||||
}
|
||||
//-----------------新版战绩---------------------------
|
||||
var gameCombat={};
|
||||
gameCombat.combatData = {
|
||||
page:0,//当前处于第几页战绩 0我的战绩1第二页战绩
|
||||
pageOneIndex:0,//选中的第二页的第几栏
|
||||
pageTwoIndex:0,//选中的第二页的第几栏
|
||||
type:0,
|
||||
gradeIdx1:0,
|
||||
gradeIdx2:0,
|
||||
};
|
||||
gameCombat.combatPageOneConfig = {
|
||||
fSpid:63,
|
||||
bgSpid:64,
|
||||
splitSpid:86,
|
||||
btnSpid:51,
|
||||
txt1Spid:65,
|
||||
txt2Spid:66,
|
||||
txt3Spid:67,
|
||||
bgTag:1,
|
||||
splitTag:500,
|
||||
btnTag:1000,
|
||||
txt1Tag:1500,
|
||||
txt2Tag:3000,
|
||||
txt3Tag:4500,
|
||||
|
||||
clip_x:64,
|
||||
clip_y:114,
|
||||
clip_h:515,
|
||||
clip_w:1175,
|
||||
|
||||
txt1Width:10,
|
||||
txt2Width:10,
|
||||
txt3Width:10,
|
||||
|
||||
splitPosition:[338,74],
|
||||
btnPosition:[1065,0],
|
||||
txt1Position:[[35,15],[35,60],[35,105]],//x,y
|
||||
txt2Position:[[130,15],[130,60],[130,105]],//x,y
|
||||
txt3Position5:[[400,45],[540,45],[680,45],[820,45],[960,45]],//[居中点,y]
|
||||
txt3Position10:[[400,10],[540,10],[680,10],[820,10],[960,10],
|
||||
[400,80],[540,80],[680,80],[820,80],[960,80]],//[居中点,y]
|
||||
nickNameLimit5:8,
|
||||
nickNameLimit10:8,
|
||||
nsSpace:30,//昵称积分间隔
|
||||
|
||||
bgSpace:167,//背景间隔
|
||||
|
||||
|
||||
};
|
||||
gameCombat.combatPageTwoConfig = {
|
||||
fSpid:87,
|
||||
bgSpid:88,
|
||||
splitSpid:91,
|
||||
btnSpid:54,
|
||||
txt1Spid:89,
|
||||
//txt2Spid:66,
|
||||
txt3Spid:90,
|
||||
bgTag:1,
|
||||
splitTag:500,
|
||||
btnTag:1000,
|
||||
txt1Tag:1500,
|
||||
txt2Tag:3000,
|
||||
txt3Tag:4500,
|
||||
|
||||
clip_x:64,
|
||||
clip_y:114,
|
||||
clip_h:515,
|
||||
clip_w:1175,
|
||||
|
||||
txt1Width:10,
|
||||
txt2Width:10,
|
||||
txt3Width:10,
|
||||
|
||||
splitPosition:[338,74],
|
||||
btnPosition:[1065,0],
|
||||
txt1Position:[[90,50],[35,60],[35,105]],//x,y
|
||||
txt2Position:[[130,15],[130,60],[130,105]],//x,y
|
||||
txt3Position5:[[400,45],[540,45],[680,45],[820,45],[960,45]],//[居中点,y]
|
||||
txt3Position10:[[400,10],[540,10],[680,10],[820,10],[960,10],
|
||||
[400,80],[540,80],[680,80],[820,80],[960,80]],//[居中点,y]
|
||||
nickNameLimit5:2,
|
||||
nickNameLimit10:2,
|
||||
nsSpace:30,//昵称积分间隔
|
||||
|
||||
bgSpace:167,//背景间隔
|
||||
|
||||
|
||||
};
|
||||
gameCombat.combatPageOneData = {
|
||||
slide:false,
|
||||
bgTag:0,
|
||||
btnTag:0,
|
||||
txt1Tag:0,
|
||||
txt2Tag:0,
|
||||
txt3Tag:0,
|
||||
splitTag:0,
|
||||
};
|
||||
gameCombat.combatPageTwoData = {
|
||||
slide:false,
|
||||
bgTag:0,
|
||||
btnTag:0,
|
||||
txt1Tag:0,
|
||||
txt2Tag:0,
|
||||
txt3Tag:0,
|
||||
splitTag:0,
|
||||
};
|
||||
gameCombat.utlani_doend=function(id,sx,count,allend){
|
||||
|
||||
}
|
||||
gameCombat.utlmousedown = function(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6){
|
||||
switch(spid){
|
||||
case gameCombat.combatPageOneConfig.fSpid:
|
||||
gameCombat.combatPageOneData.slide = false;
|
||||
break;
|
||||
case gameCombat.combatPageTwoConfig.fSpid:
|
||||
gameCombat.combatPageTwoData.slide = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
gameCombat.utlmouseup=function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2){
|
||||
if(spid_down == gameCombat.combatPageOneConfig.fSpid){
|
||||
var pos = get_self(spid_down,19,0,0,0);
|
||||
var sh = get_self(spid_down,21,0,0,0);
|
||||
if(sh <= gameCombat.combatPageOneConfig.clip_h){
|
||||
play_ani(1,spid_down,19,pos,gameCombat.combatPageOneConfig.clip_y,0,ifast_abs(gameCombat.combatPageOneConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||||
}else{
|
||||
if(pos > gameCombat.combatPageOneConfig.clip_y){
|
||||
play_ani(1,spid_down,19,pos,gameCombat.combatPageOneConfig.clip_y,0,ifast_abs(gameCombat.combatPageOneConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||||
}else{
|
||||
var ppos = gameCombat.combatPageOneConfig.clip_y + gameCombat.combatPageOneConfig.clip_h - sh;
|
||||
if(pos < ppos){
|
||||
play_ani(1,spid_down,19,pos,ppos,0,ifast_abs(ppos - pos),0,0,0,1,0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(spid_down == gameCombat.combatPageTwoConfig.fSpid){
|
||||
var pos = get_self(spid_down,19,0,0,0);
|
||||
var sh = get_self(spid_down,21,0,0,0);
|
||||
if(sh <= gameCombat.combatPageTwoConfig.clip_h){
|
||||
play_ani(1,spid_down,19,pos,gameCombat.combatPageTwoConfig.clip_y,0,ifast_abs(gameCombat.combatPageTwoConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||||
}else{
|
||||
if(pos > gameCombat.combatPageTwoConfig.clip_y){
|
||||
play_ani(1,spid_down,19,pos,gameCombat.combatPageTwoConfig.clip_y,0,ifast_abs(gameCombat.combatPageTwoConfig.clip_y - pos),0,0,0,1,0,0,0);
|
||||
}else{
|
||||
var ppos = gameCombat.combatPageTwoConfig.clip_y + gameCombat.combatPageTwoConfig.clip_h - sh;
|
||||
if(pos < ppos){
|
||||
play_ani(1,spid_down,19,pos,ppos,0,ifast_abs(ppos - pos),0,0,0,1,0,0,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if(spid_down==spid_up){
|
||||
switch(spid_up){
|
||||
case 13://发送战绩请求
|
||||
|
||||
break;
|
||||
case gameCombat.combatPageOneConfig.fSpid://战绩页一
|
||||
if(!gameCombat.combatPageOneData.slide){
|
||||
var up_id = ifast_check_add(spid_up,upx,upy);
|
||||
|
||||
if(up_id>=gameCombat.combatPageOneConfig.btnTag&&up_id<=gameCombat.combatPageOneConfig.txt1Tag){
|
||||
//console.log(up_id - gameCombat.combatPageOneConfig.btnTag);
|
||||
gameCombat.newGoCombatPageTwo(up_id - gameCombat.combatPageOneConfig.btnTag);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case gameCombat.combatPageTwoConfig.fSpid://战绩页二
|
||||
if(!gameCombat.combatPageTwoData.slide){
|
||||
var up_id = ifast_check_add(spid_up,upx,upy);
|
||||
//console.log(up_id);
|
||||
if(up_id>=gameCombat.combatPageTwoConfig.btnTag&&up_id<=gameCombat.combatPageTwoConfig.txt1Tag){
|
||||
console.log(up_id - gameCombat.combatPageTwoConfig.btnTag);//选中的是第几小局0开始
|
||||
gameCombat.combatData.pageTwoIndex = up_id - gameCombat.combatPageTwoConfig.btnTag;
|
||||
gameCombat.newGoCombatPageThree(gameCombat.combatData.pageOneIndex,gameCombat.combatData.pageTwoIndex);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 49:
|
||||
case 61:
|
||||
{
|
||||
gameCombat.closeNewCombat();
|
||||
}
|
||||
break;
|
||||
case 55://战绩返回
|
||||
if(gameCombat.combatData.page == 0){
|
||||
gameCombat.closeNewCombat();
|
||||
}else if(gameCombat.combatData.page == 1){
|
||||
gameCombat.newGoCombatPageOne();
|
||||
}else{
|
||||
gameCombat.newGoCombatPageTwo(gameCombat.combatData.pageOneIndex);
|
||||
}
|
||||
break;
|
||||
case 84:
|
||||
gameCombat.Send_get_player_grade1(0);
|
||||
break;
|
||||
case 85:
|
||||
gameCombat.Send_get_player_grade1(1);
|
||||
break;
|
||||
case 104://我的开房上一页
|
||||
gameCombat.Send_get_player_grade1(1,1,gameCombat.combatData.gradeIdx1);
|
||||
break;
|
||||
case 105://下一页
|
||||
gameCombat.Send_get_player_grade1(1,2,gameCombat.combatData.gradeIdx2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
gameCombat.utlmousemove=function(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1){
|
||||
switch(spid){
|
||||
case gameCombat.combatPageOneConfig.fSpid:
|
||||
if(ifast_abs(offmovey)>2){
|
||||
set_self(spid,19,offmovey,1,0,0);
|
||||
gameCombat.combatPageOneData.slide = true;
|
||||
}
|
||||
break;
|
||||
case gameCombat.combatPageTwoConfig.fSpid:
|
||||
if(ifast_abs(offmovey)>2){
|
||||
set_self(spid,19,offmovey,1,0,0);
|
||||
gameCombat.combatPageTwoData.slide = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
gameCombat.utlgamemydraw=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||||
|
||||
}
|
||||
gameCombat.utlgamemydrawbegin=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7){
|
||||
if(spid==gameCombat.combatPageOneConfig.fSpid){
|
||||
set_clip(0,0,gameCombat.combatPageOneConfig.clip_x,gameCombat.combatPageOneConfig.clip_y,gameCombat.combatPageOneConfig.clip_w,gameCombat.combatPageOneConfig.clip_h);
|
||||
}
|
||||
if(spid==gameCombat.combatPageTwoConfig.fSpid){
|
||||
set_clip(0,0,gameCombat.combatPageTwoConfig.clip_x,gameCombat.combatPageTwoConfig.clip_y,gameCombat.combatPageTwoConfig.clip_w,gameCombat.combatPageTwoConfig.clip_h);
|
||||
}
|
||||
}
|
||||
|
||||
//打开战绩
|
||||
gameCombat.openNewCombat = function(){
|
||||
|
||||
//gameCombat.combatData.page = 0;
|
||||
if(!gameCombat.combatData.type){
|
||||
set_self(83,43,1,0,0);
|
||||
}else{
|
||||
set_self(83,43,2,0,0);
|
||||
}
|
||||
set_group(7,37,1,0,0);
|
||||
|
||||
|
||||
//gameCombat.newCreateCombatPageOne();
|
||||
gameCombat.newGoCombatPageOne();
|
||||
}
|
||||
//关闭战绩
|
||||
gameCombat.closeNewCombat = function(){
|
||||
set_group(7,37,0,0,0);
|
||||
set_group(8,37,0,0,0);
|
||||
set_group(9,37,0,0,0);
|
||||
set_group(13,37,0,0,0);
|
||||
set_group(14,37,0,0,0);
|
||||
set_group(15,37,0,0,0);
|
||||
set_group(16,37,0,0,0);
|
||||
set_group(17,37,0,0,0);
|
||||
gameCombat.removeCombatPageOne();
|
||||
gameCombat.removeCombatPageTwo();
|
||||
gameCombat.removeCombatPageThree();
|
||||
}
|
||||
//创建战绩页一
|
||||
gameCombat.newCreateCombatPageOne = function(){
|
||||
gameCombat.removeCombatPageOne();
|
||||
set_group(8,37,1,0,0);
|
||||
set_self(gameCombat.combatPageOneConfig.fSpid,18,gameCombat.combatPageOneConfig.clip_x,0,0);
|
||||
set_self(gameCombat.combatPageOneConfig.fSpid,19,gameCombat.combatPageOneConfig.clip_y,0,0);
|
||||
var h = gameCombat.combatPageOneConfig.bgSpace;
|
||||
set_self(gameCombat.combatPageOneConfig.fSpid,21,h*CombatInfo.length,0,0);
|
||||
set_self(gameCombat.combatPageOneConfig.fSpid,20,get_self(gameCombat.combatPageOneConfig.bgSpid,20,0,0,0),0,0);
|
||||
var bgTag = gameCombat.combatPageOneConfig.bgTag;
|
||||
var btnTag = gameCombat.combatPageOneConfig.btnTag;
|
||||
var txt1Tag = gameCombat.combatPageOneConfig.txt1Tag;
|
||||
var txt2Tag = gameCombat.combatPageOneConfig.txt2Tag;
|
||||
var txt3Tag = gameCombat.combatPageOneConfig.txt3Tag;
|
||||
var splitTag = gameCombat.combatPageOneConfig.splitTag;
|
||||
for(var i=0;i<CombatInfo.length;i++){
|
||||
//背景
|
||||
var bg = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.bgSpid,
|
||||
0,0+i*gameCombat.combatPageOneConfig.bgSpace,bgTag);
|
||||
bgTag++;
|
||||
//时间标签
|
||||
var timeTag = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt1Spid,
|
||||
gameCombat.combatPageOneConfig.txt1Position[0][0],
|
||||
gameCombat.combatPageOneConfig.txt1Position[0][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
txt1Tag);
|
||||
set_self(timeTag,7,"时间:",0,0);
|
||||
txt1Tag++;
|
||||
//房号标签
|
||||
var roomCodeTag = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt1Spid,
|
||||
gameCombat.combatPageOneConfig.txt1Position[1][0],
|
||||
gameCombat.combatPageOneConfig.txt1Position[1][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
txt1Tag);
|
||||
set_self(roomCodeTag,7,"房号:",0,0);
|
||||
txt1Tag++;
|
||||
//局数标签
|
||||
var countTag = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt1Spid,
|
||||
gameCombat.combatPageOneConfig.txt1Position[2][0],
|
||||
gameCombat.combatPageOneConfig.txt1Position[2][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
txt1Tag);
|
||||
set_self(countTag,7,"局数:",0,0);
|
||||
txt1Tag++;
|
||||
//时间
|
||||
var time = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt2Spid,
|
||||
gameCombat.combatPageOneConfig.txt2Position[0][0],
|
||||
gameCombat.combatPageOneConfig.txt2Position[0][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
txt2Tag);
|
||||
set_self(time,7,CombatInfo[i].overtime,0,0);
|
||||
txt2Tag++;
|
||||
|
||||
//房号
|
||||
var roomcode = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt2Spid,
|
||||
gameCombat.combatPageOneConfig.txt2Position[1][0],
|
||||
gameCombat.combatPageOneConfig.txt2Position[1][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
txt2Tag);
|
||||
txt2Tag++;
|
||||
set_self(roomcode,7,CombatInfo[i].roomcode,0,0);
|
||||
//局数
|
||||
var round = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt2Spid,
|
||||
gameCombat.combatPageOneConfig.txt2Position[2][0],
|
||||
gameCombat.combatPageOneConfig.txt2Position[2][1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
txt2Tag);
|
||||
txt2Tag++;
|
||||
set_self(round,7,CombatInfo[i].gameinfo1.roundsum,0,0);
|
||||
|
||||
//玩家信息(昵称,积分)
|
||||
var position = gameCombat.combatPageOneConfig.txt3Position5;
|
||||
var _pCount = 0;
|
||||
for(var m=0;m<CombatInfo[i].gameinfo1.playerlist.length;m++){
|
||||
if(CombatInfo[i].gameinfo1.playerlist[m]){
|
||||
_pCount++;
|
||||
}
|
||||
}
|
||||
if(_pCount > 5){
|
||||
//splitPosition
|
||||
position = gameCombat.combatPageOneConfig.txt3Position10;
|
||||
var splitLine = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.splitSpid,
|
||||
gameCombat.combatPageOneConfig.splitPosition[0],
|
||||
gameCombat.combatPageOneConfig.splitPosition[1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
splitTag);
|
||||
splitTag++;
|
||||
}
|
||||
var nameLimit;
|
||||
CombatInfo[i].gameinfo1.playerlist.length > 5 ? nameLimit = gameCombat.combatPageOneConfig.nickNameLimit10:nameLimit = gameCombat.combatPageOneConfig.nickNameLimit5;
|
||||
var n=0;
|
||||
for(var j=0;j<CombatInfo[i].gameinfo1.playerlist.length;j++){
|
||||
if(CombatInfo[i].gameinfo1.playerlist[j]){
|
||||
//set_rec(233+i*count+j*2,Func.subString(CombatInfo[i].gameinfo1.playerlist[j][0],gameCombat.combat.pageOnelimitStrLen,gameCombat.combat.pageOneDoc));
|
||||
//set_rec(234+i*count+j*2,CombatInfo[i].gameinfo1.playerlist[j][1]);
|
||||
//var nameTxt = "";
|
||||
//if(CombatInfo[i].gameinfo1.playerlist[j]){
|
||||
var nameTxt = Func.subString(CombatInfo[i].gameinfo1.playerlist[j][0],nameLimit,true);
|
||||
//}
|
||||
|
||||
var nickname = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt3Spid,
|
||||
position[n][0]- String(nameTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width/2,
|
||||
position[n][1]+i*gameCombat.combatPageOneConfig.bgSpace,txt3Tag);
|
||||
txt3Tag++;
|
||||
set_self(nickname,7,nameTxt,0,0);
|
||||
//var scoreTxt = "";
|
||||
//if(CombatInfo[i].gameinfo1.playerlist[j]){
|
||||
var scoreTxt = CombatInfo[i].gameinfo1.playerlist[j][1];
|
||||
//}
|
||||
//
|
||||
var score = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.txt3Spid,
|
||||
position[n][0]- String(scoreTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width/2,
|
||||
position[n][1]+gameCombat.combatPageOneConfig.nsSpace+i*gameCombat.combatPageOneConfig.bgSpace,txt3Tag);
|
||||
txt3Tag++;
|
||||
set_self(score,7,scoreTxt,0,0);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
var btn = ifast_addtospritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,gameCombat.combatPageOneConfig.btnSpid,
|
||||
gameCombat.combatPageOneConfig.btnPosition[0],
|
||||
gameCombat.combatPageOneConfig.btnPosition[1]+i*gameCombat.combatPageOneConfig.bgSpace,
|
||||
btnTag);
|
||||
btnTag++;
|
||||
}
|
||||
gameCombat.combatPageOneData.bgTag = bgTag;
|
||||
gameCombat.combatPageOneData.btnTag = btnTag;
|
||||
gameCombat.combatPageOneData.txt1Tag = txt1Tag;
|
||||
gameCombat.combatPageOneData.txt2Tag = txt2Tag;
|
||||
gameCombat.combatPageOneData.txt3Tag = txt3Tag;
|
||||
gameCombat.combatPageOneData.splitTag = splitTag;
|
||||
}
|
||||
//删除战绩页一
|
||||
gameCombat.removeCombatPageOne = function(){
|
||||
for(var i=gameCombat.combatPageOneConfig.bgTag;i<gameCombat.combatPageOneData.bgTag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageOneData.bgTag = 0;
|
||||
for(var i=gameCombat.combatPageOneConfig.btnTag;i<gameCombat.combatPageOneData.btnTag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageOneData.btnTag = 0;
|
||||
for(var i=gameCombat.combatPageOneConfig.txt1Tag;i<gameCombat.combatPageOneData.txt1Tag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageOneData.txt1Tag = 0;
|
||||
for(var i=gameCombat.combatPageOneConfig.txt2Tag;i<gameCombat.combatPageOneData.txt2Tag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageOneData.txt2Tag = 0;
|
||||
for(var i=gameCombat.combatPageOneConfig.txt3Tag;i<gameCombat.combatPageOneData.txt3Tag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageOneData.txt3Tag = 0;
|
||||
for(var i=gameCombat.combatPageOneConfig.splitTag;i<gameCombat.combatPageOneData.splitTag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageOneConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageOneData.splitTag = 0;
|
||||
set_group(8,37,0,0,0);
|
||||
}
|
||||
//创建战绩页二
|
||||
gameCombat.newCreateCombatPageTwo = function(){
|
||||
|
||||
set_group(9,37,1,0,0);
|
||||
set_self(gameCombat.combatPageTwoConfig.fSpid,18,gameCombat.combatPageTwoConfig.clip_x,0,0);
|
||||
set_self(gameCombat.combatPageTwoConfig.fSpid,19,gameCombat.combatPageTwoConfig.clip_y,0,0);
|
||||
var h = gameCombat.combatPageTwoConfig.bgSpace;
|
||||
set_self(gameCombat.combatPageTwoConfig.fSpid,21,h*CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round.length,0,0);
|
||||
set_self(gameCombat.combatPageTwoConfig.fSpid,20,get_self(gameCombat.combatPageTwoConfig.bgSpid,20,0,0,0),0,0);
|
||||
var bgTag = gameCombat.combatPageTwoConfig.bgTag;
|
||||
var btnTag = gameCombat.combatPageTwoConfig.btnTag;
|
||||
var txt1Tag = gameCombat.combatPageTwoConfig.txt1Tag;
|
||||
var txt3Tag = gameCombat.combatPageTwoConfig.txt3Tag;
|
||||
var splitTag = gameCombat.combatPageTwoConfig.splitTag;
|
||||
|
||||
|
||||
|
||||
|
||||
for(var i=0;i<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round.length;i++){
|
||||
//背景
|
||||
var bg = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.bgSpid,
|
||||
0,0+i*gameCombat.combatPageTwoConfig.bgSpace,bgTag);
|
||||
bgTag++;
|
||||
//第几局
|
||||
var round = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.txt1Spid,
|
||||
gameCombat.combatPageTwoConfig.txt1Position[0][0],
|
||||
gameCombat.combatPageTwoConfig.txt1Position[0][1]+i*gameCombat.combatPageTwoConfig.bgSpace,
|
||||
txt1Tag);
|
||||
var rd = i+1;
|
||||
var txt = "";
|
||||
rd < 10 ? (txt = "第 "+rd+" 局" ): (txt = "第"+rd+"局");
|
||||
set_self(round,7,txt,0,0);
|
||||
txt1Tag++;
|
||||
|
||||
//玩家信息(昵称,积分)
|
||||
var position = gameCombat.combatPageTwoConfig.txt3Position5;
|
||||
var _pCount=0;
|
||||
for(var m=0;m<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist.length;m++){
|
||||
if(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist[m]){
|
||||
_pCount++;
|
||||
}
|
||||
}
|
||||
if(_pCount > 5){
|
||||
//splitPosition
|
||||
position = gameCombat.combatPageTwoConfig.txt3Position10;
|
||||
var splitLine = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.splitSpid,
|
||||
gameCombat.combatPageTwoConfig.splitPosition[0],
|
||||
gameCombat.combatPageTwoConfig.splitPosition[1]+i*gameCombat.combatPageTwoConfig.bgSpace,
|
||||
splitTag);
|
||||
splitTag++;
|
||||
}
|
||||
var nameLimit;
|
||||
CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist.length > 5 ? nameLimit = gameCombat.combatPageTwoConfig.nickNameLimit10:nameLimit = gameCombat.combatPageTwoConfig.nickNameLimit5;
|
||||
var scoreList = [];
|
||||
var n=0;
|
||||
for(var j=0;j<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist.length;j++){
|
||||
if(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist[j]){
|
||||
//set_rec(233+i*count+j*2,Func.subString(CombatInfo[i].gameinfo1.playerlist[j][0],gameCombat.combat.pageOnelimitStrLen,gameCombat.combat.pageOneDoc));
|
||||
//set_rec(234+i*count+j*2,CombatInfo[i].gameinfo1.playerlist[j][1]); - String(nameTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width
|
||||
var nameTxt = Func.subString(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.playerlist[j][0],nameLimit,true);
|
||||
var nickname = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.txt3Spid,
|
||||
position[n][0],position[n][1]+i*gameCombat.combatPageTwoConfig.bgSpace,txt3Tag);
|
||||
txt3Tag++;
|
||||
set_self(nickname,7,nameTxt,0,0);
|
||||
|
||||
//var scoreTxt = CombatInfo[gameCombat.combatData.page].gameinfo1.playerlist[j][1];
|
||||
// - String(scoreTxt).gblen()*gameCombat.combatPageOneConfig.txt3Width
|
||||
var score = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.txt3Spid,
|
||||
position[n][0],position[n][1]+gameCombat.combatPageTwoConfig.nsSpace+i*gameCombat.combatPageTwoConfig.bgSpace,txt3Tag);
|
||||
txt3Tag++;
|
||||
set_self(score,7,0,0,0);
|
||||
//scoreList.push(score);
|
||||
//.length <= 5 ? _maxLen = CombatInfo[v].gameinfo1.round[i].length : _maxLen = 5;
|
||||
for(var k=0;k<CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[i].length;k++){
|
||||
//set_rec(232+i*count+CombatInfo[gameCombat.combatData.page].gameinfo1.round[i][j][0],CombatInfo[v].gameinfo1.round[i][j][1]);
|
||||
if(CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[i][k][0] == j){
|
||||
set_self(score,7,CombatInfo[gameCombat.combatData.pageOneIndex].gameinfo1.round[i][k][1]);
|
||||
}
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
var btn = ifast_addtospritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,gameCombat.combatPageTwoConfig.btnSpid,
|
||||
gameCombat.combatPageTwoConfig.btnPosition[0],
|
||||
gameCombat.combatPageTwoConfig.btnPosition[1]+i*gameCombat.combatPageTwoConfig.bgSpace,
|
||||
btnTag);
|
||||
btnTag++;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
gameCombat.combatPageTwoData.bgTag = bgTag;
|
||||
gameCombat.combatPageTwoData.btnTag = btnTag;
|
||||
gameCombat.combatPageTwoData.txt1Tag = txt1Tag;
|
||||
gameCombat.combatPageTwoData.txt3Tag = txt3Tag;
|
||||
gameCombat.combatPageTwoData.splitTag = splitTag;
|
||||
}
|
||||
//删除战绩页一
|
||||
gameCombat.removeCombatPageTwo = function(){
|
||||
for(var i=gameCombat.combatPageTwoConfig.bgTag;i<gameCombat.combatPageTwoData.bgTag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageTwoData.bgTag = 0;
|
||||
for(var i=gameCombat.combatPageTwoConfig.btnTag;i<gameCombat.combatPageTwoData.btnTag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageTwoData.btnTag = 0;
|
||||
for(var i=gameCombat.combatPageTwoConfig.txt1Tag;i<gameCombat.combatPageTwoData.txt1Tag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageTwoData.txt1Tag = 0;
|
||||
for(var i=gameCombat.combatPageTwoConfig.txt3Tag;i<gameCombat.combatPageTwoData.txt3Tag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageTwoData.txt3Tag = 0;
|
||||
for(var i=gameCombat.combatPageTwoConfig.splitTag;i<gameCombat.combatPageTwoData.splitTag;i++){
|
||||
ifast_dllpritefromspritecopy(gameCombat.combatPageTwoConfig.fSpid,i);
|
||||
}
|
||||
gameCombat.combatPageTwoData.splitTag = 0;
|
||||
set_group(9,37,0,0,0);
|
||||
}
|
||||
//创建战绩页三
|
||||
gameCombat.newCreateCombatPageThree = function(){
|
||||
gameCombat.combatData.page = 2;
|
||||
}
|
||||
gameCombat.removeCombatPageThree = function(){
|
||||
|
||||
}
|
||||
//前往战绩页一
|
||||
gameCombat.newGoCombatPageOne = function(){
|
||||
gameCombat.removeCombatPageTwo();
|
||||
gameCombat.removeCombatPageThree();
|
||||
gameCombat.combatData.page = 0;
|
||||
gameCombat.newCreateCombatPageOne();
|
||||
if(gameCombat.combatData.type){
|
||||
set_self(104,37,1,0,0);
|
||||
set_self(105,37,1,0,0);
|
||||
}else{
|
||||
set_self(104,37,0,0,0);
|
||||
set_self(105,37,0,0,0);
|
||||
}
|
||||
if(CombatCount){
|
||||
set_self(684,7,CombatCount,0,0);
|
||||
set_self(684,20,String(CombatCount).length*14,0,0);
|
||||
}else{
|
||||
set_self(683,37,0,0,0);
|
||||
set_self(684,37,0,0,0);
|
||||
}
|
||||
set_self(82,37,1,0,0);
|
||||
if(!gameCombat.combatData.type){
|
||||
set_self(82,43,1,0,0);
|
||||
}else{
|
||||
set_self(82,43,2,0,0);
|
||||
}
|
||||
}
|
||||
//前往战绩页一
|
||||
gameCombat.newGoCombatPageTwo = function(page){
|
||||
gameCombat.combatData.page = 1;
|
||||
gameCombat.removeCombatPageOne();
|
||||
gameCombat.removeCombatPageThree();
|
||||
gameCombat.combatData.pageOneIndex = page;
|
||||
gameCombat.newCreateCombatPageTwo();
|
||||
if(CombatCount){
|
||||
set_self(684,7,CombatCount,0,0);
|
||||
set_self(684,20,String(CombatCount).length*14,0,0);
|
||||
}else{
|
||||
set_self(683,37,0,0,0);
|
||||
set_self(684,37,0,0,0);
|
||||
}
|
||||
set_self(82,37,1,0,0);
|
||||
if(!gameCombat.combatData.type){
|
||||
set_self(82,43,1,0,0);
|
||||
}else{
|
||||
set_self(82,43,2,0,0);
|
||||
}
|
||||
}
|
||||
//前往战绩页一
|
||||
gameCombat.newGoCombatPageThree = function(idx1,idx2){//idx1第几大局,idx2第几小局
|
||||
gameCombat.removeCombatPageOne();
|
||||
gameCombat.removeCombatPageTwo();
|
||||
gameCombat.newCreateCombatPageThree();
|
||||
//console.log("idx1:"+idx1+" idx2:"+idx2);
|
||||
}
|
||||
//发送战绩一
|
||||
gameCombat.Send_get_player_grade1 = function(type,direction,gradeidx){
|
||||
var data={};
|
||||
data.agentid = GameData.AgentId;
|
||||
data.playerid = C_Player.playerid;
|
||||
data.gameid = GameData.GameId;
|
||||
gameCombat.combatData.type = type;
|
||||
if(typeof type != "undefined"){
|
||||
data.type = type;
|
||||
}
|
||||
if(typeof direction != "undefined"){
|
||||
data.direction = direction;
|
||||
}
|
||||
if(typeof gradeidx != "undefined"){
|
||||
data.gradeidx = gradeidx;
|
||||
}
|
||||
Net.Send_get_player_grade1(data);
|
||||
}
|
||||
//接收获取战绩
|
||||
gameCombat.get_player_grade1 = function(_msg){
|
||||
Utl.playSound(Game_Config.ClickButton.src_2);
|
||||
|
||||
//gameCombat.combatData.type = _msg.data.type;
|
||||
CombatInfo = _msg.data.gradeinfo;
|
||||
CombatCount = _msg.data.asetcount;
|
||||
for(var i=0;i<CombatInfo.length;i++){
|
||||
if(typeof CombatInfo[i].gameinfo1 == "string"){
|
||||
CombatInfo[i].gameinfo1=JSON.parse(CombatInfo[i].gameinfo1);
|
||||
}
|
||||
if(i==0){
|
||||
gameCombat.combatData.gradeIdx1 = CombatInfo[i].idx;
|
||||
}
|
||||
if(i==CombatInfo.length-1){
|
||||
gameCombat.combatData.gradeIdx2 = CombatInfo[i].idx;
|
||||
}
|
||||
}
|
||||
|
||||
gameCombat.openNewCombat();
|
||||
|
||||
}
|
||||
//
|
||||
gameCombat.Send_get_player_grade2 = function(_data){
|
||||
Net.Send_get_player_grade2(_data);
|
||||
|
||||
}
|
||||
//
|
||||
gameCombat.get_player_grade2 = function(_msg){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
var gameHallImport = {};
|
||||
gameHallImport.appStart =function(){
|
||||
console.log("appStart");
|
||||
}
|
||||
gameHallImport.jumpMenuScene =function(){
|
||||
console.log("jumpMenuScene");
|
||||
}
|
||||
gameHallImport.gameStart = function(){
|
||||
console.log("gameStart");
|
||||
}
|
||||
gameHallImport.setGameList =function(){
|
||||
console.log("setGameList");
|
||||
}
|
||||
gameHallImport.clearGameinfo = function(){
|
||||
console.log("clearGameinfo");
|
||||
}
|
||||
gameHallImport.getWebdata = function(data){
|
||||
console.log("getWebdata");
|
||||
}
|
||||
|
||||
gameHallImport.isInstalled = function(data){
|
||||
console.log("isInstalled");
|
||||
return 1;
|
||||
}
|
||||
gameHallImport.up_imgurl = function(recid,photo){
|
||||
console.log("up_imgurl");
|
||||
}
|
||||
gameHallImport.getphoto = function(recid,photo){
|
||||
console.log("getphoto");
|
||||
}
|
||||
Game_Modify.StartWar=function(_msg){//开战
|
||||
|
||||
|
||||
|
||||
}
|
||||
Game_Modify._ReceiveData=function(_msg){//接收数据包
|
||||
|
||||
}
|
||||
Game_Modify.createRoom=function(_roomtype,_infinite){//创建房间
|
||||
|
||||
}
|
||||
Game_Modify.myJoinRoom=function(_msg){//自己进入房间
|
||||
|
||||
}
|
||||
Game_Modify.Reconnect=function(_deskinfo){//重连
|
||||
|
||||
}
|
||||
Game_Modify.stopAllSounds=function(){//关闭所有声音 (游戏声音)
|
||||
|
||||
}
|
||||
Game_Modify.Free=function(_msg){//投票解散结果为同意时,点击结果界面确认的按钮时触发
|
||||
|
||||
}
|
||||
Game_Modify.DeskInfo=function(_msg){//未开战状态下自己加入是牌桌数据
|
||||
|
||||
}
|
||||
Game_Modify.breakRoom=function(){//游戏已开局情况下自己退出房间触发
|
||||
|
||||
}
|
||||
|
||||
Game_Modify.playerJoinRoom=function(seat){//其他玩家加入房间
|
||||
|
||||
}
|
||||
Game_Modify.playerLeaveRoom=function(seat){//其他玩家离开房间
|
||||
|
||||
}
|
||||
Game_Modify.updateScene = function(){//更新游戏界面
|
||||
//根据本地数据重新显示界面
|
||||
|
||||
}
|
||||
Game_Modify.closeGameScene=function(){//关闭游戏界面
|
||||
|
||||
}
|
||||
Game_Modify.playerOffline = function(seat){//玩家离线
|
||||
|
||||
}
|
||||
Game_Modify.playerOnline = function(seat){//玩家上线
|
||||
|
||||
}
|
||||
Game_Modify.playerphonestate = function(seat,type){//玩家电话状态type->挂断1->接打电话、有电话进来的状态
|
||||
|
||||
}
|
||||
Game_Modify.shakeEvent = function(){
|
||||
switch(GameData.shakeID){
|
||||
case Game_Config.shakeList.startwar://摇一摇开战(如果有主动开战)
|
||||
var data={};
|
||||
data.agentid=GameData.AgentId;
|
||||
data.gameid=GameData.GameId;
|
||||
data.playerid=C_Player.playerid;
|
||||
data.roomcode=Desk.roomcode;
|
||||
Net.Send_self_makewar(data);
|
||||
Func.stopshake();
|
||||
GameData.shakeID=Game_Config.shakeList.nil;
|
||||
break;
|
||||
}
|
||||
}
|
||||
Game_Modify.calResult = function(inputArr){
|
||||
|
||||
}
|
||||
Game_Modify.onEnterMainScene = function(roomtype){//进入游戏主场景
|
||||
console.log("进入游戏主场景");
|
||||
}
|
||||
Game_Modify.onExitMainScene = function(){//退出游戏主场景
|
||||
console.log("退出游戏主场景");
|
||||
}
|
||||
Game_Modify.onGameConfig = function(_gameConfig){//获取到游戏配置时调用(只在game_config有数据时才调用)
|
||||
|
||||
}
|
||||
Game_Modify.onEnterVideo = function(){//进入牌局回放触发
|
||||
|
||||
}
|
||||
Game_Modify.onSurrender = function(_msg){//收到投降回包
|
||||
|
||||
}
|
||||
Game_Modify.onReady = function(seat){//玩家准备触发
|
||||
|
||||
}
|
||||
Game_Modify.getRoomInfo = function(roomtype,type,tea){//通过roomtype获取房间描述每行最多18个字符超过需要自己换行type1系统房间2非系统房间
|
||||
console.log("Game_Modify.getRoomInfo:"+roomtype);
|
||||
return "房间描述"+roomtype;
|
||||
}
|
||||
Game_Modify.getStarLimit = function(roomtype){//通过roomtype获取房间星星场下限数量(准入)
|
||||
console.log("Game_Modify.getStarLimit:"+roomtype);
|
||||
return 2001000;
|
||||
}
|
||||
Game_Modify.getMult = function(roomtype,type){//通过roomtype获取房间星星场倍数
|
||||
console.log("Game_Modify.getStarLimit:"+roomtype);
|
||||
return 10000;
|
||||
}
|
||||
Game_Modify.getFullRoomInfo = function(roomtype){//通过roomtype获取房间全部信息描述 每行最多26个字符超过需要自己换行
|
||||
console.log("Game_Modify.getFullRoomInfo:"+roomtype);
|
||||
return "房间描述房间描\n述房间描述房间\n描述房间描述"+roomtype;
|
||||
}
|
||||
Game_Modify.onOpenHelp = function(spid){//打开帮助页面触发
|
||||
|
||||
}
|
||||
//显示大厅界面触发
|
||||
Game_Modify.onMainMenuScene = function(){
|
||||
|
||||
}
|
||||
//确认数字输入框回调
|
||||
Game_Modify.onCheckInput = function(_result){
|
||||
console.log(_result);
|
||||
}
|
||||
//创建房间成功后触发
|
||||
Game_Modify.onCreateRoom = function(_data){
|
||||
|
||||
|
||||
}
|
||||
//获取离场限制
|
||||
Game_Modify.getLeaveLimit = function(roomtype){
|
||||
|
||||
return 10;
|
||||
}
|
||||
//成功获取定位信息触发
|
||||
Game_Modify.onLocationInfo = function(_locationInfo){
|
||||
|
||||
}
|
||||
//进入游戏界面创建牌桌之前调用
|
||||
Game_Modify.onCreateDesk = function(roomtype){
|
||||
console.log("onCreateDesk:"+roomtype);
|
||||
}
|
||||
//通过roomtype获取是否开启视频功能0->不开启1->开启
|
||||
Game_Modify.getVideoByRoomType = function(roomtype){
|
||||
return 1;
|
||||
}
|
||||
//返回值为字符数组数组每项为房间一项描述信息
|
||||
Game_Modify.getRoomTopDescAry = function(roomtype){
|
||||
console.log(roomtype);
|
||||
return ["2人跑得快(17张)","特色玩法"];
|
||||
}
|
||||
//星星场房间列表
|
||||
Game_Modify.getShareRoom = function(_msg){
|
||||
|
||||
}
|
||||
//玩家自己退出房间
|
||||
Game_Modify.myExitRoom = function(seat){
|
||||
|
||||
}
|
||||
//接收到换座包触发
|
||||
Game_Modify.changeSeat = function(seat1,seat2){
|
||||
|
||||
}
|
||||
//关闭vip选项时调用
|
||||
Game_Modify.onCloseVip = function(){
|
||||
|
||||
}
|
||||
//判断房间是否为金币场(是金币场返回1否则返回0)
|
||||
Game_Modify.getRoomMode = function(roomtype){
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
|
||||
|
||||
|
||||
gameabc_face.mouseup_4 = function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//请在下面输入您的代码
|
||||
Utl.openSnrOption(0,[1, 1, 1, 1, 1, [0,1,[1,1000,1]]],"房间描述信息");
|
||||
//var data={};
|
||||
//data.agentid=GameData.AgentId;
|
||||
//data.playerid=C_Player.playerid;
|
||||
//data.taskid=ConstVal.ShareTaskId;
|
||||
//Net.Send_player_finish_task(data);
|
||||
//var roomcode=111111;
|
||||
//if(String(roomcode).length<6){
|
||||
//GameData.shortCode = roomcode;
|
||||
//Logic.saveShortCode(GameData.shortCode);
|
||||
//}else{
|
||||
//GameData.shortCode = "";
|
||||
//Logic.saveShortCode("");
|
||||
//}
|
||||
|
||||
};
|
||||
|
||||
|
||||
gameabc_face.mouseup_578 = function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//请在下面输入您的代码
|
||||
GameUI.updateSnrOption();
|
||||
};
|
||||
|
||||
gameabc_face.mouseup_3 = function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//请在下面输入您的代码
|
||||
|
||||
};
|
||||
gameabc_face.mouseup_405 = function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//请在下面输入您的代码
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
gameabc_face.mouseup_113 = function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//请在下面输入您的代码
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
|
||||
5544
codes/games/client/Projects/Game_Surface_3/js/gameabc.min.js
vendored
Normal file
5544
codes/games/client/Projects/Game_Surface_3/js/gameabc.min.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5703
codes/games/client/Projects/Game_Surface_3/js/gameabc.min2.js
Normal file
5703
codes/games/client/Projects/Game_Surface_3/js/gameabc.min2.js
Normal file
File diff suppressed because it is too large
Load Diff
306
codes/games/client/Projects/Game_Surface_3/js/gamemain.js
Normal file
306
codes/games/client/Projects/Game_Surface_3/js/gamemain.js
Normal file
@@ -0,0 +1,306 @@
|
||||
var gameabc_face = gameabc_face||{};
|
||||
{
|
||||
gameabc_face.tag=12; //定义你的游戏全局内存
|
||||
gameabc_face.tag1=123;//定义你的游戏全局内存
|
||||
gameabc_face.tag2=123;//定义你的游戏全局内存
|
||||
gameabc_face.tag3=123;//定义你的游戏全局内存
|
||||
gameabc_face.dfwgao=1;
|
||||
}
|
||||
|
||||
gameabc_face.gamestart=function(gameid)
|
||||
{
|
||||
//游戏初始化代码
|
||||
|
||||
Logic.AppStart();
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.ani_doend=function(id,sx,count,allend)
|
||||
{
|
||||
//logmessage(id+"/"+sx+"/"+count+"/"+allend);
|
||||
//play_ani(0,2,18,50,200,0,1000,0,0,0,0,6000,1);//主动关闭
|
||||
GameUI.utlani_doend(id,sx,count,allend);
|
||||
gameCombat.utlani_doend(id,sx,count,allend);
|
||||
};
|
||||
|
||||
gameabc_face.box_doend=function(id,sx,timelen)
|
||||
{
|
||||
//play_box 结束事件
|
||||
//showmessage("box_doend:"+id+"/"+sx+"/"+timelen);
|
||||
//logmessage("box_doend:"+id+"/"+sx+"/"+timelen);
|
||||
};
|
||||
|
||||
gameabc_face.onloadurl=function(recid,rectype,url,error,count,len)
|
||||
{
|
||||
|
||||
GameUI.onloadurl(recid,rectype,url,error,count,len);
|
||||
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.chongzhi=function(userid,zt,data)
|
||||
{
|
||||
//游戏接口代码
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.onresize=function(pmw/*屏幕宽*/,pmh/*屏幕宽*/,sjweww/*设计宽*/,sjnewh/*设计宽*/,nweww/*显示宽*/,newh/*显示高*/)
|
||||
{
|
||||
|
||||
//屏幕变化
|
||||
// 在此调整 列表控件的宽高和区域 不是整体缩放
|
||||
//logmessage("onresize:"+pmw+"/"+pmh+"/"+sjweww+"/"+sjnewh+"/"+nweww+"/"+newh);
|
||||
};
|
||||
|
||||
gameabc_face.gamebegindraw=function(gameid, spid, times, timelong)
|
||||
{
|
||||
//更新开始代码
|
||||
GameUI.utlgamebegindraw(gameid, spid, times, timelong);
|
||||
};
|
||||
gameabc_face.gameenddraw=function(gameid, spid, times, timelong)
|
||||
{
|
||||
//更新完成代码
|
||||
GameUI.gameenddraw(gameid, spid, times, timelong);
|
||||
};
|
||||
|
||||
gameabc_face.mousedown=function(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6)
|
||||
{
|
||||
|
||||
//点击代码
|
||||
GameUI.utlmousedown(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6);
|
||||
Game_Modify.utlmousedown(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6);
|
||||
gameCombat.utlmousedown(gameid, spid, downx, downy, no1, no2, no3, no4, no5, no6);
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.mousedown_nomove=function(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5)
|
||||
{
|
||||
//点击代没移动代码
|
||||
GameUI.utlmousedown_nomove(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5);
|
||||
Game_Modify.utlmousedown_nomove(gameid, spid, downx, downy, timelong, no1, no2, no3, no4, no5);
|
||||
};
|
||||
|
||||
gameabc_face.mouseup=function(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2)
|
||||
{
|
||||
//点击弹起代码
|
||||
//可以通过spid_down和spid_up 的比较 来判断是 点击还是 移动
|
||||
GameUI.utlmouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2);
|
||||
Game_Modify.mouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2);
|
||||
gameCombat.utlmouseup(gameid, spid_down, downx, downy, spid_up, upx, upy, timelong, no1, no2);
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.mousemove=function(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1)
|
||||
{
|
||||
//点击后移动代码
|
||||
|
||||
|
||||
GameUI.utlmousemove(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1);
|
||||
Game_Modify.utlmousemove(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1);
|
||||
gameCombat.utlmousemove(gameid, spid, downx, downy, movex,movey ,timelong,offmovex, offmovey, no1);
|
||||
};
|
||||
|
||||
gameabc_face.gamemydraw=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7)
|
||||
{
|
||||
//每个精灵更新绘画代码
|
||||
GameUI.utlgamemydraw(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7);
|
||||
Game_Modify.gamemydraw(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7);
|
||||
gameCombat.utlgamemydraw(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7);
|
||||
};
|
||||
|
||||
gameabc_face.gamemydrawbegin=function(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7)
|
||||
{
|
||||
//每个精灵更新前绘画代码
|
||||
GameUI.utlgamemydrawbegin(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7);
|
||||
Game_Modify.utlgamemydrawbegin(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7);
|
||||
gameCombat.utlgamemydrawbegin(gameid, spid, times, timelong, no2, no3, no4, no5, no6, no7);
|
||||
};
|
||||
|
||||
gameabc_face.ontimer= function(gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong,/* 开启后运行多少次了 */ alltimes){
|
||||
|
||||
|
||||
GameUI.utlontimer(gameid, spid, /* 本次间隔多少次了 */ times, /* 本次间隔多久 */ timelong,/* 开启后运行多少次了 */ alltimes);
|
||||
};
|
||||
|
||||
gameabc_face.tcpconnected=function(tcpid)
|
||||
{
|
||||
|
||||
};
|
||||
gameabc_face.tcpmessage=function(tcpid,data)
|
||||
{
|
||||
;
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.tcpdisconnected=function(tcpid)
|
||||
{
|
||||
|
||||
|
||||
|
||||
};
|
||||
gameabc_face.tcperror=function(tcpid,data)
|
||||
{
|
||||
|
||||
|
||||
};
|
||||
|
||||
gameabc_face.httpmessage=function(myid,url,data)
|
||||
{
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
4
codes/games/client/Projects/Game_Surface_3/js/jquery-2.1.1.min.js
vendored
Normal file
4
codes/games/client/Projects/Game_Surface_3/js/jquery-2.1.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user