Отображение _health

Начинающий
Статус
Оффлайн
Регистрация
19 Сен 2022
Сообщения
5
Реакции[?]
0
Поинты[?]
0
копался в ассемблере сервера игры и нашел такую функцию


C#:
public override void Save(global::BaseNetworkable.SaveInfo info)
{
    base.Save(info);
    bool flag = this.net != null && this.net.connection == info.forConnection;
    bool flag2;
    if (!info.forDisk && info.forConnection.player != null)
    {
        global::BasePlayer basePlayer = info.forConnection.player as global::BasePlayer;
        if (basePlayer != null)
        {
            flag2 = basePlayer.IsAdmin;
            goto IL_5E;
        }
    }
    flag2 = false;
    IL_5E:
    bool flag3 = flag2;
    info.msg.basePlayer = Pool.Get<ProtoBuf.BasePlayer>();
    info.msg.basePlayer.userid = this.userID;
    info.msg.basePlayer.name = this.displayName;
    info.msg.basePlayer.playerFlags = (int)this.playerFlags;
    info.msg.basePlayer.currentTeam = this.currentTeam;
    info.msg.basePlayer.heldEntity = this.svActiveItemID;
    info.msg.basePlayer.reputation = this.reputation;
    if (!info.forDisk && this.currentGesture != null && this.currentGesture.animationType == global::GestureConfig.AnimationType.Loop)
    {
        info.msg.basePlayer.loopingGesture = this.currentGesture.gestureId;
    }
    if (this.IsConnected && (this.IsAdmin || this.IsDeveloper))
    {
        info.msg.basePlayer.skinCol = this.net.connection.info.GetFloat("global.skincol", -1f);
        info.msg.basePlayer.skinTex = this.net.connection.info.GetFloat("global.skintex", -1f);
        info.msg.basePlayer.skinMesh = this.net.connection.info.GetFloat("global.skinmesh", -1f);
    }
    else
    {
        info.msg.basePlayer.skinCol = -1f;
        info.msg.basePlayer.skinTex = -1f;
        info.msg.basePlayer.skinMesh = -1f;
    }
    info.msg.basePlayer.underwear = this.GetUnderwearSkin();
    if (info.forDisk || flag)
    {
        info.msg.basePlayer.metabolism = this.metabolism.Save();
        info.msg.basePlayer.modifiers = null;
        if (this.modifiers != null)
        {
            info.msg.basePlayer.modifiers = this.modifiers.Save();
        }
    }
    if (!info.forDisk && !flag)
    {
        info.msg.basePlayer.playerFlags &= -5;
        info.msg.basePlayer.playerFlags &= -129;
        if (info.msg.baseCombat != null && !flag3)
        {
            info.msg.baseCombat.health = 100f;
        }
    }
    info.msg.basePlayer.inventory = this.inventory.Save(info.forDisk || flag);
    this.modelState.sleeping = this.IsSleeping();
    this.modelState.relaxed = this.IsRelaxed();
    this.modelState.crawling = this.IsCrawling();
    this.modelState.loading = this.IsLoadingAfterTransfer();
    info.msg.basePlayer.modelState = this.modelState.Copy();
    if (info.forDisk)
    {
        global::BaseEntity baseEntity = this.mounted.Get(base.isServer);
        if (baseEntity.IsValid())
        {
            if (baseEntity.enableSaving)
            {
                info.msg.basePlayer.mounted = this.mounted.uid;
            }
            else
            {
                global::BaseVehicle mountedVehicle = this.GetMountedVehicle();
                if (mountedVehicle.IsValid() && mountedVehicle.enableSaving)
                {
                    info.msg.basePlayer.mounted = mountedVehicle.net.ID;
                }
            }
        }
        info.msg.basePlayer.respawnId = this.respawnId;
    }
    else
    {
        info.msg.basePlayer.mounted = this.mounted.uid;
    }
    if (flag)
    {
        info.msg.basePlayer.persistantData = this.PersistantPlayerInfo.Copy();
        if (!info.forDisk && this.State.missions != null)
        {
            info.msg.basePlayer.missions = this.State.missions.Copy();
        }
        info.msg.basePlayer.bagCount = global::SleepingBag.GetSleepingBagCount(this.userID);
        info.msg.basePlayer.shelterCount = global::LegacyShelter.GetShelterCount(this.userID);
    }
    if (info.forDisk)
    {
        info.msg.basePlayer.loadingTimeout = this.timeUntilLoadingExpires;
        info.msg.basePlayer.currentLife = this.lifeStory;
        info.msg.basePlayer.previousLife = this.previousLifeStory;
    }
    if (!info.forDisk)
    {
        info.msg.basePlayer.clanId = this.clanId;
    }
    if (info.forDisk)
    {
        info.msg.basePlayer.itemCrafter = this.inventory.crafting.Save();
    }
    if (info.forDisk)
    {
        this.SavePlayerState();
    }
}

