/*
....[@@@..[@@@..............[@.................. MUD++ is a written from
....[@..[@..[@..[@..[@..[@@@@@....[@......[@.... scratch multi-user swords and
....[@..[@..[@..[@..[@..[@..[@..[@@@@@..[@@@@@.. sorcery game written in C++.
....[@......[@..[@..[@..[@..[@....[@......[@.... This server is an ongoing
....[@......[@..[@@@@@..[@@@@@.................. development project. All
................................................ contributions are welcome.
....Copyright(C).1995.Melvin.Smith.............. Enjoy.
------------------------------------------------------------------------------
Melvin Smith (aka Fusion) msmith@hom.net
MUD++ development mailing list mudpp@van.ml.org
------------------------------------------------------------------------------
mpdaemon.cc
*/
// This is the player file daemon which runs if you are running a
// distributed MUD. The daemon runs in 1 of 2 modes.
//
// 1) Server mode: Runs on the server node and services player file
// requests (upload/download) from client nodes.
// 2) Client mode: Runs on each client node and queries the server
// node daemon for player files and is responsible for updating
// to the server node.
//
// In either case the daemon (mpdaemon) and mud++ processes communicate
// via a pipe. The mud++ server forks the daemon upon bootup. The
// daemon will die if its parent dies (will change this later)
//
// Only 1 node can actually "have" a given player at a given time. The
// master player-file resides on the server, clients only have local
// copies while that player is on that node, otherwise it has no
// player files at all. Read doc/distributed-mud.doc for a complete
// explanation of how MUD++ distributed system works.
#include "config.h"
#include "socket.h"
#include "cluster.h"
#include "io.h"
fd_set r_set, w_set;
int node_count;
// stdin/stdout/stderr are mapped to the pipe fds of the
// mud++ process.
int main( int argc, char *argv[] )
{
Socket * sock;
char comd[4096];
Cout << "MSG:MPD daemon started and ready to roll.\n";
if( loadHostsFile() < 0 )
{
Cout << "Error loading HOSTS file.\n";
exit(0);
}
// Infinite loop of servicing the main servers requests
for( ;; )
{
exit(0);
}
}
// Read in ../etc/hosts and connect to all cluster members
// Notify main server upon each connect
int joinCluster()
{
}