Loading...   


QueryServ

void Database::GeneralQueryReceive(ServerPacket *pack) {
	/*
		These are general queries passed from anywhere in zone instead of packing structures and breaking them down again and again
	*/
	char *Query = nullptr;
	Query = new char[pack->ReadUInt32() + 1];
	pack->ReadString(Query);
	char errbuf[MYSQL_ERRMSG_SIZE];
	char* query = 0;
	uint32 lastid = 0;
	if (!RunQuery(query, MakeAnyLenString(&query, Query), errbuf, 0, 0, &lastid)) { 
		_log(QUERYSERV__ERR, "Failed Delete Log Record Insert: %s", errbuf);
		_log(QUERYSERV__ERR, "%s", query); 
	}
	safe_delete_array(query);
	safe_delete(pack); 
	safe_delete(Query); 
}

zone

void QueryServ::SendQuery(char *Query){ 
	// printf("Shipping SendQuery '%s'", Query);  
	ServerPacket* pack = new ServerPacket(ServerOP_QSSendQuery, strlen(Query) + 5); 
	pack->WriteUInt32(strlen(Query)); /* Pack Query String Size so it can be dynamically broken out at queryserv */
	pack->WriteString(Query); /* Query */  
	worldserver.SendPacket(pack);  
	safe_delete(pack);
}

Raw Paste Data