Exemplo n.º 1
0
    /// <summary>
    /// Creates a new drWWW object.
    /// </summary>
    /// <param name="api">The API call to use.</param>
    public drWWW(drAPI.API api)
    {
        this.api = api;

        AddField("_id", drClient.gameId);

        if (Application.isEditor && drClient.sessionId != null) {
            AddField("_token", drClient.sessionId);
        }
    }
 /// <summary>
 /// Creates a WWW object prepopulated with fields common to all calls.
 /// </summary>
 /// <param name="api">The call's API.</param>
 /// <param name="name">The name of the wallet.</param>
 /// <returns>The WWW object.</returns>
 static drWWW GetWWW(drAPI.API api, string name)
 {
     drWWW www = new drWWW(api);
     www.AddField("name", name);
     return www;
 }
    /// <summary>
    /// Creates a WWW object prepopulated with fields common to all calls.
    /// </summary>
    /// <param name="api">The call's API.</param>
    /// <param name="name">The name of the counter.</param>
    /// <param name="userIds">The user IDs.</param>
    /// <returns>The WWW object.</returns>
    static drWWW GetWWW(drAPI.API api, string name, int[] userIds)
    {
        drWWW www = new drWWW(api);
        www.AddField("name", name);

        if (userIds != null && userIds.Length > 0) {
            string userIdsJson = JSON.JsonEncode(userIds);
            www.AddField("uids", userIdsJson);
        }

        return www;
    }
Exemplo n.º 4
0
 /// <summary>
 /// Creates a new drWWW object.
 /// </summary>
 /// <param name="api">The API call to use.</param>
 internal drWWW(drAPI.API api)
 {
     this.api = api;
 }
    /// <summary>
    /// Creates a WWW object prepopulated with fields common to all calls.
    /// </summary>
    /// <param name="api">The call's API.</param>
    /// <param name="ns">The namespace of the data.</param>
    /// <param name="userId">The user's ID.</param>
    /// <returns>The WWW object.</returns>
    static drWWW GetWWW(drAPI.API api, string ns, int? userId)
    {
        drWWW www = new drWWW(api);
        www.AddField("namespace", ns);

        if (userId.HasValue) {
            www.AddField("uid", userId.Value);
        }

        return www;
    }