Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0011688 [DCSS] Support Request major have not tried 2018-09-22 18:54 2018-09-24 09:00
Reporter stoneychips View Status public  
Assigned To
Priority normal Resolution open  
Status confirmed   Product Branch 0.22 development branch
Summary 0011688: Game does not always load (black screen, only spectator window visible)
Description Not clear whether to call this a bug, but seeking advice. (Thanks!)

Having just launched a new game, I was seeing only black with the spectator window, nothing else. That is on CPO. I started another game on LLD, also in 0.22 at the same time with no problem. This particular instance has finally resolved after maybe 20-30 minutes, at which point hitting return in the black finally got me into that game again. However, when that happens at the start of the game, you lose visibility of the character selection step entirely.

I generally play on Chrome on Webtiles, CPO. I have been having very minor occurrences of this near-blackout for some time, at least before the last tournament. Typically, I hit refresh and after one or two reloads or occasionally a cache clear, things return to normal. Today I was stuck in the black despite refreshes, clearing cache, restarting browser, trying Firefox (same thing there), restarting the computer, and waiting about 10 minutes and refreshing again.

The last game I completed normally on CPO, just before this occurred is this morgue file. I'm not sure why, but it does not have any version number showing? (Have there been any changes so we don't see these now?)
https://crawl.project357.org/morgue/loopi/morgue-loopi-20180922-151015.txt [^]

The developer window in CPO showed this while stuck in the blackness:

