Thread: Help Handling Commands

Results 1 to 7 of 7
  1. #1 Help Handling Commands 
    Registered Member
    Join Date
    Sep 2009
    Posts
    67
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Base: DeltaCleaned
    Problem: I'm trying to separate everything into seperate classes so it's not all in client.java but I do not know "connect it" to client.java so it is not just dead code sitting in the class. Sorry idk how to explain it any better.
    Reply With Quote  
     

  2. #2  
    Registered Member
    Iwin's Avatar
    Join Date
    Mar 2008
    Age
    27
    Posts
    677
    Thanks given
    12
    Thanks received
    56
    Rep Power
    245
    Code:
          case 103:
    String playerCommand = inStream.readString();
    if (validClient)
    server.Commands.Command(playerCommand, playerId);
    misc.println(playerName+" [command] "+playerCommand+"");
    }
    Code:
    import java.io.*;
    
    public class Commands {
    	public void Command(String command, int playerId) {
    client c = (client) server.playerHandler.players[playerId];
    If this is what you're talking about :\
    [SPOIL]
    [/SPOIL]
    Reply With Quote  
     

  3. #3  
    Registered Member
    Join Date
    Sep 2009
    Posts
    67
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    Wouldn't the void be private?
    Reply With Quote  
     

  4. #4  
    Registered Member
    Iwin's Avatar
    Join Date
    Mar 2008
    Age
    27
    Posts
    677
    Thanks given
    12
    Thanks received
    56
    Rep Power
    245
    no. it's being called from client.java. so it needs to be public. or else client.java can't see it.
    [SPOIL]
    [/SPOIL]
    Reply With Quote  
     

  5. #5  
    Registered Member
    Join Date
    Sep 2009
    Posts
    67
    Thanks given
    0
    Thanks received
    1
    Rep Power
    1
    ok ty that was my problem.
    Reply With Quote  
     

  6. #6  
    Registered Member
    Iwin's Avatar
    Join Date
    Mar 2008
    Age
    27
    Posts
    677
    Thanks given
    12
    Thanks received
    56
    Rep Power
    245
    No problem ^_^
    [SPOIL]
    [/SPOIL]
    Reply With Quote  
     

  7. #7  
    Fuck the rest join the best, WoR
    Jinx's Avatar
    Join Date
    Oct 2010
    Posts
    635
    Thanks given
    99
    Thanks received
    65
    Rep Power
    364
    Hey, if you want to advance to this type of coding, where everything is coded in different classes, I would recommend switching sources over to project insanity. The source itself is wonderful and well worth the switch. It could take a little while getting used to the switch, but in the long run it is well worth it. Contact me if you would like help finding a good source, I may have one that you could use.
    The wor has begun.


    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. Packet Handling
    By Naughty Panda in forum RS2 Server
    Replies: 27
    Last Post: 01-16-2010, 09:44 PM
  2. Replies: 9
    Last Post: 11-28-2009, 05:39 AM
  3. 474 Packet handling
    By rolfcopter in forum Help
    Replies: 5
    Last Post: 04-26-2009, 05:19 PM
  4. Replies: 19
    Last Post: 11-23-2008, 05:30 AM
  5. region handling
    By Pandora in forum Tutorials
    Replies: 10
    Last Post: 08-17-2007, 01:11 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •