/// <summary>
        /// Updates the custom properties reference
        /// </summary>
        protected void UpdateCustomPropertiesReference()
        {
            var newTable = this.GetCustomProperties(this.matchmakingClientService);

            var previousTable = this.CustomProperties;

            if (previousTable != newTable)
            {
                this.CustomProperties = newTable;
                this.CustomPropertiesRefreshed?.Invoke(this, previousTable);
            }
        }
Beispiel #2
0
        private void PropertiesTableProvider_CustomPropertiesRefreshed(object sender, NetworkPropertiesTable previousPropertyTable)
        {
            if (previousPropertyTable != null)
            {
                this.UnsubsribeFromPropertiesTable(previousPropertyTable);
            }

            this.propertiesTable = this.propertiesTableProvider?.CustomProperties;
            if (this.propertiesTable != null)
            {
                this.propertiesTable.PropertyAdded   += this.CustomProperties_PropertyAddedOrChanged;
                this.propertiesTable.PropertyChanged += this.CustomProperties_PropertyAddedOrChanged;
                this.propertiesTable.PropertyRemoved += this.CustomProperties_PropertyRemoved;
            }

            this.ForcePropertyCheck();
        }
Beispiel #3
0
 /// <inheritdoc />
 protected override void WriteValue(NetworkPropertiesTable propertiesTable, TimeSpan value)
 {
     propertiesTable.Set(this.propertyKey, value, this.HighPrecision);
 }
Beispiel #4
0
 /// <inheritdoc />
 protected override TimeSpan ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetTimeSpan(this.propertyKey, this.HighPrecision));
 }
Beispiel #5
0
 /// <inheritdoc />
 protected override Color ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetColor(this.propertyKey));
 }
Beispiel #6
0
 private void UnsubsribeFromPropertiesTable(NetworkPropertiesTable propertiesTable)
 {
     propertiesTable.PropertyAdded   -= this.CustomProperties_PropertyAddedOrChanged;
     propertiesTable.PropertyChanged -= this.CustomProperties_PropertyAddedOrChanged;
     propertiesTable.PropertyRemoved -= this.CustomProperties_PropertyRemoved;
 }
Beispiel #7
0
 /// <inheritdoc />
 protected override string ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetString(this.propertyKey));
 }
 /// <inheritdoc />
 protected override long ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetInt64(this.propertyKey));
 }
 /// <inheritdoc />
 protected override DateTime ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetDateTime(this.propertyKey));
 }
 /// <inheritdoc />
 protected override float ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetFloat(this.propertyKey));
 }
 /// <inheritdoc />
 protected override bool ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetBoolean(this.propertyKey));
 }
Beispiel #12
0
 /// <inheritdoc />
 protected override byte ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetByte(this.propertyKey));
 }
Beispiel #13
0
 /// <inheritdoc />
 protected override V ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetSerializable <V>(this.propertyKey));
 }
 /// <inheritdoc />
 protected override Quaternion ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetQuaternion(this.propertyKey));
 }
 /// <inheritdoc />
 protected override Vector4 ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return propertiesTable.GetVector4(this.propertyKey);
 }
Beispiel #16
0
 /// <summary>
 /// Defines a delegate to read the value from the player <see cref="NetworkPropertiesTable"/>
 /// </summary>
 /// <param name="propertiesTable">The properties table that contains the player custom properties</param>
 /// <returns>The property value</returns>
 protected abstract V ReadValue(NetworkPropertiesTable propertiesTable);
 /// <inheritdoc />
 protected override Matrix ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetMatrix(this.propertyKey));
 }
Beispiel #18
0
 /// <summary>
 /// Defines a delegate to write the value in the player <see cref="NetworkPropertiesTable"/>
 /// </summary>
 /// <param name="propertiesTable">The properties table that contains the player custom properties</param>
 /// <param name="value">The value to write</param>
 protected abstract void WriteValue(NetworkPropertiesTable propertiesTable, V value);
 /// <inheritdoc />
 protected override void WriteValue(NetworkPropertiesTable propertiesTable, long value)
 {
     propertiesTable.Set(this.propertyKey, value);
 }
Beispiel #20
0
 /// <inheritdoc />
 protected override NetworkEndpoint ReadValue(NetworkPropertiesTable propertiesTable)
 {
     return(propertiesTable.GetNetworkEndpoint(this.propertyKey));
 }