Crossfire JXClient, Trunk  R20561
CrossfireServerConnection.java
Go to the documentation of this file.
1 /*
2  * This file is part of JXClient, the Fullscreen Java Crossfire Client.
3  *
4  * JXClient is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * JXClient is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with JXClient; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17  *
18  * Copyright (C) 2005-2008 Yann Chachkoff.
19  * Copyright (C) 2006-2011 Andreas Kirschbaum.
20  */
21 
22 package com.realtime.crossfire.jxclient.server.crossfire;
23 
27 import org.jetbrains.annotations.NotNull;
28 import org.jetbrains.annotations.Nullable;
29 
36 
40  void start();
41 
46  @SuppressWarnings("RedundantThrows")
47  void stop() throws InterruptedException;
48 
54 
61 
67 
74 
79  void addCrossfireQueryListener(@NotNull CrossfireQueryListener listener);
80 
87 
93 
100 
105  void addCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener);
106 
111  void removeCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener);
112 
119 
124  void addCrossfireTickListener(@NotNull CrossfireTickListener listener);
125 
130  void addCrossfireSoundListener(@NotNull CrossfireSoundListener listener);
131 
136  void addCrossfireMusicListener(@NotNull CrossfireMusicListener listener);
137 
142  void addCrossfireComcListener(@NotNull CrossfireComcListener listener);
143 
148  void addCrossfirePickupListener(@NotNull CrossfirePickupListener listener);
149 
155 
160  void addPacketWatcherListener(@NotNull ReceivedPacketListener listener);
161 
166  void removePacketWatcherListener(@NotNull ReceivedPacketListener listener);
167 
172  void addSentReplyListener(@NotNull SentReplyListener listener);
173 
178  void removeSentReplyListener(@NotNull SentReplyListener listener);
179 
185 
191 
197 
203 
209  void drawInfo(@NotNull String message, int color);
210 
218  void drawextinfo(int color, int type, int subtype, String message);
219 
224  void drawInfoSetDebugMode(boolean printMessageTypes);
225 
231  void sendAccountLogin(@NotNull String login, @NotNull String password);
232 
237  void sendAccountPlay(@NotNull String name);
238 
245  void sendAccountLink(int force, @NotNull String login, @NotNull String password);
246 
252  void sendAccountCreate(@NotNull String login, @NotNull String password);
253 
259  void sendAccountCharacterCreate(@NotNull String login, @NotNull String password);
260 
266  void sendAccountPassword(@NotNull String currentPassword, @NotNull String newPassword);
267 
271  void sendAddme();
272 
277  void sendApply(int tag);
278 
283  void sendExamine(int tag);
284 
290  void sendLock(boolean val, int tag);
291 
297  void sendLookat(final int dx, int dy);
298 
303  void sendMark(int tag);
304 
311  void sendMove(int to, int tag, int nrof);
312 
319  int sendNcom(int repeat, @NotNull String command);
320 
325  void sendReply(@NotNull String text);
326 
331  void sendRequestinfo(@NotNull String infoType);
332 
337  void sendSetup(@NotNull String... options);
338 
343  void sendToggleextendedtext(@NotNull int... types);
344 
351  void sendVersion(int csval, int scval, @NotNull String vinfo);
352 
358  void setPreferredMapSize(int preferredMapWidth, int preferredMapHeight);
359 
366  void setPreferredNumLookObjects(int preferredNumLookObjects);
367 
372  @Nullable
373  String getAccountName();
374 
375 }
void addCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
Adds a listener to be notified about item changes.
void addCrossfireTickListener(@NotNull CrossfireTickListener listener)
Adds a listener to be notified about tick changes.
void setPreferredMapSize(int preferredMapWidth, int preferredMapHeight)
Sets the preferred map size.
void sendAccountPassword(@NotNull String currentPassword, @NotNull String newPassword)
Sends a request to change the account's password.
void addCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
Adds a listener to be notified about received "pickup" messages.
void removeCrossfireUpdateItemListener(@NotNull CrossfireUpdateItemListener crossfireUpdateItemListener)
Removes a listener to be notified about item changes.
void sendAccountLink(int force, @NotNull String login, @NotNull String password)
Sends a request to add an existing character to an account.
Interface for listeners interested in drawinfo messages received from the Crossfire server...
void sendAccountLogin(@NotNull String login, @NotNull String password)
Asks for an account login.
void sendLock(boolean val, int tag)
Sends a "lock" command to the server.
Interface for listeners interested in "sound" commands.
void addCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
Adds a listener to be notified about account events.
Interface for listeners interested in "tick" commands.
void sendAccountCharacterCreate(@NotNull String login, @NotNull String password)
Sends a request to create a new character associated to the account.
Interface for classes that allow sending "askface" commands.
void setCrossfireUpdateMapListener(@Nullable CrossfireUpdateMapListener listener)
Sets a listener to be notified about map changes.
void sendMark(int tag)
Sends a "mark" command to the server.
Manages image information ("faces") needed to display the map view, items, and spell icons...
void removePacketWatcherListener(@NotNull ReceivedPacketListener listener)
Removes a listener to be notified about received packets.
void sendAccountCreate(@NotNull String login, @NotNull String password)
Sends a request to create a new account.
void drawInfoSetDebugMode(boolean printMessageTypes)
Enables or disables printing of message types.
void drawInfo(@NotNull String message, int color)
Pretends that a drawinfo message has been received.
Listener for classes interested in sent "reply" commands.
void addCrossfireMusicListener(@NotNull CrossfireMusicListener listener)
Adds a listener to be notified about received music commands.
int sendNcom(int repeat, @NotNull String command)
Sends a "ncom" command to the server.
void addCrossfireComcListener(@NotNull CrossfireComcListener listener)
Adds a listener to be notified about received comc commands.
void drawextinfo(int color, int type, int subtype, String message)
Pretends that a drawextinfo message has been received.
void sendVersion(int csval, int scval, @NotNull String vinfo)
Sends a "version" command to the server.
void sendAddme()
Sends an "addme" command to the server.
void addCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Adds a new listener monitoring the drawextinfo S->C messages.
Interface for listeners interested in "music" commands.
Interface for listeners interested in the "failure" messages received from the Crossfire server...
void sendToggleextendedtext(@NotNull int... types)
Sends a "toggleextendedtext" command to the server.
Interface for listeners interested in "pickup" messages.
void removeCrossfireMagicmapListener(@NotNull CrossfireMagicmapListener listener)
Removes a listener from the list of objects listening to magicmap messages.
void sendReply(@NotNull String text)
Sends a "reply" command to the server.
Interface for listeners interested in received packets.
void addCrossfireMagicmapListener(@NotNull CrossfireMagicmapListener listener)
Adds a listener from the list of objects listening to magicmap messages.
Interface for listeners interested in magicmap messages received from the Crossfire server...
void setPreferredNumLookObjects(int preferredNumLookObjects)
Sets the maximum number of objects in the ground view.
void addSentReplyListener(@NotNull SentReplyListener listener)
Adds a listener to be notified about sent reply packets.
void removeSentReplyListener(@NotNull SentReplyListener listener)
Removes a listener to be notified about sent reply packets.
Interface for listeners interested in account information related messages received from the Crossfir...
void addPacketWatcherListener(@NotNull ReceivedPacketListener listener)
Adds a listener to be notified about received packets.
Interface for listeners interested in drawextinfo messages received from the Crossfire server...
void removeCrossfireAccountListener(@NotNull CrossfireAccountListener listener)
Removes a listener to be notified about account events.
void addCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
Adds a new listener monitoring the query S->C messages.
void removeCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
Removes a listener to be notified of failure messages.
Adds encoding/decoding of crossfire protocol packets to a ServerConnection.
void addCrossfireSoundListener(@NotNull CrossfireSoundListener listener)
Adds a listener to be notified about received sound commands.
void sendSetup(@NotNull String... options)
Sends a "setup" command to the server.
Interface for listeners interested in comc commands received from the server.
void sendApply(int tag)
Sends an "apply" command to the server.
void removeCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
Removes the given listener from the list of objects listening to the drawinfo S->C messages...
void sendExamine(int tag)
Sends an "examine" command to the server.
void sendAccountPlay(@NotNull String name)
Sends a request to play a character from an account.
Interface for listeners interested in query messages received from the Crossfire server.
void sendLookat(final int dx, int dy)
Sends a "lookat" command to the server.
void removeCrossfirePickupListener(@NotNull CrossfirePickupListener listener)
Removes a listener to be notified about received "pickup" messages.
void sendMove(int to, int tag, int nrof)
Sends a "move" command to the server.
void sendRequestinfo(@NotNull String infoType)
Sends a "requestinfo" command to the server.
void addCrossfireFailureListener(@NotNull CrossfireFailureListener listener)
Adds a listener to be notified of failure messages.
void removeCrossfireQueryListener(@NotNull CrossfireQueryListener listener)
Removes the given listener from the list of objects listening to the query S->C messages.
void removeCrossfireDrawextinfoListener(@NotNull CrossfireDrawextinfoListener listener)
Removes the given listener from the list of objects listening to the drawextinfo S->C messages...
void addCrossfireDrawinfoListener(@NotNull CrossfireDrawinfoListener listener)
Adds a new listener monitoring the drawinfo S->C messages.