Пример #1
0
 public bool SetLobbyMemberLimit(CSteamID steamIDLobby, Int32 cMaxMembers)
 {
     return(this.GetFunction <NativeSetLobbyMemberLimitCI>(this.Functions.SetLobbyMemberLimit24)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), cMaxMembers));
 }
Пример #2
0
 public bool SetLobbyType(CSteamID steamIDLobby, ELobbyType eLobbyType)
 {
     return(this.GetFunction <NativeSetLobbyTypeCE>(this.Functions.SetLobbyType26)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), eLobbyType));
 }
Пример #3
0
 public Int32 GetLobbyChatEntry(CSteamID steamIDLobby, Int32 iChatID, ref CSteamID pSteamIDUser, Byte[] pvData, ref EChatEntryType peChatEntryType)
 {
     UInt64 s0 = 0; var result = this.GetFunction <NativeGetLobbyChatEntryCICBIE>(this.Functions.GetLobbyChatEntry20)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), iChatID, ref s0, pvData, (Int32)pvData.Length, ref peChatEntryType); pSteamIDUser = new CSteamID(s0); return(result);
 }
Пример #4
0
 public void SetLobbyGameServer(CSteamID steamIDLobby, UInt32 unGameServerIP, UInt16 unGameServerPort, CSteamID steamIDGameServer)
 {
     this.GetFunction <NativeSetLobbyGameServerCUUC>(this.Functions.SetLobbyGameServer22)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), unGameServerIP, unGameServerPort, steamIDGameServer.ConvertToUint64());
 }
        //all interfaces are a go, now callbacks and other necessary functions
        void stateChange(PersonaStateChange_t perState)
        {
            CSteamID stateChangeUId = new CSteamID(perState.m_ulSteamID);
            EPersonaState newState = steamFriends.GetFriendPersonaState(stateChangeUId);

            string uName = steamFriends.GetFriendPersonaName(stateChangeUId);
            //if (newState == EPersonaState.k_EPersonaStateOffline)
                //person is offline, remove from pug

            Program.logToWindow(uName + " (" + perState.m_ulSteamID + "/" + stateChangeUId + ") changed state to " + newState);
        }
Пример #6
0
 public void SetLobbyMemberData(CSteamID steamIDLobby, string pchKey, string pchValue)
 {
     this.GetFunction <NativeSetLobbyMemberDataCSS>(this.Functions.SetLobbyMemberData18)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), pchKey, pchValue);
 }
Пример #7
0
 public CSteamID GetFriendFromSourceByIndex(CSteamID steamIDSource, Int32 iFriend)
 {
     UInt64 ret = 0; this.GetFunction <NativeGetFriendFromSourceByIndexCI>(this.Functions.GetFriendFromSourceByIndex16)(this.ObjectAddress, ref ret, steamIDSource.ConvertToUint64(), iFriend); return(new CSteamID(ret));
 }
Пример #8
0
        void ChatMsg( FriendChatMsg_t chatMsg )
        {
            
            byte[] msgData = new byte[ 1024 * 4 ];
            EChatEntryType type = EChatEntryType.k_EChatEntryTypeChatMsg;

            CSteamID reciever = new CSteamID( chatMsg.m_ulReceiver );

            int msgLength = steamFriends.GetChatMessage( chatMsg.m_ulReceiver, ( int )chatMsg.m_iChatID, msgData, msgData.Length, ref type );

            if ( type == EChatEntryType.k_EChatEntryTypeTyping )
                return;

            msgLength = Clamp( msgLength, 1, msgData.Length );

            LogMessage log = new LogMessage();

            log.Sender = new CSteamID( chatMsg.m_ulSender );
            log.SenderName = steamFriends.GetFriendPersonaName( log.Sender );

            log.Reciever = reciever;
            log.RecieverName = steamFriends.GetFriendPersonaName( log.Reciever );

            log.Message = Encoding.UTF8.GetString( msgData, 0, msgLength );
            log.Message = log.Message.Substring( 0, log.Message.Length - 1 );
            log.MessageTime = DateTime.Now;
            log.MessageType = type;

            AddLog( log );
        }
Пример #9
0
 public string GetClanName(CSteamID steamIDClan)
 {
     return(InteropHelp.DecodeANSIReturn(this.GetFunction <NativeGetClanNameC>(this.Functions.GetClanName14)(this.ObjectAddress, steamIDClan.ConvertToUint64())));
 }
