Example #1
0
 public static NetworkAccessToken GetAccessTokenForNetwork(NetworkID netId)
 {
   NetworkAccessToken networkAccessToken;
   if (!Utility.s_dictTokens.TryGetValue(netId, out networkAccessToken))
     networkAccessToken = new NetworkAccessToken();
   return networkAccessToken;
 }
Example #2
0
 /// <summary>
 /// <para>Utility function that accepts the access token for a network after it's received from the server.</para>
 /// </summary>
 /// <param name="netId"></param>
 /// <param name="accessToken"></param>
 public static void SetAccessTokenForNetwork(NetworkID netId, NetworkAccessToken accessToken)
 {
     if (s_dictTokens.ContainsKey(netId))
     {
         s_dictTokens.Remove(netId);
     }
     s_dictTokens.Add(netId, accessToken);
 }
Example #3
0
 /// <summary>
 /// <para>Utility function to get this client's access token for a particular network, if it has been set.</para>
 /// </summary>
 /// <param name="netId"></param>
 public static NetworkAccessToken GetAccessTokenForNetwork(NetworkID netId)
 {
     NetworkAccessToken token;
     if (!s_dictTokens.TryGetValue(netId, out token))
     {
         token = new NetworkAccessToken();
     }
     return token;
 }
Example #4
0
 public static Types.NetworkAccessToken GetAccessTokenForNetwork(Types.NetworkID netId)
 {
     Types.NetworkAccessToken ret;
     if (s_dictTokens.TryGetValue(netId, out ret) == false)
     {
         ret = new Types.NetworkAccessToken();
     }
     return(ret);
 }
Example #5
0
        public static void SetAccessTokenForNetwork(Types.NetworkID netId, Types.NetworkAccessToken accessToken)
        {
            // If we're updating an existing token we need to remove the stale one first
            if (s_dictTokens.ContainsKey(netId))
            {
                s_dictTokens.Remove(netId);
            }

            s_dictTokens.Add(netId, accessToken);
        }
Example #6
0
 public static void SetAccessTokenForNetwork(NetworkID netId, NetworkAccessToken accessToken)
 {
     s_dictTokens.Add(netId, accessToken);
 }