Aller au contenu
  • 0

Problème bdd


Question

Posté(e)

Bonjour,

 

J'ai un problème avec ma base de donnée,

en gros je vous explique, toutes mes variables qui commencent par "sync." se sauvegarde directement sur ma base de donnée mais le problème est le fait que les variables ( quelles soient les mm sur des serveurs différents ayant le mm config.sk commencant bien par un "sync." ) n'ont pas les mm valeurs.

Je voudrais savoir si quelqu'un serait faire en sorte que ces variables sur des serveurs différents "communiquent" ( aient les mm valeurs ) entre eux

 

Cordialement,

NelGossem_

5 réponses à cette question

Messages recommandés

  • 0
Posté(e)

Bonjour,

 

J'ai pas très bien compris ta demande, Je te fournie ce que j'utilise :

 

 

Voici mon config.sk :

 

#     __________________________________________________________
#    / /                                                   / /\ \
#    \_\___________________________________________________\_\/ /
#        / /    _____    __            __                    / /
#       / /    / ____\  / /           /_/          /\       / /
#      / /    / /__    / /___  ___   __  ______ __/ /_     / /
#     / /     \___ \  /   __/ / __\ / / / __  //_  __/    / /
#    / /     ____/ / / /\ \  / /   / / / /_/ /  / /      / /
#   / /     \_____/ /_/ /_/ /_/   /_/ / ____/  /_/      / /__
#  / /    ========================== / / ==========    / / \ \
# | |                               /_/               | |   | |
#  \_\_________________________________________________\_\_/_/
#
# == Introduction ==
# This file contains Skript's general options. To write scripts, create a new .sk file in the scripts folder or edit any existing one.
#
# Script files prefixed with a hyphen (-) will not be loaded, e.g. renaming 'plant with hoe.sk' to '-plant with hoe.sk' will disable the whole file.
# This can e.g. be used to temporarily disable scripts and is also used for Skript's example scripts.
# You can also use the command '/skript enable/disable <script>' to enable/disable a script which will automatically rename it.
#
# === !!! PLEASE NOTE !!! ===
# This file, all scripts and other files ending in .sk are NOT .yml/YAML files, but very similar!
# Please remember the following when editing files:
# - To indent sections you can use spaces like in YAML, but tabs are also allowed. Just remember to stick to the one or the other for a section/trigger.
# - '#' starts a comment like in YAML. If you don't want it to start a comment simply double it: '##' (You also have to double these in "quoted text")
# - If you use special characters (§, äöü, éèàôç, ñ, etc.) you have to encode the file in UTF-8.
#



# ==== General Options ====

language: english
# Which language to use. Currently english and german are included in the download, but custom languages can be created as well.
# Please note that not everything can be translated yet, i.e. parts of Skript will still be english if you use another language.
# If you want to translate Skript to your language please read the readme.txt located in the /lang/ folder in the jar
# (open the jar as zip or rename it to Skript.zip to access it)


check for new version: true
# Whether Skript should check for whether a new version of Skript is available when the server starts.
# If this is set to true Skript will announce a new version to all players with the "skript.admin" permission.
# If set to false you can still check for a new version with '/skript update check'.
# Please note that Skript will not detect beta releases even if you are running one as they are not necessarily stable.

update check interval: 12 hours
# If 'check for new version' is enabled, this sets how often to check for a new update.
# A first check will always be made when the server starts, after that checks will be made in intervals set by this option.
# Set this to 0 to disable repeated checks, in which case only one check will be made when the server starts.
# Please note that this option is currently the only means of making Skript check for an update more than once,
# as '/skript update check' does only display the results of the last check if a check has been made before.

automatically download new version: false
# Whether Skript should automatically download & install the newest version if one is available.
# I suggest to disable this feature if your server restarts automatically as you likely won't be informed
# of any incompatibilities of your scripts and the newest version of Skript.
# If you disable this you can still use '/skript update download' to make Skript download the newest version.
# If you're concerned about changes use '/skript update changes' for a full list of changes since your current version.


