Show
Ignore:
Timestamp:
02/22/10 22:37:05 (7 months ago)
Author:
gaul@…
Message:
  • NASTY async socket bug resolved
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/cpp-ode/src/libmmpong/netgame_ode_pong.cc

    r532 r538  
    263263}; 
    264264 
     265void 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 
    265285void NetGameODEPong::print_playerlist() { 
    266286        for (std::map<uint16_t, std::set<uint16_t> >::iterator itteam=team2players.begin(); itteam!=team2players.end(); itteam++) {