Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Development save tent.

Newbie Spellweaver
Joined
Nov 29, 2014
Messages
40
Reaction score
8
And easy enough to check :)
_ok = DBServerSaveObject(_state,_parameters);
if (typeName _ok == "STRING") then { ...

ah ok ok I thought that argument should be passed as an array like

_ok = DBServerSaveObject [_object1,_object2,_object3];
 
Junior Spellweaver
Joined
Oct 11, 2014
Messages
188
Reaction score
48
Do not place the preservation of tent, due to the large amount of loot in one place will severely slow down the server and the server will be lag, you can crash the server



Instead of tents make the biggest backpack, for example 250 slots
 
Newbie Spellweaver
Joined
May 29, 2014
Messages
66
Reaction score
6
Did you manage to save the tents content ? If yes, I would like to test if danisimus is right...
 
Junior Spellweaver
Joined
Jan 15, 2015
Messages
113
Reaction score
13
I'm implementing tent saving system (along with car saving system which is already working) with @R4vEn and I'm experiencing no slow down with 40 tents loaded with containers and objects inside.
Oh and it's not via editing the source code btw.

#EDIT
we are running a
Intel Xeon CPU E31240 @ 3.30GHz,
24,0 GB RAM
Windows Server 2008
 
Last edited:
Newbie Spellweaver
Joined
Jan 11, 2009
Messages
12
Reaction score
0
?
I don't know you, but I tried to make a server and I didn't knew where even start.. One admin in one server helped me and I started looking for info..
Now I have discovered some little but helpful things that I am sharing..

Like.. everybody says to make your server always sunny fixed time is in init.sqf file, check one of my post in a thread there is the solution explained..
Now I figured out how to respawn loot without restarting and I'm sharing it right now..

Share your knowledge is the way to colaborate in a community, if everyone keeps their 'wisdom' to themselves then we don't have much time in this planet..
Help and be helped..
Share!

Greetings


EDIT: Hey, I'm not saying that he has to give his work for free..
I'm saying share.. Nothing's completely free in this life..
 
Junior Spellweaver
Joined
Jan 15, 2015
Messages
113
Reaction score
13
Just ask things, he will surely answer !
indeed, as said, I could help people making scripts, or explaining how scripts work, rather than give a "easy to use" tool.

EDIT: Hey, I'm not saying that he has to give his work for free..
I'm saying share.. Nothing's completely free in this life..

it's about 20 functions for saving tents and all their objects (along with their status), I've done them on my own with help ofr some good scriptes at BI forum (people who knows how to make everything work) but they didn't give me a full script to use, they just helped me telling me which command I shpuld use, how it works with the syntax etc... so as the admin says here, just go to the section "DayZ HELP" and make a request to ask everything script related and I will be happy to answer and to "try" to help (which is, in my opinion, the only way to do
 
Newbie Spellweaver
Joined
Jan 11, 2009
Messages
12
Reaction score
0
Oh nice! Okay, so you are not giving your work, but you're sharing anyway.. right? :)
Sorry if I bother you it wasn't my intention..
So to make tents saving work you have edited the source code of DayZ?
 
Newbie Spellweaver
Joined
Feb 2, 2014
Messages
30
Reaction score
5
thats what this topic was originaly about =) editing source code to save objects
 
Junior Spellweaver
Joined
Jan 15, 2015
Messages
113
Reaction score
13
Oh nice! Okay, so you are not giving your work, but you're sharing anyway.. right? :)
Sorry if I bother you it wasn't my intention..
So to make tents saving work you have edited the source code of DayZ?
Well no. I have not edited any source code cause I don't want to edit it everytime there's a new server file available.

As said, I'm using setVariable, getVariable to save info of tents in the nameSpace profile.
Now if you want to ask how these particular commands work, just open a thread in the help section cause this is Mizev's method of saving tents which differs from mine
 