enable effect commands: false
effect command token: !
# If 'enable effect commands' is set to true, chat messages starting with the 'effect command token' will be interpreted as effects and executed.
# The token can be longer than a single character, but it should not start with '/' as that starts a command.
# A player needs the permission "skript.effectcommands" to use such commands,
# which does not default to OPs since these commands can do severe damage to the world or crash the server (see below).
# Some example commands which can be used if this setting is enabled:
#    !heal player - heals the player (doesn't do anything if used from the console)
#    !repair tool - repairs the currently held item
#    !broadcast "<red>Please read the rules!" - if you want to get rid of the quotes you have to define a custom command
#    !set time to 6:00 - sets the time in the current world
# The command can also be abused, so only give the permission to trusted players, like owners & co-owners:
#    !spawn 20 ender dragons - will destroy a large part of the world in a short time if no protection is present
#    !create explosion of force 10000 - likely crashes the server or at least hangs it up for a long time
#    !ban all players - as the effect implies

  • 0
Posté(e)
allow ops to use effect commands: false
# Whether server operators which do not have the permission "skript.effectcommands" should have access to effect commands.
# This setting is mainly useful for servers that do not run any permissions plugin.


use player UUIDs in variable names: false
# Whether to use a player's UUID instead of their name in variables, e.g. {home.%player%} will look like
# {home.e5240337-a4a2-39dd-8ed9-e5ce729a8522} instead of {home.njol}.
# Please note that if this setting is changed old variables WILL NOT be renamed automatically.


date format: default
# The date format to be used when dates should be displayed.
# This can be 'default' to use Java's default date format for the system's language.
# The format is that of Java's SimpleDateFormat as defined here: http://docs.oracle.com/javase/6/docs/api/java/text/SimpleDateFormat.html
# some examples:
#  d/M/yyyy h:mm a => 15/7/2012 8:53 PM
#  dd.MM.yyyy, HH:mm => 16.03.2013, 09:33


verbosity: normal
# Determines how much info is logged.
# Allowed values: low, normal, high, very high, debug
# The highest you should go is very high, which prints quite a lot of useful information,
# including how much time each trigger takes to execute.
# Only use debug if you're programming an add-on for Skript, but even then you might usually not need it.


plugin priority: high
# Allowed values: lowest, low, normal, high, highest
# Change this if you encounter problems with other plugins, e.g.:
# - cancelled events: The event is cancelled by another plugin, but Skript handles the event nonetheless => increase priority
#                    (e.g. WorldGuard cancels events if a player doesn't have permission for the given region,
#                     and you made some 'place' triggers which should not bypass WorldGuard's protection)
# - effects '(un)cancel event': Another plugin should/should not process the event, but does/does not => decrease priority
# - effect 'drop': Another plugin doesn't process added drops => decrease priority
# - effects 'remove ... from drops'/'clear drops': Drops added by other plugins are not removed => increase priority
#                                                  Skript removes drops it shouldn't => decrease priority or specify which item types to remove


log player commands: true
# Whether Skript should log the usage of custom commands.
# They will be logged as [iNFORMATION] in this format: '<player>: /<command> <arguments>'


number accuracy: 2
# How many digits should be displayed after the dot at maximum when displaying numbers.
# Zeroes will never be displayed at all, so this setting only applies to numbers that actually have a decimal part with one or more non-zero digits.
# Money bypasses this setting and is displayed as configured in your economy plugin if you have one.


maximum target block distance: 100
# How far to search for a player's targeted block in blocks/meters.
# Lower values improve performance, but might reduce the usability of your scripts.
# This value is limited by the server (e.g. by 'view-distance' in the server.properties), but is guaranteed to work up to 100 meters.


case sensitive: false
# Whether Skript's functions should be case sensitive or not.
# This e.g. applies to the effect 'replace' and the conditions 'contains' and 'is/is not'.
# Variable names are case-insensitive irrespective of this setting.


disable variable conflict warnings: false
# Disables warnings of potential variable name conflicts if set to true.
# I recommend to not touch this option, but if you do so you should at least set it back to false
# whenever you create new scripts with new variables.



# ==== Variables ====

databases:
       database 1:

               type: MySQL

               pattern: db.*

               monitor changes: true
               monitor interval: 10 seconds

               # == MySQL configuration ==
               host: localhost
               port: 3306
               user: Ton utilisateur Root ou autre
               password: Mot de passe
               database: Nom de ta base

       database 2:

               type: CSV

               pattern: db.*

               file: ./plugins/Skript/variables.csv

               backup interval: 2 hours

  • 0
Posté(e)

donc de mon côté je n'utilise pas sync ^^ !

 

Ensuite dans mon skript tout en haut je met ceci :

 

PS : CODE PRIT SUR INTERNET :