и в этой функции я увидел вывод хп игроков "100f"


C#:
if (!info.forDisk && !flag)
    {
        info.msg.basePlayer.playerFlags &= -5;
        info.msg.basePlayer.playerFlags &= -129;
        if (info.msg.baseCombat != null && !flag3)
        {
            info.msg.baseCombat.health = 100f;
        }
    }


и так как инфа о состоянии здоровья передаётся только админам(проверка сервера на auth level), можно попробывать передавать серверу auth level 2, или же попробывать найти другой способ, если тут будут такие люди, они поймут как это реализорвать
 
Пользователь
Статус
Оффлайн
Регистрация
29 Апр 2021
Сообщения
233
Реакции[?]
63
Поинты[?]
2K
owned by megaklop
Участник
Статус
Оффлайн
Регистрация
18 Май 2023
Сообщения
620
Реакции[?]
165
Поинты[?]
2K
копался в ассемблере сервера игры и нашел такую функцию


C#:
public override void Save(global::BaseNetworkable.SaveInfo info)
{
    base.Save(info);
    bool flag = this.net != null && this.net.connection == info.forConnection;
    bool flag2;
    if (!info.forDisk && info.forConnection.player != null)
    {
        global::BasePlayer basePlayer = info.forConnection.player as global::BasePlayer;
        if (basePlayer != null)
        {
            flag2 = basePlayer.IsAdmin;
            goto IL_5E;
        }
    }
    flag2 = false;
    IL_5E:
    bool flag3 = flag2;
    info.msg.basePlayer = Pool.Get<ProtoBuf.BasePlayer>();
    info.msg.basePlayer.userid = this.userID;
    info.msg.basePlayer.name = this.displayName;
    info.msg.basePlayer.playerFlags = (int)this.playerFlags;
    info.msg.basePlayer.currentTeam = this.currentTeam;
    info.msg.basePlayer.heldEntity = this.svActiveItemID;
    info.msg.basePlayer.reputation = this.reputation;
    if (!info.forDisk && this.currentGesture != null && this.currentGesture.animationType == global::GestureConfig.AnimationType.Loop)
    {
        info.msg.basePlayer.loopingGesture = this.currentGesture.gestureId;
    }
    if (this.IsConnected && (this.IsAdmin || this.IsDeveloper))
    {
        info.msg.basePlayer.skinCol = this.net.connection.info.GetFloat("global.skincol", -1f);
        info.msg.basePlayer.skinTex = this.net.connection.info.GetFloat("global.skintex", -1f);
        info.msg.basePlayer.skinMesh = this.net.connection.info.GetFloat("global.skinmesh", -1f);
    }
    else
    {
        info.msg.basePlayer.skinCol = -1f;
        info.msg.basePlayer.skinTex = -1f;
        info.msg.basePlayer.skinMesh = -1f;
    }
    info.msg.basePlayer.underwear = this.GetUnderwearSkin();
    if (info.forDisk || flag)
    {
        info.msg.basePlayer.metabolism = this.metabolism.Save();
        info.msg.basePlayer.modifiers = null;
        if (this.modifiers != null)
        {
            info.msg.basePlayer.modifiers = this.modifiers.Save();
        }
    }
    if (!info.forDisk && !flag)
    {
        info.msg.basePlayer.playerFlags &= -5;
        info.msg.basePlayer.playerFlags &= -129;
        if (info.msg.baseCombat != null && !flag3)
        {
            info.msg.baseCombat.health = 100f;
        }
    }
    info.msg.basePlayer.inventory = this.inventory.Save(info.forDisk || flag);
    this.modelState.sleeping = this.IsSleeping();
    this.modelState.relaxed = this.IsRelaxed();
    this.modelState.crawling = this.IsCrawling();
    this.modelState.loading = this.IsLoadingAfterTransfer();
    info.msg.basePlayer.modelState = this.modelState.Copy();
    if (info.forDisk)
    {
        global::BaseEntity baseEntity = this.mounted.Get(base.isServer);
        if (baseEntity.IsValid())
        {
            if (baseEntity.enableSaving)
            {
                info.msg.basePlayer.mounted = this.mounted.uid;
            }
            else
            {
                global::BaseVehicle mountedVehicle = this.GetMountedVehicle();
                if (mountedVehicle.IsValid() && mountedVehicle.enableSaving)
                {
                    info.msg.basePlayer.mounted = mountedVehicle.net.ID;
                }
            }
        }
        info.msg.basePlayer.respawnId = this.respawnId;
    }
    else
    {
        info.msg.basePlayer.mounted = this.mounted.uid;
    }
    if (flag)
    {
        info.msg.basePlayer.persistantData = this.PersistantPlayerInfo.Copy();
        if (!info.forDisk && this.State.missions != null)
        {
            info.msg.basePlayer.missions = this.State.missions.Copy();
        }
        info.msg.basePlayer.bagCount = global::SleepingBag.GetSleepingBagCount(this.userID);
        info.msg.basePlayer.shelterCount = global::LegacyShelter.GetShelterCount(this.userID);
    }
    if (info.forDisk)
    {
        info.msg.basePlayer.loadingTimeout = this.timeUntilLoadingExpires;
        info.msg.basePlayer.currentLife = this.lifeStory;
        info.msg.basePlayer.previousLife = this.previousLifeStory;
    }
    if (!info.forDisk)
    {
        info.msg.basePlayer.clanId = this.clanId;
    }
    if (info.forDisk)
    {
        info.msg.basePlayer.itemCrafter = this.inventory.crafting.Save();
    }
    if (info.forDisk)
    {
        this.SavePlayerState();
    }
}

