64
64
65
65
int main ()
66
66
{
67
- printf (" \n Enter your database connection info.\n " );
68
- std::string const connection_string = MakeConnectionString ();
69
-
70
- printf (" \n Connecting to database.\n " );
71
- if (!GameDb.Initialize (connection_string.c_str ()))
72
- {
73
- printf (" \n Error: Cannot connect to world database!\n " );
74
- GetChar ();
75
- return 1 ;
76
- }
77
-
78
- WorldDatabase::LoadWorldDatabase ();
79
- printf (" \n " );
80
-
81
67
printf (" Options:\n " );
82
68
printf (" 1. Create timeline for specific guids\n " );
83
69
printf (" 2. Create timeline for all in time period\n " );
@@ -96,10 +82,24 @@ int main()
96
82
option == OPTION_QUESTS_WITH_RP_EVENTS ||
97
83
option == OPTION_GENERATE_SCRIPT)
98
84
{
99
-
85
+ printf (" \n Enter your database connection info.\n " );
86
+ std::string const connection_string = MakeConnectionString ();
87
+
88
+ printf (" \n Connecting to database.\n " );
89
+ if (!GameDb.Initialize (connection_string.c_str ()))
90
+ {
91
+ printf (" \n Error: Cannot connect to world database!\n " );
92
+ GetChar ();
93
+ return 1 ;
94
+ }
95
+
96
+ WorldDatabase::LoadWorldDatabase ();
97
+ printf (" \n " );
98
+
100
99
printf (" Enter sniff database name: " );
101
100
SniffDatabase::m_databaseName = GetString (" sniffs_new_test" );
102
101
SniffDatabase::LoadSniffDatabase ();
102
+ printf (" \n " );
103
103
104
104
if (option == OPTION_TIMELINE_SPECIFIC_GUIDS)
105
105
{
@@ -310,19 +310,29 @@ int main()
310
310
}
311
311
else if (option == OPTION_BREAKDOWN_NPC_FLAGS)
312
312
{
313
- printf (" NPC Flags: " );
314
- uint32 flags = GetUInt32 ();
315
- std::string flagNames = GetNpcFlagNames (flags);
316
- printf (flagNames.c_str ());
317
- GetChar ();
313
+ bool repeat = true ;
314
+ while (repeat)
315
+ {
316
+ printf (" NPC Flags: " );
317
+ uint32 flags = GetUInt32 ();
318
+ std::string flagNames = GetNpcFlagNames (flags);
319
+ printf (flagNames.c_str ());
320
+ printf (" \n Again? (y/n)\n >" );
321
+ repeat = GetChar () == ' y' ;
322
+ }
318
323
}
319
324
else if (option == OPTION_BREAKDOWN_UNIT_FLAGS)
320
325
{
321
- printf (" Unit Flags: " );
322
- uint32 flags = GetUInt32 ();
323
- std::string flagNames = GetUnitFlagNames (flags);
324
- printf (flagNames.c_str ());
325
- GetChar ();
326
+ bool repeat = true ;
327
+ while (repeat)
328
+ {
329
+ printf (" Unit Flags: " );
330
+ uint32 flags = GetUInt32 ();
331
+ std::string flagNames = GetUnitFlagNames (flags);
332
+ printf (flagNames.c_str ());
333
+ printf (" \n Again? (y/n)\n >" );
334
+ repeat = GetChar () == ' y' ;
335
+ }
326
336
}
327
337
328
338
GetChar ();
0 commit comments