Hash the server assembly from GetLoadedAssemblyPath on Unity 6.7 and later
ServerMgr hashes Assembly-CSharp's file for the server's assembly hash and
reports "il2cpp" when Assembly.Location is empty, which it is for any
assembly loaded from an image rather than a file. Unity 6.7 adds
GetLoadedAssemblyPath(), the path Unity loaded the assembly from, and the
6.7 and CoreCLR branch uses it here instead of Location.
Hand-ported from the runtime part of unity_6.7.0's changeset
169806" class="changeset">
169806
(10ce1f6a9e0, "Use new Unity APIs for GetAssemblies()"). The API doesn't
exist in Unity 6.3, so the change sits behind UNITY_6000_7_OR_NEWER and
main's 6.3 build is unchanged. The rest of
169806" class="changeset">
169806 swaps
AppDomain.GetAssemblies() for CurrentAssemblies.GetLoadedAssemblies() in
editor tools and test helpers, which matters to the CoreCLR editor's
assembly reloading; that arrives with 6.7 itself, and a guarded copy here
would only conflict with it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>