code-disaster / steamworks4j

A thin Java wrapper to access the Steamworks API
https://code-disaster.github.io/steamworks4j/
MIT License
467 stars 64 forks source link

Super stuck/brickwalled. Where can I find help on auth tickets? #70

Closed goodnewsjimdotcom closed 6 years ago

goodnewsjimdotcom commented 6 years ago

Hello,

I have 500 hours into a game and I didn't expect to get stuck for four weeks on validating an auth ticket. I'm brickwalled hard. The steamworks documentation isn't very good, and steamworks4j relies on it. I desperately need help using Steamworks4j. Is there a forum some place maybe I could get help? If not, I can paypal(and in game loot) reward for an answer:

I have the auth ticket of 233 ints got from my Unity Client to my Java Server. I want to validate it from the Steam server.

What is wrong with my code: ByteBuffer bb;//java.nio bb=ByteBuffer.allocateDirect(1024);//the minimum I can set this number to is 936

for(i=0;i<len;i++)//len =234 bb.putInt(value[i] from an array);

SteamGameServerCallback sgsc=new SteamGameServerCallback(){autogen code}

SteamGameServer sgs = new SteamGameServer(sgsc);

SteamID sid= SteamId.createFromNativeHandle(765611xxxxxxxxxxxL);

//tested sid .isValid() and is true

BeginAuthSessionResult asr;

asr=sgs.beginAuthSession(bb,sid);/c++ version has three parameters instead of two: (void token, Int tokenLen, SteamId)... The Java just has two parameters ByteBuffer, SteamId */

System.out.println("Ticket:"+asr); // prints Ticket: InvalidTicket

To post on reddit about this if you need a contact outside git: https://www.reddit.com/r/javahelp/comments/8ihwqn/pretty_desperate_and_brick_walled_no_one_helping/?st=jh136f4h&sh=57dd28d0

goodnewsjimdotcom commented 6 years ago

Ok, I found my problem:

instead of bb.putint. It needs to be bb.put((byte)myvalueint)

I do not need help for now. :)

Thank you everyone for your cares and prayers.