options:
   name_bd: nom de ta base                                      
   user_bd: root ou autre                                               
   pass_bd: mot de passe                                            
   ip_bd: localhost

   prefix: &6&l[stats]
   version: 0.6

script options:
   $ db url jdbc:mysql://{@ip_bd}:3306/{@name_bd}
   $ db username {@user_bd}
   $ db password {@pass_bd}

 

Ensuite je peux faire ceci :

 

CODE PRIT SUR INTERNET
command /stats [<text>]:
   trigger:
       if arg 1 is "player":
           wait 0.1 seconds
           open chest with 1 rows named "&2&lSTATS &3&lKills/Deaths" to player
           wait 0.2 seconds
           play raw sound "random.pop" at player with pitch 1 volume 0.1
           format slot 2 of player with diamond sword named "&2&lKills:&7 %{db.kills.%player%}%" to close
           wait 0.2 seconds
           play raw sound "random.pop" at player with pitch 1 volume 0.1
           format slot 6 of player with bone named "&c&lMorts:&7 %{db.deaths.%player%}%" to close
       else if arg 1 is "block":
           wait 0.3 seconds
           open chest with 4 rows named "&2&lSTATS &E&lCasser / placer" to player
           wait 0.1 seconds
           play raw sound "random.pop" at player with pitch 1 volume 0.1
           format slot 11 of player with quartz ore named "&3&lQuartz:&7&l %{db.quartz.%player%}%" to close
           format slot 12 of player with redstone ore named "&c&lRedstone:&7&l %{db.redstonee.%player%}%" to close
           format slot 13 of player with lapis ore named "&1&lLapis:&7&l %{db.lapis.%player%}%" to close
           format slot 14 of player with diamond ore named "&3&lDiamond:&7&l %{db.diamond.%player%}%" to close
           format slot 15 of player with emerald ore named "&2&lEmerald:&7&l %{db.emerald.%player%}%" to close
           format slot 21 of player with obsidian named "&7&lObsidian:&7&l %{db.obsidian.%player%}%" to close
           format slot 23 of player with stone named "&7&lStone:&7&l %{db.stone.%player%}%" to close
           format slot 31 of player with book named "&2&lTOTAL:&7&l %{db.blocksro.%player%}%" to close
       if arg 1 is "box":
           wait 0.1 seconds
           open chest with 1 rows named "&2&lSTATS &3&lKills/morts" to player
           wait 0.2 seconds
           play raw sound "random.pop" at player with pitch 1 volume 0.1
           format slot 2 of player with diamond sword named "&2&lKills:&7 %{db.kills.%player%}%" to close
           wait 0.2 seconds
           play raw sound "random.pop" at player with pitch 1 volume 0.1
           format slot 6 of player with bone named "&c&lMorts:&7 %{db.deaths.%player%}%" to close
       else if arg 1 is "resetall":
           send "{@prefix} &e&lRénitialisation des statistiques..."
           send "{@prefix} &e&l5"
           wait 1 seconds
           send "{@prefix} &e&l4"
           wait 1 seconds
           send "{@prefix} &e&l3"
           wait 1 seconds
           send "{@prefix} &e&l2"
           wait 1 seconds
           send "{@prefix} &e&l1"
           wait 0.5 seconds
           send "{@prefix} &2&lVos statistiques viennent d'être reset."
           set {db.kills.%player%} to 0
           set {db.deaths.%player%} to 0
           set {db.creeper.%player%} to 0
           set {db.skeleton.%player%} to 0
           set {db.spider.%player%} to 0
           set {db.zombie.%player%} to 0
           set {db.slime.%player%} to 0
           set {db.ghast.%player%} to 0
           set {db.pigman.%player%} to 0
           set {db.enderman.%player%} to 0
           set {db.cavespider.%player%} to 0
           set {db.silverfish.%player%} to 0
           set {db.blaze.%player%} to 0
           set {db.magmacube.%player%} to 0
           set {db.bat.%player%} to 0
           set {db.witch.%player%} to 0
           set {db.mobs.%player%} to 0
           set {db.pig.%player%} to 0
           set {db.sheep.%player%} to 0
           set {db.cow.%player%} to 0
           set {db.squid.%player%} to 0
           set {db.wolf.%player%} to 0
           set {db.ocelot.%player%} to 0
           set {db.horse.%player%} to 0
           set {db.chicken.%player%} to 0
           set {db.animals.%player%} to 0
           set {db.blocksro.%player%} to 0
           set {db.redstonee.%player%} to 0
           set {db.lapis.%player%} to 0
           set {db.obsidian.%player%} to 0
           set {db.emerald.%player%} to 0
           set {db.diamond.%player%} to 0
           set {db.stone.%player%} to 0
           set {db.quartz.%player%} to 0
       else:
           open chest with 3 rows named "&2&lStats d'&3%player%" to player
           wait 0.1 seconds
           set {_p} to "%player%" parsed as player
           play raw sound "random.pop" at player with pitch 1 volume 0.1
           format slot 10 of player with skull of {_p} named "&2&lStats &3&lKills/Deaths" with lore "&7Click ici" to close then run [make player execute command "/stats player"]
           format slot 16 of player with diamond pickaxe named "&2&lStats / &e&lCasser/placer les blocks" with lore "&7Click ici" to close then run [make player execute command "/stats block"]

