larsiusprime / SteamWrap

Haxe native extension for the Steam API
MIT License
106 stars 44 forks source link

Implemented networking & matchmaking APIs #17

Closed YellowAfterlife closed 5 years ago

YellowAfterlife commented 7 years ago

This covers the commonly used functions, much in parallels with my native extension for GameMaker.

Also added a few helper functions, although C++ side for non-prime functions still could look better.

Is being tested by early_melon and seems to be working accordingly.

larsiusprime commented 7 years ago

Much thanks! Has this been tested and verified as working (and/or at least compiling and not crashing) on Mac, Windows, and Linux?

YellowAfterlife commented 7 years ago

Only tested on Windows, but based on prior experience it is incredibly unlikely for something to not work on other systems if there's no platform-specific code (so long as the correct API version is used).

The following the can be used to easily validate that networking API is linked correctly (sending a packet to self):

var id = Steam.getSteamID();
var buf = Bytes.ofString("hello");
trace("Send: " + Steam.networking.sendPacket(id, buf, buf.length, RELIABLE));
Lib.current.addEventListener(Event.ENTER_FRAME, function(_) {
    while (Steam.networking.receivePacket()) {
        var src = Steam.networking.getPacketSender();
        var str = Steam.networking.getPacketData().toString();
        trace(src + ": " + str);
    }
});
larsiusprime commented 7 years ago

Cool, I'll review this and merge it in soon. Thanks for this contribution!

(I should really get some continuous integration set up for this library. )

jinjinjinK commented 6 years ago

I'm early_melon the guy testing the implementation of the network, matchmaking API made by YellowAfterlife. Everything works fine with it, I have one issue when monitoring performance with hxscout, SteamWrap makes the game crash at launch. I don't know if it's from this forked version or the main branch of steamwrap though.

larsiusprime commented 5 years ago

Better late than never?

jinjinjinK commented 5 years ago

Thanks a lot ! Is the issue with the crash when using hxscout being fixed too ?