forked from chteufleur/go-xmpp4steam
53 lines
956 B
Go
53 lines
956 B
Go
package gateway
|
|
|
|
import (
|
|
"github.com/Philipp15b/go-steam"
|
|
)
|
|
|
|
const (
|
|
SentryDirectory = "sentries/"
|
|
resource = "go-xmpp4steam"
|
|
)
|
|
|
|
type GatewayInfo struct {
|
|
// Steam
|
|
SteamLogin string
|
|
SteamPassword string
|
|
SteamLoginInfo *steam.LogOnDetails
|
|
SteamClient *steam.Client
|
|
SentryFile string
|
|
FriendSteamId map[string]*StatusSteamFriend
|
|
SteamConnecting bool
|
|
Deleting bool
|
|
|
|
// XMPP
|
|
XMPP_JID_Client string
|
|
XMPP_Out chan interface{}
|
|
XMPP_Connected_Client map[string]bool
|
|
}
|
|
|
|
type StatusSteamFriend struct {
|
|
XMPP_Status string
|
|
XMPP_Type string
|
|
SteamGameName string
|
|
SteamName string
|
|
}
|
|
|
|
func (g *GatewayInfo) Run() {
|
|
go g.SteamRun()
|
|
}
|
|
|
|
func (g *GatewayInfo) SetSteamAuthCode(authCode string) {
|
|
g.SteamLoginInfo.AuthCode = authCode
|
|
}
|
|
|
|
func (g *GatewayInfo) Disconnect() {
|
|
g.XMPP_Disconnect()
|
|
go g.SteamDisconnect()
|
|
}
|
|
|
|
func (g *GatewayInfo) Delete() {
|
|
g.Deleting = true
|
|
g.Disconnect()
|
|
}
|