Skip to content

ComprosoftCEO/TelnetServer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Telnet Server

Telnet Server written in Java


Compiling and Running

The Telnet server is designed to run with the Eclipse IDE. The main method is in the file ServerControl.java, which uses a JFrame interface to display the server log.

When running the server, you will probably need to run Java as Administrator (Windows) or with Sudo (Linux). Compile the source into a runnable .jar file, then run the file using:

java -jar Telnet.jar (for Windows Command Prompt running as Administrator)

or

sudo java -jar Telnet.jar (for the Linux terminal)


Server Properties

Various properties of the server (such as the port number or maximum amount of threads) can be changed in the server.properties file. Additional properties can be added by modifying ServerProperties.java and adding more entries to the defined enum.


Adding Commands

The list of commands is stored in AllCommands.java, and adding a command is as simple as defining another entry in the enum. When adding a command, be sure to include a short description.

Commands are stored in the enum using the "Class" class (see the Javadocs on Reflection). For a class to be a valid:

  1. It must extend the abstract class "Command"
  2. It must have one constructor:
public constructor(IOHandler io);

While some special commands may have different constructors, this is the format needed to add a command to the AllCommands enum.


Credits

The Telnet Server code is based on Ayache Khettar's telnet-server. However, extension modifications were made to the code to adapt it for other uses.

The Crafting Engine code comes from another project, CraftingEngine, which is based on the game Little Alchemy by Jakob Koziol. As of yet, the Java version doesn't implement saving and loading.