cash_array = {} // Update the local player's cash value. getDBData (false, 'corps', 'cash', 'cash_array', worldmap_loadcashdata_success(), undefined, 'name', global_corp_name) ///// ///// ... elsewhere .... ///// // Use XMLHttpRequest to request for table data. function getDBData (get3dmap, input_tablename, columnlist, responsedatavar, successfunc, mapoffsetlist, input_where, input_values) { // Add custom "where" with associated values. var input_values_and_where = '' if (input_values) input_values_and_where = '&input_where='+input_where+'&input_values='+input_values // Trim the column list of spaces, and don't do anything if the column list is blank! columnlist = columnlist.trim(); if (columnlist=='') return // Find out if x/y data is needed if (get3dmap) {var xy1='x,y,'; xy2='&orderby=x,y'} else {var xy1 = ''; xy2=''} // If mapoffsetlist is not defined, set it to null. if (typeof mapoffsetlist == 'undefined') mapoffsetlist=null // If mapoffsetlist is a single value, make it an array. if (typeof mapoffsetlist == 'number') mapoffsetlist = [mapoffsetlist] // Convert request into POST data. var requeststring = '&request_type=read&input_tablename='+input_tablename+'&columnlist='+xy1+columnlist+xy2+'&curworld_dbname='+worldmap_curworld_dbname+input_values_and_where // Set up the temp string and call the request function. var http_request = makeRequest('dbrequest.php', requeststring, true) http_request.onreadystatechange = function() { if (http_request.readyState == 4) { if (http_request.status == 200) { if (http_request.responseText.substr(0,5) == 'Error') {alert(http_request.responseText); return} // Populate responsedatavar with the data. var tempdata = http_request.responseText var splitarray = new Array() var xcoords = new Array(); var ycoords = new Array(); var onedarray=true, x=0, y=0 var header_version = tempdata.charCodeAt(0) if (header_version != 0) {alert('Unable to cope with this response text header version. ('+header_version+')'); return} var column_amount = tempdata.charCodeAt(1) var c = 0, c2 = 0, len = column_amount*9+2 if (window[responsedatavar]==null) window[responsedatavar] = new Array() for (i=2; i