예제 #1
0
 public virtual void OnLoadModules()
 {
     this.RegisterModule <IAuth>(this.auth       = new Auth <AuthSettings>(this, this.settings, this.settings.authSettings));
     this.RegisterModule <IProfile>(this.profile = new Profile <ProfileSettings>(this, this.settings, this.settings.standardProfileSettings));
     this.RegisterModule <IFriends>(this.friends = new Friends <FriendsSettings>(this, this.settings, this.settings.standardFriendsSettings));
     this.RegisterModule <IUsers>(this.users     = new Users <UsersSettings>(this, this.settings, this.settings.standardUsersSettings));
 }
예제 #2
0
    //Thanks to Karl @ Stunlock Studios for giving me their function as he implemented utils.GetImage(Size/RGBA) into our library
    public Texture2D GetTextureFromSteamID(SteamID steamId)
    {
        IFriends friends = Steamworks.SteamInterface.Friends;
        IUtils   utils   = Steamworks.SteamInterface.Utils;

        ImageHandle avatarHandle = friends.GetLargeFriendAvatar(steamId);

        if (avatarHandle.IsValid)
        {
            uint width, height;
            if (utils.GetImageSize(avatarHandle, out width, out height))
            {
                Texture2D texture = new Texture2D((int)width, (int)height, TextureFormat.RGBA32, true);
                Color32[] buffer  = new Color32[width * height];

                GCHandle bufferHandle = GCHandle.Alloc(buffer, GCHandleType.Pinned);

                try
                {
                    System.IntPtr bufferPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, 0);

                    if (utils.GetImageRGBA(avatarHandle, bufferPtr, (int)width * (int)height * 4))
                    {
                        // Flip vertical
                        for (int x = 0; x < width; x++)
                        {
                            for (int y = 0; y < height / 2; y++)
                            {
                                Color32 temp = buffer[x + (width * y)];
                                buffer[x + (width * y)] = buffer[x + (width * (height - 1 - y))];
                                buffer[x + (width * (height - 1 - y))] = temp;
                            }
                        }

                        texture.SetPixels32(buffer);
                        texture.Apply();
                    }
                }
                finally
                {
                    bufferHandle.Free();
                }
                return(texture);
            }
        }

        return(null);
    }
예제 #3
0
 public FriendsController(IUserIdentityRepository userIdentityRepository,
                          IFriends friends)
 {
     _userIdentityRepository = userIdentityRepository;
     _friends = friends;
 }
예제 #4
0
 public new void TestInitialise()
 {
     base.TestInitialise();
     friends = roar.Friends;
     Assert.IsNotNull(friends);
 }
예제 #5
0
 public FriendsController(IFriends friends, IUser user)
 {
     _friends = friends;
     _user    = user;
 }
예제 #6
0
 public Friends()
 {
     dal = DataAccess.CreateFriends();
 }
예제 #7
0
 public UtilityFriends(IFriends IFriend)
 {
     this._IFriend = IFriend;
     _IFriend.FirstName();
     _IFriend.LastName();
 }
예제 #8
0
 new public void TestInitialise()
 {
     base.TestInitialise();
     friends = roar.Friends;
     Assert.IsNotNull(friends);
 }
 public UsersController(IUsersService UserService, IFriends FriendService)
 {
     this.UserService   = UserService;
     this.FriendService = FriendService;
 }
예제 #10
0
 internal void Init(IFriends view)
 {
     _view = view;
     this.LoadAccounts();
 }
 public FriendsController(IFriends FriendService)
 {
     this.FriendService = FriendService;
 }
예제 #12
0
 public void Init(IFriends view)
 {
     _view = view;
     _view.LoadFriends(Friend.GetFriendsAccountsByAccountID(_userSession.CurrentUser.AccountID));
 }