|
|
@ -50,8 +50,7 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
H_AUTO(cbClientPosition);
|
|
|
|
H_AUTO(cbClientPosition);
|
|
|
|
|
|
|
|
|
|
|
|
CEntityId id;
|
|
|
|
CEntityId id;
|
|
|
|
NLMISC::TGameCycle fsTick;
|
|
|
|
msgin.serial(id);
|
|
|
|
msgin.serial(id, fsTick);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TDataSetRow entityIndex = TheDataset.getDataSetRow( id );
|
|
|
|
TDataSetRow entityIndex = TheDataset.getDataSetRow( id );
|
|
|
|
if ( !entityIndex.isValid() )
|
|
|
|
if ( !entityIndex.isValid() )
|
|
|
@ -62,16 +61,16 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// entity pos (x, y, z, theta)
|
|
|
|
// entity pos (x, y, z, theta)
|
|
|
|
NLMISC::TGameCycle clientTick;
|
|
|
|
NLMISC::TGameCycle tick;
|
|
|
|
sint32 x, y, z;
|
|
|
|
sint32 x, y, z;
|
|
|
|
float heading;
|
|
|
|
float heading;
|
|
|
|
msgin.serial(clientTick, x, y, z, heading);
|
|
|
|
msgin.serial(tick, x, y, z, heading);
|
|
|
|
|
|
|
|
|
|
|
|
if (IsRingShard)
|
|
|
|
if (IsRingShard)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// make sure the move that the player is trying to make is legal
|
|
|
|
// make sure the move that the player is trying to make is legal
|
|
|
|
// if the move wasn't legal then the values of 'x' and 'y' will be changed to make them legal
|
|
|
|
// if the move wasn't legal then the values of 'x' and 'y' will be changed to make them legal
|
|
|
|
bool moveWasLegal= pCGPMS->MoveChecker->checkMove(entityIndex, x, y, clientTick);
|
|
|
|
bool moveWasLegal= pCGPMS->MoveChecker->checkMove(entityIndex, x, y, tick);
|
|
|
|
|
|
|
|
|
|
|
|
// if the move wasn't legal then dispatch a message to the player
|
|
|
|
// if the move wasn't legal then dispatch a message to the player
|
|
|
|
if (!moveWasLegal)
|
|
|
|
if (!moveWasLegal)
|
|
|
@ -103,7 +102,7 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
CMirrorPropValue1DS<sint32>( TheDataset, entityIndex, DSPropertyPOSY )= y;
|
|
|
|
CMirrorPropValue1DS<sint32>( TheDataset, entityIndex, DSPropertyPOSY )= y;
|
|
|
|
CMirrorPropValue1DS<sint32>( TheDataset, entityIndex, DSPropertyPOSZ )= (z&~7) + (local ? 1 : 0) + (interior ? 2 : 0) + (water ? 4 : 0);
|
|
|
|
CMirrorPropValue1DS<sint32>( TheDataset, entityIndex, DSPropertyPOSZ )= (z&~7) + (local ? 1 : 0) + (interior ? 2 : 0) + (water ? 4 : 0);
|
|
|
|
CMirrorPropValue1DS<float>( TheDataset, entityIndex, DSPropertyORIENTATION )= heading;
|
|
|
|
CMirrorPropValue1DS<float>( TheDataset, entityIndex, DSPropertyORIENTATION )= heading;
|
|
|
|
CMirrorPropValue1DS<NLMISC::TGameCycle>( TheDataset, entityIndex, DSPropertyTICK_POS )= clientTick + GPMS_LCT_TICKS;
|
|
|
|
CMirrorPropValue1DS<NLMISC::TGameCycle>( TheDataset, entityIndex, DSPropertyTICK_POS )= tick + GPMS_LCT_TICKS;
|
|
|
|
|
|
|
|
|
|
|
|
CMirrorPropValue1DS<TYPE_CELL> cell ( TheDataset, entityIndex, DSPropertyCELL );
|
|
|
|
CMirrorPropValue1DS<TYPE_CELL> cell ( TheDataset, entityIndex, DSPropertyCELL );
|
|
|
|
uint32 cx = (uint16) ( + x/CWorldPositionManager::getCellSize() );
|
|
|
|
uint32 cx = (uint16) ( + x/CWorldPositionManager::getCellSize() );
|
|
|
@ -144,7 +143,7 @@ void cbClientPosition( CMessage& msgin, const string &serviceName, NLNET::TServi
|
|
|
|
//CWorldPositionManager::setEntityPosition(id, x, y, z, heading, tick);
|
|
|
|
//CWorldPositionManager::setEntityPosition(id, x, y, z, heading, tick);
|
|
|
|
if (player->getType() == CWorldEntity::Player && player->CheckMotion && player->PosInitialised)
|
|
|
|
if (player->getType() == CWorldEntity::Player && player->CheckMotion && player->PosInitialised)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CWorldPositionManager::movePlayer(player, x, y, z, heading, clientTick);
|
|
|
|
CWorldPositionManager::movePlayer(player, x, y, z, heading, tick);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // cbClientPosition //
|
|
|
|
} // cbClientPosition //
|
|
|
|