Giter VIP home page Giter VIP logo

Comments (9)

Idles avatar Idles commented on July 17, 2024 1

I updated Steamworks.NET in the Unity Package Manager window and can now successfully call the API. Thanks for getting this fixed so quickly!

from steamworks.net.

ha-ves avatar ha-ves commented on July 17, 2024

Not sure if we can put PR for this, seem the repo almost out of life.
Add this in CodeGen/src/interfaces.py:

g_TypeDict = {
    ...
    "const int *": "ref int",
    "const uint16 *": "ref ushort",
    ...
}

from steamworks.net.

Idles avatar Idles commented on July 17, 2024

Thanks for the tip. ref int and ref ushort would only allow passing 1 int and 1 ushort, which also doesn't match the native method signature. Is it valid to specify int[] and ushort[]? I've seen some other methods that have parameters with the byte[] signature

from steamworks.net.

ha-ves avatar ha-ves commented on July 17, 2024

oh right sorry, didn't see the header file completely, yeah then that works

from steamworks.net.

rlabrecque avatar rlabrecque commented on July 17, 2024

Can you verify that int[] and ushort[] work?

If so we can get that change in this weekend. I think the spot to make a change is in g_SpecialArgsDict

from steamworks.net.

Idles avatar Idles commented on July 17, 2024

I'll give it a try and see if I can put a PR together; might not happen until the work week

from steamworks.net.

rlabrecque avatar rlabrecque commented on July 17, 2024

I don't need a full PR, I can do that pretty quickly, what I can't really do right now is verify that it works.

To test locally without having to regenerate everything you'd need to make two manual changes to both:

public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nNumLanes, out int pLanePriorities, out ushort pLaneWeights) {
InteropHelp.TestIfAvailableClient();
return NativeMethods.ISteamNetworkingSockets_ConfigureConnectionLanes(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, out pLanePriorities, out pLaneWeights);

public static extern EResult ISteamNetworkingSockets_ConfigureConnectionLanes(IntPtr instancePtr, HSteamNetConnection hConn, int nNumLanes, out int pLanePriorities, out ushort pLaneWeights);

Ultimately they should probably end up looking like say this: https://github.com/search?q=repo%3Arlabrecque%2FSteamworks.NET%20pvecDepots&type=code

from steamworks.net.

Idles avatar Idles commented on July 17, 2024

Thanks Riley

I made a mutable local copy of the Unity package and compiled successfully with the edits shown below. The method call succeeds at runtime and received k_EResultOK using this invocation:

Invocation:

var lanesResult = SteamNetworkingSockets.ConfigureConnectionLanes(conn, 3, new int[] {1, 2, 3}, new ushort[] {4, 5, 6});

Package edits:

[DllImport(NativeLibraryName, EntryPoint = "SteamAPI_ISteamNetworkingSockets_ConfigureConnectionLanes", CallingConvention = CallingConvention.Cdecl)]
public static extern EResult ISteamNetworkingSockets_ConfigureConnectionLanes(IntPtr instancePtr, HSteamNetConnection hConn, int nNumLanes, [In, Out] int[] pLanePriorities, [In, Out] ushort[] pLaneWeights);
public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nNumLanes, int[] pLanePriorities, ushort[] pLaneWeights) {
	InteropHelp.TestIfAvailableClient();
	return NativeMethods.ISteamNetworkingSockets_ConfigureConnectionLanes(CSteamAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, pLanePriorities, pLaneWeights);
}
public static EResult ConfigureConnectionLanes(HSteamNetConnection hConn, int nNumLanes, int[] pLanePriorities, ushort[] pLaneWeights) {
	InteropHelp.TestIfAvailableGameServer();
	return NativeMethods.ISteamNetworkingSockets_ConfigureConnectionLanes(CSteamGameServerAPIContext.GetSteamNetworkingSockets(), hConn, nNumLanes, pLanePriorities, pLaneWeights);
}

from steamworks.net.

rlabrecque avatar rlabrecque commented on July 17, 2024

Thanks @Idles ! Whenever you get a chance can you make sure that new commit fixes this accurately?

from steamworks.net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.