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

Tablist and MySQL #26

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

Tablist and MySQL #26

wants to merge 8 commits into from

Conversation

LordBoos
Copy link
Contributor

  • Add posibility to have "news" channel on Discord. When user sends message to that channel, it is pushed to mysql database (to be shown on website).

  • Add posibility to show Discord users with set roles in the Minecraft tablist with configurable format

…essages sent from discord to game and from game to discord. The format will start to work as soon as a player has the same nickname in game and on discord and writes one chat message to the game chat.
Add possibility to show discord users in Minecraft tablist
try {
Statement statement = DiscordMC.getConnection().createStatement();
String query = "INSERT INTO `DiscordMC_news`(`message`, `user`) " +
"VALUES ('" + finalContent + "','" + nickname + "')";
Copy link
Owner

Choose a reason for hiding this comment

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

This should be handled with a PreparedStatement to prevent SQL injection

Statement statement = null;

try {
connection.setAutoCommit(false);
Copy link
Owner

Choose a reason for hiding this comment

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

Why not auto commit?

connection.commit();

} finally {
connection.setAutoCommit(true);
Copy link
Owner

Choose a reason for hiding this comment

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

Why that?

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.

2 participants