on sign change:
   line 1 is "[megastats]":
       player has permission "megastats.admin"
       if line 2 is "all":
           set line 1 to "&3&l[stats]"
           set line 2 to "&2ALL"
           set line 3 to ""
           set line 4 to ""
       if line 2 is "monsters":
           set line 1 to "&3&l[stats]"
           set line 2 to "&cMonsters"
           set line 3 to ""
           set line 4 to ""
       if line 2 is "animals":
           set line 1 to "&3&l[stats]"
           set line 2 to "&2Animals"
           set line 3 to ""
           set line 4 to ""  
       if line 2 is "player":
           set line 1 to "&3&l[stats]"
           set line 2 to "&eKills"
           set line 3 to "&eDeaths"
           set line 4 to ""
       if line 2 is "broken":
           set line 1 to "&3&l[stats]"
           set line 2 to "&7Broken"
           set line 3 to "&7Blocks"
           set line 4 to ""


on rightclick on sign:
   if line 1 of clicked block is "&3&l[stats]":
       if line 2 of clicked block is "&eKills":
           if line 3 of clicked block is "&eDeaths":
               make player execute command "/stats player"
on rightclick on sign:
   if line 1 of clicked block is "&3&l[stats]":
       if line 2 of clicked block is "&2Animals":
           make player execute command "/stats animals"
on rightclick on sign:
   if line 1 of clicked block is "&3&l[stats]":
       if line 2 of clicked block is "&cMonsters":
           make player execute command "/stats monsters"
on rightclick on sign:
   if line 1 of clicked block is "&3&l[stats]":
       if line 2 of clicked block is "&2ALL":
           make player execute command "/stats"
on rightclick on sign:
   if line 1 of clicked block is "&3&l[stats]":
       if line 2 of clicked block is "&7Broken":
           if line 3 of clicked block is "&7Blocks":
               make player execute command "/stats ores"




on death of player:
   add 1 to {db.kills.%attacker%}
   add 1 to {db.deaths.%victim%}
on break of quartz ore:
   add 1 to {db.quartz.%player%}
   add 1 to {db.blocksro.%player%}
on break of diamond ore:
   add 1 to {db.diamond.%player%}
   add 1 to {blocksro.%player%}
on break of emerald ore:
   add 1 to {db.emerald.%player%}
   add 1 to {db.blocksro.%player%}
on break of obsidian:
   add 1 to {db.obsidian.%player%}
   add 1 to {db.blocksro.%player%}
on break of stone:
   add 1 to {db.stone.%player%}
   add 1 to {db.blocksro.%player%}
on break of lapis ore:
   add 1 to {db.lapis.%player%}
   add 1 to {db.blocksro.%player%}
on break of redstone ore:
   add 1 to {db.redstone.%player%}
   add 1 to {db.blocksro.%player%}

Quand je met tout ceci, J'ai aucun problème ça fonctionne niquelle ;) Les statistiques sont bien envoyés du serveur 1 au serveur 2.

 

J'espère que tu as compris x:

  • 0
Posté(e)
Merci,

Mais ca fonctionne toujours pas et quand je redémarre un serveur, ca reset toutes les variables ( peut-être que celles qui commencent par sync. )

Essaye avec db. Je connais pas sync^^ peut être que ça se reset ? Aucune idée.

×
×
  • Créer...

Information importante

Nous avons placé des cookies sur votre appareil pour aider à améliorer ce site. Vous pouvez choisir d’ajuster vos paramètres de cookie, sinon nous supposerons que vous êtes d’accord pour continuer.