public void SyncFindData(string syncString) { if (string.IsNullOrEmpty(syncString)) { return; } SynchronisedString = syncString; if (ClothFactory.Instance.ClothingStoredData.ContainsKey(syncString)) { clothingData = ClothFactory.Instance.ClothingStoredData[syncString]; TryInit(); } else if (ClothFactory.Instance.BackpackStoredData.ContainsKey(syncString)) { containerData = ClothFactory.Instance.BackpackStoredData[syncString]; TryInit(); } else if (ClothFactory.Instance.HeadSetStoredData.ContainsKey(syncString)) { headsetData = ClothFactory.Instance.HeadSetStoredData[syncString]; TryInit(); } else { Logger.LogError($"No Cloth Data found for {syncString}", Category.SpriteHandler); } }
public static GameObject CreateHeadsetCloth(HeadsetData headsetData, Vector3 worldPos, Transform parent = null, ClothingVariantType CVT = ClothingVariantType.Default, int variant = -1, GameObject PrefabOverride = null) { if (Instance.uniHeadSet == null) { Logger.LogError("UniHeadSet Prefab not found", Category.SpriteHandler); return(null); } GameObject clothObj; if (PrefabOverride != null) { clothObj = PoolManager.PoolNetworkInstantiate(PrefabOverride, worldPos, parent); } else { clothObj = PoolManager.PoolNetworkInstantiate(Instance.uniHeadSet, worldPos, parent); } var _Clothing = clothObj.GetComponent <Clothing>(); var Item = clothObj.GetComponent <ItemAttributes>(); var Headset = clothObj.GetComponent <Headset>(); _Clothing.SpriteInfo = StaticSpriteHandler.SetupSingleSprite(headsetData.Sprites.Equipped); _Clothing.SetSynchronise(HD: headsetData); Item.SetUpFromClothingData(headsetData.Sprites, headsetData.ItemAttributes); Headset.EncryptionKey = headsetData.Key.EncryptionKey; return(clothObj); }
public void Battery(Object stateInfo) { String jsonString; try { jsonString = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\..\\Local\\Logitech\\settings.json"); var ms = new MemoryStream(Encoding.Unicode.GetBytes(jsonString)); DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(LgsData)); LgsData bsObj = (LgsData)deserializer.ReadObject(ms); this.batteryStatus = bsObj.headset.data; using (StreamWriter writer = new StreamWriter("D:\\out.txt")) { Console.SetOut(writer); Console.Write(bsObj.headset); }; } catch (FileNotFoundException ex) { Console.Error.Write("Error found : LGS settings.json file not found. Try restarting LGS if this errors comes back often." + ex); } catch (DirectoryNotFoundException ex) { Console.Error.Write("Error found : LGS folder not found. Maybe LGS is not installed." + ex); } finally { Thread.Sleep(2000); this.threadRunning = false; } }
public void Battery(Object stateInfo) { String jsonString; try { jsonString = File.ReadAllText(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\..\\Local\\LGHUB\\settings.json"); var ms = new MemoryStream(Encoding.Unicode.GetBytes(jsonString)); DataContractJsonSerializer deserializer = new DataContractJsonSerializer(typeof(GhubData)); GhubData bsObj = (GhubData)deserializer.ReadObject(ms); this.batteryStatus = bsObj.data; } catch (FileNotFoundException ex) { Console.Error.Write("Error found : GHUB settings.json file not found. Try restarting GHUB if this errors comes back often." + ex); } catch (DirectoryNotFoundException ex) { Console.Error.Write("Error found : GHUB folder not found. Maybe GHUB is not installed." + ex); } finally { Thread.Sleep(2000); this.threadRunning = false; } }
public void GatherData() { PlayerCustomisationData.getPlayerCustomisationDatas(DataPCD); ClothingData.getClothingDatas(DataClothingData); ContainerData.getContainerData(DataContainerData); HeadsetData.getHeadsetData(DataHeadsetData); PlayerTextureData.getClothingDatas(DataRaceData); }
public void SetSynchronise(ClothingData CD = null, ContainerData ConD = null, HeadsetData HD = null) { if (CD != null) { SynchronisedString = CD.name; clothingData = CD; } else if (ConD != null) { SynchronisedString = ConD.name; containerData = ConD; } else if (HD != null) { SynchronisedString = HD.name; headsetData = HD; } }