Remote Server Monitor

Results 1 to 4 of 4
  1. #1
    Not working on UnitedFlyf Mootie is offline
    MemberRank
    Apr 2009 Join Date
    1,589Posts

    Remote Server Monitor

    Introduction
    This application is designed for convenient server administration and replication while retaining security.

    Remote Server Monitor
    The monitor is an application designed to run on an administrator's local computer. It then connects to a specified exclusive Controller Cloud. The administrator then will be able to start, stop, and control server-sided applications that the Controller Cloud has access to through a powerful GUI. The monitor is able to execute controls such as creating broadcasts, access control modifications, and anything else the server app developer wishes to implement via the XorRelayService library.

    Relay Service
    The Relay Service is a windows service that runs the server-sided applications as child processes in the background of the server machine itself. It relays commands and information to and from the Controller Clouds.

    Controller Service
    The Controller Service is essentially a proxy that administrators connect to with the Remote Server Monitor. The Controller Service will then connect to the server machines via the Relay Service. This allows for a more secure setup as the administrator will only be able to connect to one port on the internal network, while the Controller Cloud communicates with the server machines.

    Screen Shots











    API Header
    Code:
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    // file:	XorRelayServiceCli.h
    //
    // summary:	Declares the XorNet Relay Service Client API.
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    
    #pragma once
    
    #include <Windows.h>
    #include <vector>
    #include <map>
    
    //	Callback typedef
    typedef	bool (*CmdHandler)();
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    /// <summary>	XorNet Relay Service Client API. </summary>
    ///
    /// <remarks>	Lethal, 5/31/2012. </remarks>
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    class XorRelayServiceCli
    {
    public:
    	XorRelayServiceCli();
    	virtual ~XorRelayServiceCli();
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	
    	/// 			Adds a callback. 
    	/// 			Commands called by Relay Service by default:
    	///				- "SaveAllExit"(calls this before "stop signal")
    	///				- "Census"(calls this to request the number of users online this server)  
    	///	</summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <param name="hCmd">				The command handler. </param>
    	/// <param name="szCommand">		The command string. </param>
    	/// <param name="szDescription">	The description string. </param>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static void		AddCallback(CmdHandler hCmd, const char *szCommand, const char *szDescription);
    
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	Sends a response to the Controller node. </summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <param name="szResponse">	The response format. </param>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static void		RespondToControl( const char *szResponse, ... );
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	
    	/// 			Used to retreive the input buffer, which can be used for reading dynamic commands.
    	/// </summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <returns>	
    	/// 			NULL if it fails, else the command 1024 char input buffer. The command code is not 
    	/// 			included and the buffer will "never" be NULL.
    	/// </returns>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static const char*	GetInputBuffer();
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	Initializes the Relay Service Client. </summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <param name="szSrvName">	 	Name of the server app. </param>
    	/// <param name="szIniFile">	 	The path of the server app's INI file. </param>
    	/// <param name="nStartupNumber">	The startup number order(starts at 0). </param>
    	/// <param name="bCreateThread"> 	(optional) Create a new thread for processing. </param>
    	///
    	/// <returns>	true if it succeeds, false if it fails. </returns>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static bool		Init(const char* szSrvName, const char* szIniFile, int nStartupNumber, bool bCreateThread=false);
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	
    	/// 			Connects to the Relay Service. Should be called after initial application loading 
    	/// 			is done. After this is called, the next server will begin startup. 
    	///	</summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <returns>	true if it succeeds, false if it fails. </returns>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static bool		Start();
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	
    	/// 			Gracefully disconnects the server app from the Relay Service after the Relay Service
    	/// 			signals stop. If this is called before the Relay Service signals, "stop", it will be
    	/// 			considered a crash.
    	///	</summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <returns>	true if it succeeds, false if it fails. </returns>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static bool		Stop();	
    
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	/// <summary>	
    	/// 			Call this every 1-1000ms(100ms recommended) if the bCreateThread param was passed as 
    	/// 			FALSE in the initialization call.
    	/// </summary>
    	///
    	/// <remarks>	Lethal, 5/31/2012. </remarks>
    	///
    	/// <returns>	TRUE if the "stop" signal has been received, the application should then exit. </returns>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static bool		Process();
    
    
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	///	<summary>	Retrieves strings from controller client. </summary>
    	////////////////////////////////////////////////////////////////////////////////////////////////////
    	static const char*	GetIniFile();
    	static const char*	GetServerName();
    };
    
    
    ////////////////////////////////////////////////////////////////////////////////////////////////////
    ///	<summary>	Response codes </summary>
    /// 
    /// <remarks>	Lethal, 5/31/2012. </remarks>
    /////////////////////////////////////////////////////////////////////////////////////////////////
    #define XORRC_RESPONSECODE_SERVER_READY			"SERVER READY IDSTR = {6EC9D721-D946-4906-AB79-5AF7B35241CB}\n"		// Notifies Relay Service that server app is ready!
    #define XORRC_RESPONSECODE_SET_CUSTOM_STATE		"Set Custom State {79CC1671-A46D-478a-9497-4933581B5B03},%d,%s\n"	// Sets custom state(1st param: state id, 2nd param: state display name)
    #define XORRC_RESPONSECODE_SERVER_ERROR			"Server Error {FE58BC7B-ECE9-4d9a-85D0-ED6433ACAF6D},%s\n"			// Sets Custom Error(1st param: error string to display)
    #define XORRC_RESPONSECODE_WORLD_CENSUS			"World Census {8B1B5C78-AB81-4c0f-B0EF-A380269E44C5},%d\n"			// Sets World Census(1st param: CCU) -- Recommended one per "cluster"
    #define XORRC_RESPONSECODE_ZONE_CENSUS			"Zone Census {79CC1671-A46D-478a-9497-4933581B5B03},%d\n"			// Sets Zone Census(1st param: CCU) -- Recommended one per zone "channel"
    #define XORRC_RESPONSECODE_ADD_COMMAND			"Add Command {79CC1671-A46D-478a-9497-4933581B5B03},%s,%s\n"		// Adds Dynamic Command(1st param: display name, 2nd param: callback cmd name) 
    #define XORRC_RESPONSECODE_ADD_INPUT_COMMAND	"Add Input Command {79CC1671-A46D-478a-9497-4933581B5B03},%s,%s\n"	// Adds Dynamic Command(1st param: display name, 2nd param: callback cmd name) 
    #define XORRC_RESPONSECODE_REMOVE_COMMAND		"Remove Command {79CC1671-A46D-478a-9497-4933581B5B03},%s\n"		// Removes Dynamic Command(1st param: display name)
    #define XORRC_RESPONSECODE_ENABLE_COMMAND		"Enable Command {79CC1671-A46D-478a-9497-4933581B5B03},%s\n"		// Enables Dynamic Command(1st param: display name)
    #define XORRC_RESPONSECODE_DISABLE_COMMAND		"Disable Command {79CC1671-A46D-478a-9497-4933581B5B03},%s\n"		// Disables Dynamic Command(1st param: display name)
    #define XORRC_RESPONSECODE_WORLD_ID				"World ID {8E3FD4DA-BF63-4C6C-AA7D-013218CED9CA},%d\n"				// Sets World ID(1st param: world id)
    #define XORRC_RESPONSECODE_WAIT_COUNT			"WaitCount {7E52C067-80A5-42AA-AA4D-6D25469B3C00},W[%d],L[%d]\n"	// For Queues(untested)
    #define XORRC_RESPONSECODE_AUX_1				"Aux1 {E9E41FAF-A7D0-4762-8446-C8E85CDC5065}\n"						// Sets Aux1 status
    #define XORRC_RESPONSECODE_AUX_2				"Aux2 {E4D780A7-873B-4888-8133-023DBCD680B4}\n"						// Sets Aux2 status


  2. #2
    Not working on UnitedFlyf Mootie is offline
    MemberRank
    Apr 2009 Join Date
    1,589Posts

    Re: Remote Server Monitor

    Any feedback/questions?

  3. #3
    Banana Adler is offline
    MemberRank
    Feb 2009 Join Date
    1,119Posts

    Re: Remote Server Monitor

    The bottom right messages are the best thing ever.

  4. #4
    Trust your senses Gravious is offline
    MemberRank
    Sep 2009 Join Date
    NetherlandsLocation
    713Posts
    Looks compact and clear. Very useful for large servers, not so for smaller servers. Why did you not code it in C# completely instead of having a separate UI?

    Edit: Just found this http://forum.ragezone.com/showthread.php?p=7060055
    I think I'll just stick to full C# as I am not fully familiar with C++
    Last edited by Gravious; 15-06-12 at 10:14 AM.



Advertisement