Exemplo n.º 1
0
 void PacketProcess::S_NOTIFY_FIXED_UPDATE(PK_S_NOTIFY_FIXED_UPDATE rowPacket)
 {
     EntityBase* ret = _gameMgr->getEntityFromID((int)rowPacket.validID);
     if (ret ==nullptr || ret->getEntityType() != EntityType::ENTITY_HUMAN ) return;
     
     EntityHuman* player = (EntityHuman*)ret;
     
     log("S_NOTIFY_FIXED_UPDATE %f %f", rowPacket.position.x, rowPacket.position.y);
     player->setWorldPosition(rowPacket.position);
     
     //_gameMgr->getGameWorld()->getGameCamera()->setCameraPos(rowPacket.position);
 }
Exemplo n.º 2
0
 void PacketProcess::S_BROADCAST_BEZEL_MOVE_KEYDOWN(Packet* rowPacket)
 {
     PK_S_BROADCAST_BEZEL_MOVE_KEYDOWN* broadcastPacket = (PK_S_BROADCAST_BEZEL_MOVE_KEYDOWN*)rowPacket;
     
     EntityBase* ret = _gameMgr->getEntityFromID((int)broadcastPacket->validID);
     
     if (ret ==nullptr || ret->getEntityType() != EntityType::ENTITY_HUMAN ) return;
     
     EntityHuman* player = (EntityHuman*)ret;
     
     player->setTargetHeading(broadcastPacket->heading);
     
 }
Exemplo n.º 3
0
 void PacketProcess::S_BROADCAST_JOYSTICK_MOVING_CHANGE(Packet* rowPacket)
 {
     PK_S_BROADCAST_JOYSTICK_MOVING_CHANGE* broadcastPacket = (PK_S_BROADCAST_JOYSTICK_MOVING_CHANGE*)rowPacket;
     
     EntityBase* ret = _gameMgr->getEntityFromID((int)broadcastPacket->validID);
     if (ret ==nullptr || ret->getEntityType() != EntityType::ENTITY_HUMAN ) return;
     
     EntityHuman* player = (EntityHuman*)ret;
     
     player->setMoving(broadcastPacket->moving);
     player->setTargetHeading(broadcastPacket->heading);
     
     delete broadcastPacket;
 }
Exemplo n.º 4
0
 void PacketProcess::S_BROADCAST_JOYSTICK_MOVE_KEYUP(Packet* rowPacket)
 {
     PK_S_BROADCAST_JOYSTICK_MOVE_KEYUP* broadcastPacket = (PK_S_BROADCAST_JOYSTICK_MOVE_KEYUP*)rowPacket;
     
     EntityBase* ret = _gameMgr->getEntityFromID((int)broadcastPacket->validID);
     if (ret ==nullptr || ret->getEntityType() != EntityType::ENTITY_HUMAN ) return;
     
     EntityHuman* player = (EntityHuman*)ret;
     
     //player->setPosition(broadcastPacket->position);
     
     player->removeInputMask(JoystickMessageTypes::MOVE);
     delete broadcastPacket;
 }
Exemplo n.º 5
0
 void PacketProcess::S_BROADCAST_JOYSTICK_DOUBLE_MOVE_KEYDOWN(Packet* rowPacket)
 {
     PK_S_BROADCAST_JOYSTICK_DOUBLE_MOVE_KEYDOWN* broadcastPacket = (PK_S_BROADCAST_JOYSTICK_DOUBLE_MOVE_KEYDOWN*)rowPacket;
     
     EntityBase* ret = _gameMgr->getEntityFromID((int)broadcastPacket->validID);
     if (ret ==nullptr || ret->getEntityType() != EntityType::ENTITY_HUMAN ) return;
     
     
     EntityHuman* player = (EntityHuman*)ret;
     
     player->setMoving(broadcastPacket->moving);
     player->setTargetHeading(broadcastPacket->moving);
     
     player->setInputMask(JoystickMessageTypes::RUN);
     
     delete broadcastPacket;
 }