 |
Crossfire JXClient, Trunk
|
Go to the documentation of this file.
23 package com.realtime.crossfire.jxclient.server.crossfire;
27 import java.io.IOException;
28 import org.junit.Assert;
29 import org.junit.Test;
35 @SuppressWarnings({
"OverlyBroadThrowsClause",
"JavaDoc"})
45 @Test(timeout = 30000)
46 public
void testNegotiateNumLookObjects1() throws Exception {
75 @Test(timeout = 30000)
76 public
void test_statsMessage_callsPacketWatcherCallback() throws Exception {
88 final StringBuilder sb =
new StringBuilder();
89 connection.
addPacketWatcherListener((command, args) -> sb.append(command).append(
"/").append(args.getMonitorCommand()).append(
"\n"));
92 Assert.assertEquals(
"stats/hp 258\n", sb.toString());
103 @Test(timeout = 30000)
104 public
void test_mapUpdates_suppressInitialMapScroll() throws Exception {
118 server.
writeBytes(
new byte[]{
'n',
'e',
'w',
'm',
'a',
'p'});
119 server.
writeBytes(
new byte[]{
'm',
'a',
'p',
'2',
' ', 0x3C, (byte)0xE1,});
120 server.
writeBytes(
new byte[]{
'm',
'a',
'p',
'2',
' ', 0x3C, (byte)0xE1,});
124 Assert.assertEquals(
""+
161 Assert.assertEquals(
""+
162 "drawextinfo 1 2 3 message\n"+
int getLocalPort()
Returns the port the server is listening on.
void connect(@NotNull final String hostname, final int port)
Attempts to connect the client to a server.
void stop()
Stops operation.
void scriptCallback_drawextinfoMessage_includesSubtypeParameter()
void addPacketWatcherListener(@NotNull final ReceivedPacketListener listener)
Adds a listener to be notified about received packets.
void waitForCurrentNumLookObjectsValid()
Waits until getCurrentNumLookObjects() is stable.
void writeString(@NotNull final String s)
Write a Crossfire message to the client.
void waitForCharacterLogin()
Blocks until the character login has finished.
int getCurrentNumLookObjects()
Returns the currently negotiated setup value of "num_look_objects".
static final int CS_STAT_HP
The Hit Points stat.
Records all callback functions.
Records all callback functions.
void start()
Starts operation.
void start()
Starts the server.
void setPreferredNumLookObjects(final int preferredNumLookObjects)
Sets the maximum number of objects in the ground view.
This is the representation of all the statistics of a player, like its speed or its experience.
Default implementation of CrossfireServerConnection.
Runs the action directly.
void setCrossfireUpdateMapListener(@NotNull final CrossfireUpdateMapListener listener)
Sets a listener to be notified about map changes.
void stop()
Stops the server.
Regression tests for DefaultCrossfireServerConnection.
void writeBytes(final byte @NotNull[] b)
Write a Crossfire message to the client.
A dummy Crossfire server for tests.
Combines all model classes that are updated.