예제 #1
0
void NetworkClient::GetGroups()
{
	rMessage->Reset();
	peer->RPC("ServerPeer::GetGroups", NULL , NULL, HIGH_PRIORITY, RELIABLE, 0, UNASSIGNED_SYSTEM_ADDRESS, true, 0, UNASSIGNED_NETWORK_ID,rMessage);
	if( (rMessage->GetNumberOfUnreadBits()) > 0)
	{
		int count, groupId, len = 0;		
		char* groupName = "";
		GroupMap g;
		g.clear();
		rMessage->Read(count);
		for(int j = 0;j<count;j++)
		{
			rMessage->Read(groupId);
			rMessage->Read(len);
			groupName = new char[len+1];
			groupName[len] = 0;
			rMessage->Read(groupName, len);
			g.insert(GroupMap::value_type(groupId, groupName));
		}
		if(!g.empty())
		{
			dataMan->setGroups(g);
		}		
	}
}
예제 #2
0
	void copy(ParserGroupData &rhs)
	{
		values = rhs.values;
		lines = rhs.lines;
		groups.clear();

		for(GroupMap::iterator it = rhs.groups.begin(); it != rhs.groups.end(); ++it)
		{
			boost::shared_ptr<ParserGroup> g(parserGroupFactory());
			*g.get() = *(*it).second.get();

			groups[(*it).first] = g;
		}
	}