Thread: object click one handler

Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1 object click one handler 
    Registered Member
    hoodlom's Avatar
    Join Date
    Dec 2007
    Age
    26
    Posts
    750
    Thanks given
    0
    Thanks received
    6
    Rep Power
    170
    Description: To clean up alot of garbage from client.java

    Difficulty: 1

    Assumed Knowledge: how to copy and paste.

    Tested Server: Project-Dayz(My source, its not released) will work on all.

    Files/Classes Modified: client.java, objectClick1.java

    Procedure
    Step 1: Make a new file called objectclick1.java and put this inside of it.
    Code:
    import java.io.*;
    public class objectClick1 {
    public static void objectClick1(int objectID, int objectX, int objectY, int face, int face2, int GateID, int i) {	
    client c  = (client) server.playerHandler.players[i];
    int absX = c.absX;
    int absY = c.absY;
    int teleportToX = c.teleportToX;
    int teleportToY = c.teleportToY;
    				switch(objectID) {
    //object cases here
    }
    }
    }
    Step 2: open up client.java and search for
    Code:
    switch(objectID) {
    copy and paste all of the cases into the objectclick1.java

    Step 3: in client.java search for
    Code:
    if(GoodDistance(absX, absY, objectX, objectY, destinationRange)) {
    viewTo(objectX, objectY);
    objectClick(objectID, objectX, objectY, 0, 0, 1);
    directly under it add this.
    Code:
    objectClick1.objectClick1(objectID, objectX, objectY, 0, 0, 1, playerId);
    and tadah! your server now calls your object clicks from the handler... reduces the size & lagg of your server.

    Credits: Me
     

  2. #2  
    -DD-
    Guest
    objectclick1.java:1782: class, interface, or enum expected
    }
    ^
    1 error
    Press any key to continue . . .
     

  3. #3  
    Registered Member pHametic's Avatar
    Join Date
    Nov 2006
    Posts
    637
    Thanks given
    3
    Thanks received
    1
    Rep Power
    11
    go fix it -DD- and this ain't the help section anyways good job hoodlom
     

  4. #4  
    Optimist

    Vice's Avatar
    Join Date
    Nov 2007
    Age
    25
    Posts
    3,263
    Thanks given
    3
    Thanks received
    59
    Rep Power
    2536
    Quote Originally Posted by ramli View Post
    go fix it -DD- and this ain't the help section anyways good job hoodlom
    wow ur nice, jokes its a pretty easy error

    nice one hoodlom
    Jack
    Scotland
    Undergraduate - BSc Computing Science
     

  5. #5  
    -DD-
    Guest
    Well, it's either that to 100 errors.
     

  6. #6  
    Registered Member
    hoodlom's Avatar
    Join Date
    Dec 2007
    Age
    26
    Posts
    750
    Thanks given
    0
    Thanks received
    6
    Rep Power
    170
    I will fix the error, its my tutorial, there should be no errors.
    Edit: Never noticed that was his problem for adding things wrong.
     

  7. #7  
    gold cobra
    Guest
    You're just throwing the garbage into another class file that'll be running.

    Good job on making the server worse.
     

  8. #8  
    Registered Member
    hoodlom's Avatar
    Join Date
    Dec 2007
    Age
    26
    Posts
    750
    Thanks given
    0
    Thanks received
    6
    Rep Power
    170
    Cobra, Go Learn Java Before You Say It's Bad.
     

  9. #9  
    Registered Member
    Join Date
    Oct 2007
    Posts
    49
    Thanks given
    0
    Thanks received
    0
    Rep Power
    11
    Quote Originally Posted by hoodlom View Post
    Cobra, Go Learn Java Before You Say It's Bad.
    KAN I HES A LERN JABA [email protected][email protected]?
     

  10. #10  
    gold cobra
    Guest
    Quote Originally Posted by hoodlom View Post
    Cobra, Go Learn Java Before You Say It's Bad.
    You don't even know what java is.

    "OMG IT A CODIN LANGUAGE"

    That would be your response. You probably don't even know what primitive data types are.
     

Page 1 of 2 12 LastLast

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
  •