public void OnSendBuffSync(BuffParam.BuffSyncParam sync_param)
 {
     if (base.enableSend && base.owner.IsOriginal())
     {
         Coop_Model_CharacterBuffSync coop_Model_CharacterBuffSync = new Coop_Model_CharacterBuffSync();
         coop_Model_CharacterBuffSync.id         = base.owner.id;
         coop_Model_CharacterBuffSync.sync_param = sync_param;
         SendBroadcast(coop_Model_CharacterBuffSync, false, null, null);
     }
 }
Пример #2
0
    private void UpdatePlayerStatus(int hp, BuffParam.BuffSyncParam buffSyncParam, int weaponEquipmentId)
    {
        if (this.hp != hp)
        {
            this.hp = hp;
            if (this.hp > hpMax)
            {
                hpMax = hp;
            }
            if (this.onUpdateHp != null)
            {
                this.onUpdateHp();
            }
        }
        if (buffSyncParam != null)
        {
            buff.SetSyncParamForExplorePlayerStatus(buffSyncParam);
            if (this.onUpdateBuff != null)
            {
                this.onUpdateBuff();
            }
        }
        if (this.weaponEquipmentId != weaponEquipmentId)
        {
            this.weaponEquipmentId = weaponEquipmentId;
            bool flag = weaponEquipItemData == null;
            weaponEquipItemData = Singleton <EquipItemTable> .I.GetEquipItemData((uint)weaponEquipmentId);

            if (flag && this.onInitialize != null)
            {
                this.onInitialize();
            }
            if (this.onUpdateWeapon != null)
            {
                this.onUpdateWeapon();
            }
        }
    }