2009-12-24 15:49:15 +01:00
|
|
|
|
(*
|
|
|
|
|
* CDDL HEADER START
|
|
|
|
|
*
|
|
|
|
|
* The contents of this file are subject to the terms of the
|
|
|
|
|
* Common Development and Distribution License, Version 1.0 only
|
|
|
|
|
* (the "License"). You may not use this file except in compliance
|
|
|
|
|
* with the License.
|
|
|
|
|
*
|
|
|
|
|
* You can obtain a copy of the license at
|
|
|
|
|
* http://www.opensource.org/licenses/cddl1.php.
|
|
|
|
|
* See the License for the specific language governing permissions
|
|
|
|
|
* and limitations under the License.
|
|
|
|
|
*
|
|
|
|
|
* When distributing Covered Code, include this CDDL HEADER in each
|
|
|
|
|
* file and include the License file at
|
|
|
|
|
* http://www.opensource.org/licenses/cddl1.php. If applicable,
|
|
|
|
|
* add the following below this CDDL HEADER, with the fields enclosed
|
|
|
|
|
* by brackets "[]" replaced with your own identifying * information:
|
|
|
|
|
* Portions Copyright [yyyy] [name of copyright owner]
|
|
|
|
|
*
|
|
|
|
|
* CDDL HEADER END
|
|
|
|
|
*
|
|
|
|
|
*
|
2015-05-01 14:44:54 +02:00
|
|
|
|
* Portions Copyright 2015 Andreas Schneider
|
|
|
|
|
* Portions Copyright 2015 StaticZ
|
2009-12-24 15:49:15 +01:00
|
|
|
|
*)
|
|
|
|
|
program cedserver;
|
|
|
|
|
|
|
|
|
|
{$mode objfpc}{$H+}
|
|
|
|
|
|
|
|
|
|
uses
|
|
|
|
|
{$IFDEF UNIX}{$IFDEF UseCThreads}
|
|
|
|
|
cthreads,
|
|
|
|
|
{$ENDIF}{$ENDIF}
|
2015-05-01 12:23:03 +02:00
|
|
|
|
SysUtils, UConfig, UCEDServer, LConvEncoding, vinfo, Language;
|
2009-12-24 15:49:15 +01:00
|
|
|
|
|
|
|
|
|
{$I version.inc}
|
|
|
|
|
|
2015-05-01 12:23:03 +02:00
|
|
|
|
//{$IFDEF WINDOWS}{$R cedserver.rc}{$ENDIF}
|
|
|
|
|
|
|
|
|
|
{$R *.res}
|
|
|
|
|
|
2009-12-24 15:49:15 +01:00
|
|
|
|
|
|
|
|
|
begin
|
|
|
|
|
Writeln('');
|
2015-05-01 12:23:03 +02:00
|
|
|
|
Writeln(Format('======= CentrED+ Server [Version: %s Build: %d] =======',
|
|
|
|
|
[VersionInfo.GetFileVersionString, VersionInfo.Build]));
|
|
|
|
|
Writeln('Copyright: ', Original);
|
|
|
|
|
Writeln(' : ', '"CentrED+" version (c) ', Copyright, ' (uoquint.ru)');
|
|
|
|
|
//Writeln(' : ', '!!! pre-release (not stable version) !!!');
|
|
|
|
|
//Writeln('Modified by StaticZ (uoquint.ru)');
|
2009-12-24 15:49:15 +01:00
|
|
|
|
//Writeln('================================');
|
|
|
|
|
|
|
|
|
|
{$IFDEF Windows}
|
|
|
|
|
if FileExists(ConfigFile) then
|
|
|
|
|
Config := TConfig.Create(ConfigFile)
|
|
|
|
|
else
|
|
|
|
|
Config := TConfig.Init(ConfigFile);
|
2015-05-01 12:23:03 +02:00
|
|
|
|
LanguageLoad(Config.Language);
|
2009-12-24 15:49:15 +01:00
|
|
|
|
{$ELSE}
|
|
|
|
|
if ParamStr(1) = '--init' then
|
|
|
|
|
Config := TConfig.Init(ConfigFile)
|
|
|
|
|
else if FileExists(ConfigFile) then
|
|
|
|
|
Config := TConfig.Create(ConfigFile)
|
|
|
|
|
else begin
|
2015-05-01 12:23:03 +02:00
|
|
|
|
Writeln(UTF8ToCP866('Файл конфигурации не был найден. Запустите програму с параметром --init чтобы создать новый файл конфигурации.'));
|
2009-12-24 15:49:15 +01:00
|
|
|
|
Halt;
|
|
|
|
|
end;
|
2015-05-01 12:23:03 +02:00
|
|
|
|
LanguageLoad(Config.Language);
|
2009-12-24 15:49:15 +01:00
|
|
|
|
{$ENDIF}
|
2015-05-01 12:23:03 +02:00
|
|
|
|
|
|
|
|
|
Writeln(TimeStamp, GetText('xmLoaded') + ' "' + ExtractFileName(ConfigFile) + '"');
|
|
|
|
|
Writeln(TimeStamp, GetText('dfStRead'));
|
2009-12-24 15:49:15 +01:00
|
|
|
|
Randomize;
|
|
|
|
|
CEDServerInstance := TCEDServer.Create;
|
2015-05-01 12:23:03 +02:00
|
|
|
|
Writeln(TimeStamp, GetText('dfInited'));
|
2009-12-24 15:49:15 +01:00
|
|
|
|
CEDServerInstance.Run;
|
2015-05-01 12:23:03 +02:00
|
|
|
|
Write(TimeStamp, GetText('Quieting'));
|
2009-12-24 15:49:15 +01:00
|
|
|
|
FreeAndNil(CEDServerInstance);
|
|
|
|
|
Config.Flush;
|
|
|
|
|
FreeAndNil(Config);
|
2015-05-01 12:23:03 +02:00
|
|
|
|
Writeln(GetText('SucsDone'));
|
2009-12-24 15:49:15 +01:00
|
|
|
|
end.
|
|
|
|
|
|