/// <summary> /// Remove a Property With propertyName /// </summary> /// <param name="propertyName">The name of a Property You Want To Remove it</param> public static void RemoveProperty(string propertyName) { if (!IsAvailable) { throw new GameServiceException("GsLiveRealtime is Not Available"); } if (!FiroozehGameService.Core.GameService.GSLive.IsRealTimeAvailable()) { throw new GameServiceException("RealTime is Not Available"); } _propertyHandler.RemoveProperty(CurrentPlayerMemberId, propertyName); var property = new PropertyData(propertyName); SenderUtil.NetworkProperty(property, PropertyAction.Remove); }
private static void ApplyProperty(byte action, byte[] data, string ownerId, IPropertyHandler handler) { var actions = (PropertyAction)action; var property = new PropertyData(); GsSerializer.Object.CallReadStream(property, data); switch (actions) { case PropertyAction.Apply: handler.ApplyProperty(ownerId, new Property(property.Name, property.Data)); GsLiveRealtime.Callbacks.OnPropertyEvent?.Invoke(null, new OnPropertyEvent(property.Name, ownerId, actions, property.Data)); break; case PropertyAction.Remove: handler.RemoveProperty(ownerId, property.Name); GsLiveRealtime.Callbacks.OnPropertyEvent?.Invoke(null, new OnPropertyEvent(property.Name, ownerId, actions)); break; default: throw new ArgumentOutOfRangeException(); } }