diff --git a/public/cf/a1.gif b/public/cf/a1.gif new file mode 100644 index 0000000..6adea1c Binary files /dev/null and b/public/cf/a1.gif differ diff --git a/public/cf/a2.gif b/public/cf/a2.gif new file mode 100644 index 0000000..41fd595 Binary files /dev/null and b/public/cf/a2.gif differ diff --git a/public/cf/ad.gif b/public/cf/ad.gif new file mode 100644 index 0000000..b9353b1 Binary files /dev/null and b/public/cf/ad.gif differ diff --git a/public/cf/ae.gif b/public/cf/ae.gif new file mode 100644 index 0000000..d3c0ab5 Binary files /dev/null and b/public/cf/ae.gif differ diff --git a/public/cf/af.gif b/public/cf/af.gif new file mode 100644 index 0000000..7466394 Binary files /dev/null and b/public/cf/af.gif differ diff --git a/public/cf/ag.gif b/public/cf/ag.gif new file mode 100644 index 0000000..1ab40bd Binary files /dev/null and b/public/cf/ag.gif differ diff --git a/public/cf/ai.gif b/public/cf/ai.gif new file mode 100644 index 0000000..413c7a0 Binary files /dev/null and b/public/cf/ai.gif differ diff --git a/public/cf/al.gif b/public/cf/al.gif new file mode 100644 index 0000000..1e0132b Binary files /dev/null and b/public/cf/al.gif differ diff --git a/public/cf/am.gif b/public/cf/am.gif new file mode 100644 index 0000000..ad3d188 Binary files /dev/null and b/public/cf/am.gif differ diff --git a/public/cf/an.gif b/public/cf/an.gif new file mode 100644 index 0000000..cb9f145 Binary files /dev/null and b/public/cf/an.gif differ diff --git a/public/cf/ao.gif b/public/cf/ao.gif new file mode 100644 index 0000000..6afc4ce Binary files /dev/null and b/public/cf/ao.gif differ diff --git a/public/cf/ap.gif b/public/cf/ap.gif new file mode 100644 index 0000000..5b72cec Binary files /dev/null and b/public/cf/ap.gif differ diff --git a/public/cf/aq.gif b/public/cf/aq.gif new file mode 100644 index 0000000..6a7b740 Binary files /dev/null and b/public/cf/aq.gif differ diff --git a/public/cf/ar.gif b/public/cf/ar.gif new file mode 100644 index 0000000..fcb93bd Binary files /dev/null and b/public/cf/ar.gif differ diff --git a/public/cf/as.gif b/public/cf/as.gif new file mode 100644 index 0000000..8ff1588 Binary files /dev/null and b/public/cf/as.gif differ diff --git a/public/cf/at.gif b/public/cf/at.gif new file mode 100644 index 0000000..2bf2749 Binary files /dev/null and b/public/cf/at.gif differ diff --git a/public/cf/au.gif b/public/cf/au.gif new file mode 100644 index 0000000..431e034 Binary files /dev/null and b/public/cf/au.gif differ diff --git a/public/cf/aw.gif b/public/cf/aw.gif new file mode 100644 index 0000000..5369411 Binary files /dev/null and b/public/cf/aw.gif differ diff --git a/public/cf/ax.gif b/public/cf/ax.gif new file mode 100644 index 0000000..78b17cc Binary files /dev/null and b/public/cf/ax.gif differ diff --git a/public/cf/az.gif b/public/cf/az.gif new file mode 100644 index 0000000..d2a4b83 Binary files /dev/null and b/public/cf/az.gif differ diff --git a/public/cf/ba.gif b/public/cf/ba.gif new file mode 100644 index 0000000..27118cb Binary files /dev/null and b/public/cf/ba.gif differ diff --git a/public/cf/bb.gif b/public/cf/bb.gif new file mode 100644 index 0000000..9def66d Binary files /dev/null and b/public/cf/bb.gif differ diff --git a/public/cf/bd.gif b/public/cf/bd.gif new file mode 100644 index 0000000..7f5cf93 Binary files /dev/null and b/public/cf/bd.gif differ diff --git a/public/cf/be.gif b/public/cf/be.gif new file mode 100644 index 0000000..b5ecc33 Binary files /dev/null and b/public/cf/be.gif differ diff --git a/public/cf/bf.gif b/public/cf/bf.gif new file mode 100644 index 0000000..e710358 Binary files /dev/null and b/public/cf/bf.gif differ diff --git a/public/cf/bg.gif b/public/cf/bg.gif new file mode 100644 index 0000000..fb2b61a Binary files /dev/null and b/public/cf/bg.gif differ diff --git a/public/cf/bh.gif b/public/cf/bh.gif new file mode 100644 index 0000000..7f43e39 Binary files /dev/null and b/public/cf/bh.gif differ diff --git a/public/cf/bi.gif b/public/cf/bi.gif new file mode 100644 index 0000000..375b87c Binary files /dev/null and b/public/cf/bi.gif differ diff --git a/public/cf/bj.gif b/public/cf/bj.gif new file mode 100644 index 0000000..e4cde1b Binary files /dev/null and b/public/cf/bj.gif differ diff --git a/public/cf/bl.gif b/public/cf/bl.gif new file mode 100644 index 0000000..db1d18e Binary files /dev/null and b/public/cf/bl.gif differ diff --git a/public/cf/bm.gif b/public/cf/bm.gif new file mode 100644 index 0000000..9792953 Binary files /dev/null and b/public/cf/bm.gif differ diff --git a/public/cf/bn.gif b/public/cf/bn.gif new file mode 100644 index 0000000..194b5ae Binary files /dev/null and b/public/cf/bn.gif differ diff --git a/public/cf/bo.gif b/public/cf/bo.gif new file mode 100644 index 0000000..2ee22f5 Binary files /dev/null and b/public/cf/bo.gif differ diff --git a/public/cf/bq.gif b/public/cf/bq.gif new file mode 100644 index 0000000..54a0a23 Binary files /dev/null and b/public/cf/bq.gif differ diff --git a/public/cf/br.gif b/public/cf/br.gif new file mode 100644 index 0000000..105fa4a Binary files /dev/null and b/public/cf/br.gif differ diff --git a/public/cf/bs.gif b/public/cf/bs.gif new file mode 100644 index 0000000..3d42828 Binary files /dev/null and b/public/cf/bs.gif differ diff --git a/public/cf/bt.gif b/public/cf/bt.gif new file mode 100644 index 0000000..067bc6d Binary files /dev/null and b/public/cf/bt.gif differ diff --git a/public/cf/bv.gif b/public/cf/bv.gif new file mode 100644 index 0000000..0f8a15c Binary files /dev/null and b/public/cf/bv.gif differ diff --git a/public/cf/bw.gif b/public/cf/bw.gif new file mode 100644 index 0000000..6a20dab Binary files /dev/null and b/public/cf/bw.gif differ diff --git a/public/cf/by.gif b/public/cf/by.gif new file mode 100644 index 0000000..7b80bdf Binary files /dev/null and b/public/cf/by.gif differ diff --git a/public/cf/bz.gif b/public/cf/bz.gif new file mode 100644 index 0000000..c892f07 Binary files /dev/null and b/public/cf/bz.gif differ diff --git a/public/cf/ca.gif b/public/cf/ca.gif new file mode 100644 index 0000000..9946330 Binary files /dev/null and b/public/cf/ca.gif differ diff --git a/public/cf/cc.gif b/public/cf/cc.gif new file mode 100644 index 0000000..39d17ef Binary files /dev/null and b/public/cf/cc.gif differ diff --git a/public/cf/cd.gif b/public/cf/cd.gif new file mode 100644 index 0000000..e68515d Binary files /dev/null and b/public/cf/cd.gif differ diff --git a/public/cf/cf.gif b/public/cf/cf.gif new file mode 100644 index 0000000..e8dff86 Binary files /dev/null and b/public/cf/cf.gif differ diff --git a/public/cf/cg.gif b/public/cf/cg.gif new file mode 100644 index 0000000..bb19c50 Binary files /dev/null and b/public/cf/cg.gif differ diff --git a/public/cf/ch.gif b/public/cf/ch.gif new file mode 100644 index 0000000..6addb02 Binary files /dev/null and b/public/cf/ch.gif differ diff --git a/public/cf/ci.gif b/public/cf/ci.gif new file mode 100644 index 0000000..f6f7181 Binary files /dev/null and b/public/cf/ci.gif differ diff --git a/public/cf/ck.gif b/public/cf/ck.gif new file mode 100644 index 0000000..d3e93ac Binary files /dev/null and b/public/cf/ck.gif differ diff --git a/public/cf/cl.gif b/public/cf/cl.gif new file mode 100644 index 0000000..87addbb Binary files /dev/null and b/public/cf/cl.gif differ diff --git a/public/cf/cm.gif b/public/cf/cm.gif new file mode 100644 index 0000000..880e2c6 Binary files /dev/null and b/public/cf/cm.gif differ diff --git a/public/cf/cn.gif b/public/cf/cn.gif new file mode 100644 index 0000000..43d2a13 Binary files /dev/null and b/public/cf/cn.gif differ diff --git a/public/cf/co.gif b/public/cf/co.gif new file mode 100644 index 0000000..09d4308 Binary files /dev/null and b/public/cf/co.gif differ diff --git a/public/cf/cr.gif b/public/cf/cr.gif new file mode 100644 index 0000000..2cb4895 Binary files /dev/null and b/public/cf/cr.gif differ diff --git a/public/cf/cs.gif b/public/cf/cs.gif new file mode 100644 index 0000000..82d2e2d Binary files /dev/null and b/public/cf/cs.gif differ diff --git a/public/cf/cu.gif b/public/cf/cu.gif new file mode 100644 index 0000000..999f56f Binary files /dev/null and b/public/cf/cu.gif differ diff --git a/public/cf/cv.gif b/public/cf/cv.gif new file mode 100644 index 0000000..1b45997 Binary files /dev/null and b/public/cf/cv.gif differ diff --git a/public/cf/cw.gif b/public/cf/cw.gif new file mode 100644 index 0000000..511af2c Binary files /dev/null and b/public/cf/cw.gif differ diff --git a/public/cf/cx.gif b/public/cf/cx.gif new file mode 100644 index 0000000..0c3a77c Binary files /dev/null and b/public/cf/cx.gif differ diff --git a/public/cf/cy.gif b/public/cf/cy.gif new file mode 100644 index 0000000..5aaeec8 Binary files /dev/null and b/public/cf/cy.gif differ diff --git a/public/cf/cz.gif b/public/cf/cz.gif new file mode 100644 index 0000000..7dff305 Binary files /dev/null and b/public/cf/cz.gif differ diff --git a/public/cf/de.gif b/public/cf/de.gif new file mode 100644 index 0000000..a717978 Binary files /dev/null and b/public/cf/de.gif differ diff --git a/public/cf/dj.gif b/public/cf/dj.gif new file mode 100644 index 0000000..1d856b0 Binary files /dev/null and b/public/cf/dj.gif differ diff --git a/public/cf/dk.gif b/public/cf/dk.gif new file mode 100644 index 0000000..4724062 Binary files /dev/null and b/public/cf/dk.gif differ diff --git a/public/cf/dm.gif b/public/cf/dm.gif new file mode 100644 index 0000000..eed4e97 Binary files /dev/null and b/public/cf/dm.gif differ diff --git a/public/cf/do.gif b/public/cf/do.gif new file mode 100644 index 0000000..9e752d5 Binary files /dev/null and b/public/cf/do.gif differ diff --git a/public/cf/dz.gif b/public/cf/dz.gif new file mode 100644 index 0000000..f117a97 Binary files /dev/null and b/public/cf/dz.gif differ diff --git a/public/cf/ec.gif b/public/cf/ec.gif new file mode 100644 index 0000000..bf42f8b Binary files /dev/null and b/public/cf/ec.gif differ diff --git a/public/cf/ee.gif b/public/cf/ee.gif new file mode 100644 index 0000000..930e686 Binary files /dev/null and b/public/cf/ee.gif differ diff --git a/public/cf/eg.gif b/public/cf/eg.gif new file mode 100644 index 0000000..a68c0c4 Binary files /dev/null and b/public/cf/eg.gif differ diff --git a/public/cf/eh.gif b/public/cf/eh.gif new file mode 100644 index 0000000..8dcba7b Binary files /dev/null and b/public/cf/eh.gif differ diff --git a/public/cf/er.gif b/public/cf/er.gif new file mode 100644 index 0000000..f292a13 Binary files /dev/null and b/public/cf/er.gif differ diff --git a/public/cf/es.gif b/public/cf/es.gif new file mode 100644 index 0000000..149f453 Binary files /dev/null and b/public/cf/es.gif differ diff --git a/public/cf/et.gif b/public/cf/et.gif new file mode 100644 index 0000000..297e70b Binary files /dev/null and b/public/cf/et.gif differ diff --git a/public/cf/eu.gif b/public/cf/eu.gif new file mode 100644 index 0000000..60b1c6e Binary files /dev/null and b/public/cf/eu.gif differ diff --git a/public/cf/fi.gif b/public/cf/fi.gif new file mode 100644 index 0000000..a139c74 Binary files /dev/null and b/public/cf/fi.gif differ diff --git a/public/cf/fj.gif b/public/cf/fj.gif new file mode 100644 index 0000000..c3e433f Binary files /dev/null and b/public/cf/fj.gif differ diff --git a/public/cf/fk.gif b/public/cf/fk.gif new file mode 100644 index 0000000..b20fb54 Binary files /dev/null and b/public/cf/fk.gif differ diff --git a/public/cf/fm.gif b/public/cf/fm.gif new file mode 100644 index 0000000..54af560 Binary files /dev/null and b/public/cf/fm.gif differ diff --git a/public/cf/fo.gif b/public/cf/fo.gif new file mode 100644 index 0000000..b9b9e7e Binary files /dev/null and b/public/cf/fo.gif differ diff --git a/public/cf/fr.gif b/public/cf/fr.gif new file mode 100644 index 0000000..db1d18e Binary files /dev/null and b/public/cf/fr.gif differ diff --git a/public/cf/ga.gif b/public/cf/ga.gif new file mode 100644 index 0000000..68fba3e Binary files /dev/null and b/public/cf/ga.gif differ diff --git a/public/cf/gb.gif b/public/cf/gb.gif new file mode 100644 index 0000000..78ebdf1 Binary files /dev/null and b/public/cf/gb.gif differ diff --git a/public/cf/gd.gif b/public/cf/gd.gif new file mode 100644 index 0000000..8af68af Binary files /dev/null and b/public/cf/gd.gif differ diff --git a/public/cf/ge.gif b/public/cf/ge.gif new file mode 100644 index 0000000..b9da2e4 Binary files /dev/null and b/public/cf/ge.gif differ diff --git a/public/cf/gf.gif b/public/cf/gf.gif new file mode 100644 index 0000000..db1d18e Binary files /dev/null and b/public/cf/gf.gif differ diff --git a/public/cf/gg.gif b/public/cf/gg.gif new file mode 100644 index 0000000..583374d Binary files /dev/null and b/public/cf/gg.gif differ diff --git a/public/cf/gh.gif b/public/cf/gh.gif new file mode 100644 index 0000000..3d04871 Binary files /dev/null and b/public/cf/gh.gif differ diff --git a/public/cf/gi.gif b/public/cf/gi.gif new file mode 100644 index 0000000..e95e411 Binary files /dev/null and b/public/cf/gi.gif differ diff --git a/public/cf/gl.gif b/public/cf/gl.gif new file mode 100644 index 0000000..5f21f50 Binary files /dev/null and b/public/cf/gl.gif differ diff --git a/public/cf/gm.gif b/public/cf/gm.gif new file mode 100644 index 0000000..59cd67f Binary files /dev/null and b/public/cf/gm.gif differ diff --git a/public/cf/gn.gif b/public/cf/gn.gif new file mode 100644 index 0000000..7d05bc6 Binary files /dev/null and b/public/cf/gn.gif differ diff --git a/public/cf/gp.gif b/public/cf/gp.gif new file mode 100644 index 0000000..6be3207 Binary files /dev/null and b/public/cf/gp.gif differ diff --git a/public/cf/gq.gif b/public/cf/gq.gif new file mode 100644 index 0000000..56392a8 Binary files /dev/null and b/public/cf/gq.gif differ diff --git a/public/cf/gr.gif b/public/cf/gr.gif new file mode 100644 index 0000000..18f8a63 Binary files /dev/null and b/public/cf/gr.gif differ diff --git a/public/cf/gs.gif b/public/cf/gs.gif new file mode 100644 index 0000000..d48a065 Binary files /dev/null and b/public/cf/gs.gif differ diff --git a/public/cf/gt.gif b/public/cf/gt.gif new file mode 100644 index 0000000..6a60a15 Binary files /dev/null and b/public/cf/gt.gif differ diff --git a/public/cf/gu.gif b/public/cf/gu.gif new file mode 100644 index 0000000..6b17868 Binary files /dev/null and b/public/cf/gu.gif differ diff --git a/public/cf/gw.gif b/public/cf/gw.gif new file mode 100644 index 0000000..4774a0c Binary files /dev/null and b/public/cf/gw.gif differ diff --git a/public/cf/gy.gif b/public/cf/gy.gif new file mode 100644 index 0000000..39653f9 Binary files /dev/null and b/public/cf/gy.gif differ diff --git a/public/cf/hk.gif b/public/cf/hk.gif new file mode 100644 index 0000000..4f5bb6c Binary files /dev/null and b/public/cf/hk.gif differ diff --git a/public/cf/hm.gif b/public/cf/hm.gif new file mode 100644 index 0000000..431e034 Binary files /dev/null and b/public/cf/hm.gif differ diff --git a/public/cf/hn.gif b/public/cf/hn.gif new file mode 100644 index 0000000..3baabaa Binary files /dev/null and b/public/cf/hn.gif differ diff --git a/public/cf/hr.gif b/public/cf/hr.gif new file mode 100644 index 0000000..0ff02d0 Binary files /dev/null and b/public/cf/hr.gif differ diff --git a/public/cf/ht.gif b/public/cf/ht.gif new file mode 100644 index 0000000..6eaa00b Binary files /dev/null and b/public/cf/ht.gif differ diff --git a/public/cf/hu.gif b/public/cf/hu.gif new file mode 100644 index 0000000..b080caf Binary files /dev/null and b/public/cf/hu.gif differ diff --git a/public/cf/id.gif b/public/cf/id.gif new file mode 100644 index 0000000..8d19510 Binary files /dev/null and b/public/cf/id.gif differ diff --git a/public/cf/ie.gif b/public/cf/ie.gif new file mode 100644 index 0000000..7ab1917 Binary files /dev/null and b/public/cf/ie.gif differ diff --git a/public/cf/il.gif b/public/cf/il.gif new file mode 100644 index 0000000..f301cca Binary files /dev/null and b/public/cf/il.gif differ diff --git a/public/cf/im.gif b/public/cf/im.gif new file mode 100644 index 0000000..4b704bf Binary files /dev/null and b/public/cf/im.gif differ diff --git a/public/cf/in.gif b/public/cf/in.gif new file mode 100644 index 0000000..17bf26c Binary files /dev/null and b/public/cf/in.gif differ diff --git a/public/cf/io.gif b/public/cf/io.gif new file mode 100644 index 0000000..4e09c84 Binary files /dev/null and b/public/cf/io.gif differ diff --git a/public/cf/iq.gif b/public/cf/iq.gif new file mode 100644 index 0000000..6ceada7 Binary files /dev/null and b/public/cf/iq.gif differ diff --git a/public/cf/ir.gif b/public/cf/ir.gif new file mode 100644 index 0000000..f297b93 Binary files /dev/null and b/public/cf/ir.gif differ diff --git a/public/cf/is.gif b/public/cf/is.gif new file mode 100644 index 0000000..bac22ef Binary files /dev/null and b/public/cf/is.gif differ diff --git a/public/cf/it.gif b/public/cf/it.gif new file mode 100644 index 0000000..c85646a Binary files /dev/null and b/public/cf/it.gif differ diff --git a/public/cf/je.gif b/public/cf/je.gif new file mode 100644 index 0000000..f0d163f Binary files /dev/null and b/public/cf/je.gif differ diff --git a/public/cf/jm.gif b/public/cf/jm.gif new file mode 100644 index 0000000..7c86f46 Binary files /dev/null and b/public/cf/jm.gif differ diff --git a/public/cf/jo.gif b/public/cf/jo.gif new file mode 100644 index 0000000..fad8a1c Binary files /dev/null and b/public/cf/jo.gif differ diff --git a/public/cf/jp.gif b/public/cf/jp.gif new file mode 100644 index 0000000..ba3047f Binary files /dev/null and b/public/cf/jp.gif differ diff --git a/public/cf/ke.gif b/public/cf/ke.gif new file mode 100644 index 0000000..1c85fee Binary files /dev/null and b/public/cf/ke.gif differ diff --git a/public/cf/kg.gif b/public/cf/kg.gif new file mode 100644 index 0000000..3e9db20 Binary files /dev/null and b/public/cf/kg.gif differ diff --git a/public/cf/kh.gif b/public/cf/kh.gif new file mode 100644 index 0000000..6e07580 Binary files /dev/null and b/public/cf/kh.gif differ diff --git a/public/cf/ki.gif b/public/cf/ki.gif new file mode 100644 index 0000000..ced56fc Binary files /dev/null and b/public/cf/ki.gif differ diff --git a/public/cf/km.gif b/public/cf/km.gif new file mode 100644 index 0000000..988b5aa Binary files /dev/null and b/public/cf/km.gif differ diff --git a/public/cf/kn.gif b/public/cf/kn.gif new file mode 100644 index 0000000..25584f6 Binary files /dev/null and b/public/cf/kn.gif differ diff --git a/public/cf/kp.gif b/public/cf/kp.gif new file mode 100644 index 0000000..a569de7 Binary files /dev/null and b/public/cf/kp.gif differ diff --git a/public/cf/kr.gif b/public/cf/kr.gif new file mode 100644 index 0000000..1f91340 Binary files /dev/null and b/public/cf/kr.gif differ diff --git a/public/cf/kw.gif b/public/cf/kw.gif new file mode 100644 index 0000000..39ebb1f Binary files /dev/null and b/public/cf/kw.gif differ diff --git a/public/cf/ky.gif b/public/cf/ky.gif new file mode 100644 index 0000000..b180cd0 Binary files /dev/null and b/public/cf/ky.gif differ diff --git a/public/cf/kz.gif b/public/cf/kz.gif new file mode 100644 index 0000000..cdc59b2 Binary files /dev/null and b/public/cf/kz.gif differ diff --git a/public/cf/la.gif b/public/cf/la.gif new file mode 100644 index 0000000..08d866c Binary files /dev/null and b/public/cf/la.gif differ diff --git a/public/cf/lb.gif b/public/cf/lb.gif new file mode 100644 index 0000000..b749b53 Binary files /dev/null and b/public/cf/lb.gif differ diff --git a/public/cf/lc.gif b/public/cf/lc.gif new file mode 100644 index 0000000..4f11a33 Binary files /dev/null and b/public/cf/lc.gif differ diff --git a/public/cf/li.gif b/public/cf/li.gif new file mode 100644 index 0000000..f7f3e9f Binary files /dev/null and b/public/cf/li.gif differ diff --git a/public/cf/lk.gif b/public/cf/lk.gif new file mode 100644 index 0000000..6861afb Binary files /dev/null and b/public/cf/lk.gif differ diff --git a/public/cf/lr.gif b/public/cf/lr.gif new file mode 100644 index 0000000..d791e96 Binary files /dev/null and b/public/cf/lr.gif differ diff --git a/public/cf/ls.gif b/public/cf/ls.gif new file mode 100644 index 0000000..9d7e241 Binary files /dev/null and b/public/cf/ls.gif differ diff --git a/public/cf/lt.gif b/public/cf/lt.gif new file mode 100644 index 0000000..84bc758 Binary files /dev/null and b/public/cf/lt.gif differ diff --git a/public/cf/lu.gif b/public/cf/lu.gif new file mode 100644 index 0000000..21ee083 Binary files /dev/null and b/public/cf/lu.gif differ diff --git a/public/cf/lv.gif b/public/cf/lv.gif new file mode 100644 index 0000000..e2179e2 Binary files /dev/null and b/public/cf/lv.gif differ diff --git a/public/cf/ly.gif b/public/cf/ly.gif new file mode 100644 index 0000000..ef48062 Binary files /dev/null and b/public/cf/ly.gif differ diff --git a/public/cf/ma.gif b/public/cf/ma.gif new file mode 100644 index 0000000..a422342 Binary files /dev/null and b/public/cf/ma.gif differ diff --git a/public/cf/mc.gif b/public/cf/mc.gif new file mode 100644 index 0000000..27040fa Binary files /dev/null and b/public/cf/mc.gif differ diff --git a/public/cf/md.gif b/public/cf/md.gif new file mode 100644 index 0000000..9a6ff46 Binary files /dev/null and b/public/cf/md.gif differ diff --git a/public/cf/me.gif b/public/cf/me.gif new file mode 100644 index 0000000..2b0e9be Binary files /dev/null and b/public/cf/me.gif differ diff --git a/public/cf/mf.gif b/public/cf/mf.gif new file mode 100644 index 0000000..381c1ce Binary files /dev/null and b/public/cf/mf.gif differ diff --git a/public/cf/mg.gif b/public/cf/mg.gif new file mode 100644 index 0000000..8189b24 Binary files /dev/null and b/public/cf/mg.gif differ diff --git a/public/cf/mh.gif b/public/cf/mh.gif new file mode 100644 index 0000000..3b672ae Binary files /dev/null and b/public/cf/mh.gif differ diff --git a/public/cf/mk.gif b/public/cf/mk.gif new file mode 100644 index 0000000..37900d5 Binary files /dev/null and b/public/cf/mk.gif differ diff --git a/public/cf/ml.gif b/public/cf/ml.gif new file mode 100644 index 0000000..dbb0162 Binary files /dev/null and b/public/cf/ml.gif differ diff --git a/public/cf/mm.gif b/public/cf/mm.gif new file mode 100644 index 0000000..68617f5 Binary files /dev/null and b/public/cf/mm.gif differ diff --git a/public/cf/mn.gif b/public/cf/mn.gif new file mode 100644 index 0000000..bfc3ef5 Binary files /dev/null and b/public/cf/mn.gif differ diff --git a/public/cf/mo.gif b/public/cf/mo.gif new file mode 100644 index 0000000..785014e Binary files /dev/null and b/public/cf/mo.gif differ diff --git a/public/cf/mp.gif b/public/cf/mp.gif new file mode 100644 index 0000000..3dbe1d1 Binary files /dev/null and b/public/cf/mp.gif differ diff --git a/public/cf/mq.gif b/public/cf/mq.gif new file mode 100644 index 0000000..61acf4b Binary files /dev/null and b/public/cf/mq.gif differ diff --git a/public/cf/mr.gif b/public/cf/mr.gif new file mode 100644 index 0000000..32bd9e2 Binary files /dev/null and b/public/cf/mr.gif differ diff --git a/public/cf/ms.gif b/public/cf/ms.gif new file mode 100644 index 0000000..40da3d9 Binary files /dev/null and b/public/cf/ms.gif differ diff --git a/public/cf/mt.gif b/public/cf/mt.gif new file mode 100644 index 0000000..03b9cd1 Binary files /dev/null and b/public/cf/mt.gif differ diff --git a/public/cf/mu.gif b/public/cf/mu.gif new file mode 100644 index 0000000..f8e7278 Binary files /dev/null and b/public/cf/mu.gif differ diff --git a/public/cf/mv.gif b/public/cf/mv.gif new file mode 100644 index 0000000..098cfe0 Binary files /dev/null and b/public/cf/mv.gif differ diff --git a/public/cf/mw.gif b/public/cf/mw.gif new file mode 100644 index 0000000..16f9aeb Binary files /dev/null and b/public/cf/mw.gif differ diff --git a/public/cf/mx.gif b/public/cf/mx.gif new file mode 100644 index 0000000..ab4e600 Binary files /dev/null and b/public/cf/mx.gif differ diff --git a/public/cf/my.gif b/public/cf/my.gif new file mode 100644 index 0000000..68b2bd3 Binary files /dev/null and b/public/cf/my.gif differ diff --git a/public/cf/mz.gif b/public/cf/mz.gif new file mode 100644 index 0000000..4fd4245 Binary files /dev/null and b/public/cf/mz.gif differ diff --git a/public/cf/na.gif b/public/cf/na.gif new file mode 100644 index 0000000..58d154b Binary files /dev/null and b/public/cf/na.gif differ diff --git a/public/cf/nc.gif b/public/cf/nc.gif new file mode 100644 index 0000000..86d5a51 Binary files /dev/null and b/public/cf/nc.gif differ diff --git a/public/cf/ne.gif b/public/cf/ne.gif new file mode 100644 index 0000000..808a311 Binary files /dev/null and b/public/cf/ne.gif differ diff --git a/public/cf/nf.gif b/public/cf/nf.gif new file mode 100644 index 0000000..b4fd52b Binary files /dev/null and b/public/cf/nf.gif differ diff --git a/public/cf/ng.gif b/public/cf/ng.gif new file mode 100644 index 0000000..ba3b2c0 Binary files /dev/null and b/public/cf/ng.gif differ diff --git a/public/cf/ni.gif b/public/cf/ni.gif new file mode 100644 index 0000000..5278287 Binary files /dev/null and b/public/cf/ni.gif differ diff --git a/public/cf/nl.gif b/public/cf/nl.gif new file mode 100644 index 0000000..9f10dd4 Binary files /dev/null and b/public/cf/nl.gif differ diff --git a/public/cf/no.gif b/public/cf/no.gif new file mode 100644 index 0000000..0f8a15c Binary files /dev/null and b/public/cf/no.gif differ diff --git a/public/cf/np.gif b/public/cf/np.gif new file mode 100644 index 0000000..f00a3c2 Binary files /dev/null and b/public/cf/np.gif differ diff --git a/public/cf/nr.gif b/public/cf/nr.gif new file mode 100644 index 0000000..c887e1d Binary files /dev/null and b/public/cf/nr.gif differ diff --git a/public/cf/nu.gif b/public/cf/nu.gif new file mode 100644 index 0000000..c029e45 Binary files /dev/null and b/public/cf/nu.gif differ diff --git a/public/cf/nz.gif b/public/cf/nz.gif new file mode 100644 index 0000000..b217554 Binary files /dev/null and b/public/cf/nz.gif differ diff --git a/public/cf/om.gif b/public/cf/om.gif new file mode 100644 index 0000000..740c047 Binary files /dev/null and b/public/cf/om.gif differ diff --git a/public/cf/pa.gif b/public/cf/pa.gif new file mode 100644 index 0000000..243b7ca Binary files /dev/null and b/public/cf/pa.gif differ diff --git a/public/cf/pe.gif b/public/cf/pe.gif new file mode 100644 index 0000000..5ffe57f Binary files /dev/null and b/public/cf/pe.gif differ diff --git a/public/cf/pf.gif b/public/cf/pf.gif new file mode 100644 index 0000000..a035765 Binary files /dev/null and b/public/cf/pf.gif differ diff --git a/public/cf/pg.gif b/public/cf/pg.gif new file mode 100644 index 0000000..6a40ffe Binary files /dev/null and b/public/cf/pg.gif differ diff --git a/public/cf/ph.gif b/public/cf/ph.gif new file mode 100644 index 0000000..807e786 Binary files /dev/null and b/public/cf/ph.gif differ diff --git a/public/cf/pk.gif b/public/cf/pk.gif new file mode 100644 index 0000000..2f1b65b Binary files /dev/null and b/public/cf/pk.gif differ diff --git a/public/cf/pl.gif b/public/cf/pl.gif new file mode 100644 index 0000000..5c21ecb Binary files /dev/null and b/public/cf/pl.gif differ diff --git a/public/cf/pm.gif b/public/cf/pm.gif new file mode 100644 index 0000000..4ebcc38 Binary files /dev/null and b/public/cf/pm.gif differ diff --git a/public/cf/pn.gif b/public/cf/pn.gif new file mode 100644 index 0000000..4daea71 Binary files /dev/null and b/public/cf/pn.gif differ diff --git a/public/cf/pr.gif b/public/cf/pr.gif new file mode 100644 index 0000000..f02dc36 Binary files /dev/null and b/public/cf/pr.gif differ diff --git a/public/cf/ps.gif b/public/cf/ps.gif new file mode 100644 index 0000000..54d4443 Binary files /dev/null and b/public/cf/ps.gif differ diff --git a/public/cf/pt.gif b/public/cf/pt.gif new file mode 100644 index 0000000..70bc2ef Binary files /dev/null and b/public/cf/pt.gif differ diff --git a/public/cf/pu.gif b/public/cf/pu.gif new file mode 100644 index 0000000..634f237 Binary files /dev/null and b/public/cf/pu.gif differ diff --git a/public/cf/py.gif b/public/cf/py.gif new file mode 100644 index 0000000..2479ee2 Binary files /dev/null and b/public/cf/py.gif differ diff --git a/public/cf/qa.gif b/public/cf/qa.gif new file mode 100644 index 0000000..b16ed59 Binary files /dev/null and b/public/cf/qa.gif differ diff --git a/public/cf/re.gif b/public/cf/re.gif new file mode 100644 index 0000000..db1d18e Binary files /dev/null and b/public/cf/re.gif differ diff --git a/public/cf/ro.gif b/public/cf/ro.gif new file mode 100644 index 0000000..8398c15 Binary files /dev/null and b/public/cf/ro.gif differ diff --git a/public/cf/rs.gif b/public/cf/rs.gif new file mode 100644 index 0000000..5e53d43 Binary files /dev/null and b/public/cf/rs.gif differ diff --git a/public/cf/ru.gif b/public/cf/ru.gif new file mode 100644 index 0000000..a2036b5 Binary files /dev/null and b/public/cf/ru.gif differ diff --git a/public/cf/rw.gif b/public/cf/rw.gif new file mode 100644 index 0000000..64e64a7 Binary files /dev/null and b/public/cf/rw.gif differ diff --git a/public/cf/sa.gif b/public/cf/sa.gif new file mode 100644 index 0000000..09bc1d9 Binary files /dev/null and b/public/cf/sa.gif differ diff --git a/public/cf/sb.gif b/public/cf/sb.gif new file mode 100644 index 0000000..3087c16 Binary files /dev/null and b/public/cf/sb.gif differ diff --git a/public/cf/sc.gif b/public/cf/sc.gif new file mode 100644 index 0000000..eaafb06 Binary files /dev/null and b/public/cf/sc.gif differ diff --git a/public/cf/sd.gif b/public/cf/sd.gif new file mode 100644 index 0000000..661f077 Binary files /dev/null and b/public/cf/sd.gif differ diff --git a/public/cf/se.gif b/public/cf/se.gif new file mode 100644 index 0000000..69432be Binary files /dev/null and b/public/cf/se.gif differ diff --git a/public/cf/sg.gif b/public/cf/sg.gif new file mode 100644 index 0000000..699e4f5 Binary files /dev/null and b/public/cf/sg.gif differ diff --git a/public/cf/sh.gif b/public/cf/sh.gif new file mode 100644 index 0000000..6c07c06 Binary files /dev/null and b/public/cf/sh.gif differ diff --git a/public/cf/si.gif b/public/cf/si.gif new file mode 100644 index 0000000..04a8318 Binary files /dev/null and b/public/cf/si.gif differ diff --git a/public/cf/sj.gif b/public/cf/sj.gif new file mode 100644 index 0000000..0f8a15c Binary files /dev/null and b/public/cf/sj.gif differ diff --git a/public/cf/sk.gif b/public/cf/sk.gif new file mode 100644 index 0000000..7e48907 Binary files /dev/null and b/public/cf/sk.gif differ diff --git a/public/cf/sl.gif b/public/cf/sl.gif new file mode 100644 index 0000000..f4812e5 Binary files /dev/null and b/public/cf/sl.gif differ diff --git a/public/cf/sm.gif b/public/cf/sm.gif new file mode 100644 index 0000000..5d35426 Binary files /dev/null and b/public/cf/sm.gif differ diff --git a/public/cf/sn.gif b/public/cf/sn.gif new file mode 100644 index 0000000..d1533d8 Binary files /dev/null and b/public/cf/sn.gif differ diff --git a/public/cf/so.gif b/public/cf/so.gif new file mode 100644 index 0000000..e512218 Binary files /dev/null and b/public/cf/so.gif differ diff --git a/public/cf/sr.gif b/public/cf/sr.gif new file mode 100644 index 0000000..60f9178 Binary files /dev/null and b/public/cf/sr.gif differ diff --git a/public/cf/ss.gif b/public/cf/ss.gif new file mode 100644 index 0000000..1dbf69c Binary files /dev/null and b/public/cf/ss.gif differ diff --git a/public/cf/st.gif b/public/cf/st.gif new file mode 100644 index 0000000..bc8f22f Binary files /dev/null and b/public/cf/st.gif differ diff --git a/public/cf/sv.gif b/public/cf/sv.gif new file mode 100644 index 0000000..52392d2 Binary files /dev/null and b/public/cf/sv.gif differ diff --git a/public/cf/sx.gif b/public/cf/sx.gif new file mode 100644 index 0000000..086d7c6 Binary files /dev/null and b/public/cf/sx.gif differ diff --git a/public/cf/sy.gif b/public/cf/sy.gif new file mode 100644 index 0000000..5a74e9a Binary files /dev/null and b/public/cf/sy.gif differ diff --git a/public/cf/sz.gif b/public/cf/sz.gif new file mode 100644 index 0000000..2431f51 Binary files /dev/null and b/public/cf/sz.gif differ diff --git a/public/cf/tc.gif b/public/cf/tc.gif new file mode 100644 index 0000000..0f30f47 Binary files /dev/null and b/public/cf/tc.gif differ diff --git a/public/cf/td.gif b/public/cf/td.gif new file mode 100644 index 0000000..669723c Binary files /dev/null and b/public/cf/td.gif differ diff --git a/public/cf/tf.gif b/public/cf/tf.gif new file mode 100644 index 0000000..2b9f79d Binary files /dev/null and b/public/cf/tf.gif differ diff --git a/public/cf/tg.gif b/public/cf/tg.gif new file mode 100644 index 0000000..9ed28d6 Binary files /dev/null and b/public/cf/tg.gif differ diff --git a/public/cf/th.gif b/public/cf/th.gif new file mode 100644 index 0000000..df81d33 Binary files /dev/null and b/public/cf/th.gif differ diff --git a/public/cf/tj.gif b/public/cf/tj.gif new file mode 100644 index 0000000..5c82a32 Binary files /dev/null and b/public/cf/tj.gif differ diff --git a/public/cf/tk.gif b/public/cf/tk.gif new file mode 100644 index 0000000..2ed1580 Binary files /dev/null and b/public/cf/tk.gif differ diff --git a/public/cf/tl.gif b/public/cf/tl.gif new file mode 100644 index 0000000..03d9838 Binary files /dev/null and b/public/cf/tl.gif differ diff --git a/public/cf/tm.gif b/public/cf/tm.gif new file mode 100644 index 0000000..5894b9d Binary files /dev/null and b/public/cf/tm.gif differ diff --git a/public/cf/tn.gif b/public/cf/tn.gif new file mode 100644 index 0000000..e3a51f0 Binary files /dev/null and b/public/cf/tn.gif differ diff --git a/public/cf/to.gif b/public/cf/to.gif new file mode 100644 index 0000000..1cc4ffe Binary files /dev/null and b/public/cf/to.gif differ diff --git a/public/cf/tr.gif b/public/cf/tr.gif new file mode 100644 index 0000000..058b5e2 Binary files /dev/null and b/public/cf/tr.gif differ diff --git a/public/cf/tt.gif b/public/cf/tt.gif new file mode 100644 index 0000000..418d3a4 Binary files /dev/null and b/public/cf/tt.gif differ diff --git a/public/cf/tv.gif b/public/cf/tv.gif new file mode 100644 index 0000000..f529be6 Binary files /dev/null and b/public/cf/tv.gif differ diff --git a/public/cf/tw.gif b/public/cf/tw.gif new file mode 100644 index 0000000..0470b4d Binary files /dev/null and b/public/cf/tw.gif differ diff --git a/public/cf/tz.gif b/public/cf/tz.gif new file mode 100644 index 0000000..9a74589 Binary files /dev/null and b/public/cf/tz.gif differ diff --git a/public/cf/ua.gif b/public/cf/ua.gif new file mode 100644 index 0000000..d94e19e Binary files /dev/null and b/public/cf/ua.gif differ diff --git a/public/cf/ug.gif b/public/cf/ug.gif new file mode 100644 index 0000000..30f1282 Binary files /dev/null and b/public/cf/ug.gif differ diff --git a/public/cf/um.gif b/public/cf/um.gif new file mode 100644 index 0000000..31ef535 Binary files /dev/null and b/public/cf/um.gif differ diff --git a/public/cf/us.gif b/public/cf/us.gif new file mode 100644 index 0000000..10de218 Binary files /dev/null and b/public/cf/us.gif differ diff --git a/public/cf/uy.gif b/public/cf/uy.gif new file mode 100644 index 0000000..f547528 Binary files /dev/null and b/public/cf/uy.gif differ diff --git a/public/cf/uz.gif b/public/cf/uz.gif new file mode 100644 index 0000000..d5166c6 Binary files /dev/null and b/public/cf/uz.gif differ diff --git a/public/cf/va.gif b/public/cf/va.gif new file mode 100644 index 0000000..bc20ed5 Binary files /dev/null and b/public/cf/va.gif differ diff --git a/public/cf/vc.gif b/public/cf/vc.gif new file mode 100644 index 0000000..e8f2f70 Binary files /dev/null and b/public/cf/vc.gif differ diff --git a/public/cf/ve.gif b/public/cf/ve.gif new file mode 100644 index 0000000..9d6a98f Binary files /dev/null and b/public/cf/ve.gif differ diff --git a/public/cf/vg.gif b/public/cf/vg.gif new file mode 100644 index 0000000..b09b5f9 Binary files /dev/null and b/public/cf/vg.gif differ diff --git a/public/cf/vi.gif b/public/cf/vi.gif new file mode 100644 index 0000000..cc1804b Binary files /dev/null and b/public/cf/vi.gif differ diff --git a/public/cf/vn.gif b/public/cf/vn.gif new file mode 100644 index 0000000..a736efa Binary files /dev/null and b/public/cf/vn.gif differ diff --git a/public/cf/vu.gif b/public/cf/vu.gif new file mode 100644 index 0000000..198d346 Binary files /dev/null and b/public/cf/vu.gif differ diff --git a/public/cf/wf.gif b/public/cf/wf.gif new file mode 100644 index 0000000..a7529f5 Binary files /dev/null and b/public/cf/wf.gif differ diff --git a/public/cf/ws.gif b/public/cf/ws.gif new file mode 100644 index 0000000..b55dd2b Binary files /dev/null and b/public/cf/ws.gif differ diff --git a/public/cf/xx.gif b/public/cf/xx.gif new file mode 100644 index 0000000..bdf7b30 Binary files /dev/null and b/public/cf/xx.gif differ diff --git a/public/cf/ye.gif b/public/cf/ye.gif new file mode 100644 index 0000000..35f4440 Binary files /dev/null and b/public/cf/ye.gif differ diff --git a/public/cf/yt.gif b/public/cf/yt.gif new file mode 100644 index 0000000..1293c8d Binary files /dev/null and b/public/cf/yt.gif differ diff --git a/public/cf/za.gif b/public/cf/za.gif new file mode 100644 index 0000000..5bb0704 Binary files /dev/null and b/public/cf/za.gif differ diff --git a/public/cf/zm.gif b/public/cf/zm.gif new file mode 100644 index 0000000..d30d2d4 Binary files /dev/null and b/public/cf/zm.gif differ diff --git a/public/cf/zw.gif b/public/cf/zw.gif new file mode 100644 index 0000000..5fd6b63 Binary files /dev/null and b/public/cf/zw.gif differ diff --git a/src/actions/index.js b/src/actions/index.js index be48db6..622a8ea 100644 --- a/src/actions/index.js +++ b/src/actions/index.js @@ -185,11 +185,16 @@ export function receiveOnline(online: number): Action { }; } -export function receiveChatMessage(name: string, text: string): Action { +export function receiveChatMessage( + name: string, + text: string, + country: string, +): Action { return { type: 'RECEIVE_CHAT_MESSAGE', name, text, + country, }; } diff --git a/src/actions/types.js b/src/actions/types.js index 500046b..26f2bcc 100644 --- a/src/actions/types.js +++ b/src/actions/types.js @@ -53,7 +53,10 @@ export type Action = color: ColorIndex, } | { type: 'RECEIVE_ONLINE', online: number } - | { type: 'RECEIVE_CHAT_MESSAGE', name: string, text: string } + | { type: 'RECEIVE_CHAT_MESSAGE', + name: string, + text: string, + country: string } | { type: 'RECEIVE_CHAT_HISTORY', data: Array } | { type: 'RECEIVE_ME', name: string, @@ -78,6 +81,9 @@ export type Action = | { type: 'SET_HISTORICAL_TIME', date: string, time: string } | { type: 'ON_VIEW_FINISH_CHANGE' }; export type PromiseAction = Promise; -export type Dispatch = (action: Action | ThunkAction | PromiseAction | Array) => any; +export type Dispatch = (action: Action + | ThunkAction + | PromiseAction + | Array) => any; export type GetState = () => State; export type ThunkAction = (dispatch: Dispatch, getState: GetState) => any; diff --git a/src/client.js b/src/client.js index 03fd16d..4fe2ea2 100644 --- a/src/client.js +++ b/src/client.js @@ -43,8 +43,8 @@ function init() { ProtocolClient.on('onlineCounter', ({ online }) => { store.dispatch(receiveOnline(online)); }); - ProtocolClient.on('chatMessage', (name, text) => { - store.dispatch(receiveChatMessage(name, text)); + ProtocolClient.on('chatMessage', (name, text, country) => { + store.dispatch(receiveChatMessage(name, text, country)); }); ProtocolClient.on('chatHistory', (data) => { store.dispatch(receiveChatHistory(data)); diff --git a/src/components/Chat.jsx b/src/components/Chat.jsx index f18f784..9974b85 100644 --- a/src/components/Chat.jsx +++ b/src/components/Chat.jsx @@ -12,6 +12,12 @@ import ChatInput from './ChatInput'; import { colorFromText, splitCoordsInString } from '../core/utils'; +function onError() { + this.onerror = null; + this.src = './cf/xx.gif'; +} + + const Chat = ({ chatMessages }) => { const listRef = useRef(); const { stayScrolled } = useStayScrolled(listRef, { @@ -28,17 +34,29 @@ const Chat = ({ chatMessages }) => { { chatMessages.map((message) => (

- {(message[0] == 'info') + {(message[0] === 'info') ? {message[1]} : (

- {`${message[0]}: `} + + + {` ${message[0]}: `} + { splitCoordsInString(message[1]).map((text, i) => { - if (i % 2 == 0) { return ({text}); } + if (i % 2 === 0) { + return ({text}); + } return ({text}); }) - } + }
)}

diff --git a/src/core/ChatProvider.js b/src/core/ChatProvider.js index 2443791..926092d 100644 --- a/src/core/ChatProvider.js +++ b/src/core/ChatProvider.js @@ -31,13 +31,14 @@ class ChatProvider { }, ]; this.substitutes = []; + this.mutedCountries = []; } - addMessage(name, message) { + addMessage(name, message, country) { if (this.history.length > 20) { this.history.shift(); } - this.history.push([name, message]); + this.history.push([name, message, country]); } async sendMessage(user, message) { @@ -46,6 +47,7 @@ class ChatProvider { return 'You can\'t send a message this long :('; } const name = (user.regUser) ? user.regUser.name : null; + const country = user.country || 'xx'; if (!name) { // eslint-disable-next-line max-len @@ -75,18 +77,43 @@ class ChatProvider { if (user.isAdmin() && message.charAt(0) === '/') { // admin commands - const cmd = message.split(' '); - if (cmd[0] === '/mute') { - const timeMin = Number(cmd.slice(-1)); + const cmdArr = message.split(' '); + const cmd = cmdArr[0].substr(1); + const args = cmdArr.slice(1); + if (cmd === 'mute') { + const timeMin = Number(args.slice(-1)); if (Number.isNaN(timeMin)) { - return ChatProvider.mute(cmd.slice(1).join(' ')); + return ChatProvider.mute(args.join(' ')); } - return ChatProvider.mute(cmd.slice(1, -1).join(' '), timeMin); - } if (cmd[0] === '/unmute') { - return ChatProvider.unmute(cmd.slice(1).join(' ')); + return ChatProvider.mute(args.slice(0, -1).join(' '), timeMin); + } if (cmd === 'unmute') { + return ChatProvider.unmute(args.join(' ')); + } if (cmd === 'mutec' && args[0]) { + const cc = args[0].toLowerCase(); + this.mutedCountries.push(cc); + webSockets.broadcastChatMessage( + 'info', + `Country ${cc} has been muted`, + ); + return null; + } if (cmd === 'unmutec' && args[0]) { + const cc = args[0].toLowerCase(); + if (!this.mutedCountries.includes(cc)) { + return `Country ${cc} is not muted`; + } + this.mutedCountries = this.mutedCountries.filter((c) => c !== cc); + webSockets.broadcastChatMessage( + 'info', + `Country ${cc} has been unmuted`, + ); + return null; } } + if (this.mutedCountries.includes(country)) { + return 'Your country is temporary muted from chat'; + } + const muted = await ChatProvider.checkIfMuted(user); if (muted === -1) { return 'You are permanently muted, join our discord to apppeal the mute'; @@ -98,14 +125,19 @@ class ChatProvider { } return `You are muted for another ${muted} seconds`; } - this.addMessage(name, message); - webSockets.broadcastChatMessage(name, message); + this.addMessage(name, message, country); + webSockets.broadcastChatMessage(name, message, country); return null; } - broadcastChatMessage(name, message, sendapi: boolean = true) { - this.addMessage(name, message); - webSockets.broadcastChatMessage(name, message, sendapi); + broadcastChatMessage( + name, + message, + country: string = 'xx', + sendapi: boolean = true, + ) { + this.addMessage(name, message, country); + webSockets.broadcastChatMessage(name, message, country, sendapi); } /* diff --git a/src/reducers/user.js b/src/reducers/user.js index b4f996c..6f4120b 100644 --- a/src/reducers/user.js +++ b/src/reducers/user.js @@ -44,7 +44,7 @@ const initialState: UserState = { mailreg: false, totalRanking: {}, totalDailyRanking: {}, - chatMessages: [['info', 'Welcome to the PixelPlanet Chat']], + chatMessages: [['info', 'Welcome to the PixelPlanet Chat', 'il']], minecraftname: null, isOnMobile: false, notification: null, @@ -119,14 +119,14 @@ export default function user( } case 'RECEIVE_CHAT_MESSAGE': { - const { name, text } = action; + const { name, text, country } = action; let { chatMessages } = state; if (chatMessages.length > 50) { chatMessages = chatMessages.slice(-50); } return { ...state, - chatMessages: chatMessages.concat([[name, text]]), + chatMessages: chatMessages.concat([[name, text, country]]), }; } diff --git a/src/socket/APISocketServer.js b/src/socket/APISocketServer.js index c328fd7..ed7bff9 100644 --- a/src/socket/APISocketServer.js +++ b/src/socket/APISocketServer.js @@ -82,7 +82,7 @@ class APISocketServer extends WebSocketEvents { setInterval(this.ping, 45 * 1000); } - broadcastChatMessage(name, msg, sendapi, ws = null) { + broadcastChatMessage(name, msg, country, sendapi, ws = null) { if (!sendapi) return; const sendmsg = JSON.stringify(['msg', name, msg]); @@ -238,14 +238,14 @@ class APISocketServer extends WebSocketEvents { const chatname = (user.id) ? `[MC] ${user.regUser.name}` : `[MC] ${minecraftname}`; - chatProvider.broadcastChatMessage(chatname, msg, false); - this.broadcastChatMessage(chatname, msg, true, ws); + chatProvider.broadcastChatMessage(chatname, msg, 'xx', false); + this.broadcastChatMessage(chatname, msg, 'xx', true, ws); return; } if (command == 'chat') { const [name, msg] = packet; - chatProvider.broadcastChatMessage(name, msg, false); - this.broadcastChatMessage(name, msg, true, ws); + chatProvider.broadcastChatMessage(name, msg, 'xx', false); + this.broadcastChatMessage(name, msg, 'xx', true, ws); return; } if (command == 'linkacc') { diff --git a/src/socket/ProtocolClient.js b/src/socket/ProtocolClient.js index b8df71d..8510df2 100644 --- a/src/socket/ProtocolClient.js +++ b/src/socket/ProtocolClient.js @@ -159,10 +159,10 @@ class ProtocolClient extends EventEmitter { this.emit('chatHistory', data); return; } - if (data.length == 2) { + if (data.length === 3) { // Ordinary array: Chat message - const [name, text] = data; - this.emit('chatMessage', name, text); + const [name, text, country] = data; + this.emit('chatMessage', name, text, country); } } else { // string = name @@ -202,7 +202,7 @@ class ProtocolClient extends EventEmitter { // reconnect in 1s if last connect was longer than 7s ago, else 5s const timeout = this.timeConnected < Date.now() - 7000 ? 1000 : 5000; console.warn( - 'Socket is closed. ' + `Reconnect will be attempted in ${timeout} ms.`, + `Socket is closed. Reconnect will be attempted in ${timeout} ms.`, e.reason, ); diff --git a/src/socket/SocketServer.js b/src/socket/SocketServer.js index 1c2ac70..168cad1 100644 --- a/src/socket/SocketServer.js +++ b/src/socket/SocketServer.js @@ -145,8 +145,8 @@ class SocketServer extends WebSocketEvents { this.broadcast(buffer); } - broadcastChatMessage(name: string, message: string) { - const text = JSON.stringify([name, message]); + broadcastChatMessage(name: string, message: string, country: string) { + const text = JSON.stringify([name, message, country]); this.wss.clients.forEach((ws) => { if (ws.readyState === WebSocket.OPEN) { ws.send(text); @@ -222,12 +222,12 @@ class SocketServer extends WebSocketEvents { const waitLeft = ws.rateLimiter.tick(); if (waitLeft) { // eslint-disable-next-line max-len - ws.send(JSON.stringify(['info', `You are sending messages too fast, you have to wait ${Math.floor(waitLeft / 1000)}s :(`])); + ws.send(JSON.stringify(['info', `You are sending messages too fast, you have to wait ${Math.floor(waitLeft / 1000)}s :(`, 'il'])); return; } const errorMsg = await chatProvider.sendMessage(ws.user, message); if (errorMsg) { - ws.send(JSON.stringify(['info', errorMsg])); + ws.send(JSON.stringify(['info', errorMsg, 'il'])); } if (ws.last_message && ws.last_message === message) { ws.message_repeat += 1; diff --git a/src/socket/verifyClient.js b/src/socket/verifyClient.js index c60036b..e491cec 100644 --- a/src/socket/verifyClient.js +++ b/src/socket/verifyClient.js @@ -35,11 +35,10 @@ function authenticateClient(req) { return new Promise( ((resolve) => { router(req, {}, () => { - if (req.user) { - resolve(req.user); - } else { - resolve(req.noauthUser); - } + const user = req.user || req.noauthUser; + const country = req.headers['cf-ipcountry']; + user.country = country.toLowerCase(); + resolve(user); }); }), ); diff --git a/src/socket/websockets.js b/src/socket/websockets.js index be0f2c0..410f493 100644 --- a/src/socket/websockets.js +++ b/src/socket/websockets.js @@ -63,10 +63,17 @@ class WebSockets { broadcastChatMessage( name: string, message: string, + country: string, sendapi: boolean = true, ) { + country == country || 'xx'; this.listeners.forEach( - (listener) => listener.broadcastChatMessage(name, message, sendapi), + (listener) => listener.broadcastChatMessage( + name, + message, + country, + sendapi, + ), ); }