Mysql update tweak
This commit is contained in:
@@ -6,6 +6,7 @@ import org.bukkit as bukkit
|
|||||||
from org.bukkit import *
|
from org.bukkit import *
|
||||||
from helpers import *
|
from helpers import *
|
||||||
|
|
||||||
|
|
||||||
# Version number and requirements
|
# Version number and requirements
|
||||||
|
|
||||||
alias_version = "2.1.0"
|
alias_version = "2.1.0"
|
||||||
@@ -131,7 +132,7 @@ def on_alias_command(sender, cmd, label, args):
|
|||||||
return
|
return
|
||||||
if args[0].lower() != "player" and not is_player(sender):
|
if args[0].lower() != "player" and not is_player(sender):
|
||||||
msg(sender, "&cThe console cannot have aliases")
|
msg(sender, "&cThe console cannot have aliases")
|
||||||
return
|
return True
|
||||||
subcommands[args[0].lower()](sender, args[1:])
|
subcommands[args[0].lower()](sender, args[1:])
|
||||||
except:
|
except:
|
||||||
subcommands["help"](sender, "1")
|
subcommands["help"](sender, "1")
|
||||||
@@ -381,9 +382,8 @@ def save_data(uuid):
|
|||||||
def save_data_thread(uuid):
|
def save_data_thread(uuid):
|
||||||
conn = zxJDBC.connect(mysql_database, mysql_user, mysql_pass, "com.mysql.jdbc.Driver")
|
conn = zxJDBC.connect(mysql_database, mysql_user, mysql_pass, "com.mysql.jdbc.Driver")
|
||||||
curs = conn.cursor()
|
curs = conn.cursor()
|
||||||
value = json_dumps(data[uuid])
|
curs.execute("INSERT INTO `chatalias` (`uuid`, `alias`) VALUES (?, ?) ON DUPLICATE KEY UPDATE `alias` = VALUES(`alias`);",
|
||||||
curs.execute("INSERT INTO `chatalias` VALUES (?, ?) ON DUPLICATE KEY UPDATE `alias` = ?;",
|
(uuid, json_dumps(data[uuid])))
|
||||||
(uuid, value, value))
|
|
||||||
conn.commit()
|
conn.commit()
|
||||||
curs.close()
|
curs.close()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|||||||
Reference in New Issue
Block a user