diff options
author | Wim <wim@42.be> | 2017-06-22 01:00:27 +0200 |
---|---|---|
committer | Wim <wim@42.be> | 2017-06-22 01:00:27 +0200 |
commit | 1f914618538920db4bfec7b106ee97038b157c9b (patch) | |
tree | 6bd0ab107fe1673dbacdf9dfd10004289cd7bfab /vendor/github.com/Philipp15b/go-steam/social_events.go | |
parent | 1f9874102aaca09ce5e0289beff376c307b8c57b (diff) | |
download | matterbridge-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/social_events.go')
-rw-r--r-- | vendor/github.com/Philipp15b/go-steam/social_events.go | 161 |
1 files changed, 161 insertions, 0 deletions
diff --git a/vendor/github.com/Philipp15b/go-steam/social_events.go b/vendor/github.com/Philipp15b/go-steam/social_events.go new file mode 100644 index 00000000..f17a650a --- /dev/null +++ b/vendor/github.com/Philipp15b/go-steam/social_events.go @@ -0,0 +1,161 @@ +package steam + +import ( + . "github.com/Philipp15b/go-steam/protocol/steamlang" + . "github.com/Philipp15b/go-steam/steamid" + "time" +) + +type FriendsListEvent struct{} + +type FriendStateEvent struct { + SteamId SteamId `json:",string"` + Relationship EFriendRelationship +} + +func (f *FriendStateEvent) IsFriend() bool { + return f.Relationship == EFriendRelationship_Friend +} + +type GroupStateEvent struct { + SteamId SteamId `json:",string"` + Relationship EClanRelationship +} + +func (g *GroupStateEvent) IsMember() bool { + return g.Relationship == EClanRelationship_Member +} + +// Fired when someone changing their friend details +type PersonaStateEvent struct { + StatusFlags EClientPersonaStateFlag + FriendId SteamId `json:",string"` + State EPersonaState + StateFlags EPersonaStateFlag + GameAppId uint32 + GameId uint64 `json:",string"` + GameName string + GameServerIp uint32 + GameServerPort uint32 + QueryPort uint32 + SourceSteamId SteamId `json:",string"` + GameDataBlob []byte + Name string + Avatar string + LastLogOff uint32 + LastLogOn uint32 + ClanRank uint32 + ClanTag string + OnlineSessionInstances uint32 + PublishedSessionId uint32 + PersonaSetByUser bool + FacebookName string + FacebookId uint64 `json:",string"` +} + +// Fired when a clan's state has been changed +type ClanStateEvent struct { + ClandId SteamId `json:",string"` + StateFlags EClientPersonaStateFlag + AccountFlags EAccountFlags + ClanName string + Avatar string + MemberTotalCount uint32 + MemberOnlineCount uint32 + MemberChattingCount uint32 + MemberInGameCount uint32 + Events []ClanEventDetails + Announcements []ClanEventDetails +} + +type ClanEventDetails struct { + Id uint64 `json:",string"` + EventTime uint32 + Headline string + GameId uint64 `json:",string"` + JustPosted bool +} + +// Fired in response to adding a friend to your friends list +type FriendAddedEvent struct { + Result EResult + SteamId SteamId `json:",string"` + PersonaName string +} + +// Fired when the client receives a message from either a friend or a chat room +type ChatMsgEvent struct { + ChatRoomId SteamId `json:",string"` // not set for friend messages + ChatterId SteamId `json:",string"` + Message string + EntryType EChatEntryType + Timestamp time.Time + Offline bool +} + +// Whether the type is ChatMsg +func (c *ChatMsgEvent) IsMessage() bool { + return c.EntryType == EChatEntryType_ChatMsg +} + +// Fired in response to joining a chat +type ChatEnterEvent struct { + ChatRoomId SteamId `json:",string"` + FriendId SteamId `json:",string"` + ChatRoomType EChatRoomType + OwnerId SteamId `json:",string"` + ClanId SteamId `json:",string"` + ChatFlags byte + EnterResponse EChatRoomEnterResponse + Name string +} + +// Fired in response to a chat member's info being received +type ChatMemberInfoEvent struct { + ChatRoomId SteamId `json:",string"` + Type EChatInfoType + StateChangeInfo StateChangeDetails +} + +type StateChangeDetails struct { + ChatterActedOn SteamId `json:",string"` + StateChange EChatMemberStateChange + ChatterActedBy SteamId `json:",string"` +} + +// Fired when a chat action has completed +type ChatActionResultEvent struct { + ChatRoomId SteamId `json:",string"` + ChatterId SteamId `json:",string"` + Action EChatAction + Result EChatActionResult +} + +// Fired when a chat invite is received +type ChatInviteEvent struct { + InvitedId SteamId `json:",string"` + ChatRoomId SteamId `json:",string"` + PatronId SteamId `json:",string"` + ChatRoomType EChatRoomType + FriendChatId SteamId `json:",string"` + ChatRoomName string + GameId uint64 `json:",string"` +} + +// Fired in response to ignoring a friend +type IgnoreFriendEvent struct { + Result EResult +} + +// Fired in response to requesting profile info for a user +type ProfileInfoEvent struct { + Result EResult + SteamId SteamId `json:",string"` + TimeCreated uint32 + RealName string + CityName string + StateName string + CountryName string + Headline string + Summary string +} |