Skilled Illusionist
Joined
Jun 19, 2014
Messages
315
Reaction score
71
  1. GameValue DBServerSaveCharacter(const GameState *state, GameValuePar oper1)
  2. {
  3. if (!GetNetworkManager().IsServerOwner())
  4. {
  5. state->AccessError("dbServerSaveCharacter");
  6. return false;
  7. }

  8. if (oper1.GetType() == GameObject)
  9. {
  10. Object *obj = GetObject(oper1);
  11. Person *person = dyn_cast<Person>(obj);
  12. if (!person) return false;

  13. int dpnid;
  14. if (GetNetworkManager().IsServer())
  15. {
  16. dpnid = person->GetRemotePlayer();
  17. if (dpnid == AI_PLAYER) return false;
  18. }
  19. else
  20. {
  21. dpnid = 2; // BOT_CLIENT
  22. if (person != GWorld->PlayerOn()) return false;
  23. }

  24. JSONDocument document;
  25. document.SetObject();
  26. JSONAllocator& allocator = document.GetAllocator();

  27. // keep some members outside to be consistent with Load
  28. document.AddMember("model", cc_cast(person->GetType()->GetName()), allocator);
  29. document.AddMember("alive", person->Brain() && person->Brain()->LSIsAlive() ? 1 : 0, allocator);
  30. person->JSONSave(document, allocator);

  31. JSONBuffer buffer;
  32. JSONWriter writer(buffer);
  33. document.Accept(writer);

  34. RString request = buffer.GetString();

  35. RString url/*, attrib*/;
  36. BuildServerRequest(ESERVLET_CHARACTER,url,"save");
  37. // BuildPlayerUID(attrib,uid);

  38. return GetNetworkManager().DBSave(url.Data(), dpnid, request);
  39. }
  40. else
  41. {
  42. DoAssert(oper1.GetType() == GameArray);
  43. const GameArrayType &array = oper1;
  44. if (!CheckSize(state, array, 2)) return false;
  45. if (!CheckType(state, array[0], GameString)) return false;
  46. if (!CheckType(state, array[1], GameObject)) return false;

  47. RString uid = array[0];
  48. Person *person = dyn_cast<Person>(GetObject(array[1]));
  49. if (!person) return false;

  50. JSONDocument document;
  51. document.SetObject();
  52. JSONAllocator& allocator = document.GetAllocator();

  53. // keep some members outside to be consistent with Load
  54. document.AddMember("model", cc_cast(person->GetType()->GetName()), allocator);
  55. document.AddMember("alive", person->Brain() && person->Brain()->LSIsAlive() ? 1 : 0, allocator);
  56. person->JSONSave(document, allocator);

  57. JSONBuffer buffer;
  58. JSONWriter writer(buffer);
  59. document.Accept(writer);

  60. RString request = buffer.GetString();

  61. RString url, attrib;
  62. BuildServerRequest(ESERVLET_CHARACTER,url,"save");
  63. BuildPlayerUID(attrib,uid);

  64. return GetNetworkManager().DBSave(url.Data(),attrib,request);
  65. }
  66. }




    RAW Paste Data
    GameValue DBServerSaveCharacter(const GameState *state, GameValuePar oper1)
    {
    if (!GetNetworkManager().IsServerOwner())
    {
    state->AccessError("dbServerSaveCharacter");
    return false;
    }


    if (oper1.GetType() == GameObject)
    {
    Object *obj = GetObject(oper1);
    Person *person = dyn_cast<Person>(obj);
    if (!person) return false;


    int dpnid;
    if (GetNetworkManager().IsServer())
    {
    dpnid = person->GetRemotePlayer();
    if (dpnid == AI_PLAYER) return false;
    }
    else
    {
    dpnid = 2; // BOT_CLIENT
    if (person != GWorld->PlayerOn()) return false;
    }


    JSONDocument document;
    document.SetObject();
    JSONAllocator& allocator = document.GetAllocator();


    // keep some members outside to be consistent with Load
    document.AddMember("model", cc_cast(person->GetType()->GetName()), allocator);
    document.AddMember("alive", person->Brain() && person->Brain()->LSIsAlive() ? 1 : 0, allocator);
    person->JSONSave(document, allocator);


    JSONBuffer buffer;
    JSONWriter writer(buffer);
    document.Accept(writer);


    RString request = buffer.GetString();


    RString url/*, attrib*/;
    BuildServerRequest(ESERVLET_CHARACTER,url,"save");
    // BuildPlayerUID(attrib,uid);


    return GetNetworkManager().DBSave(url.Data(), dpnid, request);
    }
    else
    {
    DoAssert(oper1.GetType() == GameArray);
    const GameArrayType &array = oper1;
    if (!CheckSize(state, array, 2)) return false;
    if (!CheckType(state, array[0], GameString)) return false;
    if (!CheckType(state, array[1], GameObject)) return false;


    RString uid = array[0];
    Person *person = dyn_cast<Person>(GetObject(array[1]));
    if (!person) return false;


    JSONDocument document;
    document.SetObject();
    JSONAllocator& allocator = document.GetAllocator();


    // keep some members outside to be consistent with Load
    document.AddMember("model", cc_cast(person->GetType()->GetName()), allocator);
    document.AddMember("alive", person->Brain() && person->Brain()->LSIsAlive() ? 1 : 0, allocator);
    person->JSONSave(document, allocator);


    JSONBuffer buffer;
    JSONWriter writer(buffer);
    document.Accept(writer);


    RString request = buffer.GetString();


    RString url, attrib;
    BuildServerRequest(ESERVLET_CHARACTER,url,"save");
    BuildPlayerUID(attrib,uid);


    return GetNetworkManager().DBSave(url.Data(),attrib,request);
    }
    }

 
Skilled Illusionist
Joined
Jun 19, 2014
Messages
315
Reaction score
71
OMG *facepalm

great copy of the code from the first page

yes its just nok nok cause i see no news ans by the way i have save tent server and i will not releas it for now its just for my dayz vip
 
Newbie Spellweaver
Joined
Mar 31, 2013
Messages
43
Reaction score
12
Save system works for me. Mizev, can you reupload saving tent tutorial from dayzdev ru? It has been deleted :(:
 
Experienced Elementalist
Joined
Mar 10, 2015
Messages
264
Reaction score
33
If yours tent saving system is works, please share the system here.
 
Back
Top