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

Detailed KickClient message #504

Merged
merged 6 commits into from
Oct 3, 2018
Merged

Detailed KickClient message #504

merged 6 commits into from
Oct 3, 2018

Conversation

justinnobledev
Copy link
Contributor

This is a quality of life change that I was asked to make it makes it so that the disconnect menu shows more information about your ban.

Description

The disconnect box(at least in csgo) allows you to format it with new lines and html I made it so that it would show which admin banned you, the reason and the length of the ban on the initial ban. Reconnecting to the server after the ban will show you the standard ban message

Motivation and Context

QOL #468

How Has This Been Tested?

I have tested this on a windows csgo server with just base sourcemod and sbpp. I tested this by banning myself to check if the message pops up when it should.

Screenshots (if appropriate):

screenshot

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.

Print which admin ban the client, the reason and the length of the ban.
@rumblefrog rumblefrog self-requested a review August 19, 2018 08:12
if(time == 0)
Format(length, sizeof(length), "permament");
else
Format(length, sizeof(length), "%d %s", time, time == 1 ? "minute" : "minutes");
Copy link
Contributor

Choose a reason for hiding this comment

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

Why Format? I suggest FormatEx.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why would you suggest FormatEx over Format?

Copy link
Contributor

Choose a reason for hiding this comment

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

Faster. Format uses a temporary buffer, and after format operations, copies to passed buffer. FormatEx writes directly to passed buffer.

@josegoncalvestorres
Copy link

Is it possible to add when you are already banned a info message? That info only shows up when you are banned, after if you try to join again just say the usual message. And I'm getting this error: [SM] Warning(s) encountered in translation file "sourcebans.phrases.txt"
L 08/30/2018 - 03:23:22: [SM] Invalid token ' ' in #format property on line 151.

@CrazyHackGUT
Copy link
Contributor

CrazyHackGUT commented Aug 30, 2018

"#format" "{1:N},{2:s},{3:s}"

SourceMod doesn't love spaces in the format.

@crashzk
Copy link

crashzk commented Sep 27, 2018

One suggestion would be beyond the options that @R3TROATTACK cited more information to identify ADMIN that banned, example:

You are banned from this server, more information below:
- Admin:
- Steam_ID:
- Reason:
- Length:

For more information access: http://www.yourwebsite.net/

It would be possible? I believe it would be more agrarable to visualize and easier to identify the ADMIN that applied the ban.

@justinnobledev
Copy link
Contributor Author

justinnobledev commented Sep 30, 2018

One suggestion would be beyond the options that @R3TROATTACK cited more information to identify ADMIN that banned, example:

You are banned from this server, more information below:
- Admin:
- Steam_ID:
- Reason:
- Length:

For more information access: http://www.yourwebsite.net/

It would be possible? I believe it would be more agrarable to visualize and easier to identify the ADMIN that applied the ban.

I personally prefer it the way it is but if anyone else thinks it would be better that way I would be fine changing this.

Copy link
Contributor

@sneak-it sneak-it left a comment

Choose a reason for hiding this comment

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

Tested all changes to date, everything looks good, definitely a nice QoL change.

@crashzk
Copy link

crashzk commented Apr 25, 2020

@R3TROATTACK I would like to suggest some changes, currently the details of the ban are displayed like this:
image

You have been banned by this server, check {1} for more info

Admin: {1}
Reason: {2}
Length: {3}

It would be possible to implement to have the option to show the ban information like this:

You have been banned by this server:
Admin: {1}
Date/Time: {2}
Reason: {3}
Length: {4}

Check {1} for more info

And the date option would display the date and time of his ban. Would these changes be possible?

I even tried changing only the translation, but there is no way to leave the option:

	"Banned Check Site"
	{
		"#format"	"{1:s}"
		"en"			"You have been banned by this server, check {1} for more info"
	}

Divided as I mentioned above.

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

Successfully merging this pull request may close these issues.

6 participants