и в этой функции я увидел вывод хп игроков "100f"


C#:
if (!info.forDisk && !flag)
    {
        info.msg.basePlayer.playerFlags &= -5;
        info.msg.basePlayer.playerFlags &= -129;
        if (info.msg.baseCombat != null && !flag3)
        {
            info.msg.baseCombat.health = 100f;
        }
    }


и так как инфа о состоянии здоровья передаётся только админам(проверка сервера на auth level), можно попробывать передавать серверу auth level 2, или же попробывать найти другой способ, если тут будут такие люди, они поймут как это реализорвать
ай мавроди, а яйаяй
1708270678327.png
1708270682558.png
 
Начинающий
Статус
Оффлайн
Регистрация
28 Окт 2021
Сообщения
247
Реакции[?]
20
Поинты[?]
11K
тем временем чел который заспавнился с 100 хп :whyRly:
братух игрок спавнится с рандомным значением здоровья от 50 до 60
братух игрок спавнится с рандомным значением здоровья от 50 до 60
return UnityEngine.Random.Range(50f, 60f);
 
Пользователь
Статус
Оффлайн
Регистрация
29 Апр 2021
Сообщения
233
Реакции[?]
63
Поинты[?]
2K
братух игрок спавнится с рандомным значением здоровья от 50 до 60

return UnityEngine.Random.Range(50f, 60f);
это понятно, я имею ввиду чел отхилился до 100хп ливнул с игры и зашел, а у него статиком будет от 60 хп высчитываться
 
НЕКАСЕСТВЕНЫЙ КАД
Участник
Статус
Оффлайн
Регистрация
27 Фев 2019
Сообщения
1,416
Реакции[?]
247
Поинты[?]
4K
Начинающий
Статус
Оффлайн
Регистрация
24 Июн 2021
Сообщения
209
Реакции[?]
10
Поинты[?]
0
А если плотный анрег?
А если плотный анрег?
Код:
                    if (info->damageTypes()->Total() == 0.00)
                    {
                        LogSystem::Log(StringFormat::format((L"unregistred shot (missed shot due to 0 damage)"), NULL), 5.f);
                    }
                    else
                    {
                        LogSystem::Log(StringFormat::format((L"Hit %s in %s for %.2f damage"), reinterpret_cast<BasePlayer*>(entity)->_displayName(), utils::StringPool::Get(info->HitBone())->buffer, info->damageTypes()->Total()), 5.f);
                    }
 
Разработчик
Статус
Оффлайн
Регистрация
1 Сен 2018
Сообщения
1,606
Реакции[?]
872
Поинты[?]
113K
копался в ассемблере сервера игры и нашел такую функцию


