Skip to content
This repository has been archived by the owner on Sep 4, 2020. It is now read-only.

LMAO #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 13 additions & 17 deletions Assets/SteamMultiplayer/Scripts/Core/NetworkControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -484,31 +484,27 @@ public RPCInfo(int funcIndex, object[] values)
private uint width, height;
private Texture2D downloadedAvatar;

//fix for your stupid avatar shit code `made by TheMaoci` - same goes to current player ...
IEnumerator _FetchAcatar(CSteamID id, RawImage ui)
{
var AvatarInt = SteamFriends.GetLargeFriendAvatar(id);
var AvatarInt = -1;
while (AvatarInt == -1)
{
yield return null;
AvatarInt = SteamFriends.GetLargeFriendAvatar(id);
}
if (AvatarInt > 0)
SteamUtils.GetImageSize(AvatarInt, out width, out height);
if (width > 0 && height > 0)
{
SteamUtils.GetImageSize(AvatarInt, out width, out height);

if (width > 0 && height > 0)
{
byte[] avatarStream = new byte[4 * (int) width * (int) height];
SteamUtils.GetImageRGBA(AvatarInt, avatarStream, 4 * (int) width * (int) height);

downloadedAvatar = new Texture2D((int) width, (int) height, TextureFormat.RGBA32, false);
downloadedAvatar.LoadRawTextureData(avatarStream);
downloadedAvatar.Apply();

ui.texture = downloadedAvatar;
}
byte[] avatarStream = new byte[4 * (int) width * (int) height];
SteamUtils.GetImageRGBA(AvatarInt, avatarStream, 4 * (int) width * (int) height);
downloadedAvatar = new Texture2D((int) width, (int) height, TextureFormat.RGBA32, false);
downloadedAvatar.LoadRawTextureData(avatarStream);
downloadedAvatar.Apply();
ui.texture = downloadedAvatar;
}
yield return null;
}

//fix end
#endregion

public void CheckJoinedLobby()
Expand Down