Exemple #1
0
bool PacketHandler::handleMap(ENetPeer *peer, ENetPacket *packet)
{
	LoadScreenPlayer *playerName = LoadScreenPlayer::create(PKT_S2C_LoadName, peerInfo(peer)->name, peerInfo(peer)->nameLen);
	playerName->userId = peerInfo(peer)->userId;

	LoadScreenPlayer *playerHero = LoadScreenPlayer::create(PKT_S2C_LoadHero,  peerInfo(peer)->type, peerInfo(peer)->typeLen);
	playerHero->userId = peerInfo(peer)->userId;
	playerHero->skinId = 0;

	//Builds team info
	LoadScreenInfo screenInfo;
	screenInfo.bluePlayerNo = 1;
	screenInfo.redPlayerNo = 0;

	screenInfo.bluePlayerIds[0] = peerInfo(peer)->userId;

	bool pInfo = sendPacket(peer, reinterpret_cast<uint8*>(&screenInfo), sizeof(LoadScreenInfo), CHL_LOADING_SCREEN);

	//For all players send this info
	bool pName = sendPacket(peer, reinterpret_cast<uint8*>(playerName), playerName->getPacketLength(), CHL_LOADING_SCREEN);
	bool pHero = sendPacket(peer, reinterpret_cast<uint8*>(playerHero), playerHero->getPacketLength(), CHL_LOADING_SCREEN);

	//cleanup
	LoadScreenPlayer::destroy(playerName);
	LoadScreenPlayer::destroy(playerHero);

	return (pInfo && pName && pHero);

}
Exemple #2
0
bool PacketHandler::handleGameNumber(ENetPeer *peer, ENetPacket *packet)
{
	WorldSendGameNumber world;
	world.gameId = 1;
	memcpy(world.data, peerInfo(peer)->name, peerInfo(peer)->nameLen);

	return sendPacket(peer, reinterpret_cast<uint8*>(&world), sizeof(WorldSendGameNumber), CHL_S2C);
}
void NetworkListener::processPacket()
{
	ENetEvent event;

	while(enet_host_service(_server, & event, 10) > 0 && _isAlive) // > 0 we dispatch all received packets 
	{
		switch (event.type)
		{
			case ENET_EVENT_TYPE_CONNECT:
				Log::getMainInstance()->writeLine("A new client connected connected\n");

				/* Set some defaults */
				event.peer->mtu = PEER_MTU;

				event.peer->data = new ClientInfo();
				peerInfo(event.peer)->setName("HeroWars");
				peerInfo(event.peer)->setType("Teemo");

			break;

		case ENET_EVENT_TYPE_RECEIVE:
			if(!_handler->handlePacket(event.peer, event.packet,event.channelID))
			{
				//enet_peer_disconnect(event.peer, 0);
			}

			/* Clean up the packet now that we're done using it. */
			enet_packet_destroy (event.packet);
		break;

		case ENET_EVENT_TYPE_DISCONNECT:
			Log::getMainInstance()->writeLine("Peer disconnected.\n");

			/* Cleanup */
			delete event.peer->data;
		break;
		}
	}
}
Exemple #4
0
bool PacketHandler::handleLoadPing(ENetPeer *peer, ENetPacket *packet)
{
	PingLoadInfo *loadInfo = reinterpret_cast<PingLoadInfo*>(packet->data);

	PingLoadInfo response;
	memcpy(&response, packet->data, sizeof(PingLoadInfo));
	response.header.cmd = PKT_S2C_Ping_Load_Info;
	response.userId = peerInfo(peer)->userId;


	Log::getMainInstance()->writeLine("Loading: loaded: %f, ping: %f, %i, %f\n", loadInfo->loaded, loadInfo->ping, loadInfo->unk4, loadInfo->f3);
	return broadcastPacket(reinterpret_cast<uint8*>(&response), sizeof(PingLoadInfo), 4, UNRELIABLE);
}
Exemple #5
0
bool PacketHandler::handleKeyCheck(ENetPeer *peer, ENetPacket *packet)
{
	KeyCheck *keyCheck = (KeyCheck*)packet->data;
	uint64 userId = _blowfish->Decrypt(keyCheck->checkId);

	if(userId == keyCheck->userId)
	{
		PDEBUG_LOG_LINE(Log::getMainInstance()," User got the same key as i do, go on!\n");
		peerInfo(peer)->keyChecked = true;
		peerInfo(peer)->userId = userId;
	}
	else
	{
		Log::getMainInstance()->errorLine(" WRONG KEY, GTFO!!!\n");
		return false;
	}

	//Send response as this is correct (OFC DO SOME ID CHECKS HERE!!!)
	KeyCheck response;
	response.userId = keyCheck->userId;
	response.netId = 0;
	
	return sendPacket(peer, reinterpret_cast<uint8*>(&response), sizeof(KeyCheck), CHL_HANDSHAKE);
}
Exemple #6
0
bool PacketHandler::handleSynch(ENetPeer *peer, ENetPacket *packet)
{
	SynchVersion *version = reinterpret_cast<SynchVersion*>(packet->data);
	Log::getMainInstance()->writeLine("Client version: %s\n", version->version);

	SynchVersionAns answer;
	answer.mapId = 1;
	//exhaust = 0x08A8BAE4, Cleanse = 0x064D2094, flash = 0x06496EA8
	answer.players[0].userId = peerInfo(peer)->userId;
	answer.players[0].skill1 = SPL_Exhaust;
	answer.players[0].skill2 = SPL_Cleanse;

	sendPacket(peer, reinterpret_cast<uint8*>(&answer), sizeof(SynchVersionAns), 3);

	return true;
}
Exemple #7
0
bool PacketManager::handlePacket(ENetPeer *peer, ENetPacket *packet, uint8 channelID)
{
	if(packet->dataLength >= 8)
	{
		if(peerInfo(peer)->keyChecked)
			_blowfish->Decrypt(packet->data, packet->dataLength-(packet->dataLength%8)); //Encrypt everything minus the last bytes that overflow the 8 byte boundary
	}

	bool handled = false;

	for(uint32 i = 0; i < _packetHandlers.size(); i++)
	{
		handled = handled || _packetHandlers[i]->processPacket(peer,packet,channelID);
	}

	if(!handled)
	{
		PacketHeader* header = (PacketHeader*)packet->data;
		PDEBUG_LOG_LINE(Log::getMainInstance(),"Unknown packet: CMD %X(%i) CHANNEL %X(%i)\n", header->cmd, header->cmd,channelID,channelID);
	}

	return handled;	
}
bool PacketHandler::handlePacket(ENetPeer *peer, ENetPacket *packet, uint8 channelID)
{
	m_CurrPeer = peer;
	if(packet->dataLength >= 8)
	{
		if(peerInfo(peer)->keyChecked)
			_blowfish->Decrypt(packet->data, packet->dataLength-(packet->dataLength%8)); //Encrypt everything minus the last bytes that overflow the 8 byte boundary
	}

	PacketHeader *header = reinterpret_cast<PacketHeader*>(packet->data);	
	printf("Handling OpCode %02X\n", header->cmd);
	bool (PacketHandler::*handler)(HANDLE_ARGS) = _handlerTable[header->cmd][channelID];
	
	if(handler)
	{
		return (*this.*handler)(packet);
	}
	else
	{
		PDEBUG_LOG_LINE(Logging,"Unknown packet: CMD %X(%i) CHANNEL %X(%i)\n", header->cmd, header->cmd,channelID,channelID);
		printPacket(packet->data, packet->dataLength);
	}
	return false;	
}
TorrentDetails::TorrentDetails(QWidget* me, TorrentDownload* obj)
	: m_download(obj), m_bFilled(false)
{
	connect(obj, SIGNAL(destroyed(QObject*)), this, SLOT(deleteLater()));
	setupUi(me);
	TorrentDownload::m_worker->setDetailsObject(this);
	
	m_pPiecesModel = new TorrentPiecesModel(treePieces, obj);
	treePieces->setModel(m_pPiecesModel);
	treePieces->setItemDelegate(new BlockDelegate(treePieces));
	
	m_pPeersModel = new TorrentPeersModel(treePeers, obj);
	treePeers->setModel(m_pPeersModel);
	
	m_pFilesModel = new TorrentFilesModel(treeFiles, obj);
	treeFiles->setModel(m_pFilesModel);
	treeFiles->setItemDelegate(new TorrentProgressDelegate(treeFiles));
	
	QHeaderView* hdr = treePeers->header();
	hdr->resizeSection(1, 110);
	hdr->resizeSection(3, 50);
	hdr->resizeSection(4, 70);
	
	for(int i=5;i<9;i++)
		hdr->resizeSection(i, 70);
	
	hdr->resizeSection(9, 300);
	
	hdr = treeFiles->header();
	hdr->resizeSection(0, 500);
	
	QAction* act;
	QMenu* submenu;
	
	m_pMenuFiles = new QMenu(me);
	submenu = new QMenu(tr("Priority"), m_pMenuFiles);
	
	act = submenu->addAction( tr("Do not download") );
	connect(act, SIGNAL(triggered()), this, SLOT(setPriority0()));
	act = submenu->addAction( tr("Normal") );
	connect(act, SIGNAL(triggered()), this, SLOT(setPriority1()));
	act = submenu->addAction( tr("Increased") );
	connect(act, SIGNAL(triggered()), this, SLOT(setPriority4()));
	act = submenu->addAction( tr("Maximum") );
	connect(act, SIGNAL(triggered()), this, SLOT(setPriority7()));
	
	m_pMenuFiles->addAction(actionOpenFile);
	m_pMenuFiles->addMenu(submenu);
	
	connect(treeFiles, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(fileContext(const QPoint&)));
	connect(treeFiles, SIGNAL(doubleClicked(const QModelIndex &)), this, SLOT(openFile()));
	
	m_pMenuPeers = new QMenu(me);
	act = m_pMenuPeers->addAction( tr("Ban") );
	act = m_pMenuPeers->addAction( tr("Information") );
	connect(act, SIGNAL(triggered()), this, SLOT(peerInfo()));
	
	connect(treePeers, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(peerContext(const QPoint&)));
	connect(actionOpenFile, SIGNAL(triggered()), this, SLOT(openFile()));
	
	refresh();
}
Exemple #10
0
//building the map
bool PacketHandler::handleSpawn(ENetPeer *peer, ENetPacket *packet)
{
	uint8 bounds[] = {0x2c, 0x19, 0x00, 0x00, 0x40, 0x99, 0x14, 0x00, 0x00, 0x99, 0x14, 0x00, 0x00, 0x7f, 0x14, 0x00,\
		0x00, 0x7f, 0x14, 0x00, 0x00, 0x7f, 0x14, 0x00, 0x00, 0x7f, 0x14, 0x00, 0x00, 0x7f, 0x14, 0x00,\
		0x00, 0xe1, 0x14, 0x00, 0x00, 0xe1, 0x14, 0x00, 0x00, 0xe1, 0x14, 0x00, 0x00, 0x99, 0x14, 0x00,\
		0x00, 0x99, 0x14, 0x00, 0x00, 0xa9, 0x14, 0x00, 0x00, 0xa9, 0x14, 0x00, 0x00, 0xa9, 0x14, 0x00,\
		0x00, 0xa9, 0x14, 0x00, 0x00, 0xa9, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00,\
		0x00, 0xc5, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00, 0x00, 0xa9, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00,\
		0x00, 0xa9, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00, 0x00, 0xa9, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00,\
		0x00, 0xa9, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00, 0x00, 0xc5, 0x14, 0x00, 0x00, 0x95, 0x86, 0x5e,\
		0x06, 0xa8, 0x6e, 0x49, 0x06, 0x64, 0x37, 0x00, 0x00, 0x01, 0x44, 0x36, 0x00, 0x00, 0x02, 0x41,\
		0x36, 0x00, 0x00, 0x01, 0x52, 0x37, 0x00, 0x00, 0x04, 0x71, 0x36, 0x00, 0x00, 0x01, 0x43, 0x36,\
		0x00, 0x00, 0x03, 0x42, 0x36, 0x00, 0x00, 0x03, 0x41, 0x37, 0x00, 0x00, 0x01, 0x64, 0x36, 0x00,\
		0x00, 0x01, 0x92, 0x36, 0x00, 0x00, 0x01, 0x52, 0x36, 0x00, 0x00, 0x04, 0x43, 0x37, 0x00, 0x00,\
		0x03, 0x61, 0x36, 0x00, 0x00, 0x01, 0x82, 0x36, 0x00, 0x00, 0x03, 0x62, 0x36, 0x00, 0x00, 0x01,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x1e};

	uint8 turrets1[] = {0xff, 0x06, 0x4f, 0xa6, 0x01, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72,\
		0x72, 0x65, 0x74, 0x5f, 0x54, 0x31, 0x5f, 0x52, 0x5f, 0x30, 0x33, 0x5f, 0x41, 0x00, 0x74, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5,\
		0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04,\
		0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00,\
		0x80, 0x01, 0xff, 0x01, 0x4a, 0x02, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74,\
		0x5f, 0x54, 0x31, 0x5f, 0x52, 0x5f, 0x30, 0x32, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76,\
		0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00,\
		0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff,\
		0x01, 0x4a, 0x03, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x31,\
		0x5f, 0x43, 0x5f, 0x30, 0x37, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59,\
		0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00,\
		0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x04,\
		0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x52, 0x5f,\
		0x30, 0x33, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,\
		0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9,\
		0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8,\
		0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x05, 0x00, 0x00, 0x40,\
		0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x52, 0x5f, 0x30, 0x32, 0x5f,\
		0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03,\
		0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2,\
		0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38,\
		0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x06, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75,\
		0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x52, 0x5f, 0x30, 0x31, 0x5f, 0x41, 0x00, 0x74,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00,\
		0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74,\
		0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00,\
		0x00, 0x80, 0x01, 0x12, 0x00, 0x00, 0x00, 0x00};

	uint8 turrets2[] = {0xff, 0x06, 0x4f, 0xa6, 0x07, 0x00, 0x00, 0x40, 0x07, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72,\
		0x72, 0x65, 0x74, 0x5f, 0x54, 0x31, 0x5f, 0x43, 0x5f, 0x30, 0x35, 0x5f, 0x41, 0x00, 0x74, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5,\
		0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04,\
		0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00,\
		0x80, 0x01, 0xff, 0x01, 0x4a, 0x08, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74,\
		0x5f, 0x54, 0x31, 0x5f, 0x43, 0x5f, 0x30, 0x34, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76,\
		0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00,\
		0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff,\
		0x01, 0x4a, 0x09, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x31,\
		0x5f, 0x43, 0x5f, 0x30, 0x33, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59,\
		0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00,\
		0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x0a,\
		0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x31, 0x5f, 0x43, 0x5f,\
		0x30, 0x31, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,\
		0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9,\
		0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8,\
		0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x0b, 0x00, 0x00, 0x40,\
		0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x31, 0x5f, 0x43, 0x5f, 0x30, 0x32, 0x5f,\
		0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03,\
		0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2,\
		0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38,\
		0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x0c, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75,\
		0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x43, 0x5f, 0x30, 0x35, 0x5f, 0x41, 0x00, 0x74,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00,\
		0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74,\
		0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00,\
		0x00, 0x80, 0x01};

	uint8 turrets3[] = {0xff, 0x06, 0x4f, 0xa6, 0x0d, 0x00, 0x00, 0x40, 0x0d, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72,\
		0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x43, 0x5f, 0x30, 0x34, 0x5f, 0x41, 0x00, 0x74, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5,\
		0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04,\
		0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00,\
		0x80, 0x01, 0xff, 0x01, 0x4a, 0x0e, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74,\
		0x5f, 0x54, 0x32, 0x5f, 0x43, 0x5f, 0x30, 0x33, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0x00, 0x00, 0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76,\
		0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00,\
		0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff,\
		0x01, 0x4a, 0x0f, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32,\
		0x5f, 0x43, 0x5f, 0x30, 0x31, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,\
		0x00, 0xa0, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59,\
		0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00,\
		0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x10,\
		0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x43, 0x5f,\
		0x30, 0x32, 0x5f, 0x41, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0x02,\
		0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9,\
		0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8,\
		0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x11, 0x00, 0x00, 0x40,\
		0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x54, 0x75, 0x72,\
		0x72, 0x65, 0x74, 0x53, 0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02, 0x00, 0x00, 0x03,\
		0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2,\
		0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38,\
		0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x12, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75,\
		0x72, 0x72, 0x65, 0x74, 0x5f, 0x43, 0x68, 0x61, 0x6f, 0x73, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74,\
		0x53, 0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00,\
		0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74,\
		0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00,\
		0x00, 0x80, 0x01};

uint8 turrets4[] = {0xff, 0x07, 0x4f, 0xa6, 0x13, 0x00, 0x00, 0x40, 0x13, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72,\
		0x72, 0x65, 0x74, 0x5f, 0x54, 0x31, 0x5f, 0x4c, 0x5f, 0x30, 0x33, 0x5f, 0x41, 0x00, 0x74, 0x53,\
		0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5,\
		0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04,\
		0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00,\
		0x80, 0x01, 0xff, 0x01, 0x4a, 0x14, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74,\
		0x5f, 0x54, 0x31, 0x5f, 0x4c, 0x5f, 0x30, 0x32, 0x5f, 0x41, 0x00, 0x74, 0x53, 0x68, 0x72, 0x69,\
		0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76,\
		0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00,\
		0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff,\
		0x01, 0x4a, 0x15, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x31,\
		0x5f, 0x43, 0x5f, 0x30, 0x36, 0x5f, 0x41, 0x00, 0x74, 0x53, 0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f,\
		0x41, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59,\
		0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00,\
		0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x16,\
		0x00, 0x00, 0x40, 0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x4c, 0x5f,\
		0x30, 0x33, 0x5f, 0x41, 0x00, 0x74, 0x53, 0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02,\
		0x00, 0x00, 0x03, 0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9,\
		0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8,\
		0x18, 0x00, 0x38, 0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x17, 0x00, 0x00, 0x40,\
		0x40, 0x54, 0x75, 0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x4c, 0x5f, 0x30, 0x32, 0x5f,\
		0x41, 0x00, 0x74, 0x53, 0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02, 0x00, 0x00, 0x03,\
		0x00, 0x1f, 0x00, 0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2,\
		0xb9, 0xa8, 0x74, 0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38,\
		0x14, 0x68, 0x00, 0x00, 0x80, 0x01, 0xff, 0x01, 0x4a, 0x18, 0x00, 0x00, 0x40, 0x40, 0x54, 0x75,\
		0x72, 0x72, 0x65, 0x74, 0x5f, 0x54, 0x32, 0x5f, 0x4c, 0x5f, 0x30, 0x31, 0x5f, 0x41, 0x00, 0x74,\
		0x53, 0x68, 0x72, 0x69, 0x6e, 0x65, 0x5f, 0x41, 0x00, 0x02, 0x00, 0x00, 0x03, 0x00, 0x1f, 0x00,\
		0xc5, 0x16, 0x68, 0x76, 0xdd, 0x46, 0x59, 0x5d, 0xe2, 0xf9, 0x33, 0x77, 0xf2, 0xb9, 0xa8, 0x74,\
		0x04, 0x01, 0x00, 0x00, 0x04, 0x01, 0x00, 0x00, 0xe8, 0xf8, 0x18, 0x00, 0x38, 0x14, 0x68, 0x00,\
		0x00, 0x80, 0x01, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00};

	HeroSpawnPacket *heroSpawn = HeroSpawnPacket::create(PKT_HeroSpawn,  peerInfo(peer)->name, peerInfo(peer)->nameLen, peerInfo(peer)->type, peerInfo(peer)->typeLen);

	sendPacket(peer, reinterpret_cast<uint8*>(heroSpawn), heroSpawn->getPacketLength(), 3);
	sendPacket(peer, reinterpret_cast<uint8*>(bounds), sizeof(bounds), 3);
	sendPacket(peer, reinterpret_cast<uint8*>(turrets1), sizeof(turrets1), 3);
	sendPacket(peer, reinterpret_cast<uint8*>(turrets2), sizeof(turrets2), 3);
	sendPacket(peer, reinterpret_cast<uint8*>(turrets3), sizeof(turrets3), 3);
	sendPacket(peer, reinterpret_cast<uint8*>(turrets4), sizeof(turrets4), 3);

	
	return true;
}