예제 #1
0
void Handle::deserialize(BufferReader& reader) {
	const char* buf = reader.getPointer();

	memcpy(&this->index, buf, sizeof(size_t));
	memcpy(&this->id, buf + sizeof(size_t), sizeof(unsigned int));
	memcpy( &this->gc, buf + sizeof(size_t)+sizeof(unsigned int), sizeof(bool) );

	reader.finished(sizeof(size_t) + sizeof(unsigned int)+sizeof(bool));
}
예제 #2
0
void DeathCamera::deserialize(BufferReader& buffer) {
	this->gameState.deserialize(buffer);
	const DeathCameraData* data = reinterpret_cast<const DeathCameraData*>(buffer.getPointer());

	this->target.set(data->target[0], data->target[1], data->target[2], 1.0f);
	this->position.set(data->position[0], data->position[1], data->position[2], 1.0f);

	buffer.finished(sizeof(DeathCameraData));
}
예제 #3
0
int ActionEvent::getActionType(BufferReader& reader) {
	//OH GOD THE HACKS
	return *reinterpret_cast<const int*>(reader.getPointer() + sizeof(EventHeader));
}
예제 #4
0
void ActionEvent::deserialize( BufferReader& buffer ) {
	Event::deserialize( buffer );
	const struct ActionHeader *actionHdr = reinterpret_cast<const struct ActionHeader *>(buffer.getPointer());
	this->actionType = actionHdr->actionType;
	this->playerGuid = actionHdr->playerGuid;
	buffer.finished( sizeof( struct ActionHeader ) );
}