- Post your Feature Requests in this thread -

Vote for new features, or make your own requests here.
User avatar
Joel
Moodkie Staff
Posts: 3785
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

fur wrote:
Wed Aug 05, 2020 9:36 am
ES3Spreadsheet is great and handy for us reading local CSV database file, in the Resources folder.

But we want to encrypt the local database and decrypt it when using ES3Spreadsheet, using the default ES3 encryption password. So that the player cannot hack the local CSV and for example, add hp to character, or add more coins in a shop item, etc.

It will be great if you have a tool that can drag and encrypt a selected file, that can later be read by ES3Spreadsheet in runtime.

I believe I can write an Editor script using ES3.LoadRawString and ES3.SaveRawString for that, but yea if you got that in the first place then that will be great.
Hi there, and thanks for getting in contact.

This is already possible by providing an ES3Settings object to the ES3Spreadsheet.Save and ES3Spreadsheet.Load methods. E.g.

Code: Select all

var s = new ES3Spreadsheet();
s.SetCell(0, 0, 123f);
s.Save("MyCSV.csv", new ES3Settings(ES3.EncryptionType.AES));

var s2 = new ES3Spreadsheet();
s2.Load("MyCSV.csv", new ES3Settings(ES3.EncryptionType.AES));
Debug.Log(s2.GetCell<float>(0, 0));
All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started

Kokorozashi
Posts: 7
Joined: Tue Jun 25, 2019 12:20 am

Re: - Post your Feature Requests in this thread -

Post by Kokorozashi »

I'd like to see serialization attributes to let me specify per field how ES3 will save the field. When you have a scenario where you have references to instances of ScriptableObjects as well as regular ScriptableObject references. You will likely want to save the ScriptableObject instance (Object.Instantiate()) by value and save the plain ScriptableObject reference by reference. Something like [ES3SerializeByRef] and [ES3SerializeByValue] would streamline that flow.

User avatar
Joel
Moodkie Staff
Posts: 3785
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

Hi there,

We're actually working on something similar to this at the moment using the Types window, but not with attributes.

However, I think it's also worth having attributes as there are situations when this would also be useful. I've added a feature request for this here:
https://moodkie.com/forum/viewtopic.php?f=14&t=1995

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started

kohei
Posts: 1
Joined: Fri Nov 13, 2020 4:13 pm

Re: - Post your Feature Requests in this thread -

Post by kohei »

I'd like to save my custom instance as simple primitive value. I'm implementing a class which has a single int value below:

Code: Select all

public class BigInteger {
    public float val;
}

public class SaveData {
    public List<BigInteger> values;
}

But when an instance of this class is serialized to json, the serialized json file becomes bellow:

Code: Select all

"values" : [{"value" : 31131},{"value" : 9343}]
I'd like to save this simply:

Code: Select all

"values" : [31131,9343]
I implemented custom ES3 Type which has ES3Type_double as a parent. And I modified ES3Writer(Line. 174) and ES3Reader(Line 233 and 250) as below:

Code: Select all

	            if (type.isPrimitive)
	            {
					type.Write(value, this);
	            }
	            else
	            {
					StartWriteObject(null);
					WriteType(valueType);

					type.Write(value, this);

					EndWriteObject(null);
	            }

Code: Select all

    protected virtual void ReadObject<T>(object obj, ES3Type type)
	{
		if (type.isPrimitive)
		{
			type.ReadInto<T>(this, obj);
			return;
		}
		
		// Check for null.
		if(StartReadObject())
			return;

		type.ReadInto<T>(this, obj);

		EndReadObject();
	}

Code: Select all

	protected virtual T ReadObject<T>(ES3Type type)
	{
		if (type.isPrimitive)
		{
			object pobj = type.Read<T>(this);
			return (T) pobj;
		}
		
		if(StartReadObject())
			return default(T);

		object obj = type.Read<T>(this);

		EndReadObject();
		return (T)obj;
	}
	
My ES3UserType_BigInteger class is below:

Code: Select all

