Philipp15b / go-steam

Steam's protocol in Go to allow automation of different actions on the Steam network without running an actual Steam client. Includes APIs for friends, chatting, trading, trade offers and TF2 crafting.
https://pkg.go.dev/github.com/Philipp15b/go-steam/v3
Other
392 stars 131 forks source link

Is it possible to convert SteamId to SteamId64?? #43

Closed PanicIsReal closed 9 years ago

PanicIsReal commented 9 years ago

When getting trade offers OtherAccountId

It returns like a: STEAM_0:1:31561936

Is it possible to get a SteamId64 instead like:

76561198102055159

Any information would be great thanks looked through the steamid package but didn't see anything

b1naryth1ef commented 9 years ago

SteamId.ToUint64() will give you the uint64 version

PanicIsReal commented 9 years ago

I did that but I only get like a 5 digit number instead of the 17 digit one @b1naryth1ef

2015/08/27 00:05:51 Started Bot
2015/08/27 00:05:54 Logged Into Web
2015/08/27 00:05:54 Trading
2015/08/27 00:05:54 141789431

Is what I get

For this:

 52 func startTradeOfferBot() {
 53         log.Println("Trading")
 54         trader := tradeoffer.NewClient("APIKEY", client.Web.SessionId, client.Web.SteamLogin, client.Web.SteamLoginSecure)
 55
 56         offers, err := trader.GetOffers()
 57         if err != nil {
 58                 log.Println(err)
 59         }
 60
 61         for _, value := range offers.Received {
 62                 accId := value.OtherAccountId
 63
 64                 log.Println(accId.ToUint64())
 65         }
 66 }
PanicIsReal commented 9 years ago

I accomplished this buy doing:

accId := value.OtherAccountId.ToUint64()
accId = accId + 76561197960265728

the big number is just a static number that steam uses for whatever

which returns the 64 bit steam id