From 1f914618538920db4bfec7b106ee97038b157c9b Mon Sep 17 00:00:00 2001 From: Wim Date: Thu, 22 Jun 2017 01:00:27 +0200 Subject: Add vendor (steam) --- .../Philipp15b/go-steam/social_events.go | 161 +++++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 vendor/github.com/Philipp15b/go-steam/social_events.go (limited to 'vendor/github.com/Philipp15b/go-steam/social_events.go') 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 +} -- cgit v1.2.3