예제 #1
0
        protected virtual void OnGamePropertiesUpdate(INetworkConnection con, PacketGamePropertiesUpdateNotification msg)
        {
            if (msg.PropertyBagId == Properties.ID)
            {
                if (msg.Remove)
                {
                    Properties.RemoveProperties(msg.Properties);
                }
                else
                {
                    Properties.UpdateWithValues(msg.Properties);
                }
            }

            Log.LogMsg(">>> Game Properties Updated: " + msg.Properties.Length.ToString());
        }
예제 #2
0
        public override void RemoveComponent(IComponent c)
        {
            base.RemoveComponent(c);
            ServerCharacterComponent com = c as ServerCharacterComponent;

            if (com != null)
            {
                com.AddedStats.UnSubscribeToChangeNotifications(this);
                com.AddedProperties.UnSubscribeToChangeNotifications(this);

                if (Components.Count < 1)
                {
                    Properties.UnSubscribeToChangeNotifications(com);
                    Stats.UnSubscribeToChangeNotifications(com);
                }

                Stats.RemoveStats(com.AddedStats);
                Properties.RemoveProperties(com.AddedProperties);
            }
        }