Example #1
0
        public bool GetInterface()
        {
            steamFriends = Steamworks.CastInterface<ISteamFriends002> ( steamClient.GetISteamFriends ( user, pipe, "SteamFriends002" ) );

            if ( steamFriends == null )
                return false;

            clientFriends = Steamworks.CastInterface<IClientFriends> ( clientEngine.GetIClientFriends ( user, pipe, "CLIENTFRIENDS_INTERFACE_VERSION001" ) );

            if ( clientFriends == null )
                return false;

            // Virtual Table
            VTable vTable = new VTable ( clientFriends.Interface );

            getChatMsg = vTable.GetFunc<NativeGetChatRoomEntry> ( 99 );
            getChatName = vTable.GetFunc<NativeGetChatRoomName> ( 117 );
            sendChatMsg = vTable.GetFunc<NativeSendChatMsg> ( 98 );

            CallbackDispatcher.SpawnDispatchThread ( pipe );

            return true;
        }
        public bool GetInterface()
        {
            steamFriends = Steamworks.CastInterface<ISteamFriends002>(steamClient.GetISteamFriends(user, pipe, steamFriendsEngineVersion));

            if (steamFriends == null)
                return false;

            Program.logToWindow("Got ISteamFriends002 interface");

            clientFriends = Steamworks.CastInterface<IClientFriends>(clientEngine.GetIClientFriends(user, pipe, clientFriendsEngineVersion));

            if (clientFriends == null)
                return false;

            Program.logToWindow("Got IClientFriends interface");

            VTable vTable = new VTable(clientFriends.Interface);

            getChatMsg = vTable.GetFunc<NativeGetChatRoomEntry>(99);
            getChatName = vTable.GetFunc<NativeGetChatRoomName>(117);
            sendChatMsg = vTable.GetFunc<NativeSendChatMsg>(98);

            groupChatEnabled = true;
            groupStatusMsg = "Enabled with vTable offsets";

            CallbackDispatcher.SpawnDispatchThread(pipe);

            Program.logToWindow("Found steam interface. Listing current clans:");

            int numClans = steamFriends.GetClanCount();
            for (int i = 0; i < numClans; i++)
            {
                ulong clanId = steamFriends.GetClanByIndex(i);
                Program.logToWindow("Clan Num: " + i + " ID: " + clanId + " Name: " + steamFriends.GetClanName(clanId));
            }

            return true;
        }