!function(e){function t(){function e(e,t,n,i,c,d,u,h,g,p,b){var v,w,y,x,k,D,M,O,C,N,j,q,I,T,U;N=0,k=n;do a[e[t+N]]++,N++,k--;while(0!==k);if(a[0]==n)return u[0]=-1,h[0]=0,l;for(O=h[0],D=1;S>=D&&0===a[D];D++);for(M=D,D>O&&(O=D),k=S;0!==k&&0===a[k];k--);for(y=k,O>k&&(O=k),h[0]=O,T=1<<D;k>D;D++,T<<=1)if((T-=a[D])<0)return _;if((T-=a[k])<0)return _;for(a[k]+=T,o[1]=D=0,N=1,I=2;0!==--k;)o[I]=D+=a[N],I++,N++;k=0,N=0;do 0!==(D=e[t+N])&&(b[o[D]++]=k),N++;while(++k<n);for(n=o[y],o[0]=k=0,N=0,x=-1,q=-O,r[0]=0,j=0,U=0;y>=M;M++)for(v=a[M];0!==v--;){for(;M>q+O;){if(x++,q+=O,U=y-q,U=U>O?O:U,(w=1<<(D=M-q))>v+1&&(w-=v+1,I=M,U>D))for(;++D<U&&!((w<<=1)<=a[++I]);)w-=a[I];if(U=1<<D,p[0]+U>m)return _;r[x]=j=p[0],p[0]+=U,0!==x?(o[x]=k,s[0]=D,s[1]=O,D=k>>>q-O,s[2]=j-r[x-1]-D,g.set(s,3*(r[x-1]+D))):u[0]=j}for(s[1]=M-q,N>=n?s[0]=192:b[N]<i?(s[0]=b[N]<256?0:96,s[2]=b[N++]):(s[0]=d[b[N]-i]+16+64,s[2]=c[b[N++]-i]),w=1<<M-q,D=k>>>q;U>D;D+=w)g.set(s,3*(j+D));for(D=1<<M-1;0!==(k&D);D>>>=1)k^=D;for(k^=D,C=(1<<q)-1;(k&C)!=o[x];)x--,q-=O,C=(1<<q)-1}return 0!==T&&1!=y?f:l}function t(e){var t;for(n||(n=[],i=[],a=new Int32Array(S+1),s=[],r=new Int32Array(S),o=new Int32Array(S+1)),i.length<e&&(i=[]),t=0;e>t;t++)i[t]=0;for(t=0;S+1>t;t++)a[t]=0;for(t=0;3>t;t++)s[t]=0;r.set(a.subarray(0,S),0),o.set(a.subarray(0,S+1),0)}var n,i,a,s,r,o,c=this;c.inflate_trees_bits=function(a,s,r,o,l){var c;return t(19),n[0]=0,c=e(a,0,19,19,null,null,r,s,o,n,i),c==_?l.msg="oversubscribed dynamic bit lengths tree":(c==f||0===s[0])&&(l.msg="incomplete dynamic bit lengths tree",c=_),c},c.inflate_trees_dynamic=function(a,s,r,o,c,d,u,g,m){var p;return t(288),n[0]=0,p=e(r,0,a,257,k,D,d,o,g,n,i),p!=l||0===o[0]?(p==_?m.msg="oversubscribed literal/length tree":p!=h&&(m.msg="incomplete literal/length tree",p=_),p):(t(288),p=e(r,a,s,0,M,O,u,c,g,n,i),p!=l||0===c[0]&&a>257?(p==_?m.msg="oversubscribed distance tree":p==f?(m.msg="incomplete distance tree",p=_):p!=h&&(m.msg="empty distance tree with lengths",p=_),p):l)}}function n(){function e(e,t,n,i,a,s,r,o){var d,u,h,f,m,p,b,v,w,y,x,k,D,M,O,S;b=o.next_in_index,v=o.avail_in,m=r.bitb,p=r.bitk,w=r.write,y=w<r.read?r.read-w-1:r.end-w,x=g[e],k=g[t];do{for(;20>p;)v--,m|=(255&o.read_byte(b++))<<p,p+=8;if(d=m&x,u=n,h=i,S=3*(h+d),0!==(f=u[S]))for(;;){if(m>>=u[S+1],p-=u[S+1],0!==(16&f)){for(f&=15,D=u[S+2]+(m&g[f]),m>>=f,p-=f;15>p;)v--,m|=(255&o.read_byte(b++))<<p,p+=8;for(d=m&k,u=a,h=s,S=3*(h+d),f=u[S];;){if(m>>=u[S+1],p-=u[S+1],0!==(16&f)){for(f&=15;f>p;)v--,m|=(255&o.read_byte(b++))<<p,p+=8;if(M=u[S+2]+(m&g[f]),m>>=f,p-=f,y-=D,w>=M)O=w-M,w-O>0&&2>w-O?(r.window[w++]=r.window[O++],r.window[w++]=r.window[O++],D-=2):(r.window.set(r.window.subarray(O,O+2),w),w+=2,O+=2,D-=2);else{O=w-M;do O+=r.end;while(0>O);if(f=r.end-O,D>f){if(D-=f,w-O>0&&f>w-O){do r.window[w++]=r.window[O++];while(0!==--f)}else r.window.set(r.window.subarray(O,O+f),w),w+=f,O+=f,f=0;O=0}}if(w-O>0&&D>w-O){do r.window[w++]=r.window[O++];while(0!==--D)}else r.window.set(r.window.subarray(O,O+D),w),w+=D,O+=D,D=0;break}if(0!==(64&f))return o.msg="invalid distance code",D=o.avail_in-v,D=D>p>>3?p>>3:D,v+=D,b-=D,p-=D<<3,r.bitb=m,r.bitk=p,o.avail_in=v,o.total_in+=b-o.next_in_index,o.next_in_index=b,r.write=w,_;d+=u[S+2],d+=m&g[f],S=3*(h+d),f=u[S]}break}if(0!==(64&f))return 0!==(32&f)?(D=o.avail_in-v,D=D>p>>3?p>>3:D,v+=D,b-=D,p-=D<<3,r.bitb=m,r.bitk=p,o.avail_in=v,o.total_in+=b-o.next_in_index,o.next_in_index=b,r.write=w,c):(o.msg="invalid literal/length code",D=o.avail_in-v,D=D>p>>3?p>>3:D,v+=D,b-=D,p-=D<<3,r.bitb=m,r.bitk=p,o.avail_in=v,o.total_in+=b-o.next_in_index,o.next_in_index=b,r.write=w,_);if(d+=u[S+2],d+=m&g[f],S=3*(h+d),0===(f=u[S])){m>>=u[S+1],p-=u[S+1],r.window[w++]=u[S+2],y--;break}}else m>>=u[S+1],p-=u[S+1],r.window[w++]=u[S+2],y--}while(y>=258&&v>=10);return D=o.avail_in-v,D=D>p>>3?p>>3:D,v+=D,b-=D,p-=D<<3,r.bitb=m,r.bitk=p,o.avail_in=v,o.total_in+=b-o.next_in_index,o.next_in_index=b,r.write=w,l}var t,n,i,a,s=this,r=0,o=0,d=0,h=0,f=0,m=0,p=0,b=0,v=0,w=0;s.init=function(e,s,r,o,l,c){t=C,p=e,b=s,i=r,v=o,a=l,w=c,n=null},s.proc=function(s,y,x){var k,D,M,O,S,L,R,E=0,K=0,F=0;for(F=y.next_in_index,O=y.avail_in,E=s.bitb,K=s.bitk,S=s.write,L=S<s.read?s.read-S-1:s.end-S;;)switch(t){case C:if(L>=258&&O>=10&&(s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,x=e(p,b,i,v,a,w,s,y),F=y.next_in_index,O=y.avail_in,E=s.bitb,K=s.bitk,S=s.write,L=S<s.read?s.read-S-1:s.end-S,x!=l)){t=x==c?P:z;break}d=p,n=i,o=v,t=N;case N:for(k=d;k>K;){if(0===O)return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);x=l,O--,E|=(255&y.read_byte(F++))<<K,K+=8}if(D=3*(o+(E&g[k])),E>>>=n[D+1],K-=n[D+1],M=n[D],0===M){h=n[D+2],t=U;break}if(0!==(16&M)){f=15&M,r=n[D+2],t=j;break}if(0===(64&M)){d=M,o=D/3+n[D+2];break}if(0!==(32&M)){t=P;break}return t=z,y.msg="invalid literal/length code",x=_,s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);case j:for(k=f;k>K;){if(0===O)return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);x=l,O--,E|=(255&y.read_byte(F++))<<K,K+=8}r+=E&g[k],E>>=k,K-=k,d=b,n=a,o=w,t=q;case q:for(k=d;k>K;){if(0===O)return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);x=l,O--,E|=(255&y.read_byte(F++))<<K,K+=8}if(D=3*(o+(E&g[k])),E>>=n[D+1],K-=n[D+1],M=n[D],0!==(16&M)){f=15&M,m=n[D+2],t=I;break}if(0===(64&M)){d=M,o=D/3+n[D+2];break}return t=z,y.msg="invalid distance code",x=_,s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);case I:for(k=f;k>K;){if(0===O)return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);x=l,O--,E|=(255&y.read_byte(F++))<<K,K+=8}m+=E&g[k],E>>=k,K-=k,t=T;case T:for(R=S-m;0>R;)R+=s.end;for(;0!==r;){if(0===L&&(S==s.end&&0!==s.read&&(S=0,L=S<s.read?s.read-S-1:s.end-S),0===L&&(s.write=S,x=s.inflate_flush(y,x),S=s.write,L=S<s.read?s.read-S-1:s.end-S,S==s.end&&0!==s.read&&(S=0,L=S<s.read?s.read-S-1:s.end-S),0===L)))return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);s.window[S++]=s.window[R++],L--,R==s.end&&(R=0),r--}t=C;break;case U:if(0===L&&(S==s.end&&0!==s.read&&(S=0,L=S<s.read?s.read-S-1:s.end-S),0===L&&(s.write=S,x=s.inflate_flush(y,x),S=s.write,L=S<s.read?s.read-S-1:s.end-S,S==s.end&&0!==s.read&&(S=0,L=S<s.read?s.read-S-1:s.end-S),0===L)))return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);x=l,s.window[S++]=h,L--,t=C;break;case P:if(K>7&&(K-=8,O++,F--),s.write=S,x=s.inflate_flush(y,x),S=s.write,L=S<s.read?s.read-S-1:s.end-S,s.read!=s.write)return s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);t=A;case A:return x=c,s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);case z:return x=_,s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x);default:return x=u,s.bitb=E,s.bitk=K,y.avail_in=O,y.total_in+=F-y.next_in_index,y.next_in_index=F,s.write=S,s.inflate_flush(y,x)}},s.free=function(){}}function i(e,i){var a,s=this,r=R,o=0,d=0,h=0,p=[0],b=[0],v=new n,w=0,y=new Int32Array(3*m),x=0,k=new t;s.bitk=0,s.bitb=0,s.window=new Uint8Array(i),s.end=i,s.read=0,s.write=0,s.reset=function(e,t){t&&(t[0]=x),r==B&&v.free(e),r=R,s.bitk=0,s.bitb=0,s.read=s.write=0},s.reset(e,null),s.inflate_flush=function(e,t){var n,i,a;return i=e.next_out_index,a=s.read,n=(a<=s.write?s.write:s.end)-a,n>e.avail_out&&(n=e.avail_out),0!==n&&t==f&&(t=l),e.avail_out-=n,e.total_out+=n,e.next_out.set(s.window.subarray(a,a+n),i),i+=n,a+=n,a==s.end&&(a=0,s.write==s.end&&(s.write=0),n=s.write-a,n>e.avail_out&&(n=e.avail_out),0!==n&&t==f&&(t=l),e.avail_out-=n,e.total_out+=n,e.next_out.set(s.window.subarray(a,a+n),i),i+=n,a+=n),e.next_out_index=i,s.read=a,t},s.proc=function(e,n){var i,f,m,x,D,M,O,S;for(x=e.next_in_index,D=e.avail_in,f=s.bitb,m=s.bitk,M=s.write,O=M<s.read?s.read-M-1:s.end-M;;)switch(r){case R:for(;3>m;){if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);n=l,D--,f|=(255&e.read_byte(x++))<<m,m+=8}switch(i=7&f,w=1&i,i>>>1){case 0:f>>>=3,m-=3,i=7&m,f>>>=i,m-=i,r=E;break;case 1:var C=[],N=[],j=[[]],q=[[]];t.inflate_trees_fixed(C,N,j,q,e),v.init(C[0],N[0],j[0],0,q[0],0,e),f>>>=3,m-=3,r=B;break;case 2:f>>>=3,m-=3,r=F;break;case 3:return f>>>=3,m-=3,r=J,e.msg="invalid block type",n=_,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n)}break;case E:for(;32>m;){if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);n=l,D--,f|=(255&e.read_byte(x++))<<m,m+=8}if((~f>>>16&65535)!=(65535&f))return r=J,e.msg="invalid stored block lengths",n=_,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);o=65535&f,f=m=0,r=0!==o?K:0!==w?G:R;break;case K:if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);if(0===O&&(M==s.end&&0!==s.read&&(M=0,O=M<s.read?s.read-M-1:s.end-M),0===O&&(s.write=M,n=s.inflate_flush(e,n),M=s.write,O=M<s.read?s.read-M-1:s.end-M,M==s.end&&0!==s.read&&(M=0,O=M<s.read?s.read-M-1:s.end-M),0===O)))return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);if(n=l,i=o,i>D&&(i=D),i>O&&(i=O),s.window.set(e.read_buf(x,i),M),x+=i,D-=i,M+=i,O-=i,0!==(o-=i))break;r=0!==w?G:R;break;case F:for(;14>m;){if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);n=l,D--,f|=(255&e.read_byte(x++))<<m,m+=8}if(d=i=16383&f,(31&i)>29||(i>>5&31)>29)return r=J,e.msg="too many length or distance symbols",n=_,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);if(i=258+(31&i)+(i>>5&31),!a||a.length<i)a=[];else for(S=0;i>S;S++)a[S]=0;f>>>=14,m-=14,h=0,r=W;case W:for(;4+(d>>>10)>h;){for(;3>m;){if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);n=l,D--,f|=(255&e.read_byte(x++))<<m,m+=8}a[L[h++]]=7&f,f>>>=3,m-=3}for(;19>h;)a[L[h++]]=0;if(p[0]=7,i=k.inflate_trees_bits(a,p,b,y,e),i!=l)return n=i,n==_&&(a=null,r=J),s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);h=0,r=$;case $:for(;;){if(i=d,!(258+(31&i)+(i>>5&31)>h))break;var I,T;for(i=p[0];i>m;){if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);n=l,D--,f|=(255&e.read_byte(x++))<<m,m+=8}if(i=y[3*(b[0]+(f&g[i]))+1],T=y[3*(b[0]+(f&g[i]))+2],16>T)f>>>=i,m-=i,a[h++]=T;else{for(S=18==T?7:T-14,I=18==T?11:3;i+S>m;){if(0===D)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);n=l,D--,f|=(255&e.read_byte(x++))<<m,m+=8}if(f>>>=i,m-=i,I+=f&g[S],f>>>=S,m-=S,S=h,i=d,S+I>258+(31&i)+(i>>5&31)||16==T&&1>S)return a=null,r=J,e.msg="invalid bit length repeat",n=_,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);T=16==T?a[S-1]:0;do a[S++]=T;while(0!==--I);h=S}}b[0]=-1;var U=[],P=[],A=[],z=[];if(U[0]=9,P[0]=6,i=d,i=k.inflate_trees_dynamic(257+(31&i),1+(i>>5&31),a,U,P,A,z,y,e),i!=l)return i==_&&(a=null,r=J),n=i,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);v.init(U[0],P[0],y,A[0],y,z[0],e),r=B;case B:if(s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,(n=v.proc(s,e,n))!=c)return s.inflate_flush(e,n);if(n=l,v.free(e),x=e.next_in_index,D=e.avail_in,f=s.bitb,m=s.bitk,M=s.write,O=M<s.read?s.read-M-1:s.end-M,0===w){r=R;break}r=G;case G:if(s.write=M,n=s.inflate_flush(e,n),M=s.write,O=M<s.read?s.read-M-1:s.end-M,s.read!=s.write)return s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);r=H;case H:return n=c,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);case J:return n=_,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n);default:return n=u,s.bitb=f,s.bitk=m,e.avail_in=D,e.total_in+=x-e.next_in_index,e.next_in_index=x,s.write=M,s.inflate_flush(e,n)}},s.free=function(e){s.reset(e,null),s.window=null,y=null},s.set_dictionary=function(e,t,n){s.window.set(e.subarray(t,t+n),0),s.read=s.write=n},s.sync_point=function(){return r==E?1:0}}function a(){function e(e){return e&&e.istate?(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=at,e.istate.blocks.reset(e,null),l):u}var t=this;t.mode=0,t.method=0,t.was=[0],t.need=0,t.marker=0,t.wbits=0,t.inflateEnd=function(e){return t.blocks&&t.blocks.free(e),t.blocks=null,l},t.inflateInit=function(n,a){return n.msg=null,t.blocks=null,8>a||a>15?(t.inflateEnd(n),u):(t.wbits=a,n.istate.blocks=new i(n,1<<a),e(n),l)},t.inflate=function(e,t){var n,i;if(!e||!e.istate||!e.next_in)return u;for(t=t==b?f:l,n=f;;)switch(e.istate.mode){case Q:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,(15&(e.istate.method=e.read_byte(e.next_in_index++)))!=Y){e.istate.mode=rt,e.msg="unknown compression method",e.istate.marker=5;break}if((e.istate.method>>4)+8>e.istate.wbits){e.istate.mode=rt,e.msg="invalid window size",e.istate.marker=5;break}e.istate.mode=V;case V:if(0===e.avail_in)return n;if(n=t,e.avail_in--,e.total_in++,i=255&e.read_byte(e.next_in_index++),((e.istate.method<<8)+i)%31!==0){e.istate.mode=rt,e.msg="incorrect header check",e.istate.marker=5;break}if(0===(i&X)){e.istate.mode=at;break}e.istate.mode=Z;case Z:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,e.istate.need=(255&e.read_byte(e.next_in_index++))<<24&4278190080,e.istate.mode=et;case et:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<16&16711680,e.istate.mode=tt;case tt:if(0===e.avail_in)return n;n=t,e.avail_in--,e.total_in++,e.istate.need+=(255&e.read_byte(e.next_in_index++))<<8&65280,e.istate.mode=nt;case nt:return 0===e.avail_in?n:(n=t,e.avail_in--,e.total_in++,e.istate.need+=255&e.read_byte(e.next_in_index++),e.istate.mode=it,d);case it:return e.istate.mode=rt,e.msg="need dictionary",e.istate.marker=0,u;case at:if(n=e.istate.blocks.proc(e,n),n==_){e.istate.mode=rt,e.istate.marker=0;break}if(n==l&&(n=t),n!=c)return n;n=t,e.istate.blocks.reset(e,e.istate.was),e.istate.mode=st;case st:return c;case rt:return _;default:return u}},t.inflateSetDictionary=function(e,t,n){var i=0,a=n;return e&&e.istate&&e.istate.mode==it?(a>=1<<e.istate.wbits&&(a=(1<<e.istate.wbits)-1,i=n-a),e.istate.blocks.set_dictionary(t,i,a),e.istate.mode=at,l):u},t.inflateSync=function(t){var n,i,a,s,r;if(!t||!t.istate)return u;if(t.istate.mode!=rt&&(t.istate.mode=rt,t.istate.marker=0),0===(n=t.avail_in))return f;for(i=t.next_in_index,a=t.istate.marker;0!==n&&4>a;)t.read_byte(i)==ot[a]?a++:a=0!==t.read_byte(i)?0:4-a,i++,n--;return t.total_in+=i-t.next_in_index,t.next_in_index=i,t.avail_in=n,t.istate.marker=a,4!=a?_:(s=t.total_in,r=t.total_out,e(t),t.total_in=s,t.total_out=r,t.istate.mode=at,l)},t.inflateSyncPoint=function(e){return e&&e.istate&&e.istate.blocks?e.istate.blocks.sync_point():u}}function s(){}function r(){var e=this,t=new s,n=512,i=p,a=new Uint8Array(n),r=!1;t.inflateInit(),t.next_out=a,e.append=function(e,s){var o,d,u=[],_=0,h=0,g=0;if(0!==e.length){t.next_in_index=0,t.next_in=e,t.avail_in=e.length;do{if(t.next_out_index=0,t.avail_out=n,o=t.inflate(i),o==f)return-1;if(o!=l&&o!=c)throw"inflating: "+t.msg;if((r||o==c)&&t.avail_out==e.length)return-1;t.next_out_index&&u.push(t.next_out_index==n?new Uint8Array(a):new Uint8Array(a.subarray(0,t.next_out_index))),g+=t.next_out_index,s&&t.next_in_index>0&&t.next_in_index!=_&&(s(t.next_in_index),_=t.next_in_index)}while(t.avail_in>0);return d=new Uint8Array(g),u.forEach(function(e){d.set(e,h),h+=e.length}),d}},e.flush=function(){t.inflateEnd()}}var o=15,l=0,c=1,d=2,u=-2,_=-3,h=-4,f=-5,g=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],m=1440,p=0,b=4,v=9,w=5,y=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],x=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],k=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],D=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],M=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],S=15;t.inflate_trees_fixed=function(e,t,n,i){return e[0]=v,t[0]=w,n[0]=y,i[0]=x,l};var C=0,N=1,j=2,q=3,I=4,T=5,U=6,P=7,A=8,z=9,L=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],R=0,E=1,K=2,F=3,W=4,$=5,B=6,G=7,H=8,J=9,X=32,Y=8,Q=0,V=1,Z=2,et=3,tt=4,nt=5,it=6,at=7,st=12,rt=13,ot=[0,0,255,255];s.prototype={inflateInit:function(e){var t=this;return t.istate=new a,e||(e=o),t.istate.inflateInit(t,e)},inflate:function(e){var t=this;return t.istate?t.istate.inflate(t,e):u},inflateEnd:function(){var e=this;if(!e.istate)return u;var t=e.istate.inflateEnd(e);return e.istate=null,t},inflateSync:function(){var e=this;return e.istate?e.istate.inflateSync(e):u},inflateSetDictionary:function(e,t){var n=this;return n.istate?n.istate.inflateSetDictionary(n,e,t):u},read_byte:function(e){var t=this;return t.next_in.subarray(e,e+1)[0]},read_buf:function(e,t){var n=this;return n.next_in.subarray(e,e+t)}},e.Inflater=r}(this),define("contrib/inflate",function(){}),define("comm",["jquery","contrib/inflate"],function($){function send_message(e,t){t=t||{},t.msg=e,socket.send(JSON.stringify(t))}function send_raw(e){socket.send(e)}function register_handler(e,t){message_handlers[e]=t}function unregister_handler(e){message_handlers[e]=null}function register_message_handlers(e){$.extend(message_handlers,e)}function register_immediate_handlers(e){$.extend(immediate_handlers,e)}function handle_message(msg){if("string"==typeof msg)eval(msg);else{var handler=message_handlers[msg.msg];if(!handler)return void console.error("Unknown message type: "+msg.msg);handler(msg)}}function handle_message_immediately(e){var t=immediate_handlers[e.msg];return t?t(e):!1}function enqueue_messages(msgtext){if(msgtext.match(/^{/)){var msgobj;try{msgobj=eval("("+msgtext+")")}catch(e){return console.error("Parsing error:",e),void console.error("Source message:",msgtext)}var msgs=msgobj.msgs;null==msgs&&(msgs=[msgobj]);for(var i in msgs)window.log_messages&&2!==window.log_messages&&console.log("Message: "+msgs[i].msg,msgs[i]),handle_message_immediately(msgs[i])||message_queue.push(msgs[i])}else message_queue.push(msgtext);handle_message_backlog()}function handle_message_backlog(){for(;message_queue.length&&0==message_inhibit;){var e=message_queue.shift();if(window.debug_mode)handle_message(e);else try{handle_message(e)}catch(t){console.error("Error in message:",e),console.error(t.message),console.error(t.stack)}}}function inhibit_messages(){message_inhibit++}function uninhibit_messages(){message_inhibit>0&&message_inhibit--,handle_message_backlog()}function handle_multi_message(e){for(var t;t=e.msgs.pop();)message_queue.unshift(t)}function decode_utf8(e,t){var n=new Blob(e),i=new FileReader;i.onload=function(e){t(e.target.result)},i.readAsText(n,"UTF-8")}function inflate_works_on_ua(){if(!blob_construction_supported)return!1;var e=$.browser;return e.chrome&&e.version.match("^14.")?!1:e.chrome&&e.version.match("^19.")?!1:e.safari?!1:e.opera?!1:!0}function connect(e,t){var n=null;if("MozWebSocket"in window?n=MozWebSocket:"WebSocket"in window&&(n=window.WebSocket),null===n)return void t();var i;i="http:"==location.protocol?"ws://":"wss://",i+=location.host+"/socket",socket=inflater?new [^] n(i):new n(i,"no-compression"),socket.binaryType="arraybuffer",socket.onopen=function(){e()},socket.onmessage=function(e){if(inflater&&e.data instanceof ArrayBuffer){var t=new Uint8Array(e.data.byteLength+4);t.set(new Uint8Array(e.data),0),t.set([0,0,255,255],e.data.byteLength);var n=[inflater.append(t)];if(-1===n[0]){console.error("Decompression error!");{inflater.append(t)}}return void decode_utf8(n,function(e){2===window.log_messages&&console.log("Message: "+e),window.log_message_size&&console.log("Message size: "+e.length),enqueue_messages(e)})}2===window.log_messages&&console.log("Message: "+e.data),window.log_message_size&&console.log("Message size: "+e.data.length),enqueue_messages(e.data)},socket.onerror=function(){console.error("Websocket connection error")},socket.onclose=function(e){console.log("Websocket connection was closed",e.code,e.reason)}}window.log_messages=!1,window.log_message_size=!1;var socket=null,message_inhibit=0,message_queue=[],message_handlers={},immediate_handlers={},blob_construction_supported=!0;try{var blob=new Blob([new Uint8Array([0])])}catch(e){blob_construction_supported=!1,log("Blob construction not supported, disabling compression")}register_message_handlers({multi:handle_multi_message});var inflater=null;return"Uint8Array"in window&&"Blob"in window&&"FileReader"in window&&"ArrayBuffer"in window&&inflate_works_on_ua()&&(inflater=new Inflater),{send_message:send_message,send_raw:send_raw,register_handler:register_handler,unregister_handler:unregister_handler,register_handlers:register_message_handlers,register_immediate_handlers:register_immediate_handlers,inhibit_messages:inhibit_messages,uninhibit_messages:uninhibit_messages,connect:connect}}),define("pubsub",[],function(){function e(){function e(){t.apply(null,n)}var n=arguments;setTimeout(e,0)}function t(e){var t=[];arguments.length>1&&(t=Array.prototype.splice.call(arguments,1));var n=a[e];if(n)for(var i=0;i<n.length;++i)n[i].apply(null,t)}function n(e,t){a[e]||(a[e]=[]),a[e].push(t)}function i(e,t){for(var n=a[e],i=0;i<n.length;++i)if(n[i]===t){n.splice(i,1);break}}var a={};return{publish:e,publish_sync:t,subscribe:n,unsubscribe:i}}),define("user",["comm","pubsub"],function(e,t){function n(e,t,n){if("normal"==t)return"";var i={admins:"a Server Administrator",devteam:"a DCSS Developer",goodplayers:"a goodplayer (10+ wins)",greatplayers:"a greatplayer (has won every species)",greaterplayers:"a greaterplayer (has won every species and background)",centuryplayers:"a centuryplayer (100+ wins)"},a=e;return"devteam"==t&&e!==n&&(a=a+" ("+n+")"),a+" is "+i[t]}function i(e){c=e.username;var n="sid="+e.sid+"; path=/";"https:"===location.protocol&&(n+="; secure"),document.cookie=n,t.publish("logged_in",c)}function a(e){var t=new Date;return t.setTime(1e3*e-6e4*t.getTimezoneOffset()),t.toUTCString()}function s(e){var t="login="+e.cookie+"; path=/";t+="; expires="+a(e.expires),"https:"===location.protocol&&(t+="; secure"),document.cookie=t}function r(e){return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null}function o(t,n,i){e.send_message("login",{username:t,password:n,rememberme:i})}function l(){c=null,e.send_message("logout",{cookie:r("login")});var t="login=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT";"https:"===location.protocol&&(t+="; secure"),document.cookie=t,t="sid=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT","https:"===location.protocol&&(t+="; secure"),document.cookie=t,location.reload()}var c=null;return e.register_handlers({login_success:i,login_cookie:s}),{get username(){return c},login:o,logout:l,nerd_description:n}}),define("misc",["react"],function(e){var t=e.createClass({displayName:"Overlay",cancel:function(){this.props.on_cancel&&this.props.on_cancel()},keydown:function(e){"Escape"===e.key&&(e.stopPropagation(),this.cancel())},render:function(){var t={position:"fixed",left:0,top:0,width:"100%",height:"100%",backgroundColor:"black",opacity:this.props.opacity||.7,zIndex:2e3},n={position:"fixed",zIndex:2e3,left:0,top:0,width:"100%",pointerEvents:"none"},i="overlay "+(this.props.className||"");return e.DOM.span(null,e.DOM.div({style:t,onClick:this.cancel}),e.DOM.div({style:n,onKeyDown:this.keydown},e.DOM.div({className:i,style:{pointerEvents:"auto"}},this.props.children)))}}),n=e.createClass({displayName:"ConfirmClick",propTypes:{children:e.PropTypes.component.isRequired,on_confirm:e.PropTypes.func.isRequired,text:e.PropTypes.oneOfType([e.PropTypes.string.isRequired,e.PropTypes.component.isRequired]),title:e.PropTypes.string},getInitialState:function(){return{confirming:!1}},cancel:function(){this.setState({confirming:!1})},confirm:function(){this.setState({confirming:!1}),this.props.on_confirm()},click:function(e){e.preventDefault(),e.stopPropagation(),this.setState({confirming:!0})},render:function(){var n=null;return this.state.confirming&&(n=t({on_cancel:this.cancel,className:"confirm"},e.DOM.h3(null,this.props.title||"Please confirm"),e.DOM.div(null,this.props.text),e.DOM.input({type:"button",value:"Cancel",onClick:this.cancel}),e.DOM.input({type:"button",value:"OK",onClick:this.confirm}))),this.transferPropsTo(e.DOM.span(null,e.DOM.span({onClick:this.click},this.props.children),n))}});return{Overlay:t,ConfirmClick:n}}),define("login",["react","misc","comm","pubsub","user"],function(e,t,n,i,a){var s=t.Overlay;n.register_handler("register_fail",function(e){i.publish("register_fail",e.reason)}),n.register_handler("login_fail",function(){i.publish("login_fail")});var r=e.createClass({displayName:"PasswordChangeForm",getInitialState:function(){return{state:"input",old_password:"",new_password1:"",new_password2:""}},componentDidMount:function(){n.register_handler("password_change",this.handle_reply),this.refs.old_password.getDOMNode().focus()},componentWillUnmount:function(){n.unregister_handler("password_change",this.handle_reply)},handle_reply:function(e){if(e.success)this.replaceState({state:"done"});else{var t="Could not change password. Did you input your old one correctly?";this.setState({state:"error",message:t})}},handle_change:function(e){var t={};t[e.target.name]=e.target.value,this.setState(t)},close:function(){this.props.on_finished&&this.props.on_finished()},send:function(e){if(e.preventDefault(),this.state.new_password1===this.state.new_password2)n.send_message("change_password",{old_password:this.state.old_password,new_password:this.state.new_password1}),this.setState({state:"wait"});else{var t="New passwords do not match!";this.setState({state:"error",message:t})}},render:function(){if("done"===this.state.state)return e.DOM.div({className:"password_change done"},e.DOM.div(null,"Password successfully changed!"),e.DOM.input({type:"button",onClick:this.close,value:"Close"}));var t,n="wait"===this.state.state,i=e.DOM.form({action:""},e.DOM.div(null,e.DOM.label({htmlFor:"old_password"},"Old password:"),e.DOM.input({type:"password",name:"old_password",ref:"old_password",onChange:this.handle_change,disabled:n,value:this.state.old_password})),e.DOM.div(null,e.DOM.label({htmlFor:"new_password1"},"New password:"),e.DOM.input({type:"password",name:"new_password1",onChange:this.handle_change,disabled:n,value:this.state.new_password1})),e.DOM.div(null,e.DOM.label({htmlFor:"new_password2"},"Repeat new password:"),e.DOM.input({type:"password",name:"new_password2",onChange:this.handle_change,disabled:n,value:this.state.new_password2})),e.DOM.input({type:"button",onClick:this.close,value:"Cancel"}),e.DOM.input({type:"submit",onClick:this.send,disabled:n,value:"Send"}));switch(this.state.state){case"input":t="Please input your old password, then your new password twice.";
break;case"wait":t="Waiting for reply...";break;case"error":t=e.DOM.span({className:"error"},this.state.message)}return e.DOM.div({className:"password_change"},e.DOM.div(null,t),i)}}),o=e.createClass({displayName:"PasswordChangeLink",getInitialState:function(){return{changing_password:!1}},close:function(){this.setState({changing_password:!1})},open:function(){this.setState({changing_password:!0})},render:function(){var t=this.state.changing_password?s({on_cancel:this.close},e.DOM.h3(null,"Changing password"),r({on_finished:this.close})):null,n=e.DOM.a({href:"javascript:",onClick:this.open},"Change password");return e.DOM.span(null,n,t)}}),l=e.createClass({displayName:"LogoutLink",handle_click:function(e){a.logout(),e.preventDefault()},render:function(){return e.DOM.a({onClick:this.handle_click,href:"javascript:"},"Logout")}}),c=e.createClass({displayName:"RegisterForm",getInitialState:function(){return{message:"",error:!1,username:"",password:"",password_repeat:"",email:""}},componentDidMount:function(){i.subscribe("logged_in",this.logged_in),i.subscribe("register_fail",this.fail),this.refs.username.getDOMNode().focus()},componentWillUnmount:function(){i.unsubscribe("logged_in",this.logged_in),i.unsubscribe("register_fail",this.fail)},logged_in:function(){this.props.on_finished&&this.props.on_finished()},fail:function(e){this.setState({message:e,error:!0})},update:function(e){var t={};t[e.target.getAttribute("name")]=e.target.value,this.setState(t)},cancel:function(){this.props.on_finished&&this.props.on_finished()},send:function(e){e.preventDefault(),this.state.username.indexOf(" ")>=0?this.setState({message:"The username can't contain spaces.",error:!0}):this.state.email.indexOf(" ")>=0?this.setState({message:"The email can't contain spaces.",error:!0}):this.state.password!==this.state.password_repeat?this.setState({message:"Passwords don't match.",error:!0}):(this.setState({message:"...",error:!1}),n.send_message("register",{username:this.state.username,password:this.state.password,email:this.state.email}))},render:function(){var t=this.state.error?"error":"",n=e.DOM.span({className:t},this.state.message,e.DOM.br(null)),i=e.DOM.form({action:""},e.DOM.div(null,e.DOM.label({"for":"username"},"Username:"),e.DOM.input({type:"text",name:"username",onChange:this.update,ref:"username",value:this.state.username})),e.DOM.div(null,e.DOM.label({"for":"email"},"Email address:"),e.DOM.input({type:"email",name:"email",onChange:this.update,value:this.state.email})),e.DOM.div(null,e.DOM.label({"for":"password"},"Password:"),e.DOM.input({type:"password",name:"password",onChange:this.update,value:this.state.password})),e.DOM.div(null,e.DOM.label({"for":"password_repeat"},"Repeat password:"),e.DOM.input({type:"password",name:"password_repeat",onChange:this.update,value:this.state.password_repeat})),e.DOM.div(null,e.DOM.input({type:"button",name:"cancel",value:"Cancel",onClick:this.cancel}),e.DOM.input({type:"submit",name:"submit",value:"Submit",onClick:this.send})));return e.DOM.div({className:"register_form",style:{overflow:"hidden"}},n,i)}}),d=e.createClass({displayName:"LoginForm",getInitialState:function(){return{username:"",password:"",rememberme:!1,registering:!1,failed:!1}},componentDidMount:function(){i.subscribe("logged_in",this.logged_in),i.subscribe("login_fail",this.login_fail),this.refs.username.getDOMNode().focus()},componentWillUnmount:function(){i.unsubscribe("logged_in",this.logged_in),i.unsubscribe("login_fail",this.login_fail)},logged_in:function(e){this.props.on_login&&this.props.on_login(e)},login_fail:function(){this.setState({failed:!0})},handle_username:function(e){this.setState({username:e.target.value})},handle_password:function(e){this.setState({password:e.target.value})},handle_rememberme:function(e){this.setState({rememberme:e.target.checked})},send:function(e){a.login(this.state.username,this.state.password,this.state.rememberme),e.preventDefault()},register:function(){this.setState({registering:!0})},stop_registering:function(){this.setState({registering:!1})},render:function(){var t=null;this.state.failed&&(t=e.DOM.div({className:"error"},"Login failed!"));var n=e.DOM.form({action:""},t,e.DOM.div(null,e.DOM.input({type:"text",name:"username",placeholder:"User",value:this.state.username,onChange:this.handle_username,ref:"username"})),e.DOM.div(null,e.DOM.input({type:"password",name:"password",placeholder:"Password",value:this.state.password,onChange:this.handle_password})),e.DOM.div(null,e.DOM.input({type:"checkbox",name:"rememberme",checked:this.state.rememberme,onChange:this.handle_rememberme}),e.DOM.label({htmlFor:"rememberme"},"Stay logged in")),e.DOM.input({type:"submit",value:"Login",onClick:this.send})),i=e.DOM.a({href:"javascript:",onClick:this.register},"Register"),a=null;return this.state.registering&&(a=s({on_cancel:this.stop_registering},e.DOM.h3(null,"Register"),c({on_finished:this.stop_registering}))),e.DOM.div(null,this.props.message,n,i,a)}});return{PasswordChangeLink:o,LogoutLink:l,RegisterForm:c,LoginForm:d}}),define("lobby",["react","comm","pubsub","user","misc","login","jquery"],function(e,t,n,i,a,s,r){function o(e){for(var t=[],n=0;n<e.length;++n)-1===t.indexOf(e[n].version||e[n].name)&&t.push(e[n].version||e[n].name);return t}function l(e,t){return e.filter(function(e){return(e.version||e.name)===t})}var c=r.extend,d=a.Overlay,u=a.ConfirmClick,_=s.LoginForm,h=s.PasswordChangeLink,f=s.LogoutLink,g=e.createClass({displayName:"RcEditor",getInitialState:function(){return{contents:null}},componentDidMount:function(){t.register_handler("rcfile_contents",this.receive_rc_contents),t.send_message("get_rc",{game_id:this.props.game_id})},componentWillUnmount:function(){t.unregister_handler("rcfile_contents",this.receive_rc_contents)},receive_rc_contents:function(e){this.setState({contents:e.contents}),this.refs.editor.getDOMNode().focus()},handle_change:function(e){this.setState({contents:e.target.value})},handle_cancel:function(){this.props.on_finished()},handle_save:function(){t.send_message("set_rc",{game_id:this.props.game_id,contents:this.state.contents}),this.props.on_finished()},handle_reset:function(){t.send_message("reset_rc",{game_id:this.props.game_id}),this.setState({contents:null})},handle_drag_over:function(e){e.stopPropagation(),e.preventDefault(),e.dataTransfer.dropEffect="copy"},handle_drop:function(e){var t=e.dataTransfer.files[0];if(t){e.stopPropagation(),e.preventDefault();var n=new FileReader;n.onload=function(){this.setState({contents:n.result})}.bind(this),n.readAsText(t)}},render:function(){var t={boxSizing:"border-box",margin:0,width:"100%"},n=e.DOM.a({href:"data:text/plain,"+encodeURI(this.state.contents),target:"_blank",download:"init.txt"},"download"),i=e.DOM.span(null,"Really reset your settings file to defaults?",e.DOM.div({className:"warning"},"All changes you have made to your options will be lost!"));return e.DOM.div({style:{overflow:"hidden"}},e.DOM.h3(null,"Edit RC"),e.DOM.textarea({value:this.state.contents,onChange:this.handle_change,onDragOver:this.handle_drag_over,onDrop:this.handle_drop,style:t,disabled:null===this.state.contents,cols:"80",rows:"25",ref:"editor"}),e.DOM.br(null),"You can ",n," the current contents, or drop a file onto the text area to load it. ",e.DOM.br(null),e.DOM.input({type:"button",value:"Cancel",onClick:this.handle_cancel}),u({on_confirm:this.handle_reset,text:i},e.DOM.input({type:"button",value:"Reset"})),e.DOM.input({type:"submit",value:"Save",style:{"float":"right"},onClick:this.handle_save}),e.DOM.br(null))}}),m=e.createClass({displayName:"GameSelector",getInitialState:function(){return{selected_game:this.props.games[0],editing_rc:null}},load_game:function(e){history?(history.pushState(null,"","/play/"+e.id),n.publish("url_change")):location.href="/play/"+e.id},start_game:function(e){history&&(e.preventDefault(),history.pushState(null,"",e.target.href),n.publish("url_change"))},edit_rc:function(e){var t=this.state.selected_game.id;this.setState({editing_rc:t}),e.preventDefault()},stop_editing:function(){this.setState({editing_rc:null})},select_version:function(e){var t;t=e!==this.more_versions_text()?l(this.props.games,e)[0]:this.props.games.filter(function(e){return this.is_hidden_version(e.version||e.name)}.bind(this))[0],this.setState({selected_game:t})},select_game:function(e){this.setState({selected_game:e})},is_hidden_version:function(e){var t=this.props.settings.hide_versions;return t?t.indexOf(e)>=0:!1},more_versions_text:function(){return this.props.settings.more_versions||"More..."},render:function(){var t=this.props.saved_games,n=0===t.length?null:e.DOM.div({className:"saved_games"},"Saved games:",e.DOM.ol(null,t.map(function(t){return e.DOM.li({onClick:this.load_game.bind(this,t)},t.name,", a level ",t.lvl," ",t.race,t.god?" of "+t.god:null," "," (",t.game.name,")")}.bind(this)))),i=this.state.selected_game,a=i.version||i.name,s=this.is_hidden_version(a),r=o(this.props.games);if(!s){var c=r.length;r=r.filter(function(e){return!this.is_hidden_version(e)}.bind(this)),r.length<c&&r.push(this.more_versions_text())}var u=e.DOM.div({className:"version_select"},"Version:",e.DOM.ol({className:"select"},r.map(function(t){return e.DOM.li({onClick:this.select_version.bind(this,t),key:t,className:a===t?"selected":""},t)}.bind(this)))),_=l(this.props.games,a),h=_.length<=1?null:e.DOM.div(null,"Mode:",e.DOM.ol({className:"select"},_.map(function(t){return e.DOM.li({onClick:this.select_game.bind(this,t),key:t.mode||t.name,className:i===t?"selected":""},t.mode||t.name)}.bind(this)))),f=i.comment?e.DOM.div(null,i.comment):null,m=e.DOM.a({className:"start_game",href:"/play/"+i.id,onClick:this.start_game},"Start "+i.name),p=e.DOM.a({className:"edit_rc",href:"javascript:",onClick:this.edit_rc},"edit the settings file"),b=e.DOM.div(null,m,", ",p," or select a different version:",u,h,f),v=null;return this.state.editing_rc&&(v=d({on_cancel:this.stop_editing},g({game_id:this.state.editing_rc,on_finished:this.stop_editing}))),e.DOM.div(null,n,b,v)}}),p=e.createClass({displayName:"RunningGameEntry",handle_click:function(e){history&&(e.preventDefault(),history.pushState(null,"",e.target.href),n.publish("url_change"))},render:function(){function t(e){return 0==e?"":120>e?Math.round(e)+" s":3600>e?Math.round(e/60)+" min":Math.round(e/3600)+" h"}var n,a=this.props.game;n=a.idle_time>0?t((new Date-a.idle_start)/1e3):null;var s=i.nerd_description(a.username,a.nerdtype,a.devname),r=e.DOM.a({href:"/watch/"+a.username,className:a.nerdtype,onClick:this.handle_click,title:s},a.username);return e.DOM.tr(null,e.DOM.td(null,r),e.DOM.td({className:"game_id"},a.game_id),e.DOM.td({className:"xl"},a.xl),e.DOM.td({className:"char"},a.char),e.DOM.td({className:"place"},a.place),e.DOM.td({className:"god"},a.god),e.DOM.td({className:"idle_time"},n),e.DOM.td({className:"spectator_count"},a.spectator_count),e.DOM.td({className:"milestone"},a.milestone))}}),b=e.createClass({displayName:"RunningGamesList",getInitialState:function(){return{sort:[{field:"username",down:!1}]}},componentDidMount:function(){this.interval=setInterval(this.forceUpdate.bind(this),1e3)},componentWillUnmount:function(){clearInterval(this.interval)},header_click:function(e){var t=e.target.getAttribute("data-field");sort=this.state.sort,sort[0].field===t?sort[0].down=!sort[0].down:(sort=sort.filter(function(e){return e.field!==t}),sort.unshift({field:t,down:!1})),this.setState({sort:sort})},render:function(){function t(e,t){for(var n=0;n<s.length;++n){var i=s[n].field,a=e[i]||"",r=t[i]||"";if(a!==r){var o;if("xl"===i)a=parseInt(a)||-1,r=parseInt(r)||-1,o=a-r;else if("place"===i){var l=a.split(":"),c=r.split(":");o=l[0]!==c[0]?l[0]<c[0]?-1:1:parseInt(l[1])-parseInt(c[1])}else o=r>a?-1:1;return s[n].down&&(o*=-1),o}}return 0}function n(e){return p({game:e,key:e.id})}function i(t,n){var i=t;return t===r&&(i+=" "+o),e.DOM.th({className:i,"data-field":t},n)}var a=this.props.games.slice(0),s=this.state.sort;a.sort(t);var r=s[0].field,o=s[0].down?"headerSortDown":"headerSortUp",l=e.DOM.table({className:"player_list"},e.DOM.thead(null,e.DOM.tr({onClick:this.header_click},i("username","User"),i("game_id","Game"),i("xl","XL"),i("char","Char"),i("place","Place"),i("god","God"),i("idle_time","Idle"),i("spectator_count","Specs"),i("milestone","Milestone"))),e.DOM.tbody(null,a.map(n)));return e.DOM.div(null,e.DOM.span(null,"Games currently running:"),l)}}),v=e.createClass({displayName:"LobbyRoot",getInitialState:function(){return{username:null,games:null,game_link_settings:null,saved_games:null,running_games:[],banner:null,footer:null}},componentDidMount:function(){t.register_handler("lobby",this.lobby),t.register_handler("lobby_html",this.lobby_html),t.register_handler("game_info",this.game_info)},componentWillUnmount:function(){t.unregister_handler("lobby",this.lobby),t.unregister_handler("lobby_html",this.lobby_html),t.unregister_handler("game_info",this.game_info)},lobby:function(e){var t=this.state.running_games;if(e.remove)for(var n=0;n<t.length;++n)if(t[n].id===e.remove){t.splice(n,1);break}if(e.entries)for(var i=0;i<e.entries.length;++i){var a=new Date;a.setSeconds(a.getSeconds()-e.entries[i].idle_time),e.entries[i].idle_start=a;for(var s=!1,n=0;n<t.length;++n)if(t[n].id===e.entries[i].id){c(t[n],e.entries[i]),s=!0;break}s||t.push(e.entries[i])}this.setState({running_games:t})},lobby_html:function(e){this.setState({banner:e.banner,footer:e.footer})},game_info:function(e){this.setState({games:e.games,game_link_settings:e.settings||{},saved_games:e.saved_games})},logged_in:function(e){this.setState({username:e})},render:function(){var t;t=this.state.username?e.DOM.div({style:{"float":"right",textAlign:"right"},className:"login"},"Logged in as ",this.state.username," | ",h(null)," | ",f(null)):e.DOM.div({style:{"float":"right",textAlign:"right"},className:"login"},_({on_login:this.logged_in}));var n=null;this.state.games&&(n=m({games:this.state.games,settings:this.state.game_link_settings,saved_games:this.state.saved_games}));var i=null;this.state.running_games.length&&(i=b({games:this.state.running_games}));var a=e.DOM.header({dangerouslySetInnerHTML:{__html:this.state.banner}}),s=e.DOM.footer({dangerouslySetInnerHTML:{__html:this.state.footer}});return e.DOM.div({className:"lobby"},t,a,n,i,s)}});return v}),window.linkify=function(){var e="[a-z\\d.-]+://",t="(?:(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])\\.){3}(?:[0-9]|[1-9]\\d|1\\d{2}|2[0-4]\\d|25[0-5])",n="(?:(?:[^\\s!@#$%^&*()_=+[\\]{}\\\\|;:'\",.<>/?]+)\\.)+",i="(?:ac|ad|aero|ae|af|ag|ai|al|am|an|ao|aq|arpa|ar|asia|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|biz|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|cat|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|coop|com|co|cr|cu|cv|cx|cy|cz|de|dj|dk|dm|do|dz|ec|edu|ee|eg|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gov|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|info|int|in|io|iq|ir|is|it|je|jm|jobs|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mil|mk|ml|mm|mn|mobi|mo|mp|mq|mr|ms|mt|museum|mu|mv|mw|mx|my|mz|name|na|nc|net|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|org|pa|pe|pf|pg|ph|pk|pl|pm|pn|pro|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|sk|sl|sm|sn|so|sr|st|su|sv|sy|sz|tc|td|tel|tf|tg|th|tj|tk|tl|tm|tn|to|tp|travel|tr|tt|tv|tw|tz|ua|ug|uk|um|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|xn--0zwm56d|xn--11b5bs3a9aj6g|xn--80akhbyknj4f|xn--9t4b11yi5a|xn--deba0ad|xn--g6w251d|xn--hgbk6aj7f53bba|xn--hlcj6aya9esc7a|xn--jxalpdlp|xn--kgbechtv|xn--zckzah|ye|yt|yu|za|zm|zw)",a="(?:"+n+i+"|"+t+")",s="(?:[;/][^#?<>\\s]*)?",r="(?:\\?[^#<>\\s]*)?(?:#[^<>\\s]*)?",o="\\b"+e+"[^<>\\s]+",l="\\b"+a+s+r+"(?!\\w)",c="mailto:",d="(?:"+c+")?[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@"+a+r+"(?!\\w)",u=new RegExp("(?:"+o+"|"+l+"|"+d+")","ig"),_=new RegExp("^"+e,"i"),h={"'":"`",">":"<",")":"(","]":"[","}":"{","B;":"B+","b\x00:":"b\x009"},f={callback:function(e,t){return t?''+t+'":e},punct_regexp:/(?:[!?.,:;'"]|(?:&|&)(?:lt|gt|quot|apos|raquo|laquo|rsaquo|lsaquo);)$/};return function(e,t){t=t||{};var n,i,a,s,r,o,l,d,g,m,p,b,v="",w=[];for(i in f)void 0===t[i]&&(t[i]=f[i]);for(;n=u.exec(e);)if(a=n[0],o=u.lastIndex,l=o-a.length,!/[\/:]/.test(e.charAt(l-1))){do d=a,b=a.substr(-1),p=h[b],p&&(g=a.match(new RegExp("\\"+p+"(?!$)","g")),m=a.match(new RegExp("\\"+b,"g")),(g?g.length:0)<(m?m.length:0)&&(a=a.substr(0,a.length-1),o--)),t.punct_regexp&&(a=a.replace(t.punct_regexp,function(e){return o-=e.length,""}));while(a.length&&a!==d);s=a,_.test(s)||(s=(-1!==s.indexOf("@")?s.indexOf(c)?c:"":s.indexOf("irc.")?s.indexOf("ftp.")?"http://":"ftp://":"irc://")+s),r!=l&&(w.push([e.slice(r,l)]),r=o),w.push([a,s])}for(w.push([e.substr(r)]),i=0;i<w.length;i++)v+=t.callback.apply(window,w[i]);return [^] v||e}}(),define("contrib/ba-linkify",function(){}),define("linkify",["react","contrib/ba-linkify"],function(e){function t(t){function a(t,i){s.push(null==i?t:i.match(n)?e.DOM.a({target:"_blank",href:i},t):t)}var s=[];return i(t,{callback:a}),s}var n=/^http:|^https:|^ftp:|^irc:/,i=window.linkify;return delete window.linkify,t}),define("chat",["react","comm","pubsub","user","login","misc","linkify"],function(e,t,n,i,a,s,r){function o(e){f.push({text:e.url+".txt"})}function l(e){delete e.msg,f.push(e),n.publish("chat_update")}function c(e){_=e.spectators,h=e.anon_count,n.publish("chat_update")}function d(t){return void 0===t.sender?e.DOM.div(null,e.DOM.span({className:"chat_msg chat_automated"},r(t.text))):e.DOM.div(null,e.DOM.span({className:"chat_sender"},t.sender),": ",e.DOM.span({className:"chat_msg"},r(t.text)))}function u(e,t){return e.player!==t.player?e.player?-1:1:e.name<t.name?-1:e.name===t.name?0:1}var _=[],h=0,f=[],g=s.Overlay,m=a.LoginForm,p=e.createClass({displayName:"ChatViewer",componentWillUpdate:function(){var e=this.getDOMNode();this.at_bottom=e.scrollTop+e.offsetHeight===e.scrollHeight},componentDidUpdate:function(){this.at_bottom&&this.scroll_bottom()},scroll_bottom:function(){var e=this.getDOMNode();e.scrollTop=e.scrollHeight},render:function(){var t={overflowX:"hidden",overflowY:"auto",textOverflow:"ellipsis",wordWrap:"break-word"};return this.transferPropsTo(e.DOM.div({style:t},this.props.children))}}),b=e.createClass({displayName:"Chat",getInitialState:function(){return{folded:!0,seen_msg_count:f.length,msg:"",logging_in:!1}},componentDidMount:function(){n.subscribe("chat_update",this.update),n.subscribe("chat_hotkey",this.focus)},componentWillUnmount:function(){n.unsubscribe("chat_update",this.update),n.unsubscribe("chat_hotkey",this.focus)},componentDidUpdate:function(e,t){(t.folded&&!this.state.folded||t.logging_in&&!this.state.logging_in)&&this.refs.input&&this.refs.input.getDOMNode().focus()},update:function(){this.state.folded?this.forceUpdate():this.setState({seen_msg_count:f.length})},focus:function(){this.state.folded?this.setState({folded:!1}):this.refs.input&&this.refs.input.getDOMNode().focus()},handle_input:function(e){this.setState({msg:e.target.value})},toggle:function(){this.setState({folded:!this.state.folded,seen_msg_count:f.length})},send:function(e){return e.preventDefault(),""!==this.state.msg&&t.send_message("chat_msg",{text:this.state.msg}),this.setState({msg:""}),!1},keydown:function(e){"Escape"===e.key&&(e.stopPropagation(),this.refs.input.getDOMNode().blur(),this.toggle())},do_login:function(){this.setState({logging_in:!0})},stop_login:function(){this.setState({logging_in:!1})},render:function(){var t={display:this.state.folded?"none":"block"},n=f.length-this.state.seen_msg_count,a="message_count";n>0&&(a+=" has_new");var s=_.slice(0);s.sort(u);for(var r=[],o=0,l=0;l<s.length;++l){l>0&&r.push(", ");var c=s[l].player?"player":"watcher";c+=" "+s[l].nerdtype;var h=i.nerd_description(s[l].name,s[l].nerdtype,s[l].devname);r.push(s[l].url?e.DOM.a({href:s[l].url,target:"_blank",title:h,className:c},s[l].name):e.DOM.span({title:h,className:c},s[l].name)),s[l].player||++o}var b;b=i.username?e.DOM.form({action:""},e.DOM.input({type:"text",onChange:this.handle_input,value:this.state.msg,ref:"input"}),e.DOM.input({type:"submit",onClick:this.send,value:"OK"})):e.DOM.div({className:"chat_login_text"},e.DOM.a({onClick:this.do_login,href:"javascript:"},"Login")," to chat");var v=null;return this.state.logging_in&&(v=g({on_cancel:this.stop_login,className:"login_overlay"},e.DOM.h3(null,"Login"),m({on_login:this.stop_login}))),e.DOM.span(null,e.DOM.a({href:"javascript:",className:"caption",onClick:this.toggle},e.DOM.span({className:"spectator_count"},o+" spectators"),e.DOM.span({className:a},n+" new messages",n>0?" (Press F12)":"")),e.DOM.div({className:"chat_body",style:t,onKeyDown:this.keydown},e.DOM.span({className:"spectator_list"},r),p({className:"chat_container"},e.DOM.span({className:"chat_history",style:{width:"100%"}},f.map(d))),b),v)}});return t.register_handlers({dump:o,chat:l,update_spectators:c}),b}),define("loader",["react","comm","pubsub","misc","login","chat","jquery"],function(e,t,n,i,a,s,r){function o(e){return e+"'"+("s"===e.slice(-1)?"":"s")}function l(e,t){if(t)switch(e){case"quit":case"won":case"bailed out":case"dead":return null;case"cancel":return t+" quit before creating a character.";case"saved":return t+" stopped playing (saved).";case"crash":return o(t)+" game crashed.";case"error":return o(t)+" game was terminated due to an error.";default:return o(t)+" game ended unexpectedly."+("unknown"!=e?" ("+e+")":"")}else switch(e){case"quit":case"won":case"bailed out":case"dead":case"saved":case"cancel":return null;case"crash":return"Unfortunately your game crashed.";case"error":return"Unfortunately your game terminated due to an error.";default:return"Unfortunately your game ended unexpectedly."+("unknown"!=e?" ("+e+")":"")}}var c=i.Overlay,d=a.LoginForm,u=["saved","cancel","quit","won","bailed out","dead"],_=e.createClass({displayName:"LegacyGame",componentDidMount:function(){r("body").prepend("<div id='game'>"),r("#game").html(this.props.html),r("body").append("<div id='overlay'>"),this.props.compat_handler&&this.props.compat_handler(this.props.html)},render:function(){return e.DOM.div({className:"chat"},s(null))}}),h=e.createClass({displayName:"Dialog",handle_click:function(e){if(e.target.hasAttribute("data-key")){e.preventDefault();var n=e.target.getAttribute("data-key").charCodeAt(0);t.send_raw('{"msg":"input","data":['+n+"]}")}},render:function(){var t=this.props.html;return c(null,e.DOM.div({onClick:this.handle_click,className:"server_dialog",dangerouslySetInnerHTML:{__html:t}}))}}),f=e.createClass({displayName:"GameLoader",getInitialState:function(){return{watching:null,game_component:null,dialog:null,state:"loading"}},componentDidMount:function(){t.register_handlers({stale_process_fail:this.stale_process_fail,"force_terminate?":this.force_terminate,login_required:this.login_required,show_dialog:this.show_dialog,hide_dialog:this.hide_dialog,game_started:this.game_started,watching_started:this.watching_started,game_ended:this.game_ended,game_client:this.receive_game_client})},stale_process_fail:function(e){this.setState({state:"failed",error_msg:e.content})},force_terminate:function(){this.setState({state:"force_terminate"})},login_required:function(e){this.setState({state:"logging_in",logging_in_for:e.game})},show_dialog:function(e){this.setState({dialog:e.html})},hide_dialog:function(){this.setState({dialog:null})},game_started:function(){this.setState({state:"play"})},watching_started:function(e){this.setState({state:"play",watching:e.username})},game_ended:function(e){e.reason?this.state.watching||-1===u.indexOf(e.reason)?this.setState({state:"ended",game_end:e}):document.location="/":document.location="/"},receive_game_client:function(e){t.inhibit_messages();var n=this;if(void 0===e.content){var i="/gamedata/"+e.version,a="game"+(e.min?".min":"");require.config({paths:{game_data:i,"game_data/game":i+"/"+a}}),require(["game_data/game"],function(e){n.setState({game_component:e}),t.uninhibit_messages()})}else{var s=e.content.match(/^<!-- +version: +(\d+) /);s=null==s?0:parseInt(s[1]);var r=function(t){function i(){return _({compat_handler:t,html:e.content})}n.setState({game_component:i})};1>s?require(["compat"+s],r):r(null)}},logged_in:function(){location.reload()},force_terminate_no:function(){t.send_message("force_terminate",{answer:!1}),this.setState({state:"loading"})},force_terminate_yes:function(){t.send_message("force_terminate",{answer:!0}),this.setState({state:"loading"})},render:function(){var t=null,n=null,i=null,a=null;if(this.state.game_component&&(t=this.state.game_component()),"play"!==this.state.state&&"ended"!==this.state.state){var s=document.getElementById("loader_img").src;n=c({opacity:1,className:"noborder loader"},e.DOM.span(null,"Loading..."),e.DOM.br(null),e.DOM.img({src:s}))}switch(this.state.state){case"logging_in":i=c({className:"login_overlay"},e.DOM.h3(null,"Login required"),e.DOM.div(null,"You need to log in to play"," "+this.state.logging_in_for,"."),d({on_login:this.logged_in}));break;case"failed":i=c(null,e.DOM.h3(null,"Could not start game"),e.DOM.div({dangerouslySetInnerHTML:{__html:this.state.error_msg}}));break;case"force_terminate":i=c(null,e.DOM.h3(null,"Force terminate?"),"There is already a Crawl process running that could not be stopped cleanly. Force termination?",e.DOM.input({type:"button",value:"No",onClick:this.force_terminate_no}),e.DOM.input({type:"button",value:"Yes",onClick:this.force_terminate_yes}));break;case"ended":var r=this.state.game_end,o=l(r.reason,this.state.watching),u=null,_=null;if(r.message&&(_=e.DOM.pre(null,r.message.replace(/\s+$/,""))),r.dump){var f;f="saved"===r.reason?"Character dump":"crash"===r.reason?"Crash log":"Morgue file",u=e.DOM.a({target:"_blank",href:r.dump+".txt"},f)}i=c(null,e.DOM.h3(null,"The game ended."),e.DOM.p(null,o),_,e.DOM.p({style:{textAlign:"right"}},u),e.DOM.a({href:"/"},"Close"))}return this.state.dialog&&(a=h({html:this.state.dialog})),e.DOM.span(null,t,n,i,a)}});return f}),define("key_conversion",["jquery"],function(e){var t;t=-255;{var n=(t++,t++,t++,t++,t++,t++,t++,t++,t++,t++,t++,t++,t++),i=t++,a=t++,s=t++,r=t++,o=t++,l=t++,c=t++,d=t++,u=t++,_=(t++,t++),h=t++,f=t++,g=t++,m=t++,p=t++,b=t++,v=t++,w=t++,y=t++;t++}t=-10009;var x=(t++,t++,t++,t++,t++,t++,t++,t++,{27:27,8:8,9:9,45:-250,35:-1001,40:-253,34:-1003,37:-252,12:-247,39:-251,36:-1007,38:-254,33:-1009,112:-1011,113:-1012,114:-1013,115:-1014,116:-1015,117:-1016,118:-1017,119:-1018,120:-1019,121:-1020});if(!e.browser.mozilla)for(var k=0;9>=k;k++)x[96+k]=48+k;e.browser.opera&&(x[107]=61);var D={45:r,35:l,40:i,34:u,37:a,12:c,39:s,36:o,38:n,33:d,97:l,98:i,99:u,100:a,102:s,103:o,104:n,105:d},M={45:m,35:b,40:h,34:y,37:f,12:v,39:g,36:p,38:_,33:w,97:b,98:h,99:y,100:f,102:g,103:p,104:_,105:w},O=["O","Q","F","P","W","A","T","X","S","G","I","D","E","H","J","K","L","Y","U","B","N","C"];return{simple:x,shift:D,ctrl:M,captured_control_keys:O}}),define("keyboard",["jquery","comm","key_conversion","client","pubsub"],function(e,t,n,i,a){function r(){var e=document.activeElement.tagName,t=document.activeElement.type;return"TEXTAREA"===e?!0:"INPUT"!==e||"text"!==t&&"password"!==t&&"email"!==t?!1:!0}function o(){return"play"===i.state||"watch"===i.state}function l(){return"watch"===i.state}function c(n){if(o()&&!r()&&!n.isDefaultPrevented()&&(!n.ctrlKey&&!n.altKey||!e.browser.mozilla&&n.ctrlKey&&n.altKey)&&0!=n.which&&8!=n.which&&9!=n.which&&_(n,"game_keypress")&&!l()){n.preventDefault();var i=String.fromCharCode(n.which);"{"==i?u(["{".charCodeAt(0)]):t.send_message("input",{text:i})}}function d(e){t.send_raw('{"msg":"key","keycode":'+e+"}")}function u(n){s='{"msg":"input","data":[',e.each(n,function(e,t){s+=0==e?t:","+t}),s+="]}",t.send_raw(s)}function _(t,n){var i=e.extend({},t);return i.type=n,e(i.target).trigger(i),i.isDefaultPrevented()&&t.preventDefault(),i.isPropagationStopped()?(t.stopImmediatePropagation(),!1):!0}function h(t){if(o()&&!r()&&_(t,"game_keydown")){if(l())return void(t.ctrlKey||t.shiftKey||t.altKey||(27==t.which||"Q"==String.fromCharCode(t.which)?(t.preventDefault(),document.location="/"):123==t.which&&(t.preventDefault(),a.publish("chat_hotkey"))));if(!t.ctrlKey||t.shiftKey||t.altKey)if(t.ctrlKey||!t.shiftKey||t.altKey)if(t.ctrlKey||t.shiftKey||!t.altKey)t.ctrlKey||t.shiftKey||t.altKey||(123==t.which?(t.preventDefault(),a.publish("chat_hotkey")):t.which in n.simple&&(t.preventDefault(),d(n.simple[t.which])));else{if(t.which<32)return;t.preventDefault(),u([27,t.which])}else t.which in n.shift&&(t.preventDefault(),d(n.shift[t.which]));else if(t.which in n.ctrl)t.preventDefault(),d(n.ctrl[t.which]);else if(-1!=e.inArray(String.fromCharCode(t.which),n.captured_control_keys)){t.preventDefault();var i=t.which-"A".charCodeAt(0)+1;d(i)}}}return e(document).on("keypress.client",c),e(document).on("keydown.client",h),{handle_keypress:c,handle_keydown:h}}),define("client",["exports","jquery","react","comm","lobby","loader","pubsub","keyboard"],function(e,t,n,i,a,s,r){function o(e){w.setProps(e)}function l(){var e=location.hash.match(/^#play-(.+)/);if(e){var t=e[1];history?history.replaceState(null,"","/play/"+t):location="/play/"+t}var n=location.hash.match(/^#watch-(.+)/);if(n){var i=n[1];history?history.replaceState(null,"","/watch/"+i):location="/watch/"+i}}function c(){var e=location.pathname.match(/^\/play\/(.+)/);if(e){var t=e[1];i.send_message("play",{game_id:t}),o({state:"play"})}var n=location.pathname.match(/^\/watch\/(.+)/);if(n){var a=n[1];i.send_message("watch",{username:a}),o({state:"watch"})}else"/"==location.pathname&&(i.send_message("lobby"),o({state:"lobby"}))}function d(){c(!1)}function u(){o({state:"connect_failure"})}function _(){return i.send_message("pong"),!0}function h(e){return e.reconnect?location.reload():o({state:"closed",msg:e.reason}),!0}function f(e){document.location=e.path}function g(e){console.warn("Received 'html' message!",e),t("#"+e.id).html(e.content)}function m(e){t(".floating_dialog").hide();var n=t(e);n.stop(!0,!0).fadeIn(100,function(){n.focus()}),p(n),t("#overlay").show()}function p(e){var n=t(window).width()/2-e.outerWidth()/2;0>n&&(n=0);var i=t(window).height()/2-e.outerHeight()/2;0>i&&(i=0),i>50&&(i=50);var a=e.offset();(a.left!=n||a.top!=i)&&e.offset({left:n,top:i})}function b(){t(".floating_dialog").blur().hide(),t("#overlay").hide()}window.debug_mode=!1;var v=n.createClass({displayName:"PageRoot",getDefaultProps:function(){return{state:"connecting"}},render:function(){switch(this.props.state){case"connecting":return n.DOM.div({},"Connecting...");case"connect_failure":return n.DOM.div({},"Could not connect to server.");case"lobby":return a();case"play":case"watch":return s();case"closed":return n.DOM.div({},"The connection was closed:",n.DOM.br(),this.props.msg);default:return n.DOM.div({},"BUG: Unknown state ",this.props.state)}}});l();var w=n.renderComponent(v(),document.getElementById("root"));return i.register_immediate_handlers({ping:_,close:h}),i.register_handlers({html:g,go:f}),i.connect(d,u),Object.defineProperty(e,"state",{get:function(){return w.props.state}}),r.subscribe("url_change",c),window.onpopstate=function(){location.reload()},e.show_dialog=m,e.hide_dialog=b,e.center_element=p,e.is_watching=function(){return"watch"===w.props.state},window.assert=function(){},window.log=function(e){window.console&&window.console.log&&window.console.log(e)},e}),require.config({baseUrl:"/static/scripts",paths:{jquery:use_cdn?"//cdnjs.cloudflare.com/ajax/libs/jquery/1.8.2/jquery.min":"/static/scripts/contrib/jquery",react:use_cdn?"//cdnjs.cloudflare.com/ajax/libs/react/0.10.0/react.min":"/static/scripts/contrib/react-0.10.0",text:"/static/scripts/contrib/text",jsx:"/static/scripts/contrib/jsx",JSXTransformer:"/static/scripts/contrib/JSXTransformer-0.10.0",image:"/static/scripts/contrib/image"},jsx:{fileExtension:".jsx"}}),require(["client"]),define("app",function(){});

Hopefully this is normal, but after the return got me in, it shows this:

<!DOCTYPE HTML>
<html>
  <head>
    <title>WebTiles - Dungeon Crawl Stone Soup</title>
    <link rel="icon" href="/static/stone_soup_icon-32x32.png" type="image/png">
    <link rel="stylesheet" type="text/css" href="/static/style.css">
  </head>
  <body>
    <noscript>Please enable javascript!</noscript>

    <div id="root"></div>

    <img style="display:none;" id="loader_img" alt="" src="/static/title_psiweapon_kiku.png?v=1fb76c004833b61aa0fa82204f92b2b8">

    <script>
      window.use_cdn = true;
    </script>
    <script src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.11/require.min.js" data-main="/static/scripts/app.min"></script>
  </body>
</html>
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0032645)
aidanholm (developer)
2018-09-23 13:31

This seems to be a CPO-specific bug, possibly caused by the recent server transition. Unfortunately CPO's webtiles client is running a heavily modified version, so it's probably something only chequers can fix :/
(0032646)
stoneychips (reporter)
2018-09-23 15:29

Okay thanks for looking at it. Guess I'll send him mail about it. It hasn't usually been blocking me for sooo long but yeah.

By the way, at risk of hijacking my own thread but, any thoughts about the morgue files now missing game version numbers?
(0032647)
aidanholm (developer)
2018-09-23 18:45

You're welcome! I'm not sure what you mean by the version number being missing; I see " Dungeon Crawl Stone Soup version 0.22.0" at the very top. Do you mean the fact that it's missing the commit hash (the random looking part at the end)? I believe that's omitted for brevity's sake if you play a non-trunk game.
(0032650)
stoneychips (reporter)
2018-09-24 09:00

Yes, the long string of letters and numbers at the end of the version. Guess I didn't realize that was only the commit/build number. Okay.

- Issue History
Date Modified Username Field Change
2018-09-22 18:54 stoneychips New Issue
2018-09-23 13:31 aidanholm Note Added: 0032645
2018-09-23 13:31 aidanholm Status new => confirmed
2018-09-23 15:29 stoneychips Note Added: 0032646
2018-09-23 18:45 aidanholm Note Added: 0032647
2018-09-24 09:00 stoneychips Note Added: 0032650


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker