Skip to content

Commit 265a935

Browse files
committed
fix: GRCRT (again) too fast on Firefox
there are these days, where script runs faster than the game ;)
1 parent f12ca9d commit 265a935

File tree

3 files changed

+8
-109
lines changed

3 files changed

+8
-109
lines changed

GRCRT.f.errReporter.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ function grcrtErrReporter(err){
3636
sendErr()
3737
} else {
3838
console.log(_json);
39+
if(typeof Layout == "object" && typeof Layout.showConfirmDialog == "function"){
3940
Layout.showConfirmDialog(
4041
"GRCRTools oops!",
4142
'<div><img src="'+RepConv.grcrt_cdn+'img/octopus.png" style="float:left;padding-right: 10px"/><p style="padding:5px"><b>Found error</b><br/><pre>'+err+'</pre><br/>You want send?</p></div>',
@@ -44,5 +45,10 @@ function grcrtErrReporter(err){
4445
sendErr()
4546
}
4647
)
48+
} else {
49+
setTimeout(function(){
50+
grcrtErrReporter(err);
51+
},500);
52+
}
4753
}
4854
}

modules/GRCRT_AO.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function _GRCRT_AO() {
2525
,
2626
_scrollWidth = Object.size(GameData.researches)*(40+_aoMargin*2),
2727
_scrollLock = false,
28-
_towns = MM.getCollections().Town[0],
28+
_towns = null,//MM.getCollections().Town[0],
2929
_researchMode = true,
3030
_researchQueue = {};
3131

modules/RepConvGRC.js

Lines changed: 1 addition & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ function _RepConvGRC() {
470470
.mousePopup(new MousePopup(RepConvTool.GetLabel('STATS.PLAYER')));
471471
if ("https:" == window.location.protocol && (RepConv.active.statsGRCL != 'potusek')) {
472472
$(_link).attr({
473-
//'href' : getStatsLink('player', $(this).attr('player_id'), $(this).attr('player_name')),
474473
'href' : getStatsLink('player', _player, _player_name),
475474
'target' : '_blank'
476475
})
@@ -1697,41 +1696,18 @@ function _RepConvGRC() {
16971696
function showStats(what, who_id, who_name){
16981697
var
16991698
RepConvNode = $('<div/>', {'id': 'RepConvNode'});
1700-
// if (RepConv.active.statsGRCL == 'grepostats') {
1701-
// var website = getStatsLink(what, who_id, who_name);
1702-
// RepConvNode.append($('<iframe/>', {'src': website, 'style': 'width: 975px; height: 480px;'}));
1703-
// Layout.dialogWindow.open(RepConvNode.html().toString(), RepConvTool.GetLabel('STATS.'+what.toUpperCase()), 975, 480, null, false).setPosition("center", "center");
1704-
// } else
1705-
if (RepConv.active.statsGRCL == 'grepointel') {
1706-
if (what == 'player') {
1707-
what = 'pn';
1708-
} else if (what == 'alliance') {
1709-
what = 'an'
1710-
}
1711-
var website = getStatsLink(what, who_id, who_name);
1712-
RepConvNode.append($('<iframe/>', {'src': website, 'style': 'width: 1020px; height: 580px;'}));
1713-
Layout.dialogWindow.open(RepConvNode.html().toString(), RepConvTool.GetLabel('STATS.'+what.toUpperCase()), 1020, 580, null, false).setPosition("center", "center");
1714-
} else {
1715-
//try {
1716-
// (WM.getWindowByType("grcrt_stats")[0]).close()
1717-
//} catch (e){}
1699+
if (RepConv.active.statsGRCL == 'potusek') {
17181700
WF.open("grcrt_stats",{
17191701
args: {
17201702
'what': what,
17211703
'id': who_id,
17221704
'name': who_name
17231705
}
17241706
})
1725-
//var website = RepConv.grcrt_domain+'light/'+what+'/' + Game.world_id + '/' + who_id + '/' + Game.locale_lang;
1726-
//RepConvNode.append($('<iframe/>', {'src': website, 'style': 'width: 825px; height: 625px; border: 0px'}));
1727-
//Layout.dialogWindow.open(RepConvNode.html().toString(), RepConvTool.GetLabel('STATS.'+what.toUpperCase()), 825, 690, function(){},false).setPosition("center", "center");
17281707
}
17291708
}
17301709
function getStatsLink(what, who_id, who_name){
17311710
var website;
1732-
// if (RepConv.active.statsGRCL == 'grepostats') {
1733-
// website = 'http://' + Game.market_id + '.grepostats.com/world/' + Game.world_id + '/'+what+'/' + who_id;
1734-
// } else
17351711
if (RepConv.active.statsGRCL == 'grepointel') {
17361712
if (what == 'player') {
17371713
what = 'pn';
@@ -1792,72 +1768,6 @@ function _RepConvGRC() {
17921768
} catch (e){}
17931769
}
17941770

1795-
//function wonderLinks(RCGP) {
1796-
// if (RCGP.getJQElement().find($('.grcrt_linkbox')).length == 0) {
1797-
// RCGP.setHeight(540)
1798-
// var _div = $('<div/>',{'class':'grcrt_linkbox'})
1799-
// .css({'margin': '0px 5px 10px 0px','padding': '0 30px'});
1800-
// _div
1801-
// .append(
1802-
// $('<a/>',{
1803-
// 'href':'http://devpotusek.potusek.eu/'+Game.locale_lang+'/wonder/'+Game.world_id+'/'+Game.alliance_id+'/'+RepConv.hash+'#'+WorldWonders.all_wonders[WorldWonders.wonder_nr].wonder_type,'target':'_blank'})
1804-
// .css({'float': 'left'})
1805-
// .html('Pokaż mój udział w budowie')
1806-
// )
1807-
// if (MM.checkAndPublishRawModel('Player', {id : Game.player_id}).getAllianceRights().founder || MM.checkAndPublishRawModel('Player', {id : Game.player_id}).getAllianceRights().leader) {
1808-
// _div
1809-
// .append(
1810-
// $('<a/>',{
1811-
// 'href':'http://devpotusek.potusek.eu/'+Game.locale_lang+'/wonder/'+Game.world_id+'/'+Game.alliance_id+'/'+($.md5(Game.alliance_id + "_" + Game.world_id))+'#'+WorldWonders.all_wonders[WorldWonders.wonder_nr].wonder_type,'target':'_blank'})
1812-
// .css({'float': 'right'})
1813-
// .html('Pokaż udział członków sojuszu w budowie')
1814-
// )
1815-
// }
1816-
// _div
1817-
// .append(
1818-
// $('<br/>').css('clear','both')
1819-
// )
1820-
// _div
1821-
// .insertAfter(RCGP.getJQElement().find($('.gpwindow_content>.wonder_state>.game_border')).eq(0))
1822-
// }
1823-
//}
1824-
1825-
function logWonderSend(data){
1826-
// var
1827-
// _wonder = wonders[data.island_x+'_'+data.island_y],
1828-
// _json = {
1829-
// lang:Game.world_id.substr(0,2),
1830-
// world:Game.world_id,
1831-
// wonder_id:WorldWonders.all_wonders[_wonder].id,
1832-
// wonder_lvl:WorldWonders.all_wonders[_wonder].expansion_stage,
1833-
// alliance_id:MM.checkAndPublishRawModel("Player", {
1834-
// id: Game.player_id
1835-
// }).getAllianceId(),
1836-
// player_id:Game.player_id,
1837-
// wood:data.wood,
1838-
// stone:data.stone,
1839-
// iron:data.iron,
1840-
// power:data.power,
1841-
// wonder_type: WorldWonders.all_wonders[_wonder].wonder_type,
1842-
// wonder_name: JSON.parse(
1843-
// RepConvTool.Atob(
1844-
// $('a.gp_goto_wonder_link').attr('href')
1845-
// )
1846-
// ).name,
1847-
// player_hash : RepConv.hash,
1848-
// alliance_hash : $.md5(MM.checkAndPublishRawModel("Player", {
1849-
// id: Game.player_id
1850-
// }).getAllianceId() + "_" + Game.world_id)
1851-
// },
1852-
// _send = $.ajax({
1853-
// 'url' : RepConv.grcrt_domain+'wonder.php',
1854-
// 'method' : 'post',
1855-
// 'data' : {json:(JSON.stringify(_json))},
1856-
// 'cache':false,
1857-
// 'async':true
1858-
// });
1859-
}
1860-
18611771
function posibleSpell(RCGP){
18621772
if (RepConv.active.power) {
18631773
switch (RCGP.getContext().sub) {
@@ -1868,9 +1778,6 @@ function _RepConvGRC() {
18681778
.css('opacity','0.4')
18691779
.attr('href',null)
18701780
.attr('onclick',null);
1871-
//$.each(RCGP.getJQElement().find($('.js-power-icon').filter(function(){return !$(this).hasClass('disabled')})), function(ind, elem){
1872-
// $(elem).find($('div[name=counter]')).remove()
1873-
//})
18741781

18751782
RepConv.Debug && console.log('loadPower');
18761783
$.each(RCGP.getJQElement().find($('.js-power-icon div[name=counter]')), function(ind, elem) {
@@ -2012,9 +1919,7 @@ function _RepConvGRC() {
20121919
list_pos : 'left',
20131920
value : RepConv.active.statsGRCL,
20141921
options : [
2015-
//{value: 'potusek', name: 'grepolis.potusek.eu'},
20161922
{value: 'potusek', name: 'www.grcrt.net'},
2017-
//{value: 'grepostats', name: "grepostats.com"},
20181923
{value: 'grepointel', name: "grepointel.com"}
20191924
]
20201925
})
@@ -2280,17 +2185,6 @@ function _RepConvGRC() {
22802185
}
22812186
}
22822187

2283-
var acc = {}, alliance_name = MM.checkAndPublishRawModel('Player',{id:Game.player_id}).getAllianceName()
2284-
$.each(ITowns.towns, function(ind,town){
2285-
var cc = town;
2286-
cc.points = cc.getPoints();
2287-
cc.player_name = Game.player_name
2288-
cc.alliance_name = alliance_name
2289-
acc[ind]=cc
2290-
})
2291-
2292-
2293-
22942188
function emotsTabs(wndType, action){//insertArea){
22952189
var content = $('<div/>', {'class': 'gpwindow_content', 'style': 'overflow-y:auto !important; max-height: 185px; min-height: 120px;'}),
22962190
contentLinks = $('<ul/>', {'class':'menu_inner grcrt_menu_inner', 'style':'padding: 0px;left:0px;'}),
@@ -3396,7 +3290,6 @@ $.each(ITowns.towns, function(ind,town){
33963290
json.iron = (settings.url.indexOf('decrease_build_time_with_favor')>-1) ? 0 : json.iron,
33973291
json.power = (settings.url.indexOf('decrease_build_time_with_favor')>-1) ? 400 : 0,
33983292
RepConv.Debug && console.log(json);
3399-
// logWonderSend(json);
34003293
}
34013294
//} catch (e){}
34023295
$.each(Layout.wnd.getAllOpen(), function(ind, elem) {

0 commit comments

Comments
 (0)