C#:
public override void Save(global::BaseNetworkable.SaveInfo info)
{
    base.Save(info);
    bool flag = this.net != null && this.net.connection == info.forConnection;
    bool flag2;
    if (!info.forDisk && info.forConnection.player != null)
    {
        global::BasePlayer basePlayer = info.forConnection.player as global::BasePlayer;
        if (basePlayer != null)
        {
            flag2 = basePlayer.IsAdmin;
            goto IL_5E;
        }
    }
    flag2 = false;
    IL_5E:
    bool flag3 = flag2;
    info.msg.basePlayer = Pool.Get<ProtoBuf.BasePlayer>();
    info.msg.basePlayer.userid = this.userID;
    info.msg.basePlayer.name = this.displayName;
    info.msg.basePlayer.playerFlags = (int)this.playerFlags;
    info.msg.basePlayer.currentTeam = this.currentTeam;
    info.msg.basePlayer.heldEntity = this.svActiveItemID;
    info.msg.basePlayer.reputation = this.reputation;
    if (!info.forDisk && this.currentGesture != null && this.currentGesture.animationType == global::GestureConfig.AnimationType.Loop)
    {
        info.msg.basePlayer.loopingGesture = this.currentGesture.gestureId;
    }
    if (this.IsConnected && (this.IsAdmin || this.IsDeveloper))
    {
        info.msg.basePlayer.skinCol = this.net.connection.info.GetFloat("global.skincol", -1f);
        info.msg.basePlayer.skinTex = this.net.connection.info.GetFloat("global.skintex", -1f);
        info.msg.basePlayer.skinMesh = this.net.connection.info.GetFloat("global.skinmesh", -1f);
    }
    else
    {
        info.msg.basePlayer.skinCol = -1f;
        info.msg.basePlayer.skinTex = -1f;
        info.msg.basePlayer.skinMesh = -1f;
    }
    info.msg.basePlayer.underwear = this.GetUnderwearSkin();
    if (info.forDisk || flag)
    {
        info.msg.basePlayer.metabolism = this.metabolism.Save();
        info.msg.basePlayer.modifiers = null;
        if (this.modifiers != null)
        {
            info.msg.basePlayer.modifiers = this.modifiers.Save();
        }
    }
    if (!info.forDisk && !flag)
    {
        info.msg.basePlayer.playerFlags &= -5;
        info.msg.basePlayer.playerFlags &= -129;
        if (info.msg.baseCombat != null && !flag3)
        {
            info.msg.baseCombat.health = 100f;
        }
    }
    info.msg.basePlayer.inventory = this.inventory.Save(info.forDisk || flag);
    this.modelState.sleeping = this.IsSleeping();
    this.modelState.relaxed = this.IsRelaxed();
    this.modelState.crawling = this.IsCrawling();
    this.modelState.loading = this.IsLoadingAfterTransfer();
    info.msg.basePlayer.modelState = this.modelState.Copy();
    if (info.forDisk)
    {
        global::BaseEntity baseEntity = this.mounted.Get(base.isServer);
        if (baseEntity.IsValid())
        {
            if (baseEntity.enableSaving)
            {
                info.msg.basePlayer.mounted = this.mounted.uid;
            }
            else
            {
                global::BaseVehicle mountedVehicle = this.GetMountedVehicle();
                if (mountedVehicle.IsValid() && mountedVehicle.enableSaving)
                {
                    info.msg.basePlayer.mounted = mountedVehicle.net.ID;
                }
            }
        }
        info.msg.basePlayer.respawnId = this.respawnId;
    }
    else
    {
        info.msg.basePlayer.mounted = this.mounted.uid;
    }
    if (flag)
    {
        info.msg.basePlayer.persistantData = this.PersistantPlayerInfo.Copy();
        if (!info.forDisk && this.State.missions != null)
        {
            info.msg.basePlayer.missions = this.State.missions.Copy();
        }
        info.msg.basePlayer.bagCount = global::SleepingBag.GetSleepingBagCount(this.userID);
        info.msg.basePlayer.shelterCount = global::LegacyShelter.GetShelterCount(this.userID);
    }
    if (info.forDisk)
    {
        info.msg.basePlayer.loadingTimeout = this.timeUntilLoadingExpires;
        info.msg.basePlayer.currentLife = this.lifeStory;
        info.msg.basePlayer.previousLife = this.previousLifeStory;
    }
    if (!info.forDisk)
    {
        info.msg.basePlayer.clanId = this.clanId;
    }
    if (info.forDisk)
    {
        info.msg.basePlayer.itemCrafter = this.inventory.crafting.Save();
    }
    if (info.forDisk)
    {
        this.SavePlayerState();
    }
}

и в этой функции я увидел вывод хп игроков "100f"


C#:
if (!info.forDisk && !flag)
    {
        info.msg.basePlayer.playerFlags &= -5;
        info.msg.basePlayer.playerFlags &= -129;
        if (info.msg.baseCombat != null && !flag3)
        {
            info.msg.baseCombat.health = 100f;
        }
    }


и так как инфа о состоянии здоровья передаётся только админам(проверка сервера на auth level), можно попробывать передавать серверу auth level 2, или же попробывать найти другой способ, если тут будут такие люди, они поймут как это реализорвать
нихуя себе ассемблер
 
Начинающий
Статус
Оффлайн
Регистрация
24 Июн 2021
Сообщения
209
Реакции[?]
10
Поинты[?]
0
норм мавроди на 300 руб скамит, хавать нечего чтоли хд

1710092129978.pngвремя со скольки я жду свой код

1710092177052.pngподождал
 
profitprogrammer
Участник
Статус
Онлайн
Регистрация
13 Дек 2020
Сообщения
889
Реакции[?]
180
Поинты[?]
60K
Начинающий
Статус
Оффлайн
Регистрация
28 Окт 2021
Сообщения
247
Реакции[?]
20
Поинты[?]
11K
Сверху Снизу