Пример #10
0
 public Int32 GetFriendCountFromSource(CSteamID steamIDSource)
 {
     return(this.GetFunction <NativeGetFriendCountFromSourceC>(this.Functions.GetFriendCountFromSource15)(this.ObjectAddress, steamIDSource.ConvertToUint64()));
 }
Пример #11
0
 public bool HasFriend(CSteamID steamIDFriend, EFriendFlags iFriendFlags)
 {
     return(this.GetFunction <NativeHasFriendCE>(this.Functions.HasFriend11)(this.ObjectAddress, steamIDFriend.ConvertToUint64(), iFriendFlags));
 }
Пример #12
0
        public bool removePlayer(CSteamID steamID)
        {
            int playerIndex = GetPlayerIndex(steamID);

            if (playerIndex >= 0)
            {
                //player is in the pug
                string name = pugStatus.players[playerIndex, 1];

                pugStatus.players[playerIndex, 0] = null;
                pugStatus.players[playerIndex, 1] = null;

                Program.logToFile("Removed " + name + " (" + steamID + ") from the pug");

                this.sendBotCommand("REMOVEPLAYER!" + name + "!" + steamID.ToString());

                pugStatus.numPlayers -= 1;

                return true;
            }

            return false;
        }
Пример #13
0
        public int GetPlayerIndex(CSteamID steamID)
        {
            for (int i = 0; i < pugStatus.players.GetLength(0); i++)
            {
                Program.logToWindow("Checking row " + i + " for SteamID " + steamID.ToString() + ". Array values: ID: \n"
                    + pugStatus.players[i, 0] + " Name: " + pugStatus.players[i, 1]);

                if (pugStatus.players[i, 0] == steamID.ToString())
                {
                    return i;
                }
            }

            return -1;
        }
Пример #14
0
 public bool GetUGCDetails(UInt64 hContent, ref UInt32 pnAppID, StringBuilder ppchName, ref Int32 pnFileSizeInBytes, ref CSteamID pSteamIDOwner)
 {
     UInt64 s0 = 0; var result = this.GetFunction <NativeGetUGCDetailsUUSIC>(this.Functions.GetUGCDetails19)(this.ObjectAddress, hContent, ref pnAppID, ppchName, ref pnFileSizeInBytes, ref s0); pSteamIDOwner = new CSteamID(s0); return(result);
 }
Пример #15
0
 public bool IsUserInSource(CSteamID steamIDUser, CSteamID steamIDSource)
 {
     return(this.GetFunction <NativeIsUserInSourceCC>(this.Functions.IsUserInSource17)(this.ObjectAddress, steamIDUser.ConvertToUint64(), steamIDSource.ConvertToUint64()));
 }
Пример #16
0
 public bool GetUGCDetails(UInt64 arg0, ref UInt32 arg1, StringBuilder arg2, ref Int32 arg3, ref CSteamID arg4)
 {
     UInt64 s0 = 0; var result = this.GetFunction <NativeGetUGCDetailsUUSIC>(this.Functions.GetUGCDetails18)(this.ObjectAddress, arg0, ref arg1, arg2, ref arg3, ref s0); arg4 = new CSteamID(s0); return(result);
 }
Пример #17
0
 public void SetInGameVoiceSpeaking(CSteamID steamIDUser, bool bSpeaking)
 {
     this.GetFunction <NativeSetInGameVoiceSpeakingCB>(this.Functions.SetInGameVoiceSpeaking18)(this.ObjectAddress, steamIDUser.ConvertToUint64(), bSpeaking);
 }
        void friendAdded(FriendAdded_t addedFriend)
        {
            Program.logToWindow("New friend. Sending greeting");
            Thread.Sleep(14000); //waiting 14 seconds so we're sure this new fella is our friend
            CSteamID newFriendId = new CSteamID(addedFriend.m_ulSteamID);
            string newFriendName = steamFriends.GetFriendPersonaName(newFriendId);

            sendMessage(newFriendId, "Hello there, " + newFriendName + ". I am the steam chat half of the "
                + "iPGN TF2 PUG bot. Commands available to you are: none", false);
            sendMessage(newFriendId, "If you need assistance, don't hesitate to join us on IRC, "
                + "#tf2pug @ irc.gamesurge.net. A simple widget is available at http://tf2pug.ipgn.com.au/irc/", false);

            ulong ipgnClanId = 103582791430132508;

            clientFriends.InviteFriendToClan(newFriendId, ipgnClanId);
        }
