Thread: Update Command

Results 1 to 5 of 5
  1. #1 Update Command 
    Registered Member zine's Avatar
    Join Date
    Nov 2011
    Posts
    40
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Ok so i decided to add a c2.sendMessage so my players know what update it is, either a update to add/fix content or just a general update ect..

    this is my code
    if (playerCommand.startsWith("update")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];

    String[] args = playerCommand.split(" ");
    int a = Integer.parseInt(args[1]);
    PlayerHandler.updateSeconds = a;
    PlayerHandler.updateAnnounced = false;
    PlayerHandler.updateRunning = true;
    c2.sendMessage ("Check the forums for the latest updates!");
    }
    }
    }
    it all works fine, it sends the message ect.. however the update does not wait until the count down is finished and kicks everyone off before the count down hits 0.

    for example if i set my timer to say 20 seconds (::update 20) it would get to 17 seconds and kick everyone off.. i know its probably todo with the way i have put the code but i can't figure out which way it should go.
    Reply With Quote  
     

  2. #2  
    Registered Member
    vovik ukr's Avatar
    Join Date
    Aug 2010
    Posts
    1,240
    Thanks given
    136
    Thanks received
    187
    Rep Power
    278
    did you try restart you computer?
    Reply With Quote  
     

  3. #3  
    Donator

    Join Date
    Aug 2013
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    try adding in this
    Code:
    PlayerHandler.updateStartTime = System.currentTimeMillis();
    so it would look like this
    Code:
    PlayerHandler.updateRunning = true;
    c2.sendMessage ("Check the forums for the latest updates!");
    **** ma bad double post, delete dis one pls
    Reply With Quote  
     

  4. #4  
    Donator

    Join Date
    Aug 2013
    Posts
    16
    Thanks given
    0
    Thanks received
    1
    Rep Power
    11
    try adding in this
    Code:
    PlayerHandler.updateStartTime = System.currentTimeMillis();
    so it would look like this
    Code:
    if (playerCommand.startsWith("update")) {
    for (int j = 0; j < Server.playerHandler.players.length; j++) {
    if (Server.playerHandler.players[j] != null) {
    Client c2 = (Client)Server.playerHandler.players[j];
    
    
    
    
    String[] args = playerCommand.split(" ");
    int a = Integer.parseInt(args[1]);
    PlayerHandler.updateSeconds = a;
    PlayerHandler.updateAnnounced = false;
    PlayerHandler.updateRunning = true;
    PlayerHandler.updateStartTime = System.currentTimeMillis();
    c2.sendMessage ("Check the forums for the latest updates!");
    }
    }
    }
    Reply With Quote  
     

  5. #5  
    Registered Member zine's Avatar
    Join Date
    Nov 2011
    Posts
    40
    Thanks given
    1
    Thanks received
    1
    Rep Power
    11
    Thanks man and to you vovik.. no i didnt
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. [Shard] The Update Command
    By Chachi in forum Snippets
    Replies: 3
    Last Post: 06-26-2009, 10:54 PM
  2. [525] update command
    By Clank in forum Requests
    Replies: 2
    Last Post: 04-25-2009, 07:25 PM
  3. [Emulous]::update command
    By H0rn in forum Help
    Replies: 10
    Last Post: 03-03-2009, 07:38 PM
  4. Update command
    By crzycody4lyf in forum Requests
    Replies: 8
    Last Post: 01-22-2009, 02:30 PM
  5. ::update command
    By PrePay in forum Requests
    Replies: 17
    Last Post: 10-24-2008, 06:58 PM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •