1. Home
  2. Docs
  3. UniREST Solution 3.5
  4. Getting Started
  5. What’s new
  6. 3.2

3.2

Version 3.2

This version comes with 3 important changes and improvements:

  • the sync methods are now marked as deprecated;
  • the Token system has some changes;
  • a new FileManager class is now available for better online files management.

Deprecated sync methods

Sync methods are now marked as “deprecated”: they are still working, but they won’t be supported or extended in the future. Those are the reasons why those methods have been deprecated:

  1. sync methods block the Unity project execution. This is acceptable no more. Everything in Unity works in an async logic, so UniREST has to follow the same logic;
  2. sync methods don’t work in the WebGL platform. There’s no reason to continue upgrading a system with such limitations when the async methods support this platform too;
  3. sync methods consume Unity resources. Async methods use the UniTask framework to work in parallel using fewer resources;
  4. async logic is a more modern and professional approach for developing in Unity (IMO).

Token system changes

In the sync logic, the security Tokens were updated automatically. This was possible because login, reading and writing operations were executed one by one and they couldn’t overlap each other.

In the async logic, the Tokens can’t change automatically, because operations can be executed in parallel. For example, if two writing processes happen at the same time, the first operation changes the “Writing Token” and the second operation fails because it’s still using the “old” token.

For this reason, in the async logic, the Tokens for reading and writing have to be changed manually, using the UpdateToken() method (click here for details). This method should be used in a strategic way when you are sure that reading and/or writing operations are completed.

There is a little change in the “Login Token” when you use the ApplicationLogin() method (click here for details). This method automatically registers (and then logins) your Unity project as if it was a user. This approach is useful when your project needs to access online features and doesn’t require working with user accounts. In a scenario like this one, the “Login Token” can’t change for every login operation because the last logged in user would invalidate the other logins. So, if you use the ApplicationLogin() method, the “Login Token” is not automatically updated and you shouldn’t update the other tokens too.

Keep in mind that, however, this doesn’t low your system security because all the communications are encrypted.


FileManager class

When you use the File class to save (and load) online files, you can list and delete that files as well. However, these two operations are available for created files only and not for the uploaded files.

In order to offer better and full files management, the new FileManager class has been created (click here for details). This will work with both your created and uploaded files. Moreover, the new Rename(), Exists() and Size() methods are available for a complete file management.