Пример #19
0
 public EFriendRelationship GetFriendRelationship(CSteamID steamIDFriend)
 {
     return(this.GetFunction <NativeGetFriendRelationshipC>(this.Functions.GetFriendRelationship5)(this.ObjectAddress, steamIDFriend.ConvertToUint64()));
 }
Пример #20
0
        public int addPlayer(CSteamID steamID, string name)
        {
            int playerIndex = GetPlayerIndex(steamID);

            if (playerIndex >= 0)
            {
                //already in the pug
                return 2; //status code 2 indicates this
            }

            for (int i = 0; i < pugStatus.players.GetLength(0); i++)
            {
                if (pugStatus.players[i, 0] == null)
                {
                    pugStatus.players[i, 0] = steamID.ToString();
                    pugStatus.players[i, 1] = name;

                    Program.logToFile("Added " + name + " (" + steamID + ") to the pug");

                    this.sendBotCommand("ADDPLAYER!" + name + "!" + steamID.ToString());

                    pugStatus.numPlayers += 1;

                    return 1;
                }
            }

            return 0;
        }
Пример #21
0
 public EPersonaState GetFriendPersonaState(CSteamID steamIDFriend)
 {
     return(this.GetFunction <NativeGetFriendPersonaStateC>(this.Functions.GetFriendPersonaState6)(this.ObjectAddress, steamIDFriend.ConvertToUint64()));
 }
Пример #22
0
 public bool SendLobbyChatMsg(CSteamID steamIDLobby, Byte[] pvMsgBody)
 {
     return(this.GetFunction <NativeSendLobbyChatMsgCBI>(this.Functions.SendLobbyChatMsg19)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), pvMsgBody, (Int32)pvMsgBody.Length));
 }
Пример #23
0
 public string GetFriendPersonaName(CSteamID steamIDFriend)
 {
     return(InteropHelp.DecodeANSIReturn(this.GetFunction <NativeGetFriendPersonaNameC>(this.Functions.GetFriendPersonaName7)(this.ObjectAddress, steamIDFriend.ConvertToUint64())));
 }
Пример #24
0
 public bool RequestLobbyData(CSteamID steamIDLobby)
 {
     return(this.GetFunction <NativeRequestLobbyDataC>(this.Functions.RequestLobbyData21)(this.ObjectAddress, steamIDLobby.ConvertToUint64()));
 }
Пример #25
0
 public Int32 GetFriendAvatar(CSteamID steamIDFriend)
 {
     return(this.GetFunction <NativeGetFriendAvatarC>(this.Functions.GetFriendAvatar8)(this.ObjectAddress, steamIDFriend.ConvertToUint64()));
 }
Пример #26
0
 public bool GetLobbyGameServer(CSteamID steamIDLobby, ref UInt32 punGameServerIP, ref UInt16 punGameServerPort, ref CSteamID psteamIDGameServer)
 {
     UInt64 s0 = 0; var result = this.GetFunction <NativeGetLobbyGameServerCUUC>(this.Functions.GetLobbyGameServer23)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), ref punGameServerIP, ref punGameServerPort, ref s0); psteamIDGameServer = new CSteamID(s0); return(result);
 }
Пример #27
0
 public UInt64 JoinLobby(CSteamID steamIDLobby)
 {
     UInt64 ret = 0; this.GetFunction <NativeJoinLobbyC>(this.Functions.JoinLobby10)(this.ObjectAddress, ref ret, steamIDLobby.ConvertToUint64()); return((UInt64)ret);
 }
Пример #28
0
 public Int32 GetLobbyMemberLimit(CSteamID steamIDLobby)
 {
     return(this.GetFunction <NativeGetLobbyMemberLimitC>(this.Functions.GetLobbyMemberLimit25)(this.ObjectAddress, steamIDLobby.ConvertToUint64()));
 }
Пример #29
0
 public void LeaveLobby(CSteamID steamIDLobby)
 {
     this.GetFunction <NativeLeaveLobbyC>(this.Functions.LeaveLobby11)(this.ObjectAddress, steamIDLobby.ConvertToUint64());
 }
Пример #30
0
 public CSteamID GetLobbyOwner(CSteamID steamIDLobby)
 {
     UInt64 ret = 0; this.GetFunction <NativeGetLobbyOwnerC>(this.Functions.GetLobbyOwner27)(this.ObjectAddress, ref ret, steamIDLobby.ConvertToUint64()); return(new CSteamID(ret));
 }
