TheVampire Posted January 22, 2015 Report Share Posted January 22, 2015 Since Epoch doesn't want server owners to touch the server files, does Epoch plan to add support for custom calls or sections of the redis? In particular what I am wanting is to be able to make VEMF be able to store the mission stats per player in the Redis and recall them for a "stats" display to see who has the most AI kills, etc. I also have other ideas in mind, but before I go crazy I wanted to ask. I would think it would be better to add modifications to the dll earlier than later. Liam and fr1nk 2 Link to comment Share on other sites More sharing options...
DirtySanchez Posted January 22, 2015 Report Share Posted January 22, 2015 Hell Yeah Vampire Great Ideas. Link to comment Share on other sites More sharing options...
Tobias Solem Posted January 22, 2015 Report Share Posted January 22, 2015 I am certainly no dev, but I cannot see any reason why they'd say "no you can't have your own key in the db". Link to comment Share on other sites More sharing options...
itsatrap Posted January 22, 2015 Report Share Posted January 22, 2015 I thing you can check the hive files in the server pod Link to comment Share on other sites More sharing options...
vbawol Posted January 22, 2015 Report Share Posted January 22, 2015 I was hoping someone would ask this so I will go ahead and document some calls. Our database is schema-less this means that there are no columns or rows just keys and values. The best way to use the Epoch database for your own custom calls is to use your own key namespace. This would be similar to the TAG_* or EPOCH_ practice Arma script makers use. Save data with expiry in seconds (best way to prevent bloating db)Index: 0 = Key Name Prefix1 = Key Name Unique ID2 = Expire time in seconds (auto cleanup)3 = Data can be a string or an array _player = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _player; _expires = "2592000"; // 30 days _data = ["your", "custom", "data", "goes", "here"]; // this can be an array or string [_prefix, _uniqueId, _expires, _data] call EPOCH_server_hiveSETEX; Save dataIndex: 0 = Key Name Prefix1 = Key Name Unique ID2 = Data can be a string or an array _plyr = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _plyr; _data = ["your", "custom", "data", "goes", "here"]; // this can be an array or string [_prefix, _uniqueId, _data] call EPOCH_server_hiveSET; Save BooleanIndex: 0 = Key Name Prefix1 = Key Name Unique ID2 = Numeric index3 = Boolean _player = this; // ref to player _prefix = "VEMF_STATS"; _uniqueId = getPlayerUID _player; _val = 1; // 1 = true, 0 = false [_prefix, _uniqueId, 0, 1] call EPOCH_server_hiveSETBIT; Get dataIndex: 0 = Key Name Prefix1 = Key Name Unique ID Returns: Array _player = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _player; _response = [_prefix, _uniqueId] call EPOCH_server_hiveGET; _arr = []; if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then{ _arr = _response select 1; // do something with data in array here }; Get BooleanIndex: 0 = Key Name Prefix1 = Key Name Unique ID 2 = Numeric index Returns: Boolean (true/false) _player = this; // ref to player _prefix = "VEMF_STATS"; _uniqueId = getPlayerUID _player; _response = [_prefix, _uniqueId, 0] call EPOCH_server_hiveGETBIT; if (_response) then { // do something if true } else { // do something if false }; Please ask if you have any questions and I will update this for better clarity. mgm, Darth_Rogue, axeman and 2 others 5 Link to comment Share on other sites More sharing options...
itsatrap Posted January 22, 2015 Report Share Posted January 22, 2015 Awesome :) Link to comment Share on other sites More sharing options...
BenR Posted January 22, 2015 Report Share Posted January 22, 2015 Hey, where abouts does this save the data to in the Redis DB, in the player stats section? Link to comment Share on other sites More sharing options...
vbawol Posted January 22, 2015 Report Share Posted January 22, 2015 Hey, where abouts does this save the data to in the Redis DB, in the player stats section? The examples store the data in the database with there own key namespace. You should not try to save custom data into our key namespaces as it will break the existing data and cause compatibility issues with updates. Also using your own key namespace guarantees your data will not be effected by changes we make. TheVampire 1 Link to comment Share on other sites More sharing options...
TheVampire Posted January 22, 2015 Author Report Share Posted January 22, 2015 Better than what I was hoping for. Deserves it's own thread. :D Link to comment Share on other sites More sharing options...
BenR Posted January 22, 2015 Report Share Posted January 22, 2015 The examples store the data in the database with there own key namespace. You should not try to save custom data into our key namespaces as it will break the existing data and cause compatibility issues with updates. Also using your own key namespace guarantees your data will not be effected by changes we make. Sounds good, will have to mess around a little. Cheers Link to comment Share on other sites More sharing options...
PetuniaEpoch Posted January 23, 2015 Report Share Posted January 23, 2015 Better than what I was hoping for. Deserves it's own thread. :D Agreed! This is impressive! Hmmm how to use this functionality to keep vehicles locked over a reboot... it must be possible, surely!? Link to comment Share on other sites More sharing options...
TheVampire Posted January 23, 2015 Author Report Share Posted January 23, 2015 Agreed! This is impressive! Hmmm how to use this functionality to keep vehicles locked over a reboot... it must be possible, surely!? You would need to write a serverside script that saves the vehicles information, and locked state. Then after a restart it would need to run a script that would find the correct vehicles again after the server spawns them in and set their locked status over again. I'd rather see Epoch incorporate a timeout into the preexisting code that remembers the lock time past a restart, but still times it out. Fog Horn 1 Link to comment Share on other sites More sharing options...
PetuniaEpoch Posted January 23, 2015 Report Share Posted January 23, 2015 Same, integrated into EPOCH would be best - I think VBAWOL mentioned something coming soon like this. You would need to write a serverside script that saves the vehicles information, and locked state. Then after a restart it would need to run a script that would find the correct vehicles again after the server spawns them in and set their locked status over again. I'd rather see Epoch incorporate a timeout into the preexisting code that remembers the lock time past a restart, but still times it out. Link to comment Share on other sites More sharing options...
vbawol Posted January 23, 2015 Report Share Posted January 23, 2015 Agreed! This is impressive! Hmmm how to use this functionality to keep vehicles locked over a reboot... it must be possible, surely!? It has already been done for the next patch. TheVampire 1 Link to comment Share on other sites More sharing options...
TheVampire Posted January 23, 2015 Author Report Share Posted January 23, 2015 It has already been done for the next patch. I think I need to wish for a new gaming PC next. All my wishes are coming true... ;) Darth_Rogue 1 Link to comment Share on other sites More sharing options...
DirtySanchez Posted January 24, 2015 Report Share Posted January 24, 2015 I was hoping someone would ask this so I will go ahead and document some calls. Our database is schema-less this means that there are no columns or rows just keys and values. The best way to use the Epoch database for your own custom calls is to use your own key namespace. This would be similar to the TAG_* or EPOCH_ practice Arma script makers use. Save data with expiry in seconds (best way to prevent bloating db)Index: 0 = Key Name Prefix1 = Key Name Unique ID2 = Expire time in seconds (auto cleanup)3 = Data can be a string or an array _player = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _player; _expires = "2592000"; // 30 days _data = ["your", "custom", "data", "goes", "here"]; // this can be an array or string [_prefix, _uniqueId, _expires, _data] call EPOCH_server_hiveSETEX; Save dataIndex: 0 = Key Name Prefix1 = Key Name Unique ID2 = Data can be a string or an array _plyr = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _plyr; _data = ["your", "custom", "data", "goes", "here"]; // this can be an array or string [_prefix, _uniqueId, _data] call EPOCH_server_hiveSET; Save BooleanIndex: 0 = Key Name Prefix1 = Key Name Unique ID2 = Numeric index3 = Boolean _player = this; // ref to player _prefix = "VEMF_STATS"; _uniqueId = getPlayerUID _player; _val = 1; // 1 = true, 0 = false [_prefix, _uniqueId, 0, 1] call EPOCH_server_hiveSETBIT; Get dataIndex: 0 = Key Name Prefix1 = Key Name Unique ID Returns: Array _player = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _player; _response = [_prefix, _uniqueId] call EPOCH_server_hiveGET; _arr = []; if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then{ _arr = _response select 1; // do something with data in array here }; Get BooleanIndex: 0 = Key Name Prefix1 = Key Name Unique ID Returns: Boolean (true/false) _player = this; // ref to player _prefix = "VEMF_STATS"; _uniqueId = getPlayerUID _player; _response = [_prefix, _uniqueId] call EPOCH_server_hiveGETBIT; if (_response) then { // do something if true } else { // do something if false }; Please ask if you have any questions and I will update this for better clarity. I feel good right now! Link to comment Share on other sites More sharing options...
machine6fd Posted January 30, 2015 Report Share Posted January 30, 2015 soooo if i wanted to make something as simple as when a player connects to the server save his name, and uID to the database... my script would be like this? _plyr = this; _prefix = "Player_Info"; _uniqueId = getPlayerUID _plyr; _pName = name player; _data = [["_pName"], ["_uniqueId"]]; <--- idk?? [_prefix, _uniqueId, _data] call EPOCH_server_hiveSET; Link to comment Share on other sites More sharing options...
Silens Posted May 4, 2015 Report Share Posted May 4, 2015 In 3.0.2 build 16, epoch uses a new get function, EPOCH_server_hiveGETRANGE, looks like EPOCH_server_hiveGET is still available, but using the new one might be better looking at the build 16 changelog. Link to comment Share on other sites More sharing options...
ScaRR Posted September 17, 2015 Report Share Posted September 17, 2015 Hey, with the addition of epoch_server_core.pbo, does the above still apply or would we use something like fn_server_hiveGET?Would you use it like this to retrieve the information for a player?playerInfo = ["Player","<playeridgoeshere>"] call fn_server_hiveGET;Also, if you have to specify the instance would you do it like this?vehicleInfo = ["Vehicle:<instancegoeshere>","<vehicleidgoeshere>"] call fn_server_hiveGET;Thanks Link to comment Share on other sites More sharing options...
mgm Posted May 8, 2016 Report Share Posted May 8, 2016 On 1/21/2015 at 5:57 PM, vbawol said: I was hoping someone would ask this so I will go ahead and document some calls. Our database is schema-less this means that there are no columns or rows just keys and values. The best way to use the Epoch database for your own custom calls is to use your own key namespace. This would be similar to the TAG_* or EPOCH_ practice Arma script makers use. Save data with expiry in seconds (best way to prevent bloating db)Index: 0 = Key Name Prefix1 = Key Name Unique ID2 = Expire time in seconds (auto cleanup)3 = Data can be a string or an array _player = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _player; _expires = "2592000"; // 30 days _data = ["your", "custom", "data", "goes", "here"]; // this can be an array or string [_prefix, _uniqueId, _expires, _data] call EPOCH_server_hiveSETEX; Save dataIndex: 0 = Key Name Prefix1 = Key Name Unique ID2 = Data can be a string or an array _plyr = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _plyr; _data = ["your", "custom", "data", "goes", "here"]; // this can be an array or string [_prefix, _uniqueId, _data] call EPOCH_server_hiveSET; Save BooleanIndex: 0 = Key Name Prefix1 = Key Name Unique ID2 = Numeric index3 = Boolean _player = this; // ref to player _prefix = "VEMF_STATS"; _uniqueId = getPlayerUID _player; _val = 1; // 1 = true, 0 = false [_prefix, _uniqueId, 0, 1] call EPOCH_server_hiveSETBIT; Get dataIndex: 0 = Key Name Prefix1 = Key Name Unique ID Returns: Array _player = this; // ref to player _prefix = "VEMF_DATA"; _uniqueId = getPlayerUID _player; _response = [_prefix, _uniqueId] call EPOCH_server_hiveGET; _arr = []; if ((_response select 0) == 1 && typeName(_response select 1) == "ARRAY") then{ _arr = _response select 1; // do something with data in array here }; Get BooleanIndex: 0 = Key Name Prefix1 = Key Name Unique ID 2 = Numeric index Returns: Boolean (true/false) _player = this; // ref to player _prefix = "VEMF_STATS"; _uniqueId = getPlayerUID _player; _response = [_prefix, _uniqueId, 0] call EPOCH_server_hiveGETBIT; if (_response) then { // do something if true } else { // do something if false }; Please ask if you have any questions and I will update this for better clarity. I have been testing this and can't seem to make it work: whatever value I try to SET/SETEX, when I try to GET it, I receive no response (blank array). These functions being very basic not returning any error codes either. Are there any other real & very basic examples to test? Example: store "age" for any PUID and then receive it from the server and write to server log (to test)? Link to comment Share on other sites More sharing options...
He-Man Posted May 8, 2016 Report Share Posted May 8, 2016 Store with: Spoiler _playeruid = getplayeruid _player; _storedvalue = 1000; _return = ["He_Man_Vars", _playeruid, "7776000", [_storedvalue]] call EPOCH_fnc_server_hiveSETEX; Load with Spoiler _playeruid = getplayeruid _player; _responce = ["He_Man_Vars", _playeruid] call EPOCH_fnc_server_hiveGETRANGE; if (count (_responce select 1) > 0) then { _storedvalue = _responce select 1 select 0; }; rvg?! and mgm 2 Link to comment Share on other sites More sharing options...
mgm Posted May 8, 2016 Report Share Posted May 8, 2016 Just now, He-Man said: Store with: Hide contents _playeruid = getplayeruid _player; _storedvalue = 1000; _return = ["He_Man_Vars", _playeruid, "7776000", [_storedvalue]] call EPOCH_fnc_server_hiveSETEX; Load with Hide contents _playeruid = getplayeruid _player; _responce = ["He_Man_Vars", _playeruid] call EPOCH_fnc_server_hiveGETRANGE; if (count (_responce select 1) > 0) then { _storedvalue = _responce select 1 select 0; }; Thank you for a quick response He-Man, I will try this right away. BTW I was your biggest fan when I was 7! Link to comment Share on other sites More sharing options...
He-Man Posted May 8, 2016 Report Share Posted May 8, 2016 Thanks! :D The 7776000 is for the time, until the value will be deleted from the db (30 days for this example) Link to comment Share on other sites More sharing options...
mgm Posted May 8, 2016 Report Share Posted May 8, 2016 25 minutes ago, He-Man said: Store with: Reveal hidden contents _playeruid = getplayeruid _player; _storedvalue = 1000; _return = ["He_Man_Vars", _playeruid, "7776000", [_storedvalue]] call EPOCH_fnc_server_hiveSETEX; Load with Reveal hidden contents _playeruid = getplayeruid _player; _responce = ["He_Man_Vars", _playeruid] call EPOCH_fnc_server_hiveGETRANGE; if (count (_responce select 1) > 0) then { _storedvalue = _responce select 1 select 0; }; Tested this & it is working fine - thanks a lot! There are a couple syntax differences, one of them apparently "broke" my commands. I will play with this some more later, persistent data storage opens a big world to scripters. thanks Obama, vbawol and he-man! Link to comment Share on other sites More sharing options...
vbawol Posted May 9, 2016 Report Share Posted May 9, 2016 Glad to see people looking a bit deeper! In case you have not seen it, the github link below is for the Epoch Server Framework and has all of the documentation on calls and functions in one place. Raw extension calls:https://github.com/EpochModTeam/EpochServer Sqf DB helper functions:https://github.com/EpochModTeam/EpochServer/tree/master/sqf/epoch_server_core mgm 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now