Who/when added business
This commit is contained in:
@@ -95,6 +95,9 @@ class BusinessData {
|
|||||||
|
|
||||||
this.labelHelpType = V_PROPLABEL_INFO_NONE;
|
this.labelHelpType = V_PROPLABEL_INFO_NONE;
|
||||||
|
|
||||||
|
this.whoAdded = 0;
|
||||||
|
this.whenAdded = 0;
|
||||||
|
|
||||||
if (dbAssoc) {
|
if (dbAssoc) {
|
||||||
this.databaseId = toInteger(dbAssoc["biz_id"]);
|
this.databaseId = toInteger(dbAssoc["biz_id"]);
|
||||||
this.name = toString(dbAssoc["biz_name"]);
|
this.name = toString(dbAssoc["biz_name"]);
|
||||||
@@ -124,9 +127,10 @@ class BusinessData {
|
|||||||
|
|
||||||
this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]);
|
this.entranceFee = toInteger(dbAssoc["biz_entrance_fee"]);
|
||||||
this.till = toInteger(dbAssoc["biz_till"]);
|
this.till = toInteger(dbAssoc["biz_till"]);
|
||||||
|
|
||||||
this.labelHelpType = toInteger(dbAssoc["biz_label_help_type"]);
|
this.labelHelpType = toInteger(dbAssoc["biz_label_help_type"]);
|
||||||
this.streamingRadioStation = toInteger(dbAssoc["biz_radio_station"]);
|
this.streamingRadioStation = toInteger(dbAssoc["biz_radio_station"]);
|
||||||
|
this.whoAdded = toInteger(dbAssoc["biz_who_added"]);
|
||||||
|
this.whenAdded = toInteger(dbAssoc["biz_when_added"]);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@@ -315,7 +319,9 @@ function createBusinessCommand(command, params, client) {
|
|||||||
-1,
|
-1,
|
||||||
getPlayerInterior(client),
|
getPlayerInterior(client),
|
||||||
getPlayerDimension(client),
|
getPlayerDimension(client),
|
||||||
getPlayerData(client).interiorScene);
|
getPlayerData(client).interiorScene,
|
||||||
|
getPlayerData(client).accountData.databaseId
|
||||||
|
);
|
||||||
|
|
||||||
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`, true);
|
messageAdmins(`{adminOrange}${getPlayerName(client)}{MAINCOLOUR} created business: {businessBlue}${params}`, true);
|
||||||
}
|
}
|
||||||
@@ -357,7 +363,7 @@ function createBusinessLocationCommand(command, params, client) {
|
|||||||
|
|
||||||
// ===========================================================================
|
// ===========================================================================
|
||||||
|
|
||||||
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceScene = -1) {
|
function createBusiness(name, entrancePosition, exitPosition, entrancePickupModel = -1, entranceBlipModel = -1, entranceInterior = 0, entranceDimension = 0, entranceScene = -1, whoAdded = defaultNoAccountId) {
|
||||||
let tempBusinessData = new BusinessData(false);
|
let tempBusinessData = new BusinessData(false);
|
||||||
tempBusinessData.name = name;
|
tempBusinessData.name = name;
|
||||||
|
|
||||||
@@ -377,6 +383,9 @@ function createBusiness(name, entrancePosition, exitPosition, entrancePickupMode
|
|||||||
tempBusinessData.exitDimension = 0;
|
tempBusinessData.exitDimension = 0;
|
||||||
tempBusinessData.exitScene = -1;
|
tempBusinessData.exitScene = -1;
|
||||||
|
|
||||||
|
tempBusinessData.whoAdded = whoAdded;
|
||||||
|
tempBusinessData.whenAdded = getCurrentUnixTimestamp();
|
||||||
|
|
||||||
tempBusinessData.needsSaved = true;
|
tempBusinessData.needsSaved = true;
|
||||||
let businessId = getServerData().businesses.push(tempBusinessData);
|
let businessId = getServerData().businesses.push(tempBusinessData);
|
||||||
setBusinessDataIndexes();
|
setBusinessDataIndexes();
|
||||||
@@ -1933,6 +1942,8 @@ function saveBusinessToDatabase(businessId) {
|
|||||||
["biz_radio_station", (getRadioStationData(tempBusinessData.streamingRadioStationIndex) != false) ? toInteger(getRadioStationData(tempBusinessData.streamingRadioStationIndex).databaseId) : -1],
|
["biz_radio_station", (getRadioStationData(tempBusinessData.streamingRadioStationIndex) != false) ? toInteger(getRadioStationData(tempBusinessData.streamingRadioStationIndex).databaseId) : -1],
|
||||||
["biz_custom_interior", boolToInt(tempBusinessData.customInterior)],
|
["biz_custom_interior", boolToInt(tempBusinessData.customInterior)],
|
||||||
["biz_buy_price", tempBusinessData.buyPrice],
|
["biz_buy_price", tempBusinessData.buyPrice],
|
||||||
|
["biz_who_added", tempBusinessData.whoAdded],
|
||||||
|
["biz_when_added", tempBusinessData.whenAdded],
|
||||||
//["biz_rent_price", tempBusinessData.rentPrice],
|
//["biz_rent_price", tempBusinessData.rentPrice],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user