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); }
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); }
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; }
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; }
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; }