| | 265 | void NetGameODEPong::cln_set_paddlepos(float pos) { |
| | 266 | if (pos>1.0) |
| | 267 | pos=1.0; |
| | 268 | if (pos<0.0) |
| | 269 | pos=0.0; |
| | 270 | if (pos!=mypadpos) { |
| | 271 | mypadpos=pos; |
| | 272 | boost::shared_ptr<ODEBox> pad=get_ent<ODEBox>(mypadid); |
| | 273 | double ang=M_PI*(1.0+2.0*myteamid/srv_teamid_cur); |
| | 274 | pad->setPosition(cos(ang)*1.05, -1.0 + 2.0 * mypadpos, 0.0); |
| | 275 | NetMsg::pointer msg=NetMsg::create(NetMsg::CmdGameCustom); |
| | 276 | msg->pack_begin(); |
| | 277 | uint16_t customcmd=PlayerPadPos; |
| | 278 | msg->pack(customcmd); |
| | 279 | msg->pack(mypadpos); |
| | 280 | msg->pack_finish(); |
| | 281 | cln_con->write(msg); |
| | 282 | } |
| | 283 | }; |
| | 284 | |