Beispiel #1
0
        public IEnumerator LoginAndRedirect()
        {
            Debug.Assert(global::LobbyController.Instance.Lobby != null);

            var id = global::LobbyController.Instance.Lobby.id;

            var www = AuthHttp.Get(
                $"lobbies/{id}/users/players"
                );

            yield return(www.SendWebRequest());

            var users = JsonUtility.FromJson <UserCollection>(www.downloadHandler.text);

            users.data.ForEach(user => {
                var lobbyView  = Instantiate(ListItemPrefab);
                var controller = lobbyView.GetComponent <PlayerListItemController>();
                controller.ApplyUser(user);

                lobbyView.transform.SetParent(ContentPanel.transform, false);

                var panel       = ContentPanel.GetComponent <RectTransform>();
                panel.anchorMin = new Vector2(panel.anchorMin.x, panel.anchorMin.y - 0.15f);
            });
        }
Beispiel #2
0
        public static IEnumerator Create(string lobbyName)
        {
            var www = AuthHttp.Post("lobbies", new Dictionary <string, string>
            {
                { "name", lobbyName }
            });

            yield return(www.SendWebRequest());
        }
Beispiel #3
0
 /// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         var hashCode = 41;
         // Suitable nullity checks etc, of course :)
         if (OsgiHttpWhiteboardContextSelect != null)
         {
             hashCode = hashCode * 59 + OsgiHttpWhiteboardContextSelect.GetHashCode();
         }
         if (OsgiHttpWhiteboardListener != null)
         {
             hashCode = hashCode * 59 + OsgiHttpWhiteboardListener.GetHashCode();
         }
         if (AuthSudoCookie != null)
         {
             hashCode = hashCode * 59 + AuthSudoCookie.GetHashCode();
         }
         if (AuthSudoParameter != null)
         {
             hashCode = hashCode * 59 + AuthSudoParameter.GetHashCode();
         }
         if (AuthAnnonymous != null)
         {
             hashCode = hashCode * 59 + AuthAnnonymous.GetHashCode();
         }
         if (SlingAuthRequirements != null)
         {
             hashCode = hashCode * 59 + SlingAuthRequirements.GetHashCode();
         }
         if (SlingAuthAnonymousUser != null)
         {
             hashCode = hashCode * 59 + SlingAuthAnonymousUser.GetHashCode();
         }
         if (SlingAuthAnonymousPassword != null)
         {
             hashCode = hashCode * 59 + SlingAuthAnonymousPassword.GetHashCode();
         }
         if (AuthHttp != null)
         {
             hashCode = hashCode * 59 + AuthHttp.GetHashCode();
         }
         if (AuthHttpRealm != null)
         {
             hashCode = hashCode * 59 + AuthHttpRealm.GetHashCode();
         }
         if (AuthUriSuffix != null)
         {
             hashCode = hashCode * 59 + AuthUriSuffix.GetHashCode();
         }
         return(hashCode);
     }
 }
Beispiel #4
0
    public IEnumerator FetchLobbies()
    {
        var www = AuthHttp.Get("lobbies");

        yield return(www.SendWebRequest());

        Debug.Log(www.downloadHandler.text);

        var lobbies = JsonUtility.FromJson <LobbyCollection>(www.downloadHandler.text);

        lobbies.data.ForEach(lobby => {
            var lobbyView  = Instantiate(ListItemPrefab);
            var controller = lobbyView.GetComponent <LobbyListItemController>();
            controller.ApplyLobby(lobby);

            lobbyView.transform.SetParent(ContentPanel.transform, false);

            var panel       = ContentPanel.GetComponent <RectTransform>();
            panel.anchorMin = new Vector2(panel.anchorMin.x, panel.anchorMin.y - 0.15f);
        });
    }
Beispiel #5
0
        public IEnumerator Leave()
        {
            var www = AuthHttp.Delete($"lobbies/{id}/users/current");

            yield return(www.SendWebRequest());
        }
Beispiel #6
0
        public IEnumerator Join(string type)
        {
            var www = AuthHttp.Post($"lobbies/{id}/users/{type}", null);

            yield return(www.SendWebRequest());
        }
Beispiel #7
0
        /// <summary>
        /// Returns true if OrgApacheSlingEngineImplAuthSlingAuthenticatorProperties instances are equal
        /// </summary>
        /// <param name="other">Instance of OrgApacheSlingEngineImplAuthSlingAuthenticatorProperties to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(OrgApacheSlingEngineImplAuthSlingAuthenticatorProperties other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     OsgiHttpWhiteboardContextSelect == other.OsgiHttpWhiteboardContextSelect ||
                     OsgiHttpWhiteboardContextSelect != null &&
                     OsgiHttpWhiteboardContextSelect.Equals(other.OsgiHttpWhiteboardContextSelect)
                     ) &&
                 (
                     OsgiHttpWhiteboardListener == other.OsgiHttpWhiteboardListener ||
                     OsgiHttpWhiteboardListener != null &&
                     OsgiHttpWhiteboardListener.Equals(other.OsgiHttpWhiteboardListener)
                 ) &&
                 (
                     AuthSudoCookie == other.AuthSudoCookie ||
                     AuthSudoCookie != null &&
                     AuthSudoCookie.Equals(other.AuthSudoCookie)
                 ) &&
                 (
                     AuthSudoParameter == other.AuthSudoParameter ||
                     AuthSudoParameter != null &&
                     AuthSudoParameter.Equals(other.AuthSudoParameter)
                 ) &&
                 (
                     AuthAnnonymous == other.AuthAnnonymous ||
                     AuthAnnonymous != null &&
                     AuthAnnonymous.Equals(other.AuthAnnonymous)
                 ) &&
                 (
                     SlingAuthRequirements == other.SlingAuthRequirements ||
                     SlingAuthRequirements != null &&
                     SlingAuthRequirements.Equals(other.SlingAuthRequirements)
                 ) &&
                 (
                     SlingAuthAnonymousUser == other.SlingAuthAnonymousUser ||
                     SlingAuthAnonymousUser != null &&
                     SlingAuthAnonymousUser.Equals(other.SlingAuthAnonymousUser)
                 ) &&
                 (
                     SlingAuthAnonymousPassword == other.SlingAuthAnonymousPassword ||
                     SlingAuthAnonymousPassword != null &&
                     SlingAuthAnonymousPassword.Equals(other.SlingAuthAnonymousPassword)
                 ) &&
                 (
                     AuthHttp == other.AuthHttp ||
                     AuthHttp != null &&
                     AuthHttp.Equals(other.AuthHttp)
                 ) &&
                 (
                     AuthHttpRealm == other.AuthHttpRealm ||
                     AuthHttpRealm != null &&
                     AuthHttpRealm.Equals(other.AuthHttpRealm)
                 ) &&
                 (
                     AuthUriSuffix == other.AuthUriSuffix ||
                     AuthUriSuffix != null &&
                     AuthUriSuffix.Equals(other.AuthUriSuffix)
                 ));
        }