RTC Forums
April 23, 2024, 11:06:26 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Gate client UserInfo  (Read 12866 times)
ISIGest
RTC Expired
*
Posts: 121


« on: September 08, 2016, 07:35:07 AM »

I try to use UserInfo[UserID] to get some info about an user.

    { Returns the last received "UserInfo" string for the User "UserID".
      The "UserInfo" string is received from the Gateway with Account notifications, contains the
      "GateUserInfo" property assigned on the Client for which the notification was sent and remains
      populated while the User is logged in with at least one Account managed by our AccountManager. }
    property UserInfo[const UserID:TGateUID]:RtcString read CheckUserInfo;

But this return always empty string!
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 on: September 08, 2016, 09:10:16 AM »

The "UserInfo" string is received from the Gateway with Account notifications ("OnInfoReceived" event on the Client), contains the "GateUserInfo" property assigned on the Client for which the notification was sent (check the Data.UserInfo parameter in the OnInfoReceived event when "Data.Command" = gc_SubscribeLogIn or gc_AccountLogIn) and remains populated while the User is logged in with at least one Account managed by our AccountManager.

Here are a few examples you can check to find out more about Gateway Subscriptions and Accounts ...

"RTCGateNode" demo is a Gateway and a Multi-Gate-Client in a single Project and shows how you can manage public, private and linked Accounts using the TRtcHttpMultiGateClient component. The same methods would apply if you were using the TRtcGateAccountManager component assigned to the AccountManager property of the TRtcHttpGateClient component.

"ChatClient2" demo works with the standard Gateway (as in the "RtcSimpleGateway" demo) and uses the TRtcGateAccountManager component assigned to the AccountManager property of the TRtcHttpGateClient component to register and activate a public Account "Lobby" and get notifications about other logged in Clients with the same Account activated. "ChatClient3" demo does the same by using the TRtcHttpMultiGateClient component.

"ChatServer" demo uses the AddUserToChannel method from the OnUserReady event (available on TRtcGateway and TRtcHttpGateway components) to add "Chat" Clients to the public channel "Chat", so they will get notified when other "Chat" Clients log in and out of the Gateway. "ChatClient" demo works with the "ChatServer" demo, gets notifications from the "ChatServer" about users added by the Gateway to the "Chat" channel, and ... uses the Subscribe method on the TRtcHttpGateClient component (only as a test - not required for notifications in that demo) to subscribe to a public channel "Lobby" on the Gateway and get notifications about all other Clients subscribed to the same channel (search for "Subscribe" in source code).

If you are NOT using the TRtcGateAccountManager component (as shown in the "ChatClient2" Demo) or TRtcHttpMultiGateClient component (as shown in the "RTCGateNode" and "ChatClient3" Demos), the "UserInfo" property will be empty for all UserIDs on the TRtcHttpGateClient component.

If you are using Subscriptions on the TRtcGateway, TRtcHttpGateway or TRtcHttpGateClient component without using the Account Manager on the Client, you can access "Data.UserInfo" when the "OnInfoReceived" event is triggered on the Client and Data.Command = gc_SubscribeLogIn. If you want to use that information later, you have to store it somewhere else (your own list?) if you are NOT using the AccountManager.

Best Regards,
Danijel Tkalcec
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.023 seconds with 16 queries.