Menu

New Command

myBri
2004-03-25
2004-03-31
  • myBri

    myBri - 2004-03-25

    hello,
    How many files do i have to change to define a new comment bidirectionnel?
    I would define "/mypos" with  2 arg  x & y
    lique this "/mypos\t150\t120"
    and receive this:
    "/mypos\tmyname\t150\t120"

    Is it difficult?

     
    • Sebastian Eichner

      Hi!

      If you want to broadcast this to every client anyway, why don't you just "say" this to the room (like "mypos tester 150 120"? You client, apparently some kind of game, could look for these messages and parse them... just an idea.

      To answer your question: if you want to create a new "real" command, you will have to

      1. create an appropriate class like in  com.lyrisoft.chat.server.remote.command (look at "SayToRoom.java" for an example),

      2. create a constructXXX-method in CommandMakerRemote (or derived class)

      3. add the string in ICommands (or derived interface)

      4. add your command to conf/commands.properties

      I did not verify these steps, but i hope i did not forget any important changes... ;-)

      Of cause you also have to modify your client to handle the new commands. But think about the suggestion with using the saytoroom and sending your data as the message... i guess that would do the job for you...

      Sebastian

       

Log in to post a comment.