summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2018-08-06 21:47:05 +0200
committerWim <wim@42.be>2018-08-06 21:47:05 +0200
commit51062863a5c34d81e296cf15c61140911037cf3b (patch)
tree9b5e044672486326c7a0ca8fb26430f37bf4d83c /vendor/github.com/Philipp15b/go-steam/tf2/tf2.go
parent4fb4b7aa6c02a54db8ad8dd98e4d321396926c0d (diff)
downloadmatterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.gz
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.tar.bz2
matterbridge-msglm-51062863a5c34d81e296cf15c61140911037cf3b.zip
Use mod vendor for vendored directory (backwards compatible)
Diffstat (limited to 'vendor/github.com/Philipp15b/go-steam/tf2/tf2.go')
-rw-r--r--vendor/github.com/Philipp15b/go-steam/tf2/tf2.go75
1 files changed, 0 insertions, 75 deletions
diff --git a/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go b/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go
deleted file mode 100644
index 334362de..00000000
--- a/vendor/github.com/Philipp15b/go-steam/tf2/tf2.go
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
-Provides access to TF2 Game Coordinator functionality.
-*/
-package tf2
-
-import (
- "github.com/Philipp15b/go-steam"
- . "github.com/Philipp15b/go-steam/protocol/gamecoordinator"
- . "github.com/Philipp15b/go-steam/tf2/protocol"
- "github.com/Philipp15b/go-steam/tf2/protocol/protobuf"
-)
-
-const AppId = 440
-
-// To use any methods of this, you'll need to SetPlaying(true) and wait for
-// the GCReadyEvent.
-type TF2 struct {
- client *steam.Client
-}
-
-// Creates a new TF2 instance and registers it as a packet handler
-func New(client *steam.Client) *TF2 {
- t := &TF2{client}
- client.GC.RegisterPacketHandler(t)
- return t
-}
-
-func (t *TF2) SetPlaying(playing bool) {
- if playing {
- t.client.GC.SetGamesPlayed(AppId)
- } else {
- t.client.GC.SetGamesPlayed()
- }
-}
-
-func (t *TF2) SetItemPosition(itemId, position uint64) {
- t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCSetSingleItemPosition), &MsgGCSetItemPosition{
- itemId, position,
- }))
-}
-
-// recipe -2 = wildcard
-func (t *TF2) CraftItems(items []uint64, recipe int16) {
- t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCCraft), &MsgGCCraft{
- Recipe: recipe,
- Items: items,
- }))
-}
-
-func (t *TF2) DeleteItem(itemId uint64) {
- t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCDelete), &MsgGCDeleteItem{itemId}))
-}
-
-func (t *TF2) NameItem(toolId, target uint64, name string) {
- t.client.GC.Write(NewGCMsg(AppId, uint32(protobuf.EGCItemMsg_k_EMsgGCNameItem), &MsgGCNameItem{
- toolId, target, name,
- }))
-}
-
-type GCReadyEvent struct{}
-
-func (t *TF2) HandleGCPacket(packet *GCPacket) {
- if packet.AppId != AppId {
- return
- }
- switch protobuf.EGCBaseClientMsg(packet.MsgType) {
- case protobuf.EGCBaseClientMsg_k_EMsgGCClientWelcome:
- t.handleWelcome(packet)
- }
-}
-
-func (t *TF2) handleWelcome(packet *GCPacket) {
- // the packet's body is pretty useless
- t.client.Emit(&GCReadyEvent{})
-}