Raw Source
mcoo / zagraj.pl fix release

// ==UserScript==
// @name         zagraj.pl fix release
// @version      1.15
// @copyright 2017, Michał Makowski
// @license MIT
// @description  fighting incompetence
// @author       Michał Makowski
// @match        https://zagraj.pl/*/scrabble/*
// @updateURL https://openuserjs.org/meta/mcoo/My_Script.meta.js
// ==/UserScript==


(function() {
   window.mmak_patches={};var container=this;setInterval(function(){!window.mmak_patches.Board_countMoveScore&&container.scrabble&&container.scrabble.Engine&&(window.mmak_patches.Board_countMoveScore=!0,container.Board.prototype.countMoveScore=function(e){return function(){var t,s,i;for(t=s=this.moveCounter,i=e.RACK_CAPACITY-1;s<=i;t=s+=1)this.movePlates[t].setLogicalLocation(0,15);return this.engine.countScore(this.movePlates)}}(container.scrabble.Scrabble),console.log("Board.prototype.countMoveScore patched")),!window.mmak_patches.Engine_checkMove&&container.scrabble&&container.scrabble.Engine&&(window.mmak_patches.Engine_checkMove=!0,container.scrabble.Engine.prototype.checkMove=function(e){return function(t){var s,i,n,o,r,a,h,g,l,c,d,u,T,p,m,y,_,S;for(s=i=0,T=e.RACK_CAPACITY-1;i<=T;s=i+=1)this.move[s]=null;for(this.counter=0,g=15,a=-1,l=15,h=-1,this.moveType=e.MOVE_NOT_VALID,s=n=0,p=t.length-1;n<=p;s=n+=1)null!==t[s]&&(u=t[s].getLogicalLocation()).x<15&&-1!=u.x&&u.y<15&&-1!=u.y&&(g=Math.min(g,u.x),a=Math.max(a,u.x),l=Math.min(l,u.y),h=Math.max(h,u.y));if(l===h){for(s=o=g,m=a;o<=m;s=o+=1){if(null===this.gameBoard[s][h]&&-1===this.gameBoardI[s][h])return e.MOVE_NOT_VALID;null!==this.gameBoard[s][h]&&(this.move[this.counter++]=this.gameBoard[s][h])}this.moveType=e.MOVE_HORIZONTAL}else{if(g!==a)return e.MOVE_NOT_VALID;for(s=r=l,y=h;r<=y;s=r+=1){if(null===this.gameBoard[a][s]&&-1===this.gameBoardI[a][s])return e.MOVE_NOT_VALID;null!==this.gameBoard[a][s]&&(this.move[this.counter++]=this.gameBoard[a][s])}this.moveType=e.MOVE_VERTICAL}if(u=this.move[0].getLogicalLocation(),1===this.counter&&7===u.x&&7===u.y)return this.moveType=e.MOVE_NOT_VALID,e.MOVE_NOT_VALID;for(s=c=0,_=this.counter-1;c<=_;s=c+=1)if(this.move[s].getSet()%2==1&&0===this.move[s].getValue())return this.moveType=e.MOVE_NOT_VALID,e.MOVE_NOT_VALID;for(s=d=0,S=this.counter-1;d<=S;s=d+=1)if(u=this.move[s].getLogicalLocation(),this.isOldPlate(u.x-1,u.y)||this.isOldPlate(u.x+1,u.y)||this.isOldPlate(u.x,u.y+1)||this.isOldPlate(u.x,u.y-1)||7===u.x&&7===u.y)return this.moveType;return this.moveType=e.MOVE_NOT_VALID,e.MOVE_NOT_VALID}}(container.scrabble.Scrabble),console.log("scrabble.Engine.prototype.checkMove patched")),!window.mmak_patches.InviteWindow&&container.gui&&container.gui.InviteWindow&&(window.mmak_patches.InviteWindow=!0,container.gui.InviteWindow.prototype.actionPerformed=function(e,t){return function(s){var i,n;switch(s.getValue()){case e.BTN_SORT_BY_NAME:n=(i=this.inviteList.getCriteria())>=0,(i=Math.abs(i))===t.NAME_ASC?this.inviteList.setCriteria(i=t.NAME_DESC*(n?1:-1)):this.inviteList.setCriteria(i=t.NAME_ASC*(n?1:-1)),this.setSortCriteria(i);break;case e.BTN_SORT_BY_RANK:n=(i=this.inviteList.getCriteria())>=0,(i=Math.abs(i))===t.RANK_ASC?this.inviteList.setCriteria(i=t.RANK_DESC*(n?1:-1)):this.inviteList.setCriteria(i=t.RANK_ASC*(n?1:-1)),this.setSortCriteria(i);break;case e.BTN_SORT_CHANNEL_FILTER:this.inviteList.setCriteria(i=-this.inviteList.getCriteria()),this.setSortCriteria(i);break;case e.BTN_SORT_BY_TABLE:n=(i=this.inviteList.getCriteria())>=0,(i=Math.abs(i))===t.TABLE_ASC?this.inviteList.setCriteria(i=t.TABLE_DESC*(n?1:-1)):this.inviteList.setCriteria(i=t.TABLE_ASC*(n?1:-1)),this.setSortCriteria(i);break;case e.CWINDOW_MAGIC_NUMBER:this.setVisible(!1)}}}(container.gui.InviteWindow,container.gui.RoomUserInfo),console.log("gui.InviteWindow.prototype.actionPerformed patched")),!window.mmak_patches.Client_post&&container.room&&container.room.Client&&(window.mmak_patches.Client_post=!0,room.Client.prototype.post=function(e,t,s,i,n,o){return function(r,a){var h,g,l,c,d,u,T,p,m,y,_,S,I,C,w,E,N,B,f,b,v,A,M,U,L,O,k,R,P,V,W,z,D,G,K,x,F,H,q,j,Y,Z,Q,X,J,$,ee,te,se,ie,ne,oe,re,ae,he,ge,le,ce,de,ue,Te,pe;switch(r){case MessageType.ALIVE:return(L=new Message(4)).addShort(MessageType.ALIVE),L.addShort(this.link.getRoom()),this.link.send(L);case MessageType.CONNECT:return this.connectWindow.setVisible(!1),this.id=a.getInt(),this.menu.setActionButtonsActive(this.tableCreate),this.menu.setInfoButtonsActive(!0),this.requestFocus(),(L=new Message(8)).addShort(MessageType.SET_CONN_TIMEOUT),L.addShort(this.link.getRoom()),L.addInt(t.COMM_TIMEOUT),this.link.send(L),track("run",["html5","lobby",this.getParameter("gameid")]);case MessageType.ACCESS_DENIED:return Y=a.getByte(),this.close(1e3+Y);case MessageType.CHAT:return p=a.getInt(),this.colorString.color=o.getPredefinedColor(p%1e3),this.colorString.who=a.getUString(),this.colorString.who.length>0&&(this.colorString.who+=":"),this.colorString.text=a.getUString(),1===Math.floor(p/1e3)&&this.channelChooser.isVisible()&&this.channelChooser.setInfoLabel(this.colorString.text),this.outputPeer.add(this.colorString);case MessageType.OPEN_WINDOW:return this.openWindow(a.getUString(),a.getUString(),a.getInt(),a.getInt(),0!==a.getByte(),0!==a.getByte(),0!==a.getByte(),0!==a.getByte());case e.CREATE_TABLE:switch(G=a.getShort()){case t.NO_TABLES_AVAILABLE:return this.systemMessage("Stół nie mógł zostać utworzony. Aktualnie brak wolnych stołów w tej sali.");case t.USER_TABLE_LIMIT:return this.systemMessage("Stół nie mógł zostać utworzony. Aktualnie przebywasz na maksymalnej ilości stołów dostępnych dla jednego gracza.");case t.TABLE_CREATION_ERROR:return this.systemMessage("Stół nie mógł zostać utworzony. Skontaktuj się  z administratorem.");default:return G>0?this.openTableWindow("t="+G,G):this.systemMessage("Stół nie mógł zostać utworzony. Skontaktuj się z administratorem. Kod błędu: "+G)}break;case MessageType.ADD_USER:if(ue=a.getInt(),W=a.getUString(),j=a.getShort(),ae=a.getByte(),U=a.getByte(),l=a.getInt(),u=a.getUString(),c=a.getByte(),T=a.getInt(),le=a.getShort(),he=a.getByte(),!this.presentUsers.containsKey(W))return this.setFrozen(!0),this.addUser(ue,W,ae,j,l,le,he,U),this.channelChooser.addChannel(l,u,c,T),this.channelChooser.addUser(W,l,j,ae,le,U),this.usersCounterLabel.setCaption(" "+this.presentUsers.size()+" :"),this.setFrozen(!1);break;case MessageType.PRESENT_USERS:for(this.setFrozen(!0),Log.t("users begin"),a.inflate(),this.kibitzOnly.setActive(1===a.getByte()),this.menu.setTournamentsButtonActive(null!==this.getParameter("tourpath")),M=a.getInt(),Log.t("users1a"),b=0,Z=M-1;b<=Z;b+=1)l=a.getInt(),u=a.getUString(),c=a.getByte(),T=a.getInt(),this.channelChooser.addChannel(l,u,c,T);for(R=a.getUString(),window.playerName!==R&&(window.playerName=R),g=a.getUString(),a.getShort(),P=a.getByte(),k=a.getByte(),this.focusControlOn=1===a.getByte(),(O=this.getImage(g)).setVisible(!0),this.myChannel=a.getInt(),this.userInfo.setData(R,O,P,k),M=a.getInt(),Log.t("users1b"),A=0,Q=M-1;A<=Q;A+=1)ue=a.getInt(),W=a.getUString(),j=a.getShort(),ae=a.getByte(),U=a.getByte(),l=a.getInt(),le=a.getShort(),he=a.getByte(),this.addUser(ue,W,ae,j,l,le,he,U),this.channelChooser.addUser(W,l,j,ae,le,U);return Log.t("users2"),this.usersCounterLabel.setCaption(" "+M+" :"),this.channelChooser.setMyChannel(this.myChannel),this.showChannel&&(this.changeFocus(this.channelChooser.getChannelInput()),this.channelChooser.show()),this.setFrozen(!1);case MessageType.ADD_IGNORED_USER:if(W=a.getUString(),1===a.getByte()?(this.outputPeer.addIgnoredUser(W+":"),this.systemMessage(W+" został zignorowany.")):(this.outputPeer.removeIgnoredUser(W+":"),this.systemMessage(W+" przestał być ignorowany.")),this.userInfoWindow.name.equals(W))return this.userInfoWindow.refresh();break;case MessageType.IGNORED_USERS:for(ne=[],V=0,X=(M=a.getInt())-1;V<=X;V+=1)W=a.getUString(),this.outputPeer.addIgnoredUser(W+":"),this.userInfoWindow.name.equals(W)?ne.push(this.userInfoWindow.refresh()):ne.push(void 0);return ne;case MessageType.REMOVE_USER:return this.setFrozen(!0),W=a.getUString(),de=this.presentUsers.remove(W),this.presentUsersI.remove(de.getUserId()),null!==de&&(this.playerList.remove(de),this.channelChooser.removeUser(W,de.getChannel(),a.getInt()),this.usersCounterLabel.setCaption(" "+this.presentUsers.size()+" :")),this.userInfoWindow.name.equals(W)&&this.userInfoWindow.setData(null,null),this.setFrozen(!1);case MessageType.FRIENDS_LIST:for(x=0,J=(M=a.getInt())-1;x<=J;x+=1)S=a.getInt(),this.foes.remove(S),this.knowns.remove(S),this.friends.put(S,this);return null!==(de=this.presentUsersI.get(S))&&(de.setType(n.U_FRIEND),de.repaint()),this.friendsUpdated=!0,!0;case MessageType.FOES_LIST:for(q=0,$=(M=a.getInt())-1;q<=$;q+=1)_=a.getInt(),this.friends.remove(_),this.knowns.remove(_),this.foes.put(_,this),null!==(de=this.presentUsersI.get(_))&&(de.setType(n.U_FOE),-1!==this.userInfo.medal&&this.outputPeer.addIgnoredUser(de.getName()+":"),de.repaint());return this.foesUpdated=!0,!0;case MessageType.KNOWNS_LIST:for(oe=0,ee=(M=a.getInt())-1;oe<=ee;oe+=1)v=a.getInt(),this.foes.remove(v),this.friends.remove(v),this.knowns.put(v,this),null!==(de=this.presentUsersI.get(v))&&(de.setType(n.U_KNOWN),de.repaint());return this.knownsUpdated=!0,!0;case MessageType.FRIEND_CHANGE:if(S=a.getInt(),S<0?this.friends.remove(-S):(this.foes.remove(S),this.knowns.remove(S),this.friends.put(S,this)),null!==(de=this.presentUsersI.get(S))&&(S>0&&(de.setType(n.U_FRIEND),-1!==this.userInfo.medal?this.outputPeer.removeIgnoredUser(de.getName()+":"):de.setType(n.U_NEUTRAL)),de.repaint(),de===this.userInfoWindow.rui))return this.userInfoWindow.refresh();break;case MessageType.FOE_CHANGE:if(_=a.getInt(),_<0?this.foes.remove(-_):(this.friends.remove(_),this.knowns.remove(_),this.foes.put(_,this)),null!==(de=this.presentUsersI.get(_))&&(_>0&&(de.setType(n.U_FOE),-1!==this.userInfo.medal?this.outputPeer.addIgnoredUser(de.getName()+":"):de.setType(n.U_NEUTRAL)),de.repaint(),de===this.userInfoWindow.rui))return this.userInfoWindow.refresh();break;case MessageType.KNOWN_CHANGE:if(v=a.getInt(),v<0?this.knowns.remove(-v):(this.friends.remove(v),this.foes.remove(v),this.knowns.put(v,this)),null!==(de=this.presentUsersI.get(v))&&(v>0?de.setType(n.U_KNOWN):de.setType(n.U_NEUTRAL),de.repaint(),de===this.userInfoWindow.rui))return this.userInfoWindow.refresh();break;case MessageType.TABLE_CHANGE:for(G=a.getShort(),null===(re=this.tables.get(G))&&((re=new s(G,this.maxPlayers,t.TABLES_WIDTH)).setNoGameTypeSort(5!==this.roomNumber),this.tables.put(G,re),this.tableList.add(re),re.setActionListener(this),re.setStateChangeListener(this.tableList),re.init()),r=a.getByte(),I=1===a.getByte(),w=a.getUString(),C=a.getUString(),z=[],f=ge=0,te=(M=a.getByte())-1;ge<=te;f=ge+=1)z[f]=a.getUString();return re.updateData(z,w,r,I,C),re.setVisible(!0);case MessageType.TABLE_REMOVE:return this.setFrozen(!0),G=a.getShort(),this.inviteWindows.containsKey(G)&&this.container.remove(this.inviteWindows.remove(G)),m=this.tables.remove(G),this.tableList.remove(m),this.setFrozen(!1);case MessageType.TABLES:for(this.setFrozen(!0),a.inflate(),ce=0,se=a.getShort()-1;ce<=se;ce+=1){for(G=a.getShort(),null===(re=this.tables.get(G))&&((re=new s(G,this.maxPlayers,t.TABLES_WIDTH)).setNoGameTypeSort(5!==this.roomNumber),this.tables.put(G,re),this.tableList.add(re),re.setActionListener(this),re.setStateChangeListener(this.tableList),re.init()),r=a.getByte(),I=1===a.getByte(),w=a.getUString(),C=a.getUString(),z=[],f=Te=0,ie=(M=a.getByte())-1;Te<=ie;f=Te+=1)z[f]=a.getUString();re.updateData(z,w,r,I,C)}return this.tableList.setAllTablesVisible(!0),this.setFrozen(!1);case e.CHANGE_CHANNEL:if(pe=a.getUString(),d=a.getInt(),1===a.getByte()&&(u=a.getUString(),c=a.getByte(),T=a.getInt(),this.channelChooser.addChannel(d,u,c,T)),D=a.getInt(),!this.presentUsers.containsKey(pe))return;if(de=this.presentUsers.get(pe),this.channelChooser.changeChannel(pe,de.getChannel(),d,D),de.setChannel(d),this.userInfo.fullName.equals(pe))for(this.myChannel=d,this.channelChooser.setMyChannel(this.myChannel),this.passwordWindow.setVisible(!1),this.channelChooser.setVisible(!1),this.refreshKeyListener(),y=this.presentUsers.elements();y.hasMoreElements();)(de=y.nextElement()).setUserChannel(de.getChannel()===this.myChannel);else de.setUserChannel(de.getChannel()===this.myChannel);if(this.playerList.setCriteria(this.playerList.getCriteria()),this.userInfoWindow.name.equals(pe))return this.userInfoWindow.refresh();break;case MessageType.RANK_CHANGE:if(W=a.getUString(),null===(de=this.presentUsers.get(W)))return;return a.getInt(),j=a.getInt(),de.setStar(a.getByte()),de.setRank(j,this.modifier),this.channelChooser.rankChange(W,de.getChannel(),j,de.getStar()),this.userInfo.name.equals(W)&&(this.userInfo.star=de.getStar(),this.userInfo.repaint()),this.playerList.remove(de),this.playerList.add(de);case MessageType.USER_CHANGE:if(W=a.getUString(),le=a.getShort(),null===(de=this.presentUsers.get(W)))return;return-999===le?(U=a.getByte(),de.setMedal(U),this.userInfo.fullName.equals(W)&&this.userInfo.setMedal(U),void this.channelChooser.refreshMedal(W,de.getChannel(),U)):(-888===le&&(this.focusControlOn=1===a.getByte(),this.focusControl.setChecked(this.focusControlOn)),de.refreshTableId(le),this.channelChooser.refreshTableId(W,de.getChannel(),le),this.userInfoWindow.name.equals(W)&&this.userInfoWindow.refresh(),this.playerList.remove(de),this.playerList.add(de));case e.CHECK_TABLE_ACCEESS:return le=a.getShort(),H=a.getByte(),le>0?H>=0?this.openTableWindow("t="+le+"&p="+H,le):this.openTableWindow("t="+le,le):0===le?this.systemMessage("Nie możesz dołączyć do stołu. Aktualnie przebywasz na maksymalnej ilości stołów dostępnych dla jednego gracza."):this.gameIdString.equals("5")?this.systemMessage("Nie możesz dołączyć do stołu nr "+-le+" ponieważ jest on prywatny lub przebywasz już na drugim stole należącym do tego samego meczu lub grasz to samo rozdanie."):this.systemMessage("Stół nr "+-le+" jest prywatny i nie możesz do niego dołączyć.");case MessageType.INVITE:if(G=a.getShort(),N=a.getInt(),W=a.getUString(),K=a.getUString(),B=a.getInt(),g=a.getUString(),O=this.getImage(g),ae=a.getByte(),this.inviteOff||this.outputPeer.isUserIgnored(W+":"))return void this.sendInviteAnswer(G,N,MessageType.INVITE_BARRICADE);if(this.inviteWindows.containsKey(G)&&this.container.remove(this.inviteWindows.remove(G)),this.inviteWindows.size()===t.INVITATIONS_LIMIT)return;return this.soundOn&&Toolkit.getDefault().beep(),E=new i(t.cc),this.container.add(E),E.setBounds(85+10*this.inviteWindows.size(),50+10*this.inviteWindows.size(),300,110),E.setTitle("zaproszenie"),E.init(this,this.container,N,W,G,K,B,O,this.modifier,ae),E.setColors(t.c1,t.c2,t.c3),E.setVisible(!0),this.inviteWindows.put(G,E);case MessageType.SUPERUSER_CHANGE:if(ue=a.getInt(),he=a.getByte(),null!==(de=this.presentUsersI.get(ue)))return de.setSuperuser(he),de.repaint();break;case e.PASSWORD:return F=a.getUString(),null!==F&&(F.equals("+")||F.equals("-"))?this.channelChooser.accessChange(a.getInt(),F):this.channelChooser.setPassword(F),this.passwordWindow.setVisible(!1),this.refreshKeyListener();case MessageType.HIDERANK_CHANGE:if(W=a.getUString(),h=a.getByte(),null===(de=this.presentUsers.get(W)))return;if(ae=de.getStar(),ae<MessageType.HIDDEN_STAR_BOUND&&1===h?ae+=MessageType.HIDDEN_STAR_MODIFIER:ae>=0&&0===h&&(ae-=MessageType.HIDDEN_STAR_MODIFIER),ae===de.getStar())return;return de.setStar(ae),this.channelChooser.starChange(W,de.getChannel(),ae),this.userInfo.name.equals(W)&&(this.userInfo.star=ae,this.userInfo.repaint()),this.playerList.remove(de),this.playerList.add(de);case e.TOURNAMENT_REQ:return this.cwindow2.setTitle("uczestnictwo w turnieju"),this.cwindow2.setText("Nie było Cię podczas rozstawiania do poprzedniej rundy lub serwer był restartowany.","Czy chcesz wziąć udział w pozostałej części turnieju?"),this.cwindow2.setVisible(!0);default:return console.log("MessageReceived: "+r+" "+a)}}}.call(container.room.Client,container.room.Client,container.room.Room,container.room.SmallTable,container.room.InviteAnswerWindow,container.gui.RoomUserInfo,container.gui.ColorString),console.log("room.Client.prototype.post patched")),!window.mmak_patches.Client_actionPerformed&&container.scrabble&&container.scrabble.Client&&(window.mmak_patches.Client_actionPerformed=!0,scrabble.Client.prototype.actionPerformed=function(e,t,s,i,n,o){return function(s){var r,a,h,g,l,c,d,u,T;if(r=s.getValue(),c=null,(d=s.getSource())instanceof i)this.openInfoWindow(s.getCommand());else{if(!(d instanceof t)){switch(r){case e.BTN_START:this.menu.setStartButtonActive(!1),(c=new Message(5)).addShort(o.START),c.addShort(this.link.getRoom()),c.addByte(this.board.engine.myPosition);break;case e.BTN_INVITE:return this.inviteWindow.toTop(),void(this.inviteWindow.isVisible()||(this.inviteWindow.setVisible(!0),this.sendRoomUsers()));case e.BTN_INVITE_REFRESH:return void this.sendRoomUsers();case e.BTN_BOOT:return this.bootWindow.setVisible(!0),void this.bootWindow.toTop();case e.BTN_BOOT_CLOSE:return void this.bootWindow.setVisible(!1);case e.BTN_STANDUP:this.cwindow.setVisible(!1),this.cwindow2.setVisible(!1),this.board.removeAllPlates(),this.menu.setAllPlayerButtonsActive(!1),this.menu.setButtonsMode(Menu.MODE_NONE),(c=new Message(5)).addShort(o.STAND_UP),c.addShort(this.link.getRoom()),c.addByte(this.board.engine.myPosition),this.places[this.board.engine.myPosition].stopTimers(),this.board.engine.setMyPosition(Engine.NEUTRAL);break;case e.BTN_HELP:return void this.openHelpWindow();case e.BTN_MINIMIZE_BLANK:return this.blankSelectorWindowBig?(this.blankSelector.setVisible(!1),this.nextBlank.setVisible(!1),this.clearBlank.setVisible(!1),this.minimizeBlank.setCaption("<>"),this.cwindow.resize(228,20)):(this.cwindow.resize(228,155),this.minimizeBlank.setCaption("><"),this.blankSelector.setVisible(!0),this.blankSelector.toTop(),this.nextBlank.setVisible(!0),this.clearBlank.setVisible(!0)),void(this.blankSelectorWindowBig=!this.blankSelectorWindowBig);case e.BTN_EXIT:return this.actionExit(),void this.closeAppletWindow();case e.BTN_OK:return void this.actionOk();case e.BTN_CHECK:case e.BTN_ACCEPT:return void this.actionAcceptCheck(r);case e.BTN_CHANGE:return void this.actionChange();case e.BTN_PASS:return void this.actionPass();case e.BTN_UNDO:return void this.actionUndo();case e.BTN_SKIP:this.menu.setVotingButtonsActive(!1),(c=new Message(5)).addShort(o.SKIP_GAME),c.addShort(this.link.getRoom()),c.addByte(this.board.engine.myPosition);break;case e.BTN_SIT1:case e.BTN_SIT2:case e.BTN_SIT3:case e.BTN_SIT4:return void this.actionSit(r-e.BTN_SITS);case e.BTN_ANSWER_YES:this.places[this.board.engine.myPosition].stopAcceptTimer();case e.BTN_ANSWER_NO:this.cwindow2.setVisible(!1),(c=new Message(6)).addShort(this.votingType),c.addShort(this.link.getRoom()),c.addByte(this.board.engine.myPosition),c.addByte(r-e.BTN_ANSWERS);break;case e.BTN_PG_UP:return void this.playerList.prevPage();case e.BTN_PG_DN:return void this.playerList.nextPage();case e.BTN_BOOT_PG_UP:return void this.bootList.prevPage();case e.BTN_BOOT_PG_DN:return void this.bootList.nextPage();case e.BTN_SOUND:return;case e.BTN_GAME_RANKED:return this.radio3[3].setChecked(!0),this.group3.setActive(!1),this.radio4[5].setActive(!1),void this.radio4[6].setActive(!1);case e.BTN_GAME_FREE:return this.id===this.host&&this.group3.setActive(!0),this.radio4[5].setActive(!0),void this.radio4[6].setActive(!0);case e.BTN_OPTIONS:return this.sound.setChecked(this.soundOn),this.insertMode.setChecked(this.insertModeOn),this.group1.activateElement(e.BTN_TABLE_TYPES+this.tableType),this.group2.activateElement(e.BTN_GAME_TYPES+this.board.engine.gameType),this.group3.activateElement(e.BTN_ROUND_TIMES+this.roundTime),this.group4.activateElement(e.BTN_GAME_TIMES+this.gameTime),this.focusControl.setChecked(this.focusControlOn),this.cwindow3.setVisible(!0),void this.cwindow3.toTop();case e.BTN_OPTIONS_ACCEPT:if(this.soundOn=this.sound.isChecked(),this.insertModeOn=this.insertMode.isChecked(),h=this.focusControl.isChecked(),T=this.group1.getChecked()-e.BTN_TABLE_TYPES,g=this.group2.getChecked()-e.BTN_GAME_TYPES,u=this.group3.getChecked()-e.BTN_ROUND_TIMES,l=this.group4.getChecked()-e.BTN_GAME_TIMES,a=n.DICT_STD,this.tableType===T&&this.board.engine.gameType===g&&this.roundTime===u&&this.gameTime===l&&this.focusControlOn===h&&this.dictType===a)return void this.cwindow3.setVisible(!1);(c=new Message(10)).addShort(o.TABLE_OPTIONS),c.addShort(this.link.getRoom()),c.addByte(T),c.addByte(g),c.addByte(u),c.addByte(l),c.addByte(h?1:0),c.addByte(a),this.cwindow3.setVisible(!1);break;case e.BTN_OPTIONS_CANCEL:return void this.cwindow3.setVisible(!1);case e.BTN_USED_PLATES:return this.cwindow4.setVisible(!0),void this.cwindow4.toTop();case e.BTN_CLEAR_USED:return void this.usedPlates.clear();default:return}return this.link.send(c)}this.inviteUser(s.getCommand())}}}(container.scrabble.ButtonTypes,container.gui.RoomUserInfo,container.gui.ColorString,container.gui.UserInfo,container.scrabble.Scrabble,container.scrabble.Client),console.log("room.Client.prototype.actionPerformed patched"),awt.Point.prototype.equals=function(e){return function(t){return t instanceof e&&t.x===this.x&&t.y===this.y}}(awt.Point),console.log("awt.Point.prototype.equals patched"))},2e3),console.log("Patches loaded");
})();