Ir para conteúdo

Error MYSQL AND SQLITE


BigWriter

Posts Recomendados

Bom, estou dando uma editada no simpleclans até ai sem nenhum error no console etc, estou no caso querendo fazer Líder e Co-Líder eu consegui colocar o nome do jogador no clan profile etc. só que quando eu reinicio o servidor eu perco o líder e o co-líder o clan simplesmente fica criado mais sem os 2, acho que eu fiz errado alguma coisa quando inicia a db, porque quando eu promovo e crio o clan n da problema apenas quando vou reiniciar... caso alguem entenda o código está ai.

public void initiateDB() {
		if (this.plugin.getSettingsManager().isUseMysql()) {
			this.core = new MySQLCore(this.plugin.getSettingsManager().getHost(),
					this.plugin.getSettingsManager().getDatabase(), this.plugin.getSettingsManager().getUsername(),
					this.plugin.getSettingsManager().getPassword());
			if (this.core.checkConnection()) {
				SimpleClans.log("MYSQL CONECTOU");
				if (!this.core.existsTable("sc_clans")) {
					SimpleClans.log("Creating table: sc_clans", new Object[0]);
					final String query = "CREATE TABLE IF NOT EXISTS `sc_clans` ( `id` bigint(20) NOT NULL auto_increment, `verified` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `color_tag` varchar(25) NOT NULL, `name` varchar(100) NOT NULL, `friendly_fire` tinyint(1) default '0', `founded` bigint NOT NULL, `last_used` bigint NOT NULL, `packed_bb` mediumtext NOT NULL, `flags` text NOT NULL, `balance` double(64,2), PRIMARY KEY  (`id`), UNIQUE KEY `uq_simpleclans_1` (`tag`));";
					this.core.execute(query);
				}
				if (!this.core.existsTable("sc_players")) {
					SimpleClans.log("Creating table: sc_players", new Object[0]);
					final String query = "CREATE TABLE IF NOT EXISTS `sc_players` ( `id` bigint(20) NOT NULL auto_increment, `name` varchar(16) NOT NULL, `leader` tinyint(1) default '0', `leader2` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `friendly_fire` tinyint(1) default '0', `neutral_kills` int(11) default NULL, `rival_kills` int(11) default NULL, `civilian_kills` int(11) default NULL, `deaths` int(11) default NULL, `last_seen` bigint NOT NULL, `join_date` bigint NOT NULL, `trusted` tinyint(1) default '0', `flags` text NOT NULL, `packed_past_clans` text, PRIMARY KEY  (`id`), UNIQUE KEY `uq_sc_players_1` (`name`));";
					this.core.execute(query);
				}
				if (!this.core.existsTable("sc_kills")) {
					SimpleClans.log("Creating table: sc_kills", new Object[0]);
					final String query = "CREATE TABLE IF NOT EXISTS `sc_kills` ( `kill_id` bigint(20) NOT NULL auto_increment, `attacker` varchar(16) NOT NULL, `attacker_tag` varchar(16) NOT NULL, `victim` varchar(16) NOT NULL, `victim_tag` varchar(16) NOT NULL, `kill_type` varchar(1) NOT NULL, PRIMARY KEY  (`kill_id`));";
					this.core.execute(query);
				}
			} else {
				SimpleClans.getInstance().getServer().getConsoleSender().sendMessage("MYSQL FALHOU @%$#~&I");
			}
		} else {
			this.core = new SQLiteCore(this.plugin.getDataFolder().getPath());
			if (this.core.checkConnection()) {
				SimpleClans.log("SQLITE CONECTOU! ");
				if (!this.core.existsTable("sc_clans")) {
					SimpleClans.log("Creating table: sc_clans", new Object[0]);
					final String query = "CREATE TABLE IF NOT EXISTS `sc_clans` ( `id` bigint(20), `verified` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `color_tag` varchar(25) NOT NULL, `name` varchar(100) NOT NULL, `friendly_fire` tinyint(1) default '0', `founded` bigint NOT NULL, `last_used` bigint NOT NULL, `packed_bb` mediumtext NOT NULL, `flags` text NOT NULL, `balance` double(64,2) default 0.0,  PRIMARY KEY  (`id`), UNIQUE (`tag`));";
					this.core.execute(query);
				}
				if (!this.core.existsTable("sc_players")) {
					SimpleClans.log("Creating table: sc_players", new Object[0]);
					final String query = "CREATE TABLE IF NOT EXISTS `sc_players` ( `id` bigint(20), `name` varchar(16) NOT NULL, `leader` tinyint(1) default '0', `leader2` tinyint(1) default '0', `tag` varchar(25) NOT NULL, `friendly_fire` tinyint(1) default '0', `neutral_kills` int(11) default NULL, `rival_kills` int(11) default NULL, `civilian_kills` int(11) default NULL, `deaths` int(11) default NULL, `last_seen` bigint NOT NULL, `join_date` bigint NOT NULL, `trusted` tinyint(1) default '0', `flags` text NOT NULL, `packed_past_clans` text, PRIMARY KEY  (`id`), UNIQUE (`name`));";
					this.core.execute(query);
				}
				if (!this.core.existsTable("sc_kills")) {
					SimpleClans.log("Creating table: sc_kills", new Object[0]);
					final String query = "CREATE TABLE IF NOT EXISTS `sc_kills` ( `kill_id` bigint(20), `attacker` varchar(16) NOT NULL, `attacker_tag` varchar(16) NOT NULL, `victim` varchar(16) NOT NULL, `victim_tag` varchar(16) NOT NULL, `kill_type` varchar(1) NOT NULL, PRIMARY KEY  (`kill_id`));";
					this.core.execute(query);
				}
			} else {
				SimpleClans.getInstance().getServer().getConsoleSender().sendMessage("SQLITE FALHOU!");
			}
		}
	}
Link para o comentário
Compartilhar em outros sites

Visitante
Este tópico está impedido de receber novos posts.
×
×
  • Criar Novo...