0

JSONAPI ライブラリ ( http://mcjsonapi.com/ ) の「callmultiple」関数を呼び出すと、UriFormatExeption がスローされます。ただし、「call」関数を呼び出すと、すべて機能します。以下に、エラーを生成するコードを示します。

JSONAPI j = new JSONAPI("minecraft20.omgserv.com", 40174, "username","password", "salt");
Dictionary<Object,Object> result = j.call("getServer",null); //all works
Dictionary<Object,Object) result2 = j.callMultiple(new string[] {"getServer", "getOfflinePlayers"},null) //UriFormatException is thrown

スタックトレース:

 System.UriFormatException n'a pas été gérée
    HResult=-2146233033
    Message=invalid uri : the authority/host could not be parse
    Source=System
    Stacktrace:
        at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
        at System.Uri..ctor(String uriString)
        at com.ramblingwood.minecraft.jsonapi.JSONAPI.makeURLMultiple(IEnumerable methods, IEnumerable args)
        at com.ramblingwood.minecraft.jsonapi.JSONAPI.callMultiple(IEnumerable methods, IEnumerable args)
        at MineControl.Server.Server.UpdateServer() dans c:\Users\frank\Documents\GitHub\MineControl\MineControl\Server\Server.cs:ligne 102
        at MineControl.Server.Server..ctor(String host, Int32 port, String id, String password, String salt) dans c:\Users\frank\Documents\GitHub\MineControl\MineControl\Server\Server.cs:ligne 56
        at MineControl.App..ctor() dans c:\Users\frank\Documents\GitHub\MineControl\MineControl\App.xaml.cs:ligne 26
        at MineControl.App.Main() dans c:\Users\frank\Documents\GitHub\MineControl\MineControl\obj\Debug\App.g.cs:ligne 0
        at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
        at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
        at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
        at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
        at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
        at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
        at System.Threading.ThreadHelper.ThreadStart()
    InnerException:

このコードが悪い理由がわからないので、助けてください。ありがとうございます

4

1 に答える 1