Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZyGames.Test stress test tool is not work #13

Open
kybird opened this issue Feb 29, 2016 · 0 comments
Open

ZyGames.Test stress test tool is not work #13

kybird opened this issue Feb 29, 2016 · 0 comments

Comments

@kybird
Copy link

kybird commented Feb 29, 2016

version 6.7.9.10

it will not work. because it doesn't have model script..

ScriptEngines.cs

        private static ScriptRuntimeScope InitScriptRuntimeScope()
        {
            //star compile
            if (Interlocked.Exchange(ref _isCompiling, 1) == 0)
            {
                ScriptRuntimeDomain runtimeDomain = null;
                try
                {
                    string runtimePath = MathUtils.RuntimePath ?? MathUtils.RuntimeBinPath;
                    AppDomain.CurrentDomain.AppendPrivatePath(ScriptCompiler.ScriptPath);
                    runtimeDomain = new ScriptRuntimeDomain(typeof(ScriptRuntimeDomain).Name, new[] { _settupInfo.RuntimePrivateBinPath, ScriptCompiler.ScriptPath });
                    foreach (var assemblyName in _settupInfo.ReferencedAssemblyNames)
                    {
                        //排除System的dll
                        if (string.IsNullOrEmpty(assemblyName) ||
                            !Path.IsPathRooted(assemblyName)) continue;
                        string key = Path.GetFileNameWithoutExtension(assemblyName);
                        runtimeDomain.LoadAssembly(key, assemblyName);
                    }
                    var scope = runtimeDomain.CreateScope(_settupInfo);

                    // FAILED HERE BECAUSE IT DOES NOT HAVE MODEL SCRIPT
                    if (scope == null || scope.ModelAssembly == null) return scope;


                    bool isFirstRun = _runtimeDomain == null;
                    if (!isFirstRun && _settupInfo.ModelChangedBefore != null)
                    {
                        _settupInfo.ModelChangedBefore(_runtimeDomain.Scope.ModelAssembly);
                    }
                    runtimeDomain.MainInstance = runtimeDomain.Scope.Execute(_settupInfo.ScriptMainProgram, _settupInfo.ScriptMainTypeName) as IMainScript;
                   // NEVER COME HERE
                    _runtimeDomain = runtimeDomain;

Remark the IF statement or Add Dummy entity in Model folder

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant