public void StartRole(SOEServer server) { // Set our server Server = server; // Get a logger Log = Server.Logger.GetLogger("Gateway"); Log.Info("Constructing gateway..."); // Construct our global managers AccountManager.Start(server); // Construct our managers CommandManager.Start(); ClientLogManager.Start(); LoginManager.Start(); // Finish! Log.Info("Finished constructing gateway!"); }
public static void HandleCommand(SOEClient sender, byte[] command) { // Setup a reader SOEReader reader = new SOEReader(command); // Get the command code ushort commandOpCode = reader.ReadHostUInt16(); // Handle switch (commandOpCode) { case ((ushort)ClientLogCommands.Log): ClientLogManager.ReceiveLog(sender, command); break; default: Log.DebugFormat("Received unknown command! {0:X2}", commandOpCode); break; } }
static void Main() { //site collection const string spUrl = "http://demo"; const string app = "MyConsoleApp"; //if last parameter = true --> the config manager will look for the config/logging in the central admin //if parameter = false --> it will look in the http://demo/Sponge web to retreive the config/logging info //that means that the Sponge Logging & Configuration Feature has to be activated in this SiteColl var cfg = ClientConfigurationManager.GetOnline(spUrl, app, false); //it is possible that the logging info is retrieved from central, but config info from relative var log = ClientLogManager.GetOnline(spUrl, app, true); //get all config entries within the config foreach (var entry in cfg.Items) { log.Debug("{0} - {1}", entry.Key, entry.Value); } //get a specific entry and cast it to int //int a = cfg.Get<int>("MyKey"); }