Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pubovl (including extras) #905

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

Pubovl (including extras) #905

wants to merge 6 commits into from

Conversation

Conticop
Copy link

@Conticop Conticop commented Aug 3, 2020

Fixes #807
Original author: dd

I took some time to get Pubovl compatible with the latest master, and it has arrived here now.
I have tested it ingame, all works fine.
(See the above forum post for more info about Pubovl and its features.)


The bigger issue for me is that it makes it much easier to write a wallhack. All you need to do is delete the "only allow wallhack if you are spectator" check.

I thought, well it was made available to the public since a long time ago, with binaries precompiled and available for download from the same forum post above. So what the heck.
There'll always be cheaters in such game(s). Merge this to make admins' lives easier.

Original author: dd
Let's not do this.
@Conticop
Copy link
Author

Conticop commented Aug 3, 2020

I suppose I should have removed the comments...
(I just noticed some spacing got messed up too.)

* Removed useless comments. Rewritten a couple.

* Modernized some code fragments.

* Fixed indentation stuff (hopefully).
@Conticop
Copy link
Author

Conticop commented Aug 3, 2020

There, this is ready for review.
cc @yvt

@siecvi
Copy link

siecvi commented Aug 5, 2020

The extras should be removed or tweaked (cg_outlines, cg_textures), as they give some visibility advantage.
The player model already have neon-like colors, but when raising texture strength to more than 20 it gives extra contrast, that and cartoon-like outlines would give the perfect visibility.

shot0001
shot0002

* Removed `cg_multiTextureStrength` (unused).

* Decreased `cg_textureStrength` by half.

* Adjusted min/max of `cg_outlineStrength`.
@Conticop Conticop marked this pull request as draft August 6, 2020 17:02
@Haxk20
Copy link
Contributor

Haxk20 commented May 4, 2021

@Conticop Could you get this updated with the latest master changes ?
@yvt A little ping
This is an absolutely amazing change. While yes cheaters could easily enable ESP in real game.
Tho i would argue that it is FAR far easier for a cheater to download already made hacks then poking in the code.
And it is not that hard to add some multiple layers of checks in the code if they wanted to make ESP accesible to real gameplay.

@JimPix1
Copy link

JimPix1 commented Aug 11, 2022

@yvt Ping

Copy link
Owner

@yvt yvt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Although it's marked as draft now, I'm going to submit a review anyway to explain why it cannot be merged in the current state:

The largest problem is already stated by @siecvi: In addition to fixing #807, the PR introduces multiple features irrelevant to the primary change, such as the outline (NotTodo 2-3) and texturing effects and even global sound volume control. The PR must be kept minimal and focus on a single logical change.

Another problem concerns code quality - bypassing abstraction, the use of global variables, and such. The existing code is bad as it is, but let's not make it even worse.

@@ -190,6 +190,7 @@ namespace spades {
@field = CommandField(Manager, ui.chatHistory);
field.Bounds = AABB2(winX, winY, winW, 30.f);
field.Placeholder = _Tr("Client", "Chat Text");
field.MaxLength = 93;
Copy link
Owner

@yvt yvt Aug 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to the primary change.

Comment on lines 647 to 654
layouter.AddHeading(_Tr("Preferences", "OpenGL Effects"));
layouter.AddToggleField(_Tr("Preferences", "Outlines"), "cg_outlines");
layouter.AddSliderField(_Tr("Preferences", "Outline Strength"), "cg_outlineStrength", 2, 5, 1,
ConfigNumberFormatter(0, "px"));
layouter.AddToggleField(_Tr("Preferences", "Textures"), "cg_textures");
layouter.AddToggleField(_Tr("Preferences", "Multi-Texture Mode"), "cg_multiTextures");
layouter.AddSliderField(_Tr("Preferences", "Texture Strength"), "cg_textureStrength", 0, 100, 1,
ConfigNumberFormatter(0, "%"));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The outline (NotTodo 2-3) and texturing effects are clearly out of scope of this PR and should be removed.

namespace spades {
namespace client {

Client *Client::globalInstance = nullptr;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't store Client * in a global variable.

@@ -479,6 +481,10 @@ namespace spades {
void LocalPlayerCreatedLineBlock(IntVector3, IntVector3) override;
void LocalPlayerHurt(HurtType type, bool sourceGiven, Vector3 source) override;
void LocalPlayerBuildError(BuildFailureReason reason) override;

static bool AreCheatsEnabled(); // 'cheats', i.e. spectator wallhack or player names
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • The name needs to be more descriptive. How is this different from WallhackActive?
  • Don't make this member function static

@@ -479,6 +481,10 @@ namespace spades {
void LocalPlayerCreatedLineBlock(IntVector3, IntVector3) override;
void LocalPlayerHurt(HurtType type, bool sourceGiven, Vector3 source) override;
void LocalPlayerBuildError(BuildFailureReason reason) override;

static bool AreCheatsEnabled(); // 'cheats', i.e. spectator wallhack or player names
static bool WallhackActive();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Rename this to IsWallhackActive
  • Don't make this member function static

Comment on lines +218 to +231
// Update master volume control
if (s_volume_previous != (int)s_volume) {
// update the previous volume
s_volume_previous = (int)s_volume;
// compute the new dB level, where 27.71373379 ~ 10^(1/log(2)), and update
// the master gain to it
if ((int)s_volume == 0) {
dBPrevious = 0;
} else {
dBPrevious = powf(27.71373379f, log(((float)s_volume) / 100.0f));
}
al::qalListenerf(AL_GAIN, dBPrevious);
}

Copy link
Owner

@yvt yvt Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to the primary change.

Comment on lines +43 to +46
SPADES_SETTING(s_volume);
extern int s_volume_previous = 100; // keep track of the "previous" volume so the dB isn't recomputed when unnecessary
extern float dBPrevious = 1.0f;

Copy link
Owner

@yvt yvt Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to the primary change.

Comment on lines +41 to +44
SPADES_SETTING(s_volume);
extern int s_volume_previous;
extern float dBPrevious;

Copy link
Owner

@yvt yvt Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to the primary change.

Comment on lines +569 to +583

// Update master volume control
if (s_volume_previous != (int)s_volume) {
// update the previous volume
s_volume_previous = (int)s_volume;
// compute the new dB level, where 27.71373379 ~ 10^(1/log(2)), and update the
// master gain to it
if ((int)s_volume == 0) {
dBPrevious = 0;
} else {
dBPrevious = powf(27.71373379f, log(((float)s_volume) / 100.0f));
}
}
param.volume = dBPrevious;

Copy link
Owner

@yvt yvt Aug 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Irrelevant to the primary change.

Comment on lines -854 to +927
{
bool visiblePlayers[32];

if (!client::Client::WallhackActive()) {
GLProfiler::Context p(*profiler, "Non-mirrored Objects");
RenderObjects();
RenderObjects(false);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't refer to Client directly from the renderer layer. Introduce adequate abstractions in the renderer API.

@JimPix1
Copy link

JimPix1 commented Aug 13, 2022

Thanks for taking the time to reply, yvt. Hoping these problems get fixed 🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add pubovl spectating
6 participants