示例#1
0
void NetClient::ConnectToClients()
{
    std::vector<NetDriver> vecDrivers;

    RobotXml robotxml;
    robotxml.ReadRobotDrivers(NETWORKROBOT,vecDrivers);

    for(unsigned int i=0;i<vecDrivers.size();i++)
    {
        ConnectToDriver(vecDrivers[i]);
    }

}
示例#2
0
void NetClient::SetCarInfo(const char *pszName)
{
    std::vector<NetDriver> vecDrivers;

    RobotXml robotxml;
    robotxml.ReadRobotDrivers(NETWORKROBOT,vecDrivers);

    for (unsigned int i=0;i<vecDrivers.size();i++)
    {
        if (vecDrivers[i].name == m_strDriverName)
        {
            strncpy(vecDrivers[i].car,pszName,64);
            SendDriverInfoPacket(&vecDrivers[i]);
        }
    }
}
示例#3
0
void NetServer::SetCarInfo(const char *pszName)
{
	std::vector<NetDriver> vecDrivers;

	RobotXml robotxml;
	robotxml.ReadRobotDrivers(NETWORKROBOT,vecDrivers);

	for (unsigned int i=0;i<vecDrivers.size();i++)
	{
		if (vecDrivers[i].name == m_strDriverName)
		{
			strncpy(vecDrivers[i].car,pszName,64);
			UpdateDriver(vecDrivers[i]);
			break;
		}
	}
}