예제 #1
0
void NetworkServer::update() {
    receivePackets();
    if (needToBroadcast) {
        broadcastUpdate();
        needToBroadcast = false;
    }
}
예제 #2
0
파일: Server.cpp 프로젝트: knarf0/mmo
void Server::update()
{
	checkNewConnections();
	checkDisconnections();
	receivePackets();
	game.update(clients);
}
예제 #3
0
//*****************************************************************************
//
//
//*****************************************************************************
void receivePayLoad(void)
{
	int iReturnValue = receivePackets();

	if (iReturnValue > 0)
	{
		payloadReceived(requestBuffer, iReturnValue);
	}
}
void InfinityPortal::sendPacket(unsigned char* packet) {

	int len;
	int retVal = -1;

	receivePackets();

	while(retVal < 0) {
		retVal = libusb_bulk_transfer(deviceHandler,0x01,packet,32,&len,100);
		receivePackets();
	}

	// if(retVal != 0) {
	// 	printf("Error code: %d\n",retVal);
	// 	printf("Error name: %s\n",libusb_error_name(retVal));
	// 	exit(1);
	// }
	
}
void LANGameFinderAndAnnouncer::update() {
	if(serverPort > 0) {
		if(SDL_GetTicks() - lastAnnounce > LANGAME_ANNOUNCER_INTERVAL) {
			announceGame();
		}
	}

	updateServerInfoList();

	receivePackets();
}
	void netHandler::tick() {
		receivePackets();
	}