summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Philipp15b/go-steam/trade/doc.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-06-22 01:00:27 +0200
committerWim <wim@42.be>2017-06-22 01:00:27 +0200
commit1f914618538920db4bfec7b106ee97038b157c9b (patch)
tree6bd0ab107fe1673dbacdf9dfd10004289cd7bfab /vendor/github.com/Philipp15b/go-steam/trade/doc.go
parent1f9874102aaca09ce5e0289beff376c307b8c57b (diff)
downloadmatterbridge-msglm-1f914618538920db4bfec7b106ee97038b157c9b.tar.gz
matterbridge-msglm-1f914618538920db4bfec7b106ee97038b157c9b.tar.bz2
matterbridge-msglm-1f914618538920db4bfec7b106ee97038b157c9b.zip
Add vendor (steam)
Diffstat (limited to 'vendor/github.com/Philipp15b/go-steam/trade/doc.go')
-rw-r--r--vendor/github.com/Philipp15b/go-steam/trade/doc.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/vendor/github.com/Philipp15b/go-steam/trade/doc.go b/vendor/github.com/Philipp15b/go-steam/trade/doc.go
new file mode 100644
index 00000000..549ad47d
--- /dev/null
+++ b/vendor/github.com/Philipp15b/go-steam/trade/doc.go
@@ -0,0 +1,40 @@
+/*
+Allows automation of Steam Trading.
+
+Usage
+
+Like go-steam, this package is event-based. Call Poll() until the trade has ended, that is until the TradeEndedEvent is emitted.
+
+ // After receiving the steam.TradeSessionStartEvent
+ t := trade.New(sessionIdCookie, steamLoginCookie, steamLoginSecure, event.Other)
+ for {
+ eventList, err := t.Poll()
+ if err != nil {
+ // error handling here
+ continue
+ }
+ for _, event := range eventList {
+ switch e := event.(type) {
+ case *trade.ChatEvent:
+ // respond to any chat message
+ t.Chat("Trading is awesome!")
+ case *trade.TradeEndedEvent:
+ return
+ // other event handlers here
+ }
+ }
+ }
+
+You can either log into steamcommunity.com and use the values of the `sessionId` and `steamLogin` cookies,
+or use go-steam and after logging in with client.Web.LogOn() and receiving the WebLoggedOnEvent use the `SessionId`
+and `SteamLogin` fields of steam.Web for the respective cookies.
+
+It is important that there is no delay between the Poll() calls greater than the timeout of the Steam client
+(currently five seconds before the trade partner sees a warning) or the trade will be closed automatically by Steam.
+
+Notes
+
+All method calls to Steam APIs are blocking. This packages' and its subpackages' types are not thread-safe and no calls to any method of the same
+trade instance may be done concurrently except when otherwise noted.
+*/
+package trade