#include "server.h"
#include <cstring>
#include "error.h"
#include "server_md.h"
#include "server_mc.h"
using namespace LAMMPS_NS;
enum{MD,MC};
void Server::command(int narg, char **arg)
{
if (narg != 1) error->all(FLERR,"Illegal server command");
if (lmp->clientserver != 2)
error->all(FLERR,"Message command not used to setup LAMMPS as a server");
int protocol;
if (strcmp(arg[0],"md") == 0) protocol = MD;
else if (strcmp(arg[0],"mc") == 0) protocol = MC;
else error->all(FLERR,"Unknown message protocol");
if (protocol == MD) {
ServerMD *server = new ServerMD(lmp);
server->loop();
} else if (protocol == MC) {
ServerMC *server = new ServerMC(lmp);
server->loop();
}
}