cancel
Showing results for 
Search instead for 
Did you mean: 

Access Version Number of Currently Running Unity Script

Sam_Walker
Confirmed Champ
Confirmed Champ

We have a very common issue where, after publishing a new active version of a Unity script, many of our users running the web client or the Unity client still execute the previous version of the script, even after those users log out and back in. Pressing the "Reset Server Cache" button does not always resolve the issue. Often the only way to fix it is to reset the web server, but that cannot be done during business hours as it would end all connected users' sessions.

I do not know of a way to resolve this issue. However, one thing that would helpful is for us to be able to confirm what version of the script our users are executing. We would like to be able to output the version number of the Unity script to the Diagnostic Console while it is running. I searched through the SDK documentation but did not find anything related to this. Could this be added to the API? Or does it already exist?

1 ACCEPTED ANSWER

Chris_Tucker
Star Contributor
Star Contributor

Hi Sam,

I'd recommend that you contact your first line of support regarding this issue. Resetting the cache should cause your scripts to be updated, but it sounds like something is going wrong. Your first line of support will be able to assist in diagnosing this. We do not expose the version of the script through the API, since the expectation is that every script will be running the active version.

Also, there is a bug in version 12 which can cause a memory leak when the server cache is reset after a script is run on the server. We recommend that you try to limit the number of times the cache is reset in order to minimize the memory leak. This issue has been fixed in versions 13+.

Please let me know if you have any questions!

Chris

View answer in original post

3 REPLIES 3

Thomas_Reu
Elite Collaborator
Elite Collaborator

There may well be another way, but if you alter your paradigm for a low tech solution, then I would say:  Don't publish new software until off hours then you can run a reset right after publishing...

Chris_Tucker
Star Contributor
Star Contributor

Hi Sam,

I'd recommend that you contact your first line of support regarding this issue. Resetting the cache should cause your scripts to be updated, but it sounds like something is going wrong. Your first line of support will be able to assist in diagnosing this. We do not expose the version of the script through the API, since the expectation is that every script will be running the active version.

Also, there is a bug in version 12 which can cause a memory leak when the server cache is reset after a script is run on the server. We recommend that you try to limit the number of times the cache is reset in order to minimize the memory leak. This issue has been fixed in versions 13+.

Please let me know if you have any questions!

Chris

I think this is no longer completely true in latest versions of 13/14/15 in an environment with multiple App Servers.

See this discussion:
www.onbase.com/.../21287

My understanding from that discussion is that Reset Server Cache in terms of Unity scripts has been intentionally crippled as a workaround for previous bugs. We have not yet tested it in an affected environment (working on a development environment 15 upgrade now, from an unaffected 13 build) so I can't confirm from direct experience.