@@ -277,65 +277,16 @@ idrinth.raids = {
277277 * @returns {function[] }
278278 */
279279 var getServerMethods = function ( ) {
280- var byAjax = function ( key ) {
281- idrinth . core . ajax . run (
282- idrinth . raids . join . getServerLink ( key ) ,
283- function ( ) {
284- idrinth . raids . join . messages . success ( key ) ;
285- } ,
286- function ( ) {
287- idrinth . raids . join . messages . failed ( key ) ;
288- } ,
289- function ( ) {
290- idrinth . raids [ key ] . joined = false ;
291- idrinth . raids . join . messages . failed ( key ) ;
292- }
293- ) ;
294- } ;
295280 /**
296281 *
297282 * @param {String } key
298- * @returns {undefined }
283+ * @returns {Function }
299284 */
300- var byFrame = function ( key ) {
301- var exist = document . getElementsByClassName ( 'idrinth-join-frame' ) . length ;
302- if ( exist >= idrinth . settings . get ( "windows" ) ) {
303- idrinth . raids . list [ key ] . joined = false ;
304- return ;
305- }
306- var frame = idrinth . ui . buildElement ( {
307- type : 'iframe' ,
308- css : 'idrinth-join-frame' ,
309- id : 'join-' + key ,
310- attributes : [
311- {
312- name : 'src' ,
313- value : idrinth . raids . join . getServerLink ( key )
314- } ,
315- {
316- name : 'sandbox' ,
317- value : 'allow-forms allow-pointer-lock allow-popups allow-same-origin allow-scripts'
318- } ,
319- {
320- name : 'style' ,
321- value : 'top:' + exist + 'px;'
322- } ,
323- {
324- name : 'onload' ,
325- value : 'try{event.stopPropagation();}catch(e){}idrinth.core.timeouts.add(\'raids.join.cleanup.' + key + '\',{function(){idrinth.ui.removeElement(\'' + key + '\');},1234);'
326- } ,
327- {
328- name : 'onunload' ,
329- value : 'try{event.stopPropagation();}catch(e){}'
330- }
331- ]
332- } ) ;
333- ( ( function ( key ) {
334- return idrinth . core . timeouts . add ( 'raids.join.remove.' + key , function ( ) {
335- idrinth . ui . removeElement ( 'join-' + key ) ;
336- } , 30000 ) ;
337- } ) ( key ) ) ;
338- idrinth . ui . base . appendChild ( frame ) ;
285+ var byMessage = function ( key ) {
286+ idrinth . inframe . send (
287+ 'joinRaid' ,
288+ ( idrinth . raids . join . getServerLink ( key ) ) . replace ( / ^ .* r a i d j o i n \. p h p / , 'raidjoin.php' )
289+ ) ;
339290 idrinth . raids . join . messages . trying ( key ) ;
340291 } ;
341292 /**
@@ -368,10 +319,8 @@ idrinth.raids = {
368319 }
369320 } ;
370321 var options = [ postLink ] ;
371- if ( idrinth . platform === 'armorgames' || idrinth . platform === 'kongregate' ) {
372- options . push ( byAjax ) ;
373- } else if ( idrinth . platform === 'facebook' || idrinth . platform === 'dawnofthedragons' ) {
374- options . push ( byFrame ) ;
322+ if ( idrinth . platform === 'armorgames' || idrinth . platform === 'kongregate' ) {
323+ options . push ( byMessage ) ;
375324 }
376325 return options ;
377326 } ;
@@ -381,7 +330,7 @@ idrinth.raids = {
381330 * @returns {Boolean }
382331 */
383332 var reachedMax = function ( amount ) {
384- return amount > 99 || ( ( idrinth . platform === 'facebook' || idrinth . platform === 'dawnofthedragons' ) && amount >= idrinth . settings . get ( "windows" ) ) ;
333+ return amount > 99 ;
385334 } ;
386335 /**
387336 *
0 commit comments