Updates NTtBCommands, that defines the NTtB Protocol, to include which commands mean what. Added Ping/pong classes where Pinging and Ping-Handling could be implemented. Tried to define useful interfaces. Added Some Command Classes, unsure if they will be needed.
This commit is contained in:
parent
3e9888e662
commit
532159d466
@ -1,5 +1,19 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol;
|
||||
|
||||
|
||||
|
||||
public enum NTtBCommands {
|
||||
CRTGM, CHATL, CHATG, CHATP, LEAVG, JOING, VOTEE,
|
||||
/**
|
||||
* CRTGM: Create a new game
|
||||
* CHATA: chat to all
|
||||
* CHATW: whisper chat
|
||||
* CHATG: ghost chat
|
||||
* LEAVG: leave a game
|
||||
* JOING: join a game
|
||||
* VOTEG: ghost voting who to infect
|
||||
* VOTEH: humans voting whos the ghost
|
||||
* QUITS: quit server/ leave servr
|
||||
* LISTP: list players/clients in session with the Server
|
||||
*/
|
||||
CRTGM, CHATA, CHATW, CHATG, LEAVG, JOING, VOTEG, QUITS, LISTP
|
||||
}
|
||||
|
||||
@ -0,0 +1,5 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol;
|
||||
|
||||
public interface ProtocolDecoder {
|
||||
|
||||
}
|
||||
@ -4,5 +4,5 @@ import ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol.NTtBFormatMsg;
|
||||
|
||||
public interface ProtocolParser {
|
||||
|
||||
public NTtBFormatMsg parseMsg(String msg);
|
||||
ProtocolMessage parseMsg(String msg);
|
||||
}
|
||||
|
||||
@ -0,0 +1,4 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol.methods;
|
||||
|
||||
public class Chat {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol.methods;
|
||||
|
||||
public class NewGame {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol.methods;
|
||||
|
||||
public class QUITS {
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Protocol.methods;
|
||||
|
||||
public class VOTEG {
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.Server;
|
||||
|
||||
public class Chat {
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.helpers;
|
||||
|
||||
public class PingListener implements Runnable {
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.helpers;
|
||||
|
||||
/**
|
||||
* PingPong offers services to for listening and sending
|
||||
* Pings to a communication partner.
|
||||
* Runs on a Thread as not to disturb other communication channels.(Is this necessary?)
|
||||
*/
|
||||
public class PingPong implements PingPongInterface {
|
||||
@Override
|
||||
public void pingListener(String ping) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public String pongSender() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
//TODO: Impl
|
||||
}
|
||||
@ -0,0 +1,6 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.helpers;
|
||||
|
||||
public interface PingPongInterface extends Runnable{
|
||||
void pingListener(String ping);
|
||||
String pongSender();
|
||||
}
|
||||
@ -0,0 +1,8 @@
|
||||
package ch.unibas.dmi.dbis.cs108.Multiplayer.helpers;
|
||||
|
||||
public class PongSender implements Runnable{
|
||||
@Override
|
||||
public void run() {
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user