/// <summary> /// Converts the <see cref="ChatServerDefinition"/> into corresponding <see cref="ChatServerSettings"/>. /// </summary> /// <param name="definition">The definition.</param> /// <returns>The settings</returns> public static ChatServerSettings ConvertToSettings(this ChatServerDefinition definition) { var result = new ChatServerSettings(); result.MaximumConnections = definition.MaximumConnections; result.ClientCleanUpInterval = definition.ClientCleanUpInterval; result.RoomCleanUpInterval = definition.RoomCleanUpInterval; result.Description = definition.Description; result.ServerId = definition.ServerId; foreach (var endpoint in definition.Endpoints) { result.Endpoints.Add(new OpenMU.ChatServer.ChatServerEndpoint { ClientVersion = new ClientVersion(endpoint.Client.Season, endpoint.Client.Episode, endpoint.Client.Language), NetworkPort = endpoint.NetworkPort, }); } return(result); }
/// <summary> /// Converts the <see cref="ChatServerDefinition"/> into corresponding <see cref="ChatServerSettings"/>. /// </summary> /// <param name="definition">The definition.</param> /// <returns>The settings.</returns> public static ChatServerSettings ConvertToSettings(this ChatServerDefinition definition) { var result = new ChatServerSettings { Id = definition.GetId(), MaximumConnections = definition.MaximumConnections, ClientTimeout = definition.ClientTimeout, ClientCleanUpInterval = definition.ClientCleanUpInterval, RoomCleanUpInterval = definition.RoomCleanUpInterval, Description = definition.Description, ServerId = definition.ServerId + SpecialServerIds.ChatServer, }; foreach (var endpoint in definition.Endpoints) { result.Endpoints.Add(new OpenMU.ChatServer.ChatServerEndpoint { ClientVersion = new ClientVersion(endpoint.Client !.Season, endpoint.Client.Episode, endpoint.Client.Language), NetworkPort = endpoint.NetworkPort, });