Added Some javadoc to ClientMsgDecoder.java to explain

the use of the class.
This commit is contained in:
Sebastian Lenzlinger 2022-03-26 13:39:51 +01:00
parent 46ee78d298
commit edfceb0048

View File

@ -8,12 +8,22 @@ import ch.unibas.dmi.dbis.cs108.multiplayer.protocol.ProtocolDecoder;
import java.util.LinkedList;
import java.util.Queue;
/**
* Decodes the correctly formatted String
* containing command and parameters.
* For reasons of seperation of work
* this class only tokenizes the string
* and acknowledges to the client that smth was recieved.
* Actual method calls, change of state, method calles etc.
* are delegated to{@link ch.unibas.dmi.dbis.cs108.multiplayer.server.cmd.methods.CommandExecuter}
* from within {@link ClientHandler}.
*/
public class ClientMsgDecoder implements ProtocolDecoder {
private NightTrainProtocol protocol;
@Override
//TODO this method IS NOT FINNISHED. @return is not correct as of now!
public NTtBFormatMsg decodeMsg(String msg) {
//Declare needed variables
String[] msgTokens; //List where we'll put the string tokens seperated by $.
@ -68,12 +78,4 @@ public class ClientMsgDecoder implements ProtocolDecoder {
private String[] tokenizeMsg(String msg) {
return msg.split("$");
}
/*
* This method should implement the initiation
* of server agency according to client msg
*/
private Queue<String> serverActionBuilder() {
return new LinkedList<String>();
}
}