From eef6790a1d3c1449eb8cb19d7fe18901dd5d7851 Mon Sep 17 00:00:00 2001 From: Nephirus Date: Mon, 1 Nov 2010 12:16:09 +0100 Subject: [PATCH] Added ProtocolHelper and some tests --- .../.settings/org.eclipse.jdt.core.prefs | 5 ++ BrmTron Client/bin/BrmTronClient.apk | Bin 0 -> 19617 bytes .../brmlab/brmtron/client/ConnetionManager.class | Bin 0 -> 1883 bytes .../cz/brmlab/brmtron/client/ConnetionManager.java | 50 +++++++++++++++++ .../cz/brmlab/brmtron/server/BrmTronServer.class | Bin 5563 -> 5563 bytes .../brmtron/server/BrmTronServerThread.class | Bin 4351 -> 2870 bytes .../bin/cz/brmlab/brmtron/server/Player.class | Bin 1467 -> 2103 bytes .../cz/brmlab/brmtron/server/ProtocolHelper.class | Bin 0 -> 3033 bytes .../brmtron/server/test/BrmTronServerTest.class | Bin 3183 -> 3170 bytes .../brmtron/server/test/ProtocolHelperTest.class | Bin 0 -> 1467 bytes .../cz/brmlab/brmtron/server/BrmTronServer.java | 7 +-- .../brmlab/brmtron/server/BrmTronServerThread.java | 36 +++---------- .../src/cz/brmlab/brmtron/server/Player.java | 28 +++++++++- .../cz/brmlab/brmtron/server/ProtocolHelper.java | 60 +++++++++++++++++++++ .../brmtron/server/test/BrmTronServerTest.java | 4 +- .../brmtron/server/test/ProtocolHelperTest.java | 33 ++++++++++++ 16 files changed, 188 insertions(+), 35 deletions(-) create mode 100644 BrmTron Client/.settings/org.eclipse.jdt.core.prefs create mode 100644 BrmTron Client/bin/BrmTronClient.apk create mode 100644 BrmTron Client/bin/cz/brmlab/brmtron/client/ConnetionManager.class create mode 100644 BrmTron Client/src/cz/brmlab/brmtron/client/ConnetionManager.java rewrite BrmTron Server/bin/cz/brmlab/brmtron/server/BrmTronServerThread.class (86%) rewrite BrmTron Server/bin/cz/brmlab/brmtron/server/Player.class (100%) create mode 100644 BrmTron Server/bin/cz/brmlab/brmtron/server/ProtocolHelper.class create mode 100644 BrmTron Server/bin/cz/brmlab/brmtron/server/test/ProtocolHelperTest.class create mode 100644 BrmTron Server/src/cz/brmlab/brmtron/server/ProtocolHelper.java create mode 100644 BrmTron Server/src/cz/brmlab/brmtron/server/test/ProtocolHelperTest.java diff --git a/BrmTron Client/.settings/org.eclipse.jdt.core.prefs b/BrmTron Client/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..ac4c6d6 --- /dev/null +++ b/BrmTron Client/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,5 @@ +#Mon Oct 25 16:27:07 CEST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/BrmTron Client/bin/BrmTronClient.apk b/BrmTron Client/bin/BrmTronClient.apk new file mode 100644 index 0000000000000000000000000000000000000000..4668c4cc13cca18236279b576a06166b5f2b1934 GIT binary patch literal 19617 zcwXK7Wk4RwvIYvjxCD214{ia16WpEP?(XjH?(Xgo2n0xQNYDVm-Q69&m#plwvas{Mk3s;sN{?Z~@=|dm{%1OFcImCr1V&Lo-Jm z8(T*+8*2x8S1Ze>ApoFCsZ9b*0F5WXYYT#!_MJj#QE%~wTBHL|b@0~${*b8OrNu<@ ziFzg^9;o=bYHDkz+1-unE&B9?BKPSjUA7ixW<7`z1mQgSbE7Fil$d-Fq8!95k=uHh z#>tODMc0yCNj=IX%9|9K<8iwf?FuRL_Dw&!x!h3_9fyzljL0han`P6{`0Je|-fZYGu z`lvws*7{a@X4WsQUZn6@qMIKrbEc3@T%(kPW{%-xY>C_TYK3^E$Q7m0v`#=;5~a+& zjBp!D4ADDur-^IUdH{!()v^2J>RbCYb6X_@R0%tgX*XtB z-KZlUbNHmbwP#obhG7XuTeEw31cjlEy#4#k$r`pc0_^kG8|PIX3BS>$V}_T8A=h&D zQUf-O82JCyFap+w_BLjQ(t6fr#zqc~FAWo=_{~~D0PX4MQ{zH%jsmQN1tz_elvH?n z3u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sQ%K(5JqP#Cl61b(=#cQ# ze6pJA=VTsTn!Z9?d~_T+>D-9S?=y=?sq;d!ujRE$;B+%t(hG^VBDY@is_(Di<(Z%L zej1DM1iW-jNw7(EO<=c#27Bq6AfRY~zdPser}^Oi{M7XK@PC}&^ry1lPoP2lhoUEt z|9BkGp9+3I+T))JQo#P>u{AFWU;+R82_Sz5AILw?1Nl?-&o3+g4hG2o?K{gq_5As+ z=idRF_`kjR`KO*gU;X(zC{X^l7lHnC>hDhj|NP#Wgz+E$fcsPM_mv6lAA)&8|M}73 zPYu6MioYMV0szPe|NDCOr}Xdr7Wp62=%W8&8kLiTczM+cSjSg@d7xOW_zU&_1DGjA ALjV8( literal 0 HcwPel00001 diff --git a/BrmTron Client/bin/cz/brmlab/brmtron/client/ConnetionManager.class b/BrmTron Client/bin/cz/brmlab/brmtron/client/ConnetionManager.class new file mode 100644 index 0000000000000000000000000000000000000000..2365791b5cc1b978d93fc1cb67e4186bd8fbbc52 GIT binary patch literal 1883 zcwUWEYg5}+5Ir{-1diea6J8D!LlUs#fRZ*1ZAl-o^KvVo4USv-n2szfjuInLS#CT1 zL;2dk49=99{(w$@Qzqw1vT%*t>3FQY+C97X>`Q;W`QuLjH}QjlGXi<@H?8LFHI14S zzUMlc*|aUk*GjJASibE#n}%aFEKfl~;KFm`XG3cmPD9(SJ-19>AklKo7XssYV4{n* zLxtsU2#mRHf5-PMV^1Ix+HF_6XZXf;+u!fn2pqMYE^a2q728jrTAo#ZY#DXSBTCV? zAO2Xm`%oaQpYWig?KEgUN5(DRaQv##Y+Iu^FECs5_A1ON8zf`)WFs(g$98Q06M>;z zzREO8Zrw^^2p3gcz_`G9-FB?4_Fm2MDn_ko$y;61XjTo+mhX`=;Xkum0tNkl7m`%R z2k=qMP$w{zJDpxRUsW(qR((}YVh#(E@ue{cEUFmBh=R+kdp-WfB7+`DzlY_)vmA5|}svMH3d%zoTLd$x(1J)F;jh$Nk00 zK66{F^k*n4xXUFloVw@Qb*=5&O-*+jDoVH~AUF;y1A2E_lP@Rn0FM-KmM2cE_kT65 zeK`~=%J`gX;k%)Oz{PIbyuo3oPjW>B9M()CZ8F zK3TV0(U{74sHk`%S7q32x-ClA#)Oj-M8Et3n}Er&TY5|In#&@89ixtTSk6mveGX61t9;@ey}haB$I zw>FGO9O92I@i17(hC7T2JR^&9>|6*E7mG`(xuTA1dFloa qw{&qQ&iBmnK#(UEd1gsGR(U1F8{52dEKX4pJo3pmU%D%8Q27UhCsJJi delta 343 zcwP;U-77-@7>A!zjw|vahl6;g4i5wboxeH%YN(}QI`IvG+a&fks5hB{9 zIv6GriHK~u;4g6NKk(kYAN`*9c~hR0=QO6NUUVwWxaL=U=C4+()?uUGblcB-O=Qtb z4lOuo#e+c&Z8S>Vj-MbM4AV)7E+(X3pxdV;8DdVR^Q;K&fJF{jBFQpuGD#D$f{s{BJ707pbPW|I@PNLVgsM(MZ2;#^`EBABFzOWa&Zw6tt9eDh@)d12)rP?Ay( diff --git a/BrmTron Server/bin/cz/brmlab/brmtron/server/BrmTronServerThread.class b/BrmTron Server/bin/cz/brmlab/brmtron/server/BrmTronServerThread.class dissimilarity index 86% index c543282f35c68efaed5ffb92b774014ca42f8258..45d8b0c62e3cbc6e2b9073565298e8834eac785d 100644 GIT binary patch delta 1328 zcwRkIS!^3s6g|)5@pzdwsk7CM(>BCu#&%rC>6V4ISsX~3q)8hZa9tKRnFKeB9eWbg zd|;L$pamrKibN{PR%loyf{1O^5>h`<5tWeOgFhrH@c|!v@QsvkpPlySy?f8O_uM=8 zzS*qLR@;Btxb;1NR(!o??`D!&8{ori!NwqI-f;zu{5GqrYl2sS#!z-4wiFA_>qc-a zF)^bXDtz$s|5&iegMbPL_A|J&p<+}#5gb`Gl8eTek=?rG=tasds9%^zj zuGNUD+^ML!>q0?rc@wXhgB1UaN)7$^B_QoX~DQJhwAilK?`WxECZ=7mrpX zZN=|9OTN(MUFPj0=Ttn2rx>

