psychoman78

Member
Hey all, i been doing some thinking and not sure exactly where or how but is there a way to save the players characters into a diff save file then all the regular mobiles, and so that it's not encrypted so if theirs an issue with something on a player i can just edit the save itself and fix it.... just an idea i have been looking threw it and cant find where to change these in the save functions so it will save in its own dir and not encrypted like the mobile saves are...

Thanx
 
mobiles and items are not encrypted, they are saved as a raw binary structure that describes the item or mobile. In order to do what you want to do you will need to create a writer that will save to text and a reader that can read it. It can be done but it will be slower than raw binary.

To get started you would need to look at the persistence folder in the core and go from there.

Honestly though, it would be easier to create a gui that could read the save files so you could edit them from there. The structure of the saves are in the core, it would not be a lot of work to do it.
 
Okay thank you @dmurphy i was not sure and well at this point making a gui is not on the table i am still working on getting everything down pat i have come along way but in past 2 months but relearning code is still a long prosess hehehehe, so maybe that will have to wait
 
perhaps a 10-15 minute project to make.. my approach was build it into the core..
What I did to fix your shard's world files @Tasanar .
 
I would highly recommend it, it will reveal problems in the saves I think most people are unaware of..
 
I wish I had the time atm.., I barely find the few minutes to post right now. Just tearing it out, posting, explaining, is more work than making it.
I'm sure with all the devs running around here someone will put something together, before I can get to it.
 
well Fraz if you find the time that would be awsome i am a ways away as i have started working on a whole new code for my shard, so if you manage to get it out with even a basic explaination and install that would be awsome don't really need a ton of info just the install and basic commands and stuff the rest i can figure out as most of us prob could hehehe, something like this is little more advanced then me atm
 
Ya that would be awesome been so busy with things I almost forgot bout it hehehe, would be really nice to have

Cool. Can you help me understand the context you'd end up using it in, like what kind of problem would such a save editor solve. AFIAK you can edit all the properties of a PlayerMobile even if an account is online.
 
OKay what i was looking at is being able to Completly alter ALL aspects of a player weather online or offline being able to see the stuff that Props dont show as well as being able to go in and delete Charactors from an account if needed stuff like that things that are not currently available to staff of a shard
 
The [admin gump lets you do much of that. You can pull a character to you even if they are offline, if I remember right.
 
The [admin gump lets you do much of that. You can pull a character to you even if they are offline, if I remember right.
I saw that when I was looking around in the admin gump.

Is there something that editing a save outside the game would do for you that the admin gump doesn't do already?
 
Well what you are describing can pretty much be done now. Each item is saved to its own row in the items table along with the base attributes. If say one item is corrupt you can just delete the row, along with any references to that item and the game will load. I have actually tested this out adding and removing items to my backpack via the database. You can also if you really want to export the database to a csv file. Maybe if I can motivate myself I will create a youtube video showing how to do it.

The stuff I am actually working on now is the extended attributes like magic properties and such are still basically using the old serialization system and then just tagged on to the end in a column in the item row. Once I get rid of all the serialization there will be much less potential for corruption.
Sounds like you're looking in the direction Keninishna is going.
https://www.servuo.com/threads/redo...to-use-a-real-database.3638/page-3#post-44901
 
What they are talking about is an programm that reads the binary code and allows for it to be edited in case code gets corrupted.
 
An app like that is probably not too hard to develop, but it would be time consuming.

In one scenario, you'd have to effectively create the equivalent to the in-game [props gump, but using WinForms or WPF.
Reflection would play a huge part in populating data tables, but the most work would be involved in writing the logic to handle the varying data types of each property.
There is a reason that [Props accessible properties need to be marked with a [CommandProperty] attribute, and that is for access intention.
I'm not talking about staff access level, I'm talking about the ability to access (get or set) an individual property.
Properties not marked with a [CommandProperty] attribute were obviously never intended to be edited on the fly by staff and are likely only meant to be updated programatically, therefore it would be a good idea to use a similar role with this application.
It can allow the user to access any properties marked with a [CommandProperty] and ignore those that are not.
This kind of application would need to be launched by the running shard, so that the shards memory is more easily accessible to the application and there would be pre-existing support and references for cross-code development.

In another scenario, you could have an application that's capable of reading/writing the world save files without the shard running.
This application would simply use the ServUO.exe and Scripts.CS.dll as references, so that it would support cross-code development.
In order to load the world save files, the application could simply invoke and execute the code responsible (that already exists) for loading the world saves.
The problem with this approach is that all the entities - mobiles and items - will have their Deserialize method called...
Because RunUO/ServUO don't have standards that restrict Deserialization to only reading data, there can and will be unexpected results - some items or mobiles might have special logic in their Deserialize methods that does things like delete them, or starts a timer, or anything else except simply reading data and assigning it to a properties.
There is also the caveat that loading the data this way will also just fail because corrupt data is corrupt data and that's that, no matter the interpretation of the data.

That leaves the previously mentioned database-driven (SQL) save file as the only other viable option - you can probably just discount the second option I mentioned completely because of the caveats. For achieving the goals set out in this post, the database model would be the ideal candidate - but it just doesn't exist in a stable, production state... yet.
 
The problem with this approach is that all the entities - mobiles and items - will have their Deserialize method called...
Because RunUO/ServUO don't have standards that restrict Deserialization to only reading data, there can and will be unexpected results - some items or mobiles might have special logic in their Deserialize methods that does things like delete them, or starts a timer, or anything else except simply reading data and assigning it to a properties.

I see here a great opportunity for cleaning code and establish this standard! :D
 

Active Shards

Donations

Total amount
$0.00
Goal
$1,000.00
Back