diff --git a/public/cf/a1.gif b/public/cf/a1.gif new file mode 100644 index 00000000..6adea1c8 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 00000000..41fd5958 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 00000000..b9353b15 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 00000000..d3c0ab56 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 00000000..74663941 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 00000000..1ab40bdb 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 00000000..413c7a04 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 00000000..1e0132b2 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 00000000..ad3d1880 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 00000000..cb9f145a 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 00000000..6afc4ce8 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 00000000..5b72cece 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 00000000..6a7b7405 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 00000000..fcb93bd6 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 00000000..8ff1588f 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 00000000..2bf2749b 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 00000000..431e0342 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 00000000..53694118 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 00000000..78b17cc1 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 00000000..d2a4b839 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 00000000..27118cbf 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 00000000..9def66d5 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 00000000..7f5cf937 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 00000000..b5ecc33e 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 00000000..e7103586 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 00000000..fb2b61a5 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 00000000..7f43e396 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 00000000..375b87cc 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 00000000..e4cde1b4 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 00000000..db1d18e4 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 00000000..97929534 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 00000000..194b5ae2 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 00000000..2ee22f5e 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 00000000..54a0a238 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 00000000..105fa4ab 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 00000000..3d42828f 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 00000000..067bc6dd 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 00000000..0f8a15ca 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 00000000..6a20dabd 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 00000000..7b80bdfd 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 00000000..c892f07a 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 00000000..99463300 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 00000000..39d17efa 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 00000000..e68515d4 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 00000000..e8dff861 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 00000000..bb19c503 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 00000000..6addb022 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 00000000..f6f7181a 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 00000000..d3e93ac3 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 00000000..87addbb2 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 00000000..880e2c68 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 00000000..43d2a13b 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 00000000..09d43086 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 00000000..2cb4895b 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 00000000..82d2e2da 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 00000000..999f56fd 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 00000000..1b45997b 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 00000000..511af2c0 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 00000000..0c3a77c1 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 00000000..5aaeec8f 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 00000000..7dff305b 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 00000000..a7179789 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 00000000..1d856b04 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 00000000..4724062e 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 00000000..eed4e976 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 00000000..9e752d5f 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 00000000..f117a977 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 00000000..bf42f8b1 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 00000000..930e6866 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 00000000..a68c0c42 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 00000000..8dcba7b7 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 00000000..f292a134 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 00000000..149f4538 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 00000000..297e70ba 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 00000000..60b1c6e1 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 00000000..a139c742 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 00000000..c3e433fe 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 00000000..b20fb548 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 00000000..54af560f 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 00000000..b9b9e7e5 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 00000000..db1d18e4 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 00000000..68fba3e7 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 00000000..78ebdf1e 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 00000000..8af68af9 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 00000000..b9da2e40 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 00000000..db1d18e4 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 00000000..583374d1 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 00000000..3d04871e 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 00000000..e95e411d 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 00000000..5f21f50f 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 00000000..59cd67f5 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 00000000..7d05bc64 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 00000000..6be3207c 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 00000000..56392a84 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 00000000..18f8a63a 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 00000000..d48a065d 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 00000000..6a60a159 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 00000000..6b178685 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 00000000..4774a0c0 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 00000000..39653f99 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 00000000..4f5bb6c4 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 00000000..431e0342 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 00000000..3baabaad 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 00000000..0ff02d08 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 00000000..6eaa00b2 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 00000000..b080caf1 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 00000000..8d195107 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 00000000..7ab19170 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 00000000..f301cca6 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 00000000..4b704bf2 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 00000000..17bf26cb 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 00000000..4e09c84b 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 00000000..6ceada71 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 00000000..f297b930 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 00000000..bac22efa 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 00000000..c85646a4 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 00000000..f0d163fb 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 00000000..7c86f46c 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 00000000..fad8a1cb 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 00000000..ba3047f3 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 00000000..1c85feef 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 00000000..3e9db20a 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 00000000..6e07580a 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 00000000..ced56fc8 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 00000000..988b5aa6 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 00000000..25584f63 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 00000000..a569de7f 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 00000000..1f913404 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 00000000..39ebb1fc 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 00000000..b180cd03 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 00000000..cdc59b21 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 00000000..08d866c3 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 00000000..b749b533 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 00000000..4f11a335 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 00000000..f7f3e9f9 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 00000000..6861afbb 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 00000000..d791e965 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 00000000..9d7e241d 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 00000000..84bc758e 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 00000000..21ee083b 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 00000000..e2179e21 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 00000000..ef48062c 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 00000000..a4223422 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 00000000..27040fac 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 00000000..9a6ff468 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 00000000..2b0e9bec 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 00000000..381c1cec 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 00000000..8189b240 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 00000000..3b672ae7 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 00000000..37900d5a 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 00000000..dbb0162c 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 00000000..68617f56 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 00000000..bfc3ef59 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 00000000..785014e5 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 00000000..3dbe1d17 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 00000000..61acf4bd 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 00000000..32bd9e25 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 00000000..40da3d9e 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 00000000..03b9cd16 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 00000000..f8e72788 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 00000000..098cfe08 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 00000000..16f9aebb 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 00000000..ab4e6002 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 00000000..68b2bd3f 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 00000000..4fd42451 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 00000000..58d154b5 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 00000000..86d5a510 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 00000000..808a3114 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 00000000..b4fd52b7 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 00000000..ba3b2c09 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 00000000..5278287a 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 00000000..9f10dd4b 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 00000000..0f8a15ca 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 00000000..f00a3c2b 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 00000000..c887e1d0 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 00000000..c029e45a 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 00000000..b2175542 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 00000000..740c0479 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 00000000..243b7ca8 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 00000000..5ffe57f5 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 00000000..a0357654 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 00000000..6a40ffea 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 00000000..807e786a 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 00000000..2f1b65be 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 00000000..5c21ecb1 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 00000000..4ebcc386 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 00000000..4daea71e 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 00000000..f02dc361 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 00000000..54d44434 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 00000000..70bc2ef3 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 00000000..634f237d 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 00000000..2479ee2f 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 00000000..b16ed599 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 00000000..db1d18e4 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 00000000..8398c154 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 00000000..5e53d436 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 00000000..a2036b56 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 00000000..64e64a7e 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 00000000..09bc1d9e 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 00000000..3087c163 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 00000000..eaafb066 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 00000000..661f077e 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 00000000..69432bef 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 00000000..699e4f52 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 00000000..6c07c06a 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 00000000..04a83182 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 00000000..0f8a15ca 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 00000000..7e48907c 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 00000000..f4812e58 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 00000000..5d35426d 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 00000000..d1533d8d 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 00000000..e512218e 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 00000000..60f9178e 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 00000000..1dbf69c2 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 00000000..bc8f22fe 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 00000000..52392d25 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 00000000..086d7c65 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 00000000..5a74e9a2 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 00000000..2431f51b 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 00000000..0f30f470 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 00000000..669723c2 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 00000000..2b9f79da 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 00000000..9ed28d61 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 00000000..df81d331 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 00000000..5c82a329 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 00000000..2ed1580a 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 00000000..03d98388 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 00000000..5894b9d1 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 00000000..e3a51f06 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 00000000..1cc4ffef 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 00000000..058b5e29 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 00000000..418d3a4f 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 00000000..f529be6d 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 00000000..0470b4d1 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 00000000..9a74589d 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 00000000..d94e19e9 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 00000000..30f1282b 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 00000000..31ef5350 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 00000000..10de218b 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 00000000..f5475289 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 00000000..d5166c6b 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 00000000..bc20ed53 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 00000000..e8f2f703 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 00000000..9d6a98ff 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 00000000..b09b5f98 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 00000000..cc1804be 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 00000000..a736efa6 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 00000000..198d346a 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 00000000..a7529f50 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 00000000..b55dd2b1 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 00000000..bdf7b302 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 00000000..35f44403 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 00000000..1293c8d5 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 00000000..5bb07048 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 00000000..d30d2d41 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 00000000..5fd6b63b Binary files /dev/null and b/public/cf/zw.gif differ diff --git a/src/actions/index.js b/src/actions/index.js index be48db6b..622a8eaa 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 500046b7..26f2bccc 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 03fd16d8..4fe2ea27 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 f18f784b..9974b858 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 24437914..926092d7 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 b4f996c8..6f4120b5 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 c328fd76..ed7bff96 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 b8df71db..8510df25 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 1c2ac702..168cad1c 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 c60036b3..e491cecc 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 be0f2c09..410f4938 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, + ), ); }