&9qGU+PUHQj=-Xy*C;bQqQP}i2xe~lt?=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Si92@*iaI!%9NqC*?oqs>)(ommcj4K&vBK(pSOt9zbYIXKU8-w!*khyx!evl$mb4}Aw+=eWZ`cl zR62R>3*jgWBjw%9O>;{VO?w>wz(1La65NJ=vAhmyAHlx~4JU2vu?y&;r6B&xvUzCl wdOVG1Xl2|U500!2cD>4KDwQi~H5}tu0*{^klXeA0sdfgmZ9yr~bSUTl0GnHU00000 diff --git a/BrmTron Server/bin/cz/brmlab/brmtron/server/Player.class b/BrmTron Server/bin/cz/brmlab/brmtron/server/Player.class dissimilarity index 100% index e8a1ef625c311c56e72dc1a4eb2d927b3c6b7fd0..654911b9d008e9321f44e4d4727f20865c8d9c89 100644 GIT binary patch literal 2103 zcwU86Uvm<76g>+I1Xx3$Bx#~X5{+3F4Xw4UF&ed@)+pK(Z65S#fgN0jfU|5ewJ-fb zooPGM*qKhJAD|zq({p#1g={zD1Ki)Ad(S=h+`GSj{{8cB05|Y7gM@-hogeFM=df?K z#kkIJP#;;&vE|hF`{p~#$v{;w_r^Rn>wR<3tAE>mV|82w3A?L6*;Akn%tK2-sX6g^ z?mG6Mx2+)C9}ar9d(@?a(oitdH{D>Hd+S)oyThT=9TDsmFVkknwU5Q~B{z5Mf$i=P zUf-)8(CiMoRt`y&HOygNK~k?CWT9YDLkj5`EHTDsET`u+WH2MEiyE@X$?B4ZyuVu2 zpy8aXE^C-YK|!Hu53FZLhi%JwVYd5TJ;RRKKQJ9z_Q9d*zP3qswfOj~)c-@S6H$c|AT+^_PO8^-f`DxgG1P z>eW|`9P7QM;U+d^bz8%AY!c3~Tpw=ioYEU)B|i5w+{ax7=Xkq6)h^`+{@(GtcltcT z{WEVG%6c_!9x|h`!@U0gdnqDyXgNLJU(r9PvA8D&Z#hcOheuAwdT2|F^8W3npktLq zBsuJ9BxFjsO2}MzmQ&%`d|){dp5;8y&M|ThMgEt#`-vzC+M4kPJ~EOgSTIT-pJ3UT zJ;4R}TQO39Wlm6$yEWrH9e(q`uJHdVQ-Sa*DP&2aKni7&SmLh2kXGOXLPVi&J+kN~Fpd;|wA)b&~jItRfepid>H+@;SZ;f?sgjBt@BH z*{mgv_xQ3^Q)#wZwO>Q561~96RhE!v5hbRd&?^VHDnEp6&ZyA4gS$ZnlX+9Li-z!% zuD!>OHwZ@cR1^Fpw@7x2Q+S);+g_52*RsV>gGD^>njx#NAWyv_uTPNfd++lB3d~eV zZnVUx)z&1n!5jEGCU`j-{7r1| zL!L*+rp8AlIyO%j(>!Br-v%1@C1^rPP^%NCx^Cxs0fU-EH7BB*wnoD4s|S4|I_F*0i$bs)yuZD zLPZKpHMtu$N6~C3)$QLKak?*p26@aDlRUoI(F*$##b^#-C%L?^NGlW%Dmpte4ctdw zW)BR^BTqQj_I$XD%dtX*s^pzjgF`F}jPi7+&vEgQ|5NTa2lw?iofEfVzjUN4DZlAu zIan+ZEy_2cAtH@u7Lm5ANYhoM<%}ubcau@z7H$VLTcnZl;^q=5E)jJ`AWgh+ zg)ptw@c=<)vKg8oy$rC*yd!yH=67Vigivv{nduV}3xzBU7m~RuB*&VWYlI{MA$PDC z3K5}@+~+Go=7tKni+iDvh)-e84S4JenP*M@8X>wGp^)!vh$9nM9a$VIWC?|!cvrm{ zV2UHJmZIi4inWr)P^y)_hFFul1y*USOQFcM*(Yx*z|}a$he#@U%gP_gV39Y*m@}n5 zIkj`FsE1${2ZrF2EK_V56Idbmsv^m&k>x@Ua(EOpm%}P*38(pf& upcQMEG-C>GofF+)zS&2S4k^+hMLML|2tDhceD=~Lzu@Um!#CBf$NvC|6uCD5 diff --git a/BrmTron Server/bin/cz/brmlab/brmtron/server/ProtocolHelper.class b/BrmTron Server/bin/cz/brmlab/brmtron/server/ProtocolHelper.class new file mode 100644 index 0000000000000000000000000000000000000000..787ebeacdbf87434a4a21fe4db87ebaa7b614477 GIT binary patch literal 3033 zcwVhmXSpa1;&JAigvQ&1+* z9K8^TSYrt-A{W~-lYz8ujq6t6h-KPl)Jz=K6Di$N;1XDNRvXs>2`w29^heI>QCq-$ zFw_$co(cs8L`Yz9x0y`aTGAfY5*fXmi6G#~+4Obw_DGEoSeny>`}+=s28V)*9hy^58nWyG+N)cZ1H5#1WpA_-kaG^1K#ShEZ%=anw|jFA>- z3IE5sbqG|YG%KwiNoW(gC9u;w7wGMxIc^;uY(S%ejYU1kd8^oj%@UYpj0vppw#CfGAtFlRP4qc0VS>5ecG5lPX^lV#XbccMfC}q8TL%YesoTCA*Y%r zN>FCJTSXTR2vjm-w`p22cDuqG49Xlq98}O#REYzonb5VQibFWeQFW5!b@OBym09jl zaWBHTEL~CC7?-2v9hH+=VI)%-ma^O)O9|AJXo*0X5u<^n(`>_nvqSEYjFE^HOyEK; zC1ywgvDM91ACQ4%?}kt>d5x$T#R-y#>vkyS9JY|$JgMRVoZ>0eQYk&jjWz7>oFw^Z z9nwRS9uWb5$@4P5XB%QFba^6_cy4B-j;G`d3^s_mu$hb-b|$7f@PabgIhiaWQ3Y=w zn~gSQoGKYdvz;(f|Bwm`oD{c_o@ys!kIL8?8GBsD9-Tk78|V1~^+@{*Djt#W-L{#t z;RXkxEX`un&l`ZFL`Xxam}WC~W4>q^+eid@wN$Bw(qq7gCp9}`(PLzm$G!rG{Aur4 zaBMnD<*C9YJgeXtUJgYWR6K|0IT7ddi2*st)l+XS$ABt&zKE9~6W}ViRGu~ zCtc@YtRcr0#JrNaTGpiw+pr29sCU4$<`SZpoIuO%=tDo@RAUQ{5U`BYi2HDq)vS~g zmWTQqVKfu07sp9V(yPsZ#G@ntdJo|-JWdLg zxQHjX_oS2IDTmVEq*TE*JVmK>5>E^CZkfaj0()Io(Nyo6#A^b7fau=o^tG>D7z)+Ucn^=Lki!F3f~JXm%vXB;h+Bn DK`!N) literal 0 HcwPel00001 diff --git a/BrmTron Server/bin/cz/brmlab/brmtron/server/test/BrmTronServerTest.class b/BrmTron Server/bin/cz/brmlab/brmtron/server/test/BrmTronServerTest.class index 3ec48960188b6b6e892246141803c7cb04e54ba8..37a2d3da07feb316a3bffe85a76d427cfbcc5209 100644 GIT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nv2c(B+%@o9;SPGzUlt@o8B+KKYjvGz>^tyY?)%tK54;Aq7!}wk>nV)NRwL=*y)oUKR|oNz1Xs zZH7oXv(6B`>uz!t5j1INM2w-;upGYRZIS+Y4p!f?x`y>5Dz+}DFq@x-bz6pa7n zH9@T8(c`M=)%c2SKIb08*;U^W);3?aY8K_6b{toj!g3v|(Pp?_Mc?v?wjN}NBf*f( zr?S~>N~Ypo;O2Ard|@igH9o$qVkB<{L~8xq$n zarD#@7Ar1X&Hs4wGA9AIG~C7%L)@xOmxZ+xCfQ(MRffJ3MJE+4r|Jtizel=eXjv0x z`RSrrtH^T&SVjgIi#T;=w5D$jnq~iY&n%EN`Vo&O+Yp(B=`HUqipFaAJ zaF4jNx6JjlO{reT!&h552U%l*sI2IP~*LjK6w)==fR^H~$Jvl6e=9 zmaO^_r?r)K?c{af49PlxPFzD5=IIxEND;|66*8$aj?-BY(}4iXxP!aI{vO3U5c`Fs zf^!N+ima!|+KW<)`~Pgup;(k`SEAjZ4mxCyGfUawu%CV5x=1LXn@aUi;R{5dmk6c; hT0>!mI;{v1m?ttclq9Jn*g)|nEKp3okrCuv`~!{5Qz8HW literal 0 HcwPel00001 diff --git a/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServer.java b/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServer.java index d34c947..8e3f70d 100644 --- a/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServer.java +++ b/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServer.java @@ -42,6 +42,7 @@ public class BrmTronServer { } public static void updatePlayer(int id, Player p) { + //FIXME nemusime dostavat kompletni informace, chce to nejak mergovat players.put(id, p); } @@ -83,8 +84,8 @@ public class BrmTronServer { } /** - * @param p1 - * @param p2 + * @param p1 First line to check + * @param p2 Second line to check * @param threshold * @return * Determines, if two lines are too far from each other or not. @@ -151,7 +152,7 @@ public class BrmTronServer { double d1,d2; double a,b; - if(y1min == start1[1]) { + if(y1min == start1[1]) { //tady se to rozbiji, chce to tu identifikaci bodu vyresit jinak; kdyz jsou y-souradnice stejny, tak je rozbijou rovnice dole a = start1[0]; b = end1[0]; } else { diff --git a/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServerThread.java b/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServerThread.java index 4614b1f..32bab9d 100644 --- a/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServerThread.java +++ b/BrmTron Server/src/cz/brmlab/brmtron/server/BrmTronServerThread.java @@ -4,9 +4,6 @@ import java.io.BufferedReader; import java.io.DataOutputStream; import java.io.InputStreamReader; import java.net.Socket; -import java.util.Map; -import java.util.Scanner; -import java.util.Set; public class BrmTronServerThread extends Thread { @@ -19,13 +16,13 @@ public class BrmTronServerThread extends Thread { super("BrmTronServerThread"); this.sock = sock; this.id = id; - this.player = new Player(); + this.player = new Player(id); } @Override public void run() { String s; - double[] loc = new double[2]; + try { DataOutputStream out = new DataOutputStream(sock.getOutputStream()); BufferedReader in = new BufferedReader(new InputStreamReader(sock.getInputStream())); @@ -42,11 +39,9 @@ public class BrmTronServerThread extends Thread { } //parse client input - Scanner sc = new Scanner(s); - for(int i=0;sc.hasNextDouble();i++) { - loc[i] = sc.nextDouble(); - } - player.setCoords(loc[0], loc[1]); + Player np = ProtocolHelper.parsePlayer(s); + player.merge(np); + PathElement elem = new PathElement(player.getPrevCoords(), player.getCoords()); //collision check @@ -57,13 +52,14 @@ public class BrmTronServerThread extends Thread { BrmTronServer.addWall(elem); } else { elem.setEnd(tmp[0], tmp[1]); + BrmTronServer.addWall(elem); player.setActive(false); player.setCoords(tmp[0], tmp[1]); } //save player state and send him an update BrmTronServer.updatePlayer(id, player); - out.writeBytes(parsePlayers(BrmTronServer.getPlayers())); + out.writeBytes(ProtocolHelper.getUpdate(BrmTronServer.getPlayers())); } out.close(); @@ -74,22 +70,6 @@ public class BrmTronServerThread extends Thread { } } - - /** - * @param players Numbered list of players - * @return String representation of each player's state - */ - private String parsePlayers(Map players) { - String ret = new String(); - Set keys = players.keySet(); - - for(int i: keys) { - double[] coords = players.get(i).getCoords(); - boolean active = players.get(i).isActive(); - ret += "ID: " + i + ", Long: " + coords[0] + ", Lat: " + coords[1] + ", Active: " + active + "\n"; - } - - return ret; - } + } diff --git a/BrmTron Server/src/cz/brmlab/brmtron/server/Player.java b/BrmTron Server/src/cz/brmlab/brmtron/server/Player.java index 08ec803..4eba874 100644 --- a/BrmTron Server/src/cz/brmlab/brmtron/server/Player.java +++ b/BrmTron Server/src/cz/brmlab/brmtron/server/Player.java @@ -2,15 +2,25 @@ package cz.brmlab.brmtron.server; public class Player { + private int id=0; + private String name = "Player"; private double longitude = 0; private double latitude = 0; private double[] prevCoords = new double[2]; private boolean active = false; - public Player() { - + public Player(int id) { + this.id = id; } + public int getId() { + return id; + } + + public void setId(int id) { + this.id = id; + } + public void setLongitude(double longitude) { this.longitude = longitude; } @@ -56,5 +66,19 @@ public class Player { public double[] getPrevCoords() { return prevCoords; } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public void merge(Player np) { + //TODO lip osetrit merge Playeru + longitude = np.getLongitude(); + latitude = np.getLatitude(); + } } diff --git a/BrmTron Server/src/cz/brmlab/brmtron/server/ProtocolHelper.java b/BrmTron Server/src/cz/brmlab/brmtron/server/ProtocolHelper.java new file mode 100644 index 0000000..03d681d --- /dev/null +++ b/BrmTron Server/src/cz/brmlab/brmtron/server/ProtocolHelper.java @@ -0,0 +1,60 @@ +package cz.brmlab.brmtron.server; + +import java.util.Map; +import java.util.Set; + +public class ProtocolHelper { + + //id --- name --- longitude --- latitude --- active\n + + private static final int FIELD_ID = 0; + private static final int FIELD_NAME = 1; + private static final int FIELD_LONGITUDE = 2; + private static final int FIELD_LATITUDE = 3; + private static final int FIELD_ACTIVE = 4; + private static final String FIELD_DELIMITER = " --- "; + + public static Player parsePlayer(String input) { + //TODO overeni vstupu + String[] tmp = input.trim().split(FIELD_DELIMITER); + int id = Integer.parseInt(tmp[FIELD_ID]); + Player ret = new Player(id); + ret.setName(tmp[FIELD_NAME]); + ret.setCoords(Double.parseDouble(tmp[FIELD_LONGITUDE]), Double.parseDouble(tmp[FIELD_LATITUDE])); + ret.setActive(Boolean.parseBoolean(tmp[FIELD_ACTIVE])); + return ret; + } + + public static String buildPlayer(Player p) { + StringBuilder sb = new StringBuilder(); + + sb.append(p.getId()); + sb.append(FIELD_DELIMITER); + sb.append(p.getName()); + sb.append(FIELD_DELIMITER); + sb.append(p.getLongitude()); + sb.append(FIELD_DELIMITER); + sb.append(p.getLatitude()); + sb.append(FIELD_DELIMITER); + sb.append(p.isActive()); + sb.append("\n"); + + return sb.toString(); + } + + + /** + * @param players Numbered list of players + * @return String representation of each player's state + */ + public static String getUpdate(Map players) { + StringBuilder sb = new StringBuilder(); + Set keys = players.keySet(); + + for(int i: keys) { + sb.append(buildPlayer(players.get(i))); + } + + return sb.toString(); + } +} diff --git a/BrmTron Server/src/cz/brmlab/brmtron/server/test/BrmTronServerTest.java b/BrmTron Server/src/cz/brmlab/brmtron/server/test/BrmTronServerTest.java index a2ec90f..ba18ea8 100644 --- a/BrmTron Server/src/cz/brmlab/brmtron/server/test/BrmTronServerTest.java +++ b/BrmTron Server/src/cz/brmlab/brmtron/server/test/BrmTronServerTest.java @@ -53,9 +53,9 @@ public class BrmTronServerTest extends BrmTronServer{ public void test2_findIntersection() { final double dx = 1e-09; - double[] start1 = {0.1, 0.1}; + double[] start1 = {0.1, 0}; double[] end1 = {0.0, 2.0}; - double[] start2 = {-1.0, 0.2}; + double[] start2 = {-1.0, 0}; double[] end2 = {1.0, 200.0}; double[] res = null; diff --git a/BrmTron Server/src/cz/brmlab/brmtron/server/test/ProtocolHelperTest.java b/BrmTron Server/src/cz/brmlab/brmtron/server/test/ProtocolHelperTest.java new file mode 100644 index 0000000..e294250 --- /dev/null +++ b/BrmTron Server/src/cz/brmlab/brmtron/server/test/ProtocolHelperTest.java @@ -0,0 +1,33 @@ +package cz.brmlab.brmtron.server.test; + +import static org.junit.Assert.*; + +import org.junit.Test; + +import cz.brmlab.brmtron.server.Player; +import cz.brmlab.brmtron.server.ProtocolHelper; + +public class ProtocolHelperTest { + + @Test + public void test_parsePlayer(){ + Player p; + String input = "1 --- tester --- 1.1123 --- 54.4234 --- true\n"; + + p = ProtocolHelper.parsePlayer(input); + + assertTrue(p.getId() == 1); + assertTrue(p.getName().equals("tester")); + assertTrue(p.getLongitude() == 1.1123); + assertTrue(p.getLatitude() == 54.4234); + assertTrue(p.isActive()); + } + + @Test + public void test_buildPlayer() { + String inp = "1 --- tester --- 1.1123 --- 54.4234 --- true\n"; + Player p = ProtocolHelper.parsePlayer(inp); + String s = ProtocolHelper.buildPlayer(p); + assertTrue(s.equals(inp)); + } +} -- 2.11.4.GIT