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

Новые команды setallbalance и setbalance #257

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

user424242420
Copy link

@user424242420 user424242420 commented Jun 3, 2024

setallbalance и setbalance команды по заказу кмина

ДЛЯ РАБОТЫ КОМАНД НАДО ПЕРЕЗАГРУЗИТЬ СЕРВЕР ТАК КАК ОНИ МЕНЯЮТ ДАННЫЕ В БАЗЕ ДАННЫХ.

То есть можно засетать 0 даже тому кто сейчас не на сервере

Copy link
Member

@FireNameFN FireNameFN left a comment

Choose a reason for hiding this comment

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

Про ранний выход и не слышал.

{
var loc = IoCManager.Resolve<ILocalizationManager>();
var set_balance = 0;
int.TryParse(args[1], out set_balance);
Copy link
Member

Choose a reason for hiding this comment

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

Вот этот мусор сделает всем плохо.

Comment on lines +267 to +269
await using var db = await GetDb();
await db.DbContext.Database.ExecuteSqlAsync($"""UPDATE profile SET bank_balance = {set_balance}""");
await db.DbContext.SaveChangesAsync();
Copy link
Collaborator

Choose a reason for hiding this comment

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

SQL инъекции привет передают

Copy link
Collaborator

@JerryImMouse JerryImMouse Jun 8, 2024

Choose a reason for hiding this comment

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

var parameters = new[]
{
        new SqlParameter("@balance", setBalance),
};
await db.DbContext.Database.ExecuteSqlRawAsync(query, parameters);

Copy link
Author

Choose a reason for hiding this comment

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

@JerryImMouse а ты видишь какие параметры передаются в функцию? Как ты строку в инт передашь?

@Vonsant
Copy link
Collaborator

Vonsant commented Jun 15, 2024

Пусть висит в открытых, это на новый год.

@Vonsant Vonsant closed this Jul 13, 2024
@Vonsant Vonsant reopened this Jul 13, 2024
@Vonsant Vonsant closed this Jul 13, 2024
@Vonsant Vonsant reopened this Jul 13, 2024
@user424242420
Copy link
Author

🙃

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

Successfully merging this pull request may close these issues.

4 participants