Revert SQL changes, update key gen

slightly different generation scheme
This commit is contained in:
icomrade
2016-10-02 15:00:35 -04:00
parent 9fd2f2270b
commit f66c512485
3 changed files with 7 additions and 11 deletions

View File

@@ -169,19 +169,16 @@ server_getDiff2 = {
_result _result
}; };
// 1.8.7 dayz_objectUID2 seems to generate keys that are too long for Epoch hive. Keep old method for now. //seems max is 19 digits
dayz_objectUID2 = { dayz_objectUID2 = {
private["_position","_dir","_key","_element","_vector","_set","_vecCnt","_usedVec"]; private["_position","_dir","_time" ,"_key"];
_dir = _this select 0; _dir = _this select 0;
_time = round diag_tickTime;
if (_time > 99999) then {_time = round(random 99999);}; //prevent overflow if server isn't restarted
_key = ""; _key = "";
_position = _this select 1; _position = _this select 1;
if((count _this) == 2) then { _key = format["%1%2%3%4", round(_time + abs(_position select 0)), round(_dir), round(abs(_position select 1)), _time];
//_key = str(round(diag_tickTime max 1)) + (str(round(abs(_position select 0))) + str(round(abs(_position select 1))) + str(round _dir)); _key;
_key = format["%1%2%3%4%5",(round(diag_tickTime max 1)), (round(abs(_position select 0))), (round(abs(_position select 1))), (round _dir), (round (random(diag_tickTime max 1)))];
} else {
_key = format["%1%2%3%4%5%6",(round(diag_tickTime max 1)), (round(abs(_position select 0))), (round(abs(_position select 1))), (round(abs(_position select 2))), (round _dir), (round (random(diag_tickTime max 1)))];
};
_key
}; };
dayz_recordLogin = { dayz_recordLogin = {

View File

@@ -15,7 +15,6 @@ ALTER TABLE `Object_DATA` CHANGE `Hitpoints` `Hitpoints` VARCHAR(1024) CHARACTER
-- Update Object_DATA to support longer CharacterID and hitpoints -- Update Object_DATA to support longer CharacterID and hitpoints
-- ---------------------------- -- ----------------------------
ALTER TABLE Object_DATA MODIFY COLUMN CharacterID bigint(20); ALTER TABLE Object_DATA MODIFY COLUMN CharacterID bigint(20);
ALTER TABLE Object_DATA MODIFY COLUMN ObjectUID varchar(64);
ALTER TABLE Object_DATA MODIFY COLUMN Hitpoints varchar(1024); ALTER TABLE Object_DATA MODIFY COLUMN Hitpoints varchar(1024);
-- ---------------------------- -- ----------------------------

View File

@@ -50,7 +50,7 @@ CREATE TABLE IF NOT EXISTS `Character_DATA` (
-- ---------------------------- -- ----------------------------
CREATE TABLE IF NOT EXISTS `Object_DATA` ( CREATE TABLE IF NOT EXISTS `Object_DATA` (
`ObjectID` int(11) unsigned NOT NULL AUTO_INCREMENT, `ObjectID` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ObjectUID` varchar(64) NOT NULL DEFAULT '0', `ObjectUID` bigint(24) NOT NULL DEFAULT '0',
`Instance` int(11) unsigned NOT NULL, `Instance` int(11) unsigned NOT NULL,
`Classname` varchar(50) DEFAULT NULL, `Classname` varchar(50) DEFAULT NULL,
`Datestamp` datetime NOT NULL, `Datestamp` datetime NOT NULL,