コード例 #1
0
bool SessionHandshakeLogic::ValidateMessageFromDesktop(NetworkInMessage& msg) const
{
	// Schema version
	uint32 remoteSchemaVersion = msg.ReadUInt32();
	if (remoteSchemaVersion != kXToolsSchemaVersion)
	{
		LogWarning(
			"\n\n***************************************************************\n"
			"List Server Handshake Failed: Invalid schema version. \n"
			"Expected: %i, got %i \n"
			"Please sync to latest XTools\n"
			"***************************************************************\n\n",
			kXToolsSchemaVersion,
			remoteSchemaVersion);

		return false;
	}

	return true;
}
コード例 #2
0
void CreateOperation::Deserialize(NetworkInMessage& msg)
{
	m_elementType	= (ElementType)msg.ReadByte();
	m_name			= msg.ReadString();
	m_elementGuid	= msg.ReadInt64();
	m_parentGuid	= msg.ReadInt64();
	m_startingValue.Deserialize(msg);

	// Read the number of ancestors
	uint32 numAncestors = msg.ReadUInt32();
	m_hierarchy.reserve(numAncestors);

	// Read the GUIDs of the ancestors
	for (uint32 i = 0; i < numAncestors; ++i)
	{
		m_hierarchy.push_back(msg.ReadInt64());
	}

	// NOTE: authority level is NOT included in the op when serialized; it changes as the op is sent around the network
}