本文整理汇总了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;
}