Thread: need help with a handler

Results 1 to 9 of 9
  1. #1 need help with a handler 
    afroman
    Guest
    how do i make a ClientHandler
    i know there is a tutorial but the one that made it dident explain what to do

    can someone help me make a ClientHandler
    or just post the whole ClientHandler Code
     

  2. #2  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    what do you want it to do..? login?
     

  3. #3  
    afroman
    Guest
    i need it to hold deletethatobject makenewobject deletethatwall and all the armour sets
     

  4. #4  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    well um....
    open server.java
    add this,
    Code:
    objectHandler = new objectHandler();
    under where theres more like that.

    find something like,
    Code:
    while(!shutdownserver)
    and next to the rest like it, put
    Code:
    objectHandler.process();
    next make a file..
    objectHandler.java

    put this in it,

    Code:
    import java.io.*;
    
    public class objectHandler {
    
            public int spawnTimer;
    
      public static void spawnObjects {
    /* PUT THE STUFF TO SPAWN THE OBJECTS HERE! LIKE MAKEGLOBALOBJECT.
    IF THE VOIDS TO MAKE THEM ARE IN CLIENT.JAVA, THEN YOU WILL HAVE TO PUT EITHER A "c." OR A "client." BEFORE EACH SPAWN. LIKE "c.makeglobalobject" or "client.makeglobalobject" */
    
        }
      }
    now open client.java,
    search
    Code:
    case 210:
    make sure to erase anything inside case210:.
    it should look like this,
    Code:
                case 210:
      break;
    now add the void. it should look like this when your done.
    Code:
                case 210:
           objectHandler.spawnObjects();
      break;
     

  5. #5  
    afroman
    Guest
    i get this error how can i fix it

    Code:
    objectHandler.java:7: '(' expected
    public static void spawnObjects {
                                                    ^
     

  6. #6  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    oops i mean
    Code:
    public static void spawnObjects() {
     

  7. #7  
    afroman
    Guest
    Thanks it realy helped

    Edited: Reputation + Given for help

    :lock:
     

  8. #8  
    Banned

    Join Date
    Jul 2008
    Age
    26
    Posts
    5,826
    Thanks given
    1,301
    Thanks received
    197
    Rep Power
    0
    thanks. while making the handler, i realized the potential for something realy good, becaue on my custon source, the objects dont always load. so you could put like at the end of the spawning objects in the handler, like after the last makeglobalobject, a
    c.spawned = true;
    and in the mapdata case, but something like
    Code:
                case 210:
           objectHandler.spawnObjects();
        if(objectHandler.spawned = false) {
           objectHandler.spawnObjects();
      }
    thats not all there is to it, but it would make sure the objects spawned without stacking them on top of eachother.
     

  9. #9  
    afroman
    Guest
    thanks it works very good
     


Thread Information
Users Browsing this Thread

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


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •