• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. đź”—Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!
MindWorX
Reaction score
494

Profile posts Latest activity Postings Experience Resources About Medals

  • Hey there MindWorX, need some troubleshooting help:

    > System.IO.FileNotFoundException: Could not load file or assembly 'EasyHook, Version=2.7.4761.0...' or one of its dependencies. The system cannot find the file specified.

    I'm not understanding what's wrong: the EasyHook.dll and the 32/64 versions are in the bin/debug folder, and the Launcher's reference to EasyHook.dll in the Assemblies folder is valid.
    Hya, I have a problem with SharpCraft.
    The problem I am having is when I start a map, it will show the cmd window like it should but it says "Checking versions . . . Mismatch! To fix this, you need to update your addresses to version 1.27.0.52240."
    This error came after updating the game to 1.27

    I am ussually in the chat if you need more details.
    Oh right. If you want hosting, give me a shout. It would be an honor to host you.
    Yeah. But it has so much potential! Awesome that you are still working on it!

    I see that the project is in the Archived section. This seems wrong when you are working on it. Don't you agree? Shouldn't we move it back into the Hosted Projects category instead of the sub forum?
    Ok, I've switched them back to what I thought they had to be originally. Still crashing :( I've refocused my efforts on playing around with the sample stopwatch code you gave me, but I'm confused: Should I be using newGenEditor to put the code, or the 'Start Editor (debug)' program that's built with the source code you've made available? NewGen is the only one that doesn't complain about unregistered natives when I try to use this code:


    ----------
    function Trig_Untitled_Trigger_001_Actions takes nothing returns nothing
    local integer stopwatchId
    local real elapsedTimeMs = null

    stopwatchId = StopwatchGet() // gets a free Stopwatch
    PolledWait( 3.00 ) // give the stopwatch some time to count...
    elapsedTimeMs = StopwatchElapsedMilliseconds()

    // print time to user
    call DisplayTextToForce( GetPlayersAll(), R2S(elapsedTimeMs) )
    endfunction

    //===========================================================================
    function InitTrig_Untitled_Trigger_001 takes nothing returns nothing
    set gg_trg_Untitled_Trigger_001 = CreateTrigger( )
    call TriggerAddAction( gg_trg_Untitled_Trigger_001, function Trig_Untitled_Trigger_001_Actions )
    endfunction
    ----------
    Tried rewriting the older HTTP plugin to use the new IPlugin interface. Whereas the previous plugin worked for a simple HTTP map my friend and I cooked up, the new plugin causes the game to crash:



    Any ideas? I'm uncertain about the JassStringArg vs. JassStringRet. Which one should I be using? Could this be the reason for the crash?


    ----------
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using TinkerWorX.SharpCraft;
    using MindWorX.SharpCraft.Modules.JassAPI;
    using System.Net;
    using System.IO;

    namespace Http
    {
    [Requires(typeof(JassAPIPlugin))]
    public class HttpPlugin : IPlugin
    {
    public void Initialize(PluginContext context)
    {
    // the context is used to make game/editor specific initializing
    // for this plugin all we care about is the game
    if (context != PluginContext.Game)
    return;

    Natives.Add(new HttpRequestPrototype(this.HttpRequest));
    }

    public void OnGameLoad(PluginContext context)
    {
    // the context is used to make game/editor specific initializing
    // for this plugin all we care about is the game
    if (context != PluginContext.Game)
    return;
    }

    private delegate JassStringArg HttpRequestPrototype(JassStringArg method, JassStringArg url, JassStringArg cookies, JassStringArg values);
    private JassStringArg HttpRequest(JassStringArg method, JassStringArg url, JassStringArg cookies, JassStringArg values)
    {
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
    CookieContainer container = new CookieContainer();
    req.Method = method;
    req.UserAgent = "Warcraft III";
    req.ContentType = "application/x-www-form-urlencoded";

    Uri uri = new Uri(url);

    if (cookies != "")
    {
    string[] cookArr = cookies.ToString().Split(new string[] { ";" }, StringSplitOptions.None);
    string[] temp;
    foreach (string cook in cookArr)
    {
    if (cook.Contains("="))
    {
    temp = cook.Split(new string[] { "=" }, StringSplitOptions.None);
    container.Add(uri, new Cookie(temp[0], temp[1]));
    }
    }
    }

    req.CookieContainer = container;

    System.Net.ServicePointManager.Expect100Continue = false;
    // prevents 417 error

    if(values != "")
    using (StreamWriter writer = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII))
    {
    writer.Write(values);
    }

    HttpWebResponse response = (HttpWebResponse)req.GetResponse();

    StreamReader reader = new StreamReader(req.GetResponse().GetResponseStream());
    string output = reader.ReadToEnd();
    reader.Close();

    return output;
    }
    }
    }
    ----------
    Thanks, 'unblock'ing the dlls has fixed the issue with the plugins not being loaded correctly.

    I've been testing a map with someone else that we call 'Server Test', it is just a simple map to send an HTTP request and return data in a game of two players. It used to work in Local Area Network on the previous version of SharpCraft (v3...).

    Now on Battle.Net we try to test it together on the new version of SharpCraft v4.0.0.136 and get a peculiar error:

    Actually, this is the first time we've tried testing over Battle.Net. In the past we've always used LAN. Is there some sort of security measure that you know of that Blizzard has in place that is preventing us from hosting this map? Or could it be a local security feature like User Account Control. We both have tried running Launcher.exe as an administrator.

    Further, in the past I've also been able to play said Server Test map by myself in Single Player or LAN. Now when I try to load the map I cannot get into the lobby phase. The wc3 menus just animate as they do and I'm back in the map-selection screen. As shown in the screenshot below, this is after I try to host the map in LAN and the debug window seems fine with no errors, and loading all those war3map files.

    [IMG]

    Is this an issue with plugin compatibility (I'm still using the old plugins, e.g. Http.cs -> Http.dll)? I'd assumed that since there were no errors on startup with loading these plugins that they were OK, but this may be the issue here, in which case I'd need to write an updated version of the plugins.
    That is correct, the JassAPI plugin was not in the plugins folder. However, I did try putting it in the folder in the past in order to resolve this issue, and it looks like another error pops up, this time with WarAPI:

    Error when JassAPI is present in the Plugins folder...

    ----------
    Preparing folders . . .
    Done! (0.09 ms)
    Loading plugins from 'L:\Users\chief\Desktop\SharpCraft\SharpCraft-4.0.0.136\TinkerWorX.SharpCraft.Launcher\bin\Debug\plugins' . . .
    Locating plugins . . .
    File: Http.dll
    File: Input.dll
    File: Interface.dll
    File: MindWorX.Modules.Stopwatch.dll
    Type: MindWorX.Modules.Stopwatch.StopwatchPlugin
    File: MindWorX.SharpCraft.Modules.JassAPI.dll
    Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
    at System.Reflection.RuntimeModule.GetTypes()
    at System.Reflection.Assembly.GetTypes()
    at TinkerWorX.SharpCraft.PluginSystem.LoadPlugins(String folder, PluginContext context) in L:\Users\chief\Desktop\SharpCraft\jassnewgenpack207\SharpCraft-4.0.0.136\TinkerWorX.SharpCraft\PluginSystem.cs:line 46
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.WarAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.WarAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.WarAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.WarAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.WarAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    File: StopWatch.dll
    File: String.dll
    Done! (90.84 ms)
    Loading plugin assemblies and instanciating types. . .
    ----------

    Since it's complaining about WarAPI, I've tried placing WarAPI in the plugins directory as well, and I get this:



    Something about sandboxing and networking.. Lidgren.Network.dll is in the folder from which I'm running Launcher.exe. Is there a setting/flag I'm missing? Excerpt taken from the screenshot:


    ----------
    An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. [...] does not enable CAS policy by default, so this load may be dangerous. [...] enable the loadFromRemoteSources switch.
    ----------
    Should I enable this so-called 'loadFromRemoteSources' switch?
    Ok I'm almost there I think. The new stopwatch plugin which I've been using is still getting upset though, when it loads in Launcher.exe. Here is the plugin:

    Then I get this mess when running Launcher.exe with the stopwatch.dll in the plugins folder...

    ----------
    Loading plugins from 'L:\Users\chief\Desktop\SharpCraft\SharpCraft-4.0.0.136\TinkerWorX.SharpCraft.Launcher\bin\Debug\plugins' . . .
    Locating plugins . . .
    File: Http.dll
    File: Input.dll
    File: Interface.dll
    File: MindWorX.Modules.Stopwatch.dll
    Exception: System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
    at System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
    at System.Reflection.RuntimeModule.GetTypes()
    at System.Reflection.Assembly.GetTypes()
    at TinkerWorX.SharpCraft.PluginSystem.LoadPlugins(String folder, PluginContext context) in L:\Users\chief\Desktop\SharpCraft\jassnewgenpack207\SharpCraft-4.0.0.136\TinkerWorX.SharpCraft\PluginSystem.cs:line 46
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.JassAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.JassAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.JassAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    LoaderException: System.IO.FileLoadException: Cannot resolve dependency to assembly 'MindWorX.SharpCraft.Modules.JassAPI, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' because it has not been preloaded. When using the ReflectionOnly APIs, dependent assemblies must be pre-loaded or loaded on demand through the ReflectionOnlyAssemblyResolve event.
    File: StopWatch.dll
    File: String.dll
    Done! (24.61 ms)
    ----------
    It looks like the dependency on JassAPIPlugin is failing, and complaining about some pre-loading stuff. Does this mean that things are not being loaded in the correct order?


    - - -
    In response to your documentation, I think a post for each module would work very well! If I can get this plugin to work, I'd love to re-write the older plugins to be aligned with the new plugin framework you've made, in which case I can contribute some documentation.
    That worked, I missed that module. Will I need to grab the WarAPI as well? The compiler has no complaints so far about other things being missing..

    In the previous version, v3, running `Start game windowed` would launch Sharpcraft.exe with some flags. In this version it looks like you've gotten rid of that in favor of the Launcher.exe. While it is not yet implemented, I've simply copied over the Sharpcraft.exe along with the old plugins and modified the batch file, although I'm sure that the script compilation errors were caused by this. Is this not a safe practice to be using the old Sharpcraft.exe?

    So with the new version, v4, is there a good way to launch wc3 as we used to in v3, or should be continue to use Sharpcraft.exe? Also, does this mean Lidgren.Network.dll is obsolete in the new version?
    Thanks for updating this. I'm almost there, the only issue: where is MindWorX.SharpCraft.Modules.JassAPI defined? Am I missing a dll?

    I've downloaded the v4 zip from Github and built the TinkerWorX.SharpCraft project, and imported SharpCraft.dll into the Stopwatch example. Now all that's left is to find the missing directive above.

    - Chief
    Hi MindWorX,

    I've downloaded your source code for SharpCraft from the github repo and am trying to practice making plugins (in this case, I'm just rewriting the StopWatch plugin to familiarize myself with the plugin process).

    I've noticed in the StopWatch.cs file you've imported TinkerWorX.SharpCraft.Game(.Jass).

    However, when I open the .sln and try to write the plugin for scratch, Game is not found under SharpCraft (see: [IMG]
    How exactly do I get this to recognize TinkerWorX.SharpCraft.Game? Once I get that settled, do I just build the entire project and get the .dlls? In essence, how do you most easily create a plugin and then export it as a .dll?

    Thanks for the help!

    ~ Chief
    Yes that's where one puts it normally and where it should be if we have 1 Sharpcraft per 1 wc3 folder, right?
    ----------
    That's definitely doable. Lemme see if I can cook something up. Would a commandline argument be okay? Something like: -path "C:\Games\Warcraft III\"
    ----------
    An optimal priority for checking for war3.exe might be:
    1. Command line argument
    if not existant
    2. parent folder
    if not existant
    3. registry keys

    This does allow an custom path but does not require one, also you can have multiple wc3/Sharpcrafts per computer.
    Hey MindWorX. What do you think about letting SharpCraft only check for war3.exe in it's parent folder? Checking via registry keys prohibits multiple installations of Sharpcraft/wc3 on one computer and can cause problems, as seen here for example. After some bug search it was determined that it was SharpCraft's "fault" I could not copy my wc3 folder and test new tools (which include SharpCraft) with the copy.
    No problem man, I can do it still... I can go to my gmail account and send him mail. yes, site has option to send mail via this field, but still with your own mail you are sure. I am not sure how this works...
    [22-45-12] MasterHaosis: MindWorX, sorry
    [22-45-14] MasterHaosis: I was afk
    [22-45-25] MasterHaosis: MindWorX, I can try. What do you need?
    Something odd (I know I should report to github).

    When using sharpcraft I2S(GetRandomInt) returns "st@y!" ? lol
    halp.. im getting a bunch of access denied errors when i run your sharpcraft at fist i figured it was my antivirus so i turned it off but then i got the error box, and every time after that i got all the erros in the cmd regardless of weither the antivirus was on or off

  • Loading…
  • Loading…
  • Loading…
  • Loading…
  • Loading…
  • Loading…
Top