- Added converter for cedserver configs from version 2 to 3

- Updated changelog
- Updated installer
- Updated version to 0.4.0 and revision to 64
- Fixed about dialog
- Added some more exclusions to .hgignore
This commit is contained in:
Andreas Schneider 2008-08-27 13:18:09 +02:00
parent 1c3d624949
commit de21e6efde
8 changed files with 180 additions and 46 deletions

View File

@ -17,3 +17,9 @@ Setup/*
*.bmp *.bmp
*.xpm *.xpm
*.htm* *.htm*
*.o
*.ppu
*.a
*.compiled
*.sh
*.exe

View File

@ -259,6 +259,7 @@
</SearchPaths> </SearchPaths>
<Parsing> <Parsing>
<SyntaxOptions> <SyntaxOptions>
<CStyleOperator Value="False"/>
<UseAnsiStrings Value="True"/> <UseAnsiStrings Value="True"/>
</SyntaxOptions> </SyntaxOptions>
</Parsing> </Parsing>

View File

@ -1,23 +1,23 @@
object frmAbout: TfrmAbout object frmAbout: TfrmAbout
Left = 290 Left = 290
Height = 307 Height = 308
Top = 171 Top = 171
Width = 353 Width = 354
AutoSize = True AutoSize = True
BorderIcons = [biSystemMenu] BorderIcons = [biSystemMenu]
BorderStyle = bsDialog BorderStyle = bsDialog
Caption = 'About CentrED' Caption = 'About CentrED'
ClientHeight = 307 ClientHeight = 308
ClientWidth = 353 ClientWidth = 354
Font.Height = -11 Font.Height = -11
OnCreate = FormCreate OnCreate = FormCreate
Position = poScreenCenter Position = poScreenCenter
LCLVersion = '0.9.25' LCLVersion = '0.9.25'
object Label3: TLabel object Label3: TLabel
Left = 8 Left = 8
Height = 73 Height = 62
Top = 198 Top = 204
Width = 337 Width = 338
Align = alTop Align = alTop
BorderSpacing.Top = 16 BorderSpacing.Top = 16
BorderSpacing.Around = 8 BorderSpacing.Around = 8
@ -28,9 +28,9 @@ object frmAbout: TfrmAbout
end end
object Label5: TLabel object Label5: TLabel
Left = 8 Left = 8
Height = 13 Height = 14
Top = 118 Top = 120
Width = 337 Width = 338
Align = alTop Align = alTop
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
@ -40,9 +40,9 @@ object frmAbout: TfrmAbout
end end
object Label6: TLabel object Label6: TLabel
Left = 16 Left = 16
Height = 43 Height = 46
Top = 131 Top = 134
Width = 329 Width = 330
Align = alTop Align = alTop
BorderSpacing.Left = 16 BorderSpacing.Left = 16
BorderSpacing.Right = 8 BorderSpacing.Right = 8
@ -52,9 +52,9 @@ object frmAbout: TfrmAbout
end end
object Label7: TLabel object Label7: TLabel
Left = 8 Left = 8
Height = 13 Height = 14
Top = 105 Top = 106
Width = 337 Width = 338
Align = alTop Align = alTop
BorderSpacing.Left = 8 BorderSpacing.Left = 8
BorderSpacing.Right = 8 BorderSpacing.Right = 8
@ -64,32 +64,31 @@ object frmAbout: TfrmAbout
WordWrap = True WordWrap = True
end end
object Panel2: TPanel object Panel2: TPanel
Height = 97 Height = 98
Width = 353 Width = 354
Align = alTop Align = alTop
AutoSize = True AutoSize = True
BorderSpacing.Bottom = 8 BorderSpacing.Bottom = 8
ClientHeight = 97 BevelOuter = bvNone
ClientWidth = 353 ClientHeight = 98
ClientWidth = 354
ParentFont = True ParentFont = True
TabOrder = 0 TabOrder = 0
object Panel1: TPanel object Panel1: TPanel
Left = 1 Height = 98
Height = 96 Width = 220
Top = 1
Width = 219
AutoSize = True AutoSize = True
BevelInner = bvRaised BevelInner = bvRaised
BevelOuter = bvLowered BevelOuter = bvLowered
ClientHeight = 96 ClientHeight = 98
ClientWidth = 219 ClientWidth = 220
ParentFont = True ParentFont = True
TabOrder = 0 TabOrder = 0
object Label1: TLabel object Label1: TLabel
Left = 2 Left = 2
Height = 38 Height = 38
Top = 2 Top = 2
Width = 215 Width = 216
Align = alTop Align = alTop
Alignment = taCenter Alignment = taCenter
AutoSize = False AutoSize = False
@ -101,9 +100,9 @@ object frmAbout: TfrmAbout
end end
object lblVersion: TLabel object lblVersion: TLabel
Left = 6 Left = 6
Height = 24 Height = 25
Top = 40 Top = 40
Width = 207 Width = 208
Align = alTop Align = alTop
Alignment = taRightJustify Alignment = taRightJustify
BorderSpacing.Left = 4 BorderSpacing.Left = 4
@ -113,9 +112,9 @@ object frmAbout: TfrmAbout
end end
object lblCopyright: TLabel object lblCopyright: TLabel
Left = 6 Left = 6
Height = 24 Height = 25
Top = 68 Top = 69
Width = 207 Width = 208
Align = alTop Align = alTop
Alignment = taCenter Alignment = taCenter
BorderSpacing.Around = 4 BorderSpacing.Around = 4
@ -127,22 +126,23 @@ object frmAbout: TfrmAbout
object Panel3: TPanel object Panel3: TPanel
Left = 8 Left = 8
Height = 25 Height = 25
Top = 279 Top = 274
Width = 337 Width = 338
Align = alTop Align = alTop
BorderSpacing.Around = 8 BorderSpacing.Around = 8
BevelOuter = bvNone
ClientHeight = 25 ClientHeight = 25
ClientWidth = 337 ClientWidth = 338
ParentFont = True ParentFont = True
TabOrder = 1 TabOrder = 1
object btnClose: TButton object btnClose: TButton
Left = 261 Left = 263
Height = 23 Height = 25
Top = 1
Width = 75 Width = 75
Align = alRight Align = alRight
BorderSpacing.InnerBorder = 4 BorderSpacing.InnerBorder = 4
Caption = 'Close' Caption = 'Close'
OnClick = btnCloseClick
ParentFont = True ParentFont = True
TabOrder = 0 TabOrder = 0
end end

View File

@ -112,12 +112,16 @@
<UnitOutputDirectory Value="../obj"/> <UnitOutputDirectory Value="../obj"/>
<SrcPath Value="../;../UOLib/;../MulProvider/;../Imaging/ZLib/"/> <SrcPath Value="../;../UOLib/;../MulProvider/;../Imaging/ZLib/"/>
</SearchPaths> </SearchPaths>
<Parsing>
<SyntaxOptions>
<CStyleOperator Value="False"/>
</SyntaxOptions>
</Parsing>
<CodeGeneration> <CodeGeneration>
<SmartLinkUnit Value="True"/> <SmartLinkUnit Value="True"/>
<Optimizations> <Optimizations>
<OptimizationLevel Value="3"/> <OptimizationLevel Value="3"/>
</Optimizations> </Optimizations>
<TargetOS Value="Linux"/>
</CodeGeneration> </CodeGeneration>
<Linking> <Linking>
<Debugging> <Debugging>

View File

@ -3,7 +3,7 @@
[Setup] [Setup]
AppName=CentrED AppName=CentrED
AppVerName=CentrED 0.3.6 AppVerName=CentrED 0.4.0
AppPublisher=AKS DataBasis AppPublisher=AKS DataBasis
AppPublisherURL=http://www.aksdb.de/CentrED AppPublisherURL=http://www.aksdb.de/CentrED
AppSupportURL=http://www.aksdb.de/CentrED AppSupportURL=http://www.aksdb.de/CentrED
@ -13,10 +13,10 @@ DefaultGroupName=AKS DataBasis\CentrED
OutputBaseFilename=CentrED_win32 OutputBaseFilename=CentrED_win32
Compression=lzma Compression=lzma
SolidCompression=true SolidCompression=true
VersionInfoVersion=0.3.6 VersionInfoVersion=0.4.0
VersionInfoCompany=AKS DataBasis VersionInfoCompany=AKS DataBasis
VersionInfoDescription=Client/Server based multiuser map editor VersionInfoDescription=Client/Server based multiuser map editor
VersionInfoTextVersion=0.3.6 VersionInfoTextVersion=0.4.0
VersionInfoCopyright=Andreas Schneider VersionInfoCopyright=Andreas Schneider
AppCopyright=Andreas Schneider AppCopyright=Andreas Schneider
InfoBeforeFile=Changelog.txt InfoBeforeFile=Changelog.txt
@ -40,4 +40,4 @@ Name: {commondesktop}\CentrED; Filename: {app}\CentrED.exe; Tasks: desktopicon
[Run] [Run]
Filename: {app}\CentrED.exe; Description: {cm:LaunchProgram,CentrED}; Flags: nowait postinstall skipifsilent Filename: {app}\CentrED.exe; Description: {cm:LaunchProgram,CentrED}; Flags: nowait postinstall skipifsilent
[Messages] [Messages]
BeveledLabel=Copyright 2007 Andreas Schneider BeveledLabel=Copyright 2008 Andreas Schneider

View File

@ -1,5 +1,14 @@
Changelog: Changelog:
[C] = Client, [S] = Server [C] = Client, [S] = Server, [-] = Both/Unrelated
Version 0.4.0
=============
[C] Added regional restrictions to accounts
[C] Visualize these restrictions for users
[C] Added better GTK2 compatibility to the Linux version
[S] Changed config file to use XML
[S] Bumped config file version to 3
[-] Removed some memory leaks
Version 0.3.6 Version 0.3.6
============= =============

View File

@ -0,0 +1,114 @@
program cedserver_config_2_3;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, IniFiles, XMLWrite, dom;
procedure WriteXMLString(AElement: TDOMElement; AName, AValue: string);
var
child: TDOMElement;
begin
child := AElement.OwnerDocument.CreateElement(AName);
AElement.AppendChild(child);
child.AppendChild(AElement.OwnerDocument.CreateTextNode(AValue));
end;
procedure WriteXMLAccount(AElement: TDOMElement; AAccountString: string);
var
splitPos: Integer;
lastPos: TDOMElement;
begin
//Account name
splitPos := Pos('=', AAccountString);
WriteXMLString(AElement, 'Name', Copy(AAccountString, 1, splitPos - 1));
Delete(AAccountString, 1, splitPos);
//Accesslevel
splitPos := Pos(':', AAccountString);
WriteXMLString(AElement, 'Accesslevel', Copy(AAccountString, 1, splitPos - 1));
Delete(AAccountString, 1, splitPos);
lastPos := AElement.OwnerDocument.CreateElement('LastPos');
lastPos.AttribStrings['x'] := '0';
lastPos.AttribStrings['y'] := '0';
//Passwordhash
splitPos := Pos(':', AAccountString);
if splitPos > 0 then
begin
WriteXMLString(AElement, 'PasswordHash', Copy(AAccountString, 1, splitPos - 1));
Delete(AAccountString, 1, splitPos);
//LastPos
splitPos := Pos(':', AAccountString);
if splitPos > 0 then
begin
lastPos.AttribStrings['x'] := Copy(AAccountString, 1, splitPos - 1);
lastPos.AttribStrings['y'] := Copy(AAccountString, splitPos + 1, Length(AAccountString));
end;
end else
WriteXMLString(AElement, 'PasswordHash', AAccountString);
AElement.AppendChild(lastPos);
AElement.AppendChild(AElement.OwnerDocument.CreateElement('Regions'));
end;
var
v2ini: TIniFile;
v3xml: TXMLDocument;
root, parent, child: TDOMElement;
i: Integer;
rawAccounts: TStringList;
begin
writeln('Opening "cedserver.ini"');
v2ini := TIniFile.Create('cedserver.ini');
writeln('Preparing XML structure');
v3xml := TXMLDocument.Create;
root := v3xml.CreateElement('CEDConfig');
root.AttribStrings['Version'] := '3';
v3xml.AppendChild(root);
writeln('Transfering settings');
WriteXMLString(root, 'Port', v2ini.ReadString('Network', 'Port', '2597'));
parent := v3xml.CreateElement('Map');
root.AppendChild(parent);
WriteXMLString(parent, 'Map', v2ini.ReadString('Paths', 'map', 'map0.mul'));
WriteXMLString(parent, 'StaIdx', v2ini.ReadString('Paths', 'staidx', 'staidx0.mul'));
WriteXMLString(parent, 'Statics', v2ini.ReadString('Paths', 'statics', 'statics0.mul'));
WriteXMLString(parent, 'Width', v2ini.ReadString('Parameters', 'Width', '768'));
WriteXMLString(parent, 'Height', v2ini.ReadString('Parameters', 'Height', '512'));
WriteXmlString(root, 'Tiledata', v2ini.ReadString('Paths', 'tiledata', 'tiledata.mul'));
WriteXmlString(root, 'Radarcol', v2ini.ReadString('Paths', 'radarcol', 'radarcol.mul'));
writeln('Transfering accounts');
parent := v3xml.CreateElement('Accounts');
root.AppendChild(parent);
rawAccounts := TStringList.Create;
v2ini.ReadSectionRaw('Accounts', rawAccounts);
for i := 0 to rawAccounts.Count - 1 do
begin
child := v3xml.CreateElement('Account');
parent.AppendChild(child);
WriteXMLAccount(child, rawAccounts.Strings[i]);
end;
rawAccounts.Free;
root.AppendChild(v3xml.CreateElement('Regions'));
v2ini.Free;
writeln('Writing "cedserver.xml"');
WriteXMLFile(v3xml, 'cedserver.xml');
Writeln('Done.');
end.

View File

@ -1,5 +1,5 @@
const const
ProductVersion = '0.3.7'; ProductVersion = '0.4.0';
ProtocolVersion = 6; ProtocolVersion = 6;
Revision = '41'; Revision = '64';
Copyright = '2008 Andreas Schneider'; Copyright = '2008 Andreas Schneider';