Class PacketWatcher


  • public class PacketWatcher
    extends java.lang.Object
    Implements the "watch" function for client-sided scripts.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addCommand​(@NotNull java.lang.String command)
      Adds a command to watch for.
      void destroy()
      Releases allocated resources.
      void removeCommand​(@NotNull java.lang.String command)
      Removes a command to watch for.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PacketWatcher

        public PacketWatcher​(@NotNull
                             @NotNull CrossfireServerConnection crossfireServerConnection,
                             @NotNull
                             @NotNull ScriptProcess scriptProcess)
        Creates a new instance.
        Parameters:
        crossfireServerConnection - the server connection to watch
        scriptProcess - the script process for sending commands
    • Method Detail

      • destroy

        public void destroy()
        Releases allocated resources. Must be called before this instance is freed.
      • addCommand

        public void addCommand​(@NotNull
                               @NotNull java.lang.String command)
        Adds a command to watch for.
        Parameters:
        command - the command
      • removeCommand

        public void removeCommand​(@NotNull
                                  @NotNull java.lang.String command)
        Removes a command to watch for.
        Parameters:
        command - the command