namespace ES3Types
{
    [UnityEngine.Scripting.Preserve]
    [ES3PropertiesAttribute("value")]
    public class ES3UserType_BigInteger : ES3Type_double
    {
        public new static ES3Type Instance = null;

        public ES3UserType_BigInteger() : base(typeof(BigInteger))
        {
            isPrimitive = true;
            Instance = this;
            priority = 1;
        }

        public override void Write(object obj, ES3Writer writer)
        {
            base.Write((obj as BigInteger).value, writer);
        }

        void ReadObject<T>(ES3Reader reader, object obj)
        {
            var instance = (BigInteger) obj;
            instance.value = (double) base.Read<double>(reader);
        }

        public override object Read<T>(ES3Reader reader)
        {
            var instance = new BigInteger();
            ReadObject<T>(reader, instance);
            return instance;
        }
    }

    public class ES3UserType_BigIntegerArray : ES3ArrayType
    {
        public static ES3Type Instance;

        public ES3UserType_BigIntegerArray() : base(typeof(BigInteger[]), ES3UserType_BigInteger.Instance)
        {
            Instance = this;
        }
    }
}
This changes work successfully for me. I would be happy if you take in this changes. I'm sorry for my poor English.

User avatar
Joel
Moodkie Staff
Posts: 3785
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

Hi there,

Thanks for posting the code. As this is very specific to your project and would cause issues if we implemented it across Easy Save, we wouldn't be able to integrate this. However, hopefully this code will be useful if anyone wants to achieve anything similar in the future.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started

sgoffman
Posts: 12
Joined: Sat Feb 21, 2015 11:26 pm
Location: Mission Viejo, CA
Contact:

Re: - Post your Feature Requests in this thread -

Post by sgoffman »

I would love to be able to directly retrieve a sub-property from a JSON file.

E.g. if I have this object in my save file:

Code: Select all

	"MyCustomObject" : {
		"__type" : "MyCustomObject,Assembly-CSharp",
		"value" : {
		"s_createVersion" : "1.0.0",
		"m_level" : 2,
		"m_playerName" : "Jimmy Jones",
		"m_points" : 10543,
	}
I would like to be able to load "m_level" with something like

Code: Select all

file.Load<int>("MyCustomObject/m_level");
without having to load MyCustomObject onto an instance of the class.

PhilDark
Posts: 11
Joined: Sat Apr 03, 2021 5:10 pm

Re: - Post your Feature Requests in this thread -

Post by PhilDark »

Hello,

2 features that would be a great help for me (and maybe for other users !)

1. I know that I can save a file in the cloud, this is a great feature, but could it be possible to save a file to a googledrive folder or a ftp folder ? If not possible, do you have any idea of the way I could do this ? Another asset maybe ?

2. As it is possible to save to a csv file, it would be great to do the same but within a shared google spreadsheet document ?

Best regards, Phil

User avatar
Joel
Moodkie Staff
Posts: 3785
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

Hi Phil,

As Google doesn't provide a secure API to communicate between Google Drive or Sheets and a Unity API, we're unable to support this.

We also don't provide support for uploading files to FTP as it would be impossible to create an API which was secure on every server configuration.

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started

User avatar
AdamStepinski
Posts: 13
Joined: Wed May 05, 2021 8:44 am
Contact:

Re: - Post your Feature Requests in this thread -

Post by AdamStepinski »

Feature: Add comments in autosave window (which would show in that window where you check which fields you want to AutoSave)

then they would go into autogenerated Type file, e.g. after "//"

User avatar
Joel
Moodkie Staff
Posts: 3785
Joined: Wed Nov 07, 2012 10:32 pm

Re: - Post your Feature Requests in this thread -

Post by Joel »

Sorry, I'm afraid I'm not sure I understand your feature request. Please could you provide a bit more detail about the request, and what problem this would solve?

All the best,
Joel
Joel @ Moodkie Interactive
Purchase Easy Save | Contact | Guides | Docs | Getting started

Post Reply