Пример #31
0
 public bool InviteUserToLobby(CSteamID steamIDLobby, CSteamID steamIDInvitee)
 {
     return(this.GetFunction <NativeInviteUserToLobbyCC>(this.Functions.InviteUserToLobby12)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), steamIDInvitee.ConvertToUint64()));
 }
Пример #32
0
 public UInt64 EnumerateUserSharedWorkshopFiles(UInt32 nAppId, CSteamID creatorSteamID, UInt32 uStartIndex, ref SteamParamStringArray_t pRequiredTags, ref SteamParamStringArray_t pExcludedTags)
 {
     return(this.GetFunction <NativeEnumerateUserSharedWorkshopFilesUCUSS>(this.Functions.EnumerateUserSharedWorkshopFiles42)(this.ObjectAddress, nAppId, creatorSteamID.ConvertToUint64(), uStartIndex, ref pRequiredTags, ref pExcludedTags));
 }
Пример #33
0
 public Int32 GetNumLobbyMembers(CSteamID steamIDLobby)
 {
     return(this.GetFunction <NativeGetNumLobbyMembersC>(this.Functions.GetNumLobbyMembers13)(this.ObjectAddress, steamIDLobby.ConvertToUint64()));
 }
Пример #34
0
 /// <summary>
 /// Initialize a new <c>SteamFriend</c>.
 /// </summary>
 /// <param name="steamID"><see cref="CSteamID" /> of this friend.</param>
 internal SteamFriend(CSteamID steamID)
 {
     SteamID = steamID;
 }
Пример #35
0
 public CSteamID GetLobbyMemberByIndex(CSteamID steamIDLobby, Int32 iMember)
 {
     UInt64 ret = 0; this.GetFunction <NativeGetLobbyMemberByIndexCI>(this.Functions.GetLobbyMemberByIndex14)(this.ObjectAddress, ref ret, steamIDLobby.ConvertToUint64(), iMember); return(new CSteamID(ret));
 }
        public void sendMessage(CSteamID botTarget, string botMessage, bool IsGroupMsg)
        {
            botMessage = ipgnBotParser.chatFormat(botMessage);

            if (IsGroupMsg)
            {
                this.sendChatMsg(clientFriends.Interface, botTarget, EChatEntryType.k_EChatEntryTypeChatMsg, System.Text.Encoding.UTF8.GetBytes(botMessage), botMessage.Length + 1);
                Program.logToWindow("Sent message to groupchat" + botTarget + ": " + botMessage + " (Type: " + EChatEntryType.k_EChatEntryTypeChatMsg + ")");
            }
            else
            {
                this.steamFriends.SendMsgToFriend(botTarget, EChatEntryType.k_EChatEntryTypeChatMsg, System.Text.Encoding.UTF8.GetBytes(botMessage), botMessage.Length + 1);
                Program.logToWindow("Sent private message to " + botTarget + ": " + botMessage + " (Type: " + EChatEntryType.k_EChatEntryTypeChatMsg + ")");
            }

            ipgnBotParser.replyMessage = null;
        }
Пример #37
0
 public bool SetLobbyData(CSteamID steamIDLobby, string pchKey, string pchValue)
 {
     return(this.GetFunction <NativeSetLobbyDataCSS>(this.Functions.SetLobbyData16)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), pchKey, pchValue));
 }
        void friendRequest(UserRequestingFriendship_t userRequesting)
        {
            Program.logToWindow("new user requesting friendship:" + (CSteamID)userRequesting.m_ulSteamID);
            CSteamID friendRequestId = new CSteamID(userRequesting.m_ulSteamID);
            steamFriends.AddFriend(friendRequestId);
            clientFriends.AddFriend(friendRequestId);

            Program.logToWindow(steamFriends.GetFriendPersonaName(friendRequestId) + "requesting friendship. Added friend");
        }
Пример #39
0
 public string GetLobbyMemberData(CSteamID steamIDLobby, CSteamID steamIDUser, string pchKey)
 {
     return(InteropHelp.DecodeANSIReturn(this.GetFunction <NativeGetLobbyMemberDataCCS>(this.Functions.GetLobbyMemberData17)(this.ObjectAddress, steamIDLobby.ConvertToUint64(), steamIDUser.ConvertToUint64(), pchKey)));
 }
Пример #40
0
        public bool Equals( CSteamID sid )
        {
            if ( ( object )sid == null )
                return false;

            return steamid.Data == sid.steamid.Data;
        }
Пример #41
0
 public int addMapVote(CSteamID steamID, string map)
 {
     //Return 1 if successful, 2 if not in pug, 0 if already voted for
     return 0;
 }