当前位置: 首页>>代码示例>>C++>>正文


C++ NetClient::isLegacy方法代码示例

本文整理汇总了C++中NetClient::isLegacy方法的典型用法代码示例。如果您正苦于以下问题:C++ NetClient::isLegacy方法的具体用法?C++ NetClient::isLegacy怎么用?C++ NetClient::isLegacy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在NetClient的用法示例。


在下文中一共展示了NetClient::isLegacy方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: handleEvent

	///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	// Checks the type of event. If a valid event, creates an event packet and returns true. Else return false.
	virtual void handleEvent(const Event& evt)
	{
		// If the event has been processed locally (i.e. by a filter event service)
		if(evt.isProcessed()) return;

#ifdef OMICRON_USE_VRPN
		vrpnDevice->update(evt);
#endif
			
		int offset = 0;
			
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getTimestamp()); 
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getSourceId()); 
		OI_WRITEBUF(int, eventPacket, offset, evt.getServiceId()); 
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getServiceType()); 
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getType()); 
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getFlags()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getPosition().x()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getPosition().y()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getPosition().z()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getOrientation().w()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getOrientation().x()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getOrientation().y()); 
		OI_WRITEBUF(float, eventPacket, offset, evt.getOrientation().z()); 
		
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getExtraDataType()); 
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getExtraDataItems()); 
		OI_WRITEBUF(unsigned int, eventPacket, offset, evt.getExtraDataMask());
		
		if(evt.getExtraDataType() != Event::ExtraDataNull)
		{
			memcpy(&eventPacket[offset], evt.getExtraDataBuffer(), evt.getExtraDataSize());
		}
		offset += evt.getExtraDataSize();
		
		handleLegacyEvent(evt);
		
		std::map<char*,NetClient*> activeClients;

		std::map<char*,NetClient*>::iterator itr = netClients.begin();
		while( itr != netClients.end() )
		{
			NetClient* client = itr->second;
			
			if( client->isLegacy() )
			{
				//client->sendEvent(legacyPacket, 512);
			}
			else
			{
				client->sendMsg("",1);
				client->sendEvent(eventPacket, offset);
			}

			// If client is still connected add to active list
			if( client->isConnected() )
			{
				activeClients[itr->first] = client;
			}
			else // Client disconnected, remove from list
			{
				ofmsg("OInputServer: Client '%1%' Disconnected.", %itr->first);
				delete client;
			}
			itr++;
		}

		netClients = activeClients;
	}
开发者ID:bradliam1,项目名称:omicron-sdk,代码行数:71,代码来源:oinputserver.cpp


注:本文中的NetClient::isLegacy方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。