diff --git a/VRCBoardManager.cs b/VRCBoardManager.cs index f5dc502..62e70ec 100644 --- a/VRCBoardManager.cs +++ b/VRCBoardManager.cs @@ -263,7 +263,10 @@ namespace VRCBoard if (_atlasInfo == null) return null; if (!_atlasInfo.ContainsKey(imageId)) return null; DataToken token = _atlasInfo[imageId]; - if (token.TokenType != TokenType.DataDictionary) return null; + if (token.TokenType != TokenType.DataDictionary) + { + Debug.LogWarning("[_GetImageIdInfo] " + imageId + " does not exist."); + } return token.DataDictionary; } @@ -278,16 +281,17 @@ namespace VRCBoard DataDictionary imageInfo = _GetImageIdInfo(imageId); if (imageInfo == null) { + Debug.LogWarning("[_GetImageAtlasTexture] " + imageId + " not found!"); return false; } bool imageTypeSuccess = imageInfo.TryGetValue("type", out DataToken typeToken); bool uploadsSuccess = imageInfo.TryGetValue("uploads", out DataToken uploadsToken); bool atlasSizeSuccess = imageInfo.TryGetValue("size", out DataToken sizeToken); - //Debug.Log("Get image atlas texture " + imageId + " success: " + imageTypeSuccess + " " + uploadsSuccess + " " + atlasSizeSuccess); if ((!imageTypeSuccess || !uploadsSuccess || !atlasSizeSuccess) || (typeToken.TokenType != TokenType.String || uploadsToken.TokenType != TokenType.DataList || sizeToken.TokenType != TokenType.Double)) { + Debug.LogWarning("[_GetImageAtlasTexture] " + imageId + " is not a valid atlas."); return false; } @@ -362,6 +366,7 @@ namespace VRCBoard } public void _RequestImageLoad(string imageId, string uploader, VRCBoardBaseComponent component) { + if (uploader == null) uploader = "null"; //Debug.Log("Requesting image load " + imageId); if (string.IsNullOrEmpty(imageId)) return; string combinedId = $"{imageId}:{uploader}"; @@ -374,6 +379,7 @@ namespace VRCBoard if (split.Length != 2) return; string imageId = split[0]; string uploader = split[1]; + if (uploader == "null") uploader = null; bool success = _GetImageAtlasTexture(imageId, uploader, out int atlasIndex, out Texture2D texture, out int position, out int size, out string type, out string hash); //Debug.Log("Try download image " + combinedImageId + " success: " + success); @@ -384,7 +390,7 @@ namespace VRCBoard private void OnSupporterInfoDownload(string data) { - Debug.Log("Supporter info download success"); + Debug.Log("[VRCBoard] Supporter info download success"); if (VRCJson.TryDeserializeFromJson(data, out DataToken result)) { if (result.TokenType != TokenType.DataDictionary) return; @@ -394,7 +400,7 @@ namespace VRCBoard } else { - Debug.LogError("Failed to deserialize supporter info"); + Debug.LogError("[VRCBoard] Failed to deserialize supporter info"); } } private void SetSupporterInfo(DataDictionary value) @@ -416,12 +422,12 @@ namespace VRCBoard { _perkNodes = perkToken.DataList; } - Debug.Log("Set supporter info "+vrcsuccess+" "+supporterSuccess+" "+perkSuccess); + //Debug.Log("Set supporter info "+vrcsuccess+" "+supporterSuccess+" "+perkSuccess); } private void OnCustomModuleDownload(int moduleIndex, string data) { - Debug.Log("Custom module download success " + moduleIndex); + Debug.Log("[VRCBoard] Custom module download success " + moduleIndex); if (VRCJson.TryDeserializeFromJson(data, out DataToken result)) { if (result.TokenType != TokenType.DataDictionary) return; @@ -429,13 +435,13 @@ namespace VRCBoard } else { - Debug.LogError("Failed to deserialize custom module " + moduleIndex); + Debug.LogError("[VRCBoard] Failed to deserialize custom module " + moduleIndex); } } private void OnCustomModuleUpdate(int moduleIndex, DataDictionary data) { - Debug.Log("Custom module update " + moduleIndex); + Debug.Log("[VRCBoard] Custom module update " + moduleIndex); foreach (var component in vrcBoardComponents) component._OnCustomModuleUpdate(moduleIndex, data); } @@ -522,7 +528,7 @@ namespace VRCBoard private void OnSupporterInfoUpdate() { - Debug.Log("Supporter info updated"); + Debug.Log("[VRCBoard] Supporter info updated"); foreach (var component in vrcBoardComponents) component._OnSupporterDataUpdate(); } @@ -538,7 +544,7 @@ namespace VRCBoard } else { - Debug.LogError("Failed to deserialize atlas info"); + Debug.LogError("[VRCBoard] Failed to deserialize atlas info"); } } @@ -582,13 +588,13 @@ namespace VRCBoard public override void OnImageLoadSuccess(IVRCImageDownload result) { string url = result.Url.Get(); - Debug.Log("Image load success " + url); + Debug.Log("[VRCBoard] Image load success " + url); Texture2D texture = result.Result; int index = GetAtlasIndexFromUrl(url); if (index == -1) return; _downloadedAtlasTextures[index] = texture; _atlasDownloadTimes[index] = Time.time; - Debug.Log("Downloaded atlas texture " + index); + Debug.Log("[VRCBoard] Downloaded atlas texture " + index); foreach (var component in vrcBoardComponents) component._OnAtlasImageLoaded(index); } @@ -635,8 +641,7 @@ namespace VRCBoard return textureCacheTextures[i]; } } - - Debug.LogWarning("Key not found: " + key); + //Debug.LogWarning("[VRCBoard] Key not found: " + key); return null; } @@ -690,7 +695,7 @@ namespace VRCBoard startX = startX / size; startY = startY / size; - Debug.Log("texture startX:" + startX + ", startY:" + startY); + //Debug.Log("[VRCBoard] texture startX:" + startX + ", startY:" + startY); int textureSize = 1024;