Jump to content
  • 0
Gremlin

Adicionar delay a um comando

Question

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...



     



  • Recently Browsing

    No registered users viewing this page.

  • Similar Content

    • By Gabrieljdb
      &&    &    ||    |    !    ^
      Olá!
      Vi alguém com duvidas de como formular uma condição, então resolvi pesquisar e achei um texto bem objetivo e decidi compartilhar.
       
      ---
      Suponhamos que temos a tal condição:
      if(idade > 70 && s*** == masculino)
      Concorda que o if só será executado caso a idade seja maior que 70 e o s*** masculino
      Basicamente o programa vai checar se a idade é maior que 70, caso não seja, ele já pára na hora de executar! Isso no caso do &&.
      ---
      Agora suponhamos que temos:
      if(idade > 70 & s*** == masculino)
      O programa ao invés de descartar logo de cara a condição toda caso idade seja menor que 70, também checará a condição de lá, ou seja, ‘s*** == masculino’.
      Mas aí você pergunta, e qual a vantagem disso?
      A vantagem é nesse caso:
      if(idade > 70 & ++idade == 69 )
      Ele está além de fazendo a condição, estará pré-incrementando idade em 1! Assim isso mexerá na variável idade, o que significará que o operador lógico AND “&” deve ser usado pois nós vamos querer que a o compilador cheque AMBAS as condições.
       
      ---
      Veja a seguinte tabela de operadores lógicos:
      && E (“logical AND”) a && b
      retorna true se a e b forem ambos true. Senão retorna false. Se a for false, b não é avaliada.
      & E (“boolean logical AND”) a & b
      retorna true se a e b forem ambos true. Senão retorna false. Ambas expressões a e b são sempre avaliadas.
      || OU (“logical OR”) a || b
      retorna true se a ou b for true. Senão retorna false. Se a for true, b não é avaliada.
      | OU (“boolean logical inclusive OR”) a | b
      retorna true se a ou b for true. Senão retorna false. Ambas expressões a e b são sempre avaliadas.
      ^ OU EXCLUSIVO (“boolean logical exclusive OR”) a ^ b
      retorna true se a for true e b for false ou vice-versa. Senão retorna false
      ! NÃO (“logical NOT”) !a
      retorna true se a for false. Senão retorna false
       
      ---
      Créditos: Giancarlo Braga
      Abraços. Espero que seja útil.
    • By Gabrieljdb
      Recentemente mudei os imports da L2JFrozen 1,5, e vim me deparar com esse erro no GS
      Exception in thread "main" INFO Connecting to login on 127.0.0.1:9014 java.lang.NoClassDefFoundError: com/l2jfrozen/Config at javolution.testing.Logger.logMe(Logger.java:1) at com.l2jpaocomovo.gameserver.GameServer.main(GameServer.java:581) Caused by: java.lang.ClassNotFoundException: com.l2jfrozen.Config at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 2 more INFO Registered on login as Server 1 : L2jPaoComOvo O Servidor liga normal, cria conta normal, porem
      ping fica em "9999" e não passa da tela de login, 
      vou postar config do GS e LS
      # ===================================# # Game Server Settings # # ===================================# # Enter here (ip) address of your game server, or use the symbol * GameserverHostname = * GameserverPort = 7777 # Configure your external ip ExternalHostname = 127.0.0.1 # Configure your internal ip InternalHostname = 127.0.0.1 # Bunch ID and game server. It is better not to change. LoginPort = 9014 LoginHost = 127.0.0.1 # Parameters Databases # Database DBMS is MariaDB DatabaseGameServerHost = 127.0.0.1 # Database name GameserverDB = L2jPaoComOvo LoginserverDB = L2jPaoComOvo # Database user DatabaseUser = root # Password - Database password for user DatabasePassword = # BETA SERVER: Use this config for better testing during your BETA # All players on login (also no GM char) will got Gm Speed 4 for better testing. BetaServer = False # if true the server will be a test server (listed by test server clients only) TestServer = False # Setting for serverList # Displays [] in front of server name ServerListBrackets = False # Displays a clock next to the server name ServerListClock = False # If true, the server will be set as GM only ServerGMOnly = False # Define character name template # Example to use only : CnameTemplate=[A-Z][a-z]{3,3}[A-Za-z0-9]* # will allow names with first capital letter, next three small letters, # and any (capital or not) letter or number, like ZbigN1eW # Most rational to have CnameTemplate=[A-Z][a-z]* # meaning names only of letters with first one capital, like Zbigniew # Default .* - any namy of any symbols CnameTemplate = [a-zA-z0-9]{3,16} PetNameTemplate = [a-zA-z0-9]{3,16} ClanNameTemplate = [a-zA-z0-9]{3,16} AllyNameTemplate = [a-zA-z0-9]{3,16} # Maximum number of chars per account - Default 7 (0 = unlimited [7 is the client limit]) CharMaxNumber = 7 # Maximum number of chars per IP - Default 99 (0 = unlimited) CharMaxNumberPerIP = 99 # Define how many players are allowed to play simultaneously on your server. MaximumOnlineUsers = 1000 # Minimum and maximum protocol revision that server allow to connect. # You must keep MinProtocolRevision <= MaxProtocolRevision. # Retail 740 - 746 MinProtocolRevision = 1 MaxProtocolRevision = 999 # This is the server id that the gameserver will request (i.e. 1 is Bartz) RequestServerID = 1 #============================================================# # Login Server # #============================================================# # This is transmitted to the clients connecting from an external network, so it has to be a public IP or resolvable hostname ExternalHostname = 127.0.0.1 # This is transmitted to the client from the same network, so it has to be a local IP or resolvable hostname InternalHostname = 127.0.0.1 # Bind ip of the loginServer, use * to bind on all available IPs LoginserverHostname = * LoginserverPort = 2106 # How many times you can provide an invalid account/pass before the IP gets banned LoginTryBeforeBan = 20 # Time you won't be able to login back again after LoginTryBeforeBan tries to login. Provide a value in seconds. Default 10min. (600) LoginBlockAfterBan = 600 GMMinLevel = 100 # The address on which login will listen for GameServers, use * to bind on all available IPs LoginHostname = 127.0.0.1 # The port on which login will listen for GameServers LoginPort = 9014 # If set to True any GameServer can register on your login's free slots AcceptNewGameServer = False # If False, the licence (after the login) will not be shown # It is highly recomended for Account Seciurity to leave this option as defalut (True) ShowLicence = True # Parameters Databases # Database DBMS is MariaDB DatabaseLoginServerHost = 127.0.0.1 DatabaseLoginServerName = L2jPaoComOvo # User - Database user DatabaseUser = root # Password - Database password for user DatabasePassword = L2jPaoComOvo é ficticio, o nome real foi preservado
      esse erro acontece depois que mudei os imports
      de com.l2jfrozen ---> .coml2jpaocomovo
      antes funcionava normal
       
      --------------------------------------------------------------------------
      Minha conclusão é que devo ter esquecido de mudar algo, deixei algo passar,
      até pq aparece no erro que falta 
      java.lang.NoClassDefFoundError: com/l2jfrozen/Config  
      mas 
      na busca Ctrl+H no eclipse não me diz nada, compila normal tmb.
      alguém tem uma luz?
    • By Willards
      agora esta dando esse erro, ao da start no console do loginserver
       
       
    • By Luther
      Eae Família tudo paz ??
      É o seguinte galera, sou totalmente inexperiência na área de projetos privados, e vi comentários aqui no fórum de 1 ou 2 anos atras que a galera cita mais a Lucera e a L2jDream como as melhores no mercado, e vim aqui pedir a opinião de vocês de qual ta sendo a melhor atualmente, principalmente de quem já teve acesso a elas.
      deixe sua opinião  sobre elas ou outra que você recomendaria.
      Desde já agradeço a todos que comentarem.
    • By paris
      [14:51:32] WARN: Exception while retriving account info for 'digao03'!
      com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: The last packet successfully received from the server was 58.073.255 milliseconds ago.  The last packet sent successfully to the server was 58.073.263 milliseconds ago. is longer than the server configured value of 'wait_timeout'. You should consider either expiring and/or testing connection validity before use in your application, increasing the server configured values for client timeouts, or using the Connector/J connection property 'autoReconnect=true' to avoid this problem.
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at com.mysql.jdbc.Util.handleNewInstance(Util.java:377)
              at com.mysql.jdbc.SQLError.createCommunicationsException(SQLError.java:1036)
              at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3661)
              at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2417)
              at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2582)
              at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2530)
              at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1907)
              at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2030)
              at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
              at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
              at l2r.loginserver.LoginController.retriveAccountInfo(LoginController.java:227)
              at l2r.loginserver.LoginController.retriveAccountInfo(LoginController.java:173)
              at l2r.loginserver.network.clientpackets.RequestAuthLogin.run(RequestAuthLogin.java:132)
              at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
              at java.lang.Thread.run(Unknown Source)
              Suppressed: java.sql.SQLException: Already closed.
                      at org.apache.commons.dbcp.PoolableConnection.close(PoolableConnection.java:114)
                      at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:191)
                      at l2r.loginserver.LoginController.retriveAccountInfo(LoginController.java:248)
                      ... 5 more
      Caused by: java.net.SocketException: Software caused connection abort: socket write error
              at java.net.SocketOutputStream.socketWrite0(Native Method)
              at java.net.SocketOutputStream.socketWrite(Unknown Source)
              at java.net.SocketOutputStream.write(Unknown Source)
              at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
              at java.io.BufferedOutputStream.flush(Unknown Source)
              at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3643)
              ... 13 more
       
  • Posts

×
×
  • Create New...