- Timestamp:
- Feb 27, 2010, 8:06:39 PM (15 years ago)
- Location:
- tools/dbc_export
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
tools/dbc_export/DBCExport.lpi
r340 r341 27 27 <local> 28 28 <FormatVersion Value="1"/> 29 <CommandLineParams Value="-f ../../../trunk/source/3.3.0/dbc/GameTips.dbc -n test.dbc -c usuuuuuuuuuuuuuuuu -q "SELECT T.entry as entry,T.Text as text 0FROM (SELECT * FROM gametips WHERE (Complete = 1) AND ((Language = 1)) AND (User IN (459,670,602,462,1,400,638,592,624,610,769,331,131,704,2,499,641,660,578,337,304,277,208,613,768,754,590,606,26,618,739,503,601,607,585,596,765,320,547,687)) AND VersionStart <= 9947 AND VersionEnd >= 9947) AS T GROUP BY T.entry""/>29 <CommandLineParams Value="-f ../../../trunk/source/3.3.0/dbc/GameTips.dbc -n test.dbc -c usuuuuuuuuuuuuuuuu -q "SELECT T.entry as entry,T.Text as text1 FROM (SELECT * FROM gametips WHERE (Complete = 1) AND ((Language = 1)) AND (User IN (459,670,602,462,1,400,638,592,624,610,769,331,131,704,2,499,641,660,578,337,304,277,208,613,768,754,590,606,26,618,739,503,601,607,585,596,765,320,547,687)) AND VersionStart <= 9947 AND VersionEnd >= 9947) AS T GROUP BY T.entry""/> 30 30 <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> 31 31 </local> … … 36 36 <IsPartOfProject Value="True"/> 37 37 <UnitName Value="DBCExport"/> 38 <CursorPos X="1" Y=" 200"/>39 <TopLine Value="1 80"/>38 <CursorPos X="1" Y="199"/> 39 <TopLine Value="196"/> 40 40 <EditorIndex Value="0"/> 41 <UsageCount Value="4 5"/>41 <UsageCount Value="48"/> 42 42 <Loaded Value="True"/> 43 43 <SyntaxHighlighter Value="Delphi"/> … … 118 118 <TopLine Value="16"/> 119 119 <EditorIndex Value="3"/> 120 <UsageCount Value="3 6"/>120 <UsageCount Value="39"/> 121 121 <Loaded Value="True"/> 122 122 <SyntaxHighlighter Value="Delphi"/> … … 129 129 <TopLine Value="116"/> 130 130 <EditorIndex Value="1"/> 131 <UsageCount Value="3 6"/>131 <UsageCount Value="39"/> 132 132 <Loaded Value="True"/> 133 133 <SyntaxHighlighter Value="Delphi"/> … … 139 139 <TopLine Value="1"/> 140 140 <EditorIndex Value="2"/> 141 <UsageCount Value="3 6"/>141 <UsageCount Value="39"/> 142 142 <Loaded Value="True"/> 143 143 <SyntaxHighlighter Value="None"/> … … 154 154 <Position1> 155 155 <Filename Value="DBCExport.pas"/> 156 <Caret Line="1 88" Column="1" TopLine="174"/>156 <Caret Line="192" Column="1" TopLine="178"/> 157 157 </Position1> 158 158 <Position2> 159 159 <Filename Value="DBCExport.pas"/> 160 <Caret Line="1 89" Column="1" TopLine="175"/>160 <Caret Line="193" Column="1" TopLine="179"/> 161 161 </Position2> 162 162 <Position3> 163 163 <Filename Value="DBCExport.pas"/> 164 <Caret Line="19 0" Column="1" TopLine="176"/>164 <Caret Line="194" Column="1" TopLine="180"/> 165 165 </Position3> 166 166 <Position4> 167 167 <Filename Value="DBCExport.pas"/> 168 <Caret Line="19 1" Column="1" TopLine="177"/>168 <Caret Line="195" Column="1" TopLine="181"/> 169 169 </Position4> 170 170 <Position5> 171 171 <Filename Value="DBCExport.pas"/> 172 <Caret Line="19 2" Column="1" TopLine="178"/>172 <Caret Line="194" Column="64" TopLine="176"/> 173 173 </Position5> 174 174 <Position6> 175 175 <Filename Value="DBCExport.pas"/> 176 <Caret Line="19 3" Column="1" TopLine="179"/>176 <Caret Line="190" Column="1" TopLine="177"/> 177 177 </Position6> 178 178 <Position7> 179 179 <Filename Value="DBCExport.pas"/> 180 <Caret Line="1 94" Column="1" TopLine="180"/>180 <Caret Line="157" Column="1" TopLine="146"/> 181 181 </Position7> 182 182 <Position8> 183 183 <Filename Value="DBCExport.pas"/> 184 <Caret Line="1 88" Column="1" TopLine="174"/>184 <Caret Line="156" Column="1" TopLine="142"/> 185 185 </Position8> 186 186 <Position9> 187 187 <Filename Value="DBCExport.pas"/> 188 <Caret Line=" 83" Column="1" TopLine="69"/>188 <Caret Line="157" Column="1" TopLine="143"/> 189 189 </Position9> 190 190 <Position10> 191 191 <Filename Value="DBCExport.pas"/> 192 <Caret Line="1 86" Column="20" TopLine="166"/>192 <Caret Line="158" Column="1" TopLine="144"/> 193 193 </Position10> 194 194 <Position11> 195 195 <Filename Value="DBCExport.pas"/> 196 <Caret Line=" 83" Column="1" TopLine="69"/>196 <Caret Line="157" Column="1" TopLine="143"/> 197 197 </Position11> 198 198 <Position12> 199 199 <Filename Value="DBCExport.pas"/> 200 <Caret Line=" 186" Column="19" TopLine="166"/>200 <Caret Line="208" Column="22" TopLine="184"/> 201 201 </Position12> 202 202 <Position13> 203 203 <Filename Value="DBCExport.pas"/> 204 <Caret Line=" 83" Column="1" TopLine="69"/>204 <Caret Line="190" Column="1" TopLine="176"/> 205 205 </Position13> 206 206 <Position14> 207 207 <Filename Value="DBCExport.pas"/> 208 <Caret Line="1 80" Column="1" TopLine="166"/>208 <Caret Line="193" Column="1" TopLine="184"/> 209 209 </Position14> 210 210 <Position15> 211 211 <Filename Value="DBCExport.pas"/> 212 <Caret Line="1 86" Column="20" TopLine="174"/>212 <Caret Line="194" Column="1" TopLine="180"/> 213 213 </Position15> 214 214 <Position16> 215 215 <Filename Value="DBCExport.pas"/> 216 <Caret Line=" 82" Column="1" TopLine="69"/>216 <Caret Line="195" Column="1" TopLine="181"/> 217 217 </Position16> 218 218 <Position17> 219 219 <Filename Value="DBCExport.pas"/> 220 <Caret Line="1 88" Column="1" TopLine="166"/>220 <Caret Line="196" Column="1" TopLine="182"/> 221 221 </Position17> 222 222 <Position18> 223 223 <Filename Value="DBCExport.pas"/> 224 <Caret Line="1 87" Column="73" TopLine="173"/>224 <Caret Line="199" Column="1" TopLine="185"/> 225 225 </Position18> 226 226 <Position19> 227 227 <Filename Value="DBCExport.pas"/> 228 <Caret Line=" 188" Column="1" TopLine="174"/>228 <Caret Line="201" Column="1" TopLine="187"/> 229 229 </Position19> 230 230 <Position20> 231 231 <Filename Value="DBCExport.pas"/> 232 <Caret Line=" 186" Column="20" TopLine="174"/>232 <Caret Line="202" Column="1" TopLine="188"/> 233 233 </Position20> 234 234 <Position21> 235 235 <Filename Value="DBCExport.pas"/> 236 <Caret Line=" 188" Column="41" TopLine="173"/>236 <Caret Line="203" Column="1" TopLine="189"/> 237 237 </Position21> 238 238 <Position22> 239 239 <Filename Value="DBCExport.pas"/> 240 <Caret Line=" 187" Column="1" TopLine="173"/>240 <Caret Line="204" Column="1" TopLine="190"/> 241 241 </Position22> 242 242 <Position23> 243 243 <Filename Value="DBCExport.pas"/> 244 <Caret Line=" 188" Column="1" TopLine="174"/>244 <Caret Line="205" Column="1" TopLine="191"/> 245 245 </Position23> 246 246 <Position24> 247 <Filename Value=" DBCExport.pas"/>248 <Caret Line="1 89" Column="1" TopLine="175"/>247 <Filename Value="UDBC.pas"/> 248 <Caret Line="125" Column="1" TopLine="111"/> 249 249 </Position24> 250 250 <Position25> 251 <Filename Value=" DBCExport.pas"/>252 <Caret Line="1 88" Column="32" TopLine="176"/>251 <Filename Value="UDBC.pas"/> 252 <Caret Line="126" Column="1" TopLine="112"/> 253 253 </Position25> 254 254 <Position26> 255 <Filename Value=" DBCExport.pas"/>256 <Caret Line="1 90" Column="28" TopLine="176"/>255 <Filename Value="UDBC.pas"/> 256 <Caret Line="127" Column="1" TopLine="113"/> 257 257 </Position26> 258 258 <Position27> 259 <Filename Value=" DBCExport.pas"/>260 <Caret Line="1 87" Column="1" TopLine="173"/>259 <Filename Value="UDBC.pas"/> 260 <Caret Line="128" Column="1" TopLine="114"/> 261 261 </Position27> 262 262 <Position28> 263 <Filename Value=" DBCExport.pas"/>264 <Caret Line="1 88" Column="1" TopLine="174"/>263 <Filename Value="UDBC.pas"/> 264 <Caret Line="130" Column="1" TopLine="116"/> 265 265 </Position28> 266 266 <Position29> 267 267 <Filename Value="DBCExport.pas"/> 268 <Caret Line=" 189" Column="1" TopLine="175"/>268 <Caret Line="206" Column="1" TopLine="192"/> 269 269 </Position29> 270 270 <Position30> 271 271 <Filename Value="DBCExport.pas"/> 272 <Caret Line=" 190" Column="1" TopLine="176"/>272 <Caret Line="207" Column="1" TopLine="193"/> 273 273 </Position30> 274 274 </JumpHistory> … … 304 304 </CompilerOptions> 305 305 <Debugging> 306 <BreakPoints Count="2"> 307 <Item1> 308 <Source Value="DBCExport.pas"/> 309 <Line Value="190"/> 310 </Item1> 311 <Item2> 312 <Source Value="DBCExport.pas"/> 313 <Line Value="199"/> 314 </Item2> 315 </BreakPoints> 316 <Watches Count="2"> 317 <Item1> 318 <Expression Value="IndexTable"/> 319 </Item1> 320 <Item2> 321 <Expression Value="entry"/> 322 </Item2> 323 </Watches> 306 324 <Exceptions Count="3"> 307 325 <Item1> -
tools/dbc_export/DBCExport.pas
r340 r341 24 24 NewDBCFileName: string; 25 25 ColumnTypeDefinition: string; 26 LastIndexStringColumns: integer; 27 IndexTable: array of integer; 26 28 SQLquery: string; 27 29 DisplayData: Boolean; … … 33 35 procedure SaveDBC; 34 36 procedure ReplaceText; 37 procedure CreateIndexTable(var DbRows: TDbRows); 35 38 function GetIDbyEntry(entry: integer; var DBRows: TDBRows): integer; 36 39 end; … … 120 123 WriteLn(' -c --coltypedef DBC column type definition string (u - uint32, s - string)'); 121 124 WriteLn(' -d --display Display DBC data'); 122 WriteLn(' -q --sql_query SQL select when entry is ID first column in dbc file and text 0,text1... is texts columns');123 // SELECT T.entry as entry,T.Text as text 0FROM (SELECT * FROM gametips WHERE (Complete = 1) AND ((Language = 1)) AND (User IN (459,670,602,462,1,400,638,592,624,610,769,331,131,704,2,499,641,660,578,337,304,277,208,613,768,754,590,606,26,618,739,503,601,607,585,596,765,320,547,687)) AND VersionStart <= 9947 AND VersionEnd >= 9947) AS T GROUP BY T.entry125 WriteLn(' -q --sql_query SQL select when entry is ID first column in dbc file and text1,text2... is texts columns'); 126 // SELECT T.entry as entry,T.Text as text1 FROM (SELECT * FROM gametips WHERE (Complete = 1) AND ((Language = 1)) AND (User IN (459,670,602,462,1,400,638,592,624,610,769,331,131,704,2,499,641,660,578,337,304,277,208,613,768,754,590,606,26,618,739,503,601,607,585,596,765,320,547,687)) AND VersionStart <= 9947 AND VersionEnd >= 9947) AS T GROUP BY T.entry 124 127 end; 125 128 … … 153 156 // Load strings for string columns 154 157 for I := 1 to Length(ColumnTypeDefinition) do 155 if ColumnTypeDefinition[I] = 's' then 158 if ColumnTypeDefinition[I] = 's' then begin 156 159 LoadColumnStrings(I - 1); 160 LastIndexStringColumns:=I; 161 end; 162 157 163 158 164 end else WriteLn('File ' + DBCFileName + ' not exists.'); … … 174 180 DBRows : TDbRows; 175 181 Text: String; 176 X, Y, I : Integer;182 X, Y, I,entry: Integer; 177 183 IndexRowData: Integer; 178 184 begin … … 182 188 DBRows := Database.Query(SQLquery); 183 189 190 CreateIndexTable(DBRows); 191 184 192 185 193 for Y := 0 to Length(DBC.Cells) - 1 do begin 186 if (Y = 129) then 187 IndexRowData:= GetIDbyEntry(Cells[Y,0],DBRows); 188 IndexRowData:= GetIDbyEntry(Cells[Y,0],DBRows); 189 I := 0; 190 if (IndexRowData <> -1) then begin 191 for X := 0 to Length(ColumnTypeDefinition)-1 do begin 192 if ColumnTypeDefinition[X+1] = 's' then begin 193 Text:=DBRows.Data[IndexRowData].Values['text'+IntToStr(I)]; 194 SetString(Y,X,Text); 194 entry :=Cells[Y,0]; 195 if (Length(IndexTable) > entry) then 196 IndexRowData:= IndexTable[entry] 197 else IndexRowData:= 0; 198 199 I := 1; 200 201 if (IndexRowData <> 0) then begin 202 for X := 1 to Length(ColumnTypeDefinition) do begin 203 if ColumnTypeDefinition[X] = 's' then begin 204 Text:=DBRows.Data[IndexRowData-1].Values['text'+IntToStr(I)]; 205 SetString(Y,X-1,Text); 195 206 I:=I+1; 207 if (LastIndexStringColumns = X) then 208 Break; 196 209 end; 197 210 end; 198 DBRows.Delete(IndexRowData);199 211 end; 212 200 213 end; 201 214 … … 203 216 204 217 end; 218 end; 219 end; 220 221 //create table index = entry, value = Index-1 DBRows, notfound = 0 222 procedure TDBCExport.CreateIndexTable(var DbRows: TDbRows); 223 var 224 i: integer; 225 Count,entry: integer; 226 begin 227 try 228 Count:=DBRows.Count; 229 for i:=1 to Count do begin 230 entry:=StrToInt(DBRows.Data[i-1].Values['entry']); 231 232 if (i =127) then 233 SetLength(IndexTable,entry+1); 234 235 if (Length(IndexTable)-1 < entry) then 236 SetLength(IndexTable,entry+1); 237 238 239 IndexTable[entry]:=i; 240 241 end; 242 except 205 243 end; 206 244 end;
Note:
See TracChangeset
for help on using the changeset viewer.