Compare commits

...

9 Commits
master ... pg

Author SHA1 Message Date
42fd697dac fix: RESULT_SAFEBOX_LOAD. 2025-06-09 17:28:58 +01:00
74e9f0e99d change: Start updating ClientManager.
add: Callback AsyncQuery.
fix: Multiple missing `txn.commit()`.
2025-06-09 17:01:28 +01:00
d25bf59c6f fix: CItemIDRangeManager::BuildRange catch error 2025-06-07 23:00:26 +01:00
dc84d3f95f change: ItemIDRangeManager 2025-06-07 22:59:09 +01:00
3a38f8828c change: Marriage. 2025-06-07 22:42:01 +01:00
93d8f2a0be fix: __INTELLISENSE__ version import (VSC).
change: Format all /db files, db/Main, db/DBManager, db/Monarch.
add: PgConnectionPool, PgAsyncQuery.
2025-06-07 20:38:53 +01:00
4bc4a79a4b remove: Unused code. 2025-06-07 13:51:00 +01:00
c9bd9a76b1 change: Translate ClientManagerBoot.cpp 2025-06-06 20:26:23 +01:00
09b28e114e change: Start moving to PG.
remove: Auction.
2025-05-31 17:58:32 +01:00
106 changed files with 5376 additions and 9963 deletions

6
.gitignore vendored
View File

@ -406,6 +406,9 @@ FodyWeavers.xsd
# CMake
cmake-build-*/
cmake/
CMakeFiles/
CMakeCache.txt
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
@ -442,3 +445,6 @@ fabric.properties
# Debug folder
test/
# Vcpkg
vcpkg_installed/

811
.idea/editor.xml generated
View File

@ -1,580 +1,247 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BackendCodeEditorSettings">
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedOverridenMethod/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantFwdClassOrEnumSpecifier/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifierADL/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexRemoved" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
</component>
</project>

12
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,12 @@
{
"configurations": [
{
"type": "cmake",
"request": "launch",
"name": "Debug portfile(s)",
"cmakeDebugType": "external",
"pipeName": "/tmp/vcpkg_ext_portfile_dbg",
"preLaunchTask": "Debug vcpkg commands"
}
]
}

102
.vscode/settings.json vendored
View File

@ -1,3 +1,103 @@
{
"cmake.configureOnOpen": true
"cmake.configureOnOpen": true,
"files.associations": {
"array": "cpp",
"deque": "cpp",
"initializer_list": "cpp",
"list": "cpp",
"queue": "cpp",
"stack": "cpp",
"utility": "cpp",
"vector": "cpp",
"xhash": "cpp",
"xstring": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"sstream": "cpp",
"fstream": "cpp",
"atomic": "cpp",
"hash_map": "cpp",
"bit": "cpp",
"bitset": "cpp",
"cctype": "cpp",
"charconv": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"codecvt": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"exception": "cpp",
"expected": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"source_location": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"format": "cpp",
"future": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"ranges": "cpp",
"semaphore": "cpp",
"shared_mutex": "cpp",
"span": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"typeinfo": "cpp",
"variant": "cpp"
},
// "editor.formatOnSave": false,
"vcpkg.target.useManifest": false,
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
"cmake.configureArgs": [
"-DVCPKG_MANIFEST_MODE=OFF",
"-DVCPKG_APPLOCAL_DEPS=ON",
"-DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON",
"-DVCPKG_TARGET_TRIPLET=x64-linux"
],
"vcpkg.general.enable": true,
"vcpkg.target.hostTriplet": "x64-linux",
"vcpkg.target.defaultTriplet": "x64-linux",
"vcpkg.target.useStaticLib": false,
"cmake.configureSettings": {
"CMAKE_TOOLCHAIN_FILE": "~/.vcpkg/scripts/buildsystems/vcpkg.cmake"
},
"vcpkg.target.installDependencies": true,
"vcpkg.target.preferSystemLibs": false
}

View File

@ -1,3 +1,4 @@
# 22.04 is used due to python
FROM ubuntu:22.04 AS build
WORKDIR /app
@ -9,7 +10,7 @@ RUN echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https:
# Update the system and install various dependencies
RUN apt-get update && \
apt-get install -y git cmake ninja-build build-essential tar curl zip unzip pkg-config autoconf python3 \
libdevil-dev libncurses5-dev libbsd-dev
libdevil-dev libncurses5-dev libbsd-dev bison flex
# Arm specific
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
@ -17,7 +18,7 @@ ENV VCPKG_FORCE_SYSTEM_BINARIES=1
# Install vcpkg and the required libraries
RUN git clone https://github.com/Microsoft/vcpkg.git
RUN bash ./vcpkg/bootstrap-vcpkg.sh
RUN ./vcpkg/vcpkg install cryptopp effolkronium-random libmariadb libevent lzo fmt spdlog argon2
RUN ./vcpkg/vcpkg install cryptopp effolkronium-random libevent lzo fmt spdlog argon2 libpq libpqxx
COPY . .

View File

@ -60,7 +60,7 @@ Install `vcpkg` according to the [latest instructions](https://vcpkg.io/en/getti
Build and install the required libraries:
```shell
vcpkg install cryptopp effolkronium-random libmariadb libevent lzo fmt spdlog argon2
vcpkg install cryptopp effolkronium-random libevent lzo fmt spdlog argon2 libpq libpqxx
```
#### Building the binaries

17
TODO.md Normal file
View File

@ -0,0 +1,17 @@
# The list
- [ ] Database initialization
- [x] Main (Most important duh)
- [ ] ClientManager
- [ ] ClientManagerBoot
- [ ] ClientManagerEventFlag
- [ ] ClientManagerGuild
- [ ] ClientManagerHorseName
- [ ] ClientManagerLogin
- [ ] ClientManagerPlayer
- [x] DBManager
- [ ] GuildManager
- [ ] ItemAwardManager
- [x] ItemIDRangeManager
- [x] Marriage
- [x] Monarch

15
common/version.h Normal file
View File

@ -0,0 +1,15 @@
#ifndef __INC_METIN_II_VERSION_H__
#define __INC_METIN_II_VERSION_H__
#include <ostream>
#define __REVISION__ "c9bd9a7"
#define __COMMIT_DATE__ "2025-06-06 20:26:23 +0100"
#define __COMMIT_TAG__ "0.4.1"
#define __OS_NAME__ "Linux-5.15.167.4-microsoft-standard-WSL2"
#define __COMPILER__ "GNU 9.5.0"
#define __CPU_TARGET__ "x86_64"
void WriteVersion();
#endif

View File

@ -1,335 +0,0 @@
#ifndef __INC_AUCTION_TABLES_H__
#define __INC_AUCTION_TABLES_H__
#include "tables.h"
typedef struct _base_auction
{
public:
DWORD item_num;
TItemTable* item_proto;
int offer_price;
int price;
DWORD offer_id;
char shown_name[CHARACTER_NAME_MAX_LEN + 1];
BYTE empire;
time_t expired_time;
DWORD get_item_num () { return item_num; }
DWORD get_offer_id () { return offer_id; }
BYTE get_empire () { return empire; }
time_t get_expired_time () { return expired_time; }
bool is_expired ()
{
return (time(NULL) > expired_time);
}
int get_price () { return offer_price; }
} TAuctionSimpleItemInfo;
// 각 auction 정보들.
// primary key (item_id)
typedef struct _auction : public _base_auction
{
public:
DWORD item_id;
DWORD bidder_id;
_auction (){}
_auction (DWORD _item_num, int _offer_price, int _price, DWORD _offer_id,
char* _shown_name, time_t _expired_time, DWORD _item_id, DWORD _bidder_id, BYTE _empire)
{
item_num = _item_num;
offer_price= _offer_price;
price = _price;
offer_id = _offer_id;
memcpy(shown_name, _shown_name, strlen(_shown_name) + 1);
expired_time = _expired_time;
item_id = _item_id;
bidder_id = _bidder_id;
empire = _empire;
}
// 이 메소드들은 어떤 변수가 auction에서 어떤 역할을 하는지 까먹을 까봐
// 만들어놓았다.
// by rtsummit
DWORD get_item_id () { return item_id; }
DWORD get_bidder_id () { return bidder_id; }
int get_bid_price () { return offer_price; }
void set_bid_price (int new_price)
{
offer_price = new_price;
}
int get_impur_price () { return price; }
const char* get_bidder_name () { return shown_name; }
void set_bidder_name (const char* new_bidder_name)
{
memcpy(shown_name, new_bidder_name, strlen(new_bidder_name) + 1);
}
} TAuctionItemInfo;
// primary key (item_id)
typedef struct _sale : public _base_auction
{
_sale (){}
_sale (DWORD _item_num, int _offer_price, DWORD _offer_id,
char* _shown_name, DWORD _item_id, DWORD _wisher_id)
{
item_num = _item_num;
offer_price= _offer_price;
offer_id = _offer_id;
memcpy(shown_name, _shown_name, strlen(_shown_name) + 1);
item_id = _item_id;
wisher_id = _wisher_id;
}
DWORD item_id;
DWORD wisher_id;
} TSaleItemInfo;
// wish는 실제하는 아이템은 없다.
// primary key (item_num, wisher_id)
typedef struct _wish : public _base_auction
{
_wish (){}
_wish (DWORD _item_num, int _offer_price, DWORD _offer_id,
char* _shown_name, time_t _expired_time, BYTE _empire)
{
item_num = _item_num;
offer_price= _offer_price;
offer_id = _offer_id;
memcpy(shown_name, _shown_name, strlen(_shown_name) + 1);
expired_time = _expired_time;
empire = _empire;
}
} TWishItemInfo;
enum AuctionType {_AUCTION, _WISH_AUCTION, _MY_AUCTION, _MY_WISH_AUCTION, _AUCTION_MAX};
enum AuctionCmd {OPEN_AUCTION, OPEN_WISH_AUCTION, OPEN_MY_AUCTION, OPEN_MY_WISH_AUCTION,
AUCTION_BID, AUCTION_IMME_PUR, AUCTION_ENR_AUC, AUCTION_ENR_WISH, AUCTION_ENR_SALE,
AUCTION_GET_AUC, AUCTION_BUY_SOLD,
AUCTION_CANCEL_AUC, AUCTION_CANCEL_WISH, AUCTION_CANCEL_SALE,
AUCTION_DELETE_AUCTION_ITEM, AUCTION_DELETE_SALE_ITEM,
AUCTION_CHANGING_MONEY,
AUCTION_REBID, AUCTION_BID_CANCEL,
};
// 반드시 FAIL 앞에, 실패 류 들이 와야한다.
// 왜냐, <= AUCTION_FAIL 이런 CHECK을 할 거거든
// 반대로 SUCCESS 뒤에, 성공 류 들이 와야한다. 근데 성공류가 있긴 하려나...
enum AuctionResult { AUCTION_EXPIRED, AUCTION_NOT_EXPIRED, AUCTION_NOT_ENOUGH_MONEY,
AUCTION_SOLD, AUCTION_CANCEL, AUCTION_ALREADY_IN, AUCTION_NOT_IN, AUCTION_FAIL, AUCTION_SUCCESS };
enum AuctionSort { AUCTION_NO_ORDER,
AUCTION_ITEM_NAME_AC, AUCTION_ITEM_NAME_DC,
AUCTION_CATEGORY_AC, AUCTION_CATEGORY_DC,
AUCTION_TIME_AC, AUCTION_TIME_DC,
AUCTION_CHAR_NAME_AC, AUCTION_CHAR_NAME_DC,
AUCTION_PRICE_AC, AUCTION_PRICE_DC,
};
typedef struct command_get_auction_list
{
AuctionCmd cmd;
DWORD start_idx;
BYTE size;
} TPacketGDGetAuctionList;
typedef struct command_auction
{
void enroll_product (DWORD _item_id, BYTE _empire, int _bidPrice, int _impurPrice)
{
cmd = AUCTION_ENR_AUC;
item = _item_id;
empire = _empire;
price1 = _bidPrice;
price2 = _impurPrice;
}
void enroll_sale (DWORD _item_id, DWORD _wisher_id, int _salePrice)
{
cmd = AUCTION_ENR_SALE;
item = _item_id;
price1 = _salePrice;
player_id = _wisher_id;
}
void enroll_wish (DWORD _item_num, BYTE _empire, int _wishPrice)
{
cmd = AUCTION_ENR_WISH;
item = _item_num;
empire = _empire;
price1 = _wishPrice;
}
void bid (DWORD _item_id, int _bidPrice)
{
cmd = AUCTION_BID;
item = _item_id;
price1 = _bidPrice;
}
void impur (DWORD _item_id)
{
cmd = AUCTION_IMME_PUR;
item = _item_id;
}
void get_auctioned_item (DWORD _item_id)
{
cmd = AUCTION_GET_AUC;
item = _item_id;
}
void buy_sold_item (DWORD _item_id)
{
cmd = AUCTION_BUY_SOLD;
item = _item_id;
}
void cancel_auction (DWORD _item_id)
{
cmd = AUCTION_CANCEL_AUC;
item = _item_id;
}
void cancel_wish (DWORD _item_num)
{
cmd = AUCTION_CANCEL_WISH;
item = _item_num;
}
void cancel_sale (DWORD _item_id)
{
cmd = AUCTION_CANCEL_SALE;
item = _item_id;
}
void delete_auction_item (DWORD _item_id)
{
cmd = AUCTION_DELETE_AUCTION_ITEM;
item = _item_id;
}
void delete_sale_item (DWORD _item_id)
{
cmd = AUCTION_DELETE_SALE_ITEM;
item = _item_id;
}
void changing_money (int _money)
{
cmd = AUCTION_CHANGING_MONEY;
price1 = _money;
}
// bid랑 cmd만 다르다.
void rebid (DWORD _item_id, int _bidPrice)
{
cmd = AUCTION_REBID;
item = _item_id;
price1 = _bidPrice;
}
void bid_cancel (DWORD _item_id)
{
cmd = AUCTION_BID_CANCEL;
item = _item_id;
}
DWORD get_item () { return item; }
protected:
AuctionCmd cmd;
DWORD player_id;
DWORD item;
BYTE empire;
int price1;
int price2;
public:
AuctionCmd get_cmd() { return cmd; }
BYTE get_empire () { return empire; }
} TPacketGDCommnadAuction;
typedef struct result_auction
{
AuctionCmd cmd;
BYTE result;
DWORD target;
} TPacketDGResultAuction;
// wrapper struct
typedef struct auction_enroll_product : public command_auction
{
DWORD get_item_id() { return item; }
int get_bid_price() { return price1; }
int get_impur_price() { return price2; }
} AuctionEnrollProductInfo;
typedef struct auction_enroll_sale : public command_auction
{
DWORD get_item_id() { return item; }
DWORD get_wisher_id() { return player_id; }
int get_sale_price() { return price1; }
} AuctionEnrollSaleInfo;
typedef struct auction_enroll_wish : public command_auction
{
DWORD get_item_num() { return item; }
int get_wish_price() { return price1; }
} AuctionEnrollWishInfo;
typedef struct auction_bid : public command_auction
{
DWORD get_item_id() { return item; }
int get_bid_price() { return price1; }
} AuctionBidInfo;
typedef struct auction_impur : public command_auction
{
DWORD get_item_id() { return item; }
} AuctionImpurInfo;
//typedef struct get_auction_list
//
//bid
//{
// item_id;
// bidder_id;
// price;
//}
//impur
//{
// item_id;
// purchaser_id;
//}
//enroll_wish
//{
// item_num;
// wisher_id;
// wish_price;
//}
//enroll_sale
//{
// item_id;
// seller_id;
// sale_price;
//}
//
//return_packet
//{
// isSuccess;
//}
//
//
//get_auction_simple_item_info_list
//{
// auction_type;
// start_idx;
// size;
// conditions; 정렬은 승철님께 조언을 구해보자.ㅇㅇ
//}
//
//get_auction_detail_item_info
//{
// item_id;
//}
#endif

View File

@ -456,9 +456,6 @@ enum EWindows
MALL,
DRAGON_SOUL_INVENTORY,
BELT_INVENTORY,
#ifdef __AUCTION__
AUCTION,
#endif
GROUND
};

View File

@ -1,6 +1,5 @@
#ifndef __INC_SERVICE_H__
#define __INC_SERVICE_H__
//#define __AUCTION__
#define __PET_SYSTEM__
#endif

View File

@ -130,12 +130,6 @@ enum
HEADER_GD_VALID_LOGOUT = 134,
// AUCTION
#ifdef __AUCTION__
HEADER_GD_GET_AUCTION_LIST = 135,
HEADER_GD_COMMAND_AUCTION = 136,
#endif
HEADER_GD_REQUEST_CHARGE_CASH = 137,
HEADER_GD_DELETE_AWARDID = 138, // delete gift notify icon
@ -262,9 +256,7 @@ enum
HEADER_DG_ACK_HORSE_NAME = 176,
HEADER_DG_NEED_LOGIN_LOG = 177,
#ifdef __AUCTION__
HEADER_DG_AUCTION_RESULT = 178,
#endif
HEADER_DG_RESULT_CHARGE_CASH = 179,
HEADER_DG_ITEMAWARD_INFORMER = 180, //gift notify
HEADER_DG_RESPOND_CHANNELSTATUS = 181,

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(db CXX)

View File

@ -1,719 +0,0 @@
#include "stdafx.h"
#ifdef __AUCTION__
#include "DBManager.h"
#include "Peer.h"
#include "AuctionManager.h"
void MyBidBoard::Boot (CPeer* peer)
{
peer->EncodeWORD(sizeof(DWORD) + sizeof(DWORD) + sizeof(int));
peer->EncodeWORD(Size());
for (TMyBidBoard::iterator pc_it = pc_map.begin(); pc_it != pc_map.end(); pc_it++)
{
TItemMap* item_map = pc_it->second;
for (TItemMap::iterator it = item_map->begin(); it != item_map->end(); it++)
{
peer->Encode(&(pc_it->first), sizeof(DWORD));
peer->Encode(&(it->first), sizeof(DWORD));
peer->Encode(&(it->second), sizeof(int));
}
}
}
size_t MyBidBoard::Size ()
{
size_t size = 0;
for (TMyBidBoard::iterator it = pc_map.begin(); it != pc_map.end(); it++)
{
size += it->second->size();
}
return size;
}
int MyBidBoard::GetMoney (DWORD player_id, DWORD item_id)
{
TMyBidBoard::iterator pc_it = pc_map.find (player_id);
if (pc_it == pc_map.end())
{
return -1;
}
TItemMap* item_map = pc_it->second;
TItemMap::iterator it = item_map->find (item_id);
if (it == item_map->end())
return -1;
else
return it->second;
}
bool MyBidBoard::Delete (DWORD player_id, DWORD item_id)
{
TMyBidBoard::iterator pc_it = pc_map.find (player_id);
if (pc_it == pc_map.end())
{
return false;
}
TItemMap* item_map = pc_it->second;
TItemMap::iterator it = item_map->find (item_id);
if (it == item_map->end())
return false;
else
{
item_map->erase(it);
}
char szQuery[512];
snprintf(szQuery, sizeof(szQuery), "DELETE FROM my_bid WHERE player_id = %d and item_id = %d", player_id, item_id);
CDBManager::instance().AsyncQuery(szQuery);
return true;
}
void MyBidBoard::Insert (DWORD player_id, DWORD item_id, int money)
{
TMyBidBoard::iterator pc_it = pc_map.find (player_id);
TItemMap* item_map;
if (pc_it == pc_map.end())
{
item_map = new TItemMap();
pc_map.insert (TMyBidBoard::value_type (player_id, item_map));
}
else
item_map = pc_it->second;
TItemMap::iterator it = item_map->find (item_id);
if (it == item_map->end())
{
item_map->insert (TItemMap::value_type (item_id, money));
}
else
{
it->second = money;
}
char szQuery[512];
snprintf(szQuery, sizeof(szQuery), "REPLACE INTO my_bid VALUES (%d, %d, %d)", player_id, item_id, money);
CDBManager::instance().AsyncQuery(szQuery);
}
AuctionManager::AuctionManager()
{
}
AuctionManager::~AuctionManager()
{
}
void AuctionManager::Initialize()
{ auction_item_cache_map.clear();
LoadAuctionItem();
LoadAuctionInfo();
LoadSaleInfo();
LoadWishInfo();
LoadMyBidInfo();
}
void AuctionManager::LoadAuctionItem()
{
char szQuery[512];
snprintf(szQuery, sizeof(szQuery),
"SELECT id, owner_id, count, vnum, socket0, socket1, socket2, "
"attrtype0, attrvalue0, "
"attrtype1, attrvalue1, "
"attrtype2, attrvalue2, "
"attrtype3, attrvalue3, "
"attrtype4, attrvalue4, "
"attrtype5, attrvalue5, "
"attrtype6, attrvalue6 "
"FROM item WHERE window = 'AUCTION'");
SQLMsg *msg = CDBManager::instance().DirectQuery(szQuery);
MYSQL_RES *res = msg->Get()->pSQLResult;
if (!res)
{
return;
}
int rows;
if ((rows = mysql_num_rows(res)) <= 0) // 데이터 없음
{
return;
}
for (int i = 0; i < rows; ++i)
{
MYSQL_ROW row = mysql_fetch_row(res);
TPlayerItem item;
int cur = 0;
str_to_number(item.id, row[cur++]);
str_to_number(item.owner, row[cur++]);
item.window = AUCTION;
str_to_number(item.count, row[cur++]);
str_to_number(item.vnum, row[cur++]);
str_to_number(item.alSockets[0], row[cur++]);
str_to_number(item.alSockets[1], row[cur++]);
str_to_number(item.alSockets[2], row[cur++]);
for (int j = 0; j < ITEM_ATTRIBUTE_MAX_NUM; j++)
{
str_to_number(item.aAttr[j].bType, row[cur++]);
str_to_number(item.aAttr[j].sValue, row[cur++]);
}
InsertItemCache(&item, true);
}
return;
}
void AuctionManager::LoadAuctionInfo()
{
char szQuery[512];
snprintf(szQuery, sizeof(szQuery),
"select * from auction");
SQLMsg *msg = CDBManager::instance().DirectQuery(szQuery);
MYSQL_RES *res = msg->Get()->pSQLResult;
if (!res)
{
return;
}
int rows;
if ((rows = mysql_num_rows(res)) <= 0) // 데이터 없음
{
return;
}
for (int i = 0; i < rows; ++i)
{
MYSQL_ROW row = mysql_fetch_row(res);
TAuctionItemInfo auctionItemInfo;
int cur = 0;
str_to_number(auctionItemInfo.item_num, row[cur++]);
str_to_number(auctionItemInfo.offer_price, row[cur++]);
str_to_number(auctionItemInfo.price, row[cur++]);
str_to_number(auctionItemInfo.offer_id, row[cur++]);
memcpy (auctionItemInfo.shown_name, (char*)row[cur], strlen((char*)row[cur]) +1);
cur++;
str_to_number(auctionItemInfo.empire, row[cur++]);
str_to_number(auctionItemInfo.expired_time, row[cur++]);
str_to_number(auctionItemInfo.item_id, row[cur++]);
str_to_number(auctionItemInfo.bidder_id, row[cur++]);
InsertAuctionItemInfoCache(&auctionItemInfo, true);
}
return;
}
void AuctionManager::LoadSaleInfo()
{
char szQuery[512];
snprintf(szQuery, sizeof(szQuery),
"select * from sale");
SQLMsg *msg = CDBManager::instance().DirectQuery(szQuery);
MYSQL_RES *res = msg->Get()->pSQLResult;
if (!res)
{
return;
}
int rows;
if ((rows = mysql_num_rows(res)) <= 0) // 데이터 없음
{
return;
}
for (int i = 0; i < rows; ++i)
{
MYSQL_ROW row = mysql_fetch_row(res);
TSaleItemInfo saleItemInfo;
int cur = 0;
str_to_number(saleItemInfo.item_num, row[cur++]);
str_to_number(saleItemInfo.offer_price, row[cur++]);
str_to_number(saleItemInfo.price, row[cur++]);
str_to_number(saleItemInfo.offer_id, row[cur++]);
memcpy (saleItemInfo.shown_name, (char*)row[cur], strlen((char*)row[cur]) +1);
cur++;
str_to_number(saleItemInfo.empire, row[cur++]);
str_to_number(saleItemInfo.expired_time, row[cur++]);
str_to_number(saleItemInfo.item_id, row[cur++]);
str_to_number(saleItemInfo.wisher_id, row[cur++]);
InsertSaleItemInfoCache(&saleItemInfo, true);
}
return;
}
void AuctionManager::LoadWishInfo()
{
char szQuery[512];
snprintf(szQuery, sizeof(szQuery),
"select * from wish");
SQLMsg *msg = CDBManager::instance().DirectQuery(szQuery);
MYSQL_RES *res = msg->Get()->pSQLResult;
if (!res)
{
return;
}
int rows;
if ((rows = mysql_num_rows(res)) <= 0) // 데이터 없음
{
return;
}
for (int i = 0; i < rows; ++i)
{
MYSQL_ROW row = mysql_fetch_row(res);
TWishItemInfo wishItemInfo;
int cur = 0;
str_to_number(wishItemInfo.item_num, row[cur++]);
str_to_number(wishItemInfo.offer_price, row[cur++]);
str_to_number(wishItemInfo.price, row[cur++]);
str_to_number(wishItemInfo.offer_id, row[cur++]);
memcpy (wishItemInfo.shown_name, (char*)row[cur], strlen((char*)row[cur]) +1);
cur++;
str_to_number(wishItemInfo.empire, row[cur++]);
str_to_number(wishItemInfo.expired_time, row[cur++]);
InsertWishItemInfoCache(&wishItemInfo, true);
}
return;
}
void AuctionManager::LoadMyBidInfo ()
{
char szQuery[512];
snprintf(szQuery, sizeof(szQuery),
"select * from my_bid");
SQLMsg *msg = CDBManager::instance().DirectQuery(szQuery);
MYSQL_RES *res = msg->Get()->pSQLResult;
if (!res)
{
return;
}
int rows;
if ((rows = mysql_num_rows(res)) <= 0) // 데이터 없음
{
return;
}
for (int i = 0; i < rows; ++i)
{
MYSQL_ROW row = mysql_fetch_row(res);
int cur = 0;
DWORD player_id;
DWORD item_id;
int money;
str_to_number(player_id, row[cur++]);
str_to_number(item_id, row[cur++]);
str_to_number(money, row[cur++]);
InsertMyBid (player_id, item_id, money);
}
return;
}
inline CItemCache* AuctionManager::GetItemCache(DWORD item_id)
{
TItemCacheMap::iterator it = auction_item_cache_map.find (item_id);
if (it == auction_item_cache_map.end())
return NULL;
else
return it->second;
}
void AuctionManager::Boot(CPeer* peer)
{
peer->EncodeWORD(sizeof(TPlayerItem));
peer->EncodeWORD(auction_item_cache_map.size());
itertype(auction_item_cache_map) auction_item_cache_map_it = auction_item_cache_map.begin();
while (auction_item_cache_map_it != auction_item_cache_map.end())
peer->Encode((auction_item_cache_map_it++)->second->Get(), sizeof(TPlayerItem));
Auction.Boot(peer);
Sale.Boot(peer);
Wish.Boot(peer);
MyBid.Boot(peer);
}
bool AuctionManager::InsertItemCache(CItemCache *item_cache, bool bSkipQuery)
{
CItemCache* c = GetItemCache (item_cache->Get(false)->id);
if (c != NULL)
{
return false;
}
auction_item_cache_map.insert(TItemCacheMap::value_type(item_cache->Get(true)->id, item_cache));
item_cache->OnFlush();
return true;
}
bool AuctionManager::InsertItemCache(TPlayerItem * pNew, bool bSkipQuery)
{
CItemCache* c = GetItemCache (pNew->id);
if (c != NULL)
{
return false;
}
c = new CItemCache();
c->Put(pNew, bSkipQuery);
auction_item_cache_map.insert(TItemCacheMap::value_type(pNew->id, c));
c->Flush();
return true;
}
bool AuctionManager::DeleteItemCache(DWORD item_id)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
return false;
}
c->Delete();
return true;
}
AuctionResult AuctionManager::EnrollInAuction(CItemCache* item_cache, TAuctionItemInfo &item_info)
{
CItemCache* c = GetItemCache (item_info.item_id);
if (c != NULL)
{
SPDLOG_ERROR("item id : {} is already in AuctionManager", item_info.item_id);
return AUCTION_FAIL;
}
if (!Auction.InsertItemInfo (&item_info))
{
SPDLOG_ERROR("item id : {} is already in AuctionBoard", item_info.item_id);
return AUCTION_FAIL;
}
item_cache->Get()->window = AUCTION;
item_cache->Get()->pos = 9999999;
InsertItemCache (item_cache);
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::EnrollInSale(CItemCache* item_cache, TSaleItemInfo &item_info)
{
CItemCache* c = GetItemCache (item_info.item_id);
if (c != NULL)
{
SPDLOG_ERROR("item id : {} is already in AuctionManager", item_info.item_id);
return AUCTION_FAIL;
}
if (!Wish.GetItemInfoCache (WishBoard::Key (item_info.item_num, item_info.wisher_id)))
{
SPDLOG_ERROR("item_num : {}, wisher_id : {} is not in wish auction.", item_info.item_num, item_info.wisher_id);
return AUCTION_FAIL;
}
if (!Sale.InsertItemInfo (&item_info))
{
SPDLOG_ERROR("item id : {} is already in SaleBoard", item_info.item_id);
return AUCTION_FAIL;
}
item_cache->Get()->window = AUCTION;
item_cache->Get()->pos = 999999;
InsertItemCache (item_cache);
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::EnrollInWish(TWishItemInfo &item_info)
{
if (!Wish.InsertItemInfo (&item_info))
{
SPDLOG_ERROR("wisher_id : {}, item_num : {} is already in WishBoard", item_info.offer_id, item_info.item_num);
return AUCTION_FAIL;
}
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::Bid(DWORD bidder_id, const char* bidder_name, DWORD item_id, DWORD bid_price)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
if (MyBid.GetMoney (bidder_id, item_id) != 0)
{
return AUCTION_ALREADY_IN;
}
CAuctionItemInfoCache* item_cache = Auction.GetItemInfoCache(item_id);
TAuctionItemInfo* item_info = item_cache->Get(false);
if (item_info->is_expired())
{
return AUCTION_EXPIRED;
}
if ((double)bid_price < (double)item_info->get_bid_price() * 1.05)
{
return AUCTION_NOT_ENOUGH_MONEY;
}
item_info->set_bid_price(bid_price);
item_info->bidder_id = bidder_id;
item_info->set_bidder_name (bidder_name);
item_cache->OnFlush();
InsertMyBid (bidder_id, item_id, bid_price);
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::Impur(DWORD purchaser_id, const char* purchaser_name, DWORD item_id)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
CAuctionItemInfoCache* item_cache = Auction.GetItemInfoCache(item_id);
TAuctionItemInfo* item_info = item_cache->Get(false);
if (item_info->is_expired())
{
return AUCTION_EXPIRED;
}
// 즉구 해버렸으므로, 경매는 끝났다.
item_info->expired_time = 0;
item_info->bidder_id = purchaser_id;
item_info->set_bidder_name (purchaser_name);
item_info->set_bid_price (item_info->get_impur_price());
item_cache->OnFlush();
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::GetAuctionedItem (DWORD actor_id, DWORD item_id, TPlayerItem& item)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
CAuctionItemInfoCache* item_info_cache = Auction.GetItemInfoCache(item_id);
if (item_info_cache == NULL)
{
SPDLOG_ERROR("how can this accident happen?");
return AUCTION_FAIL;
}
TAuctionItemInfo* item_info = item_info_cache->Get(false);
if (!item_info->is_expired())
{
return AUCTION_NOT_EXPIRED;
}
memcpy(&item, c->Get(), sizeof(TPlayerItem));
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::BuySoldItem (DWORD actor_id, DWORD item_id, TPlayerItem& item)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
CSaleItemInfoCache* item_info_cache = Sale.GetItemInfoCache(item_id);
if (item_info_cache == NULL)
{
SPDLOG_ERROR("how can this accident happen?");
return AUCTION_FAIL;
}
TSaleItemInfo* item_info = item_info_cache->Get(false);
memcpy(&item, c->Get(), sizeof(TPlayerItem));
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::CancelAuction (DWORD actor_id, DWORD item_id, TPlayerItem& item)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
CAuctionItemInfoCache* item_info_cache = Auction.GetItemInfoCache(item_id);
if (item_info_cache == NULL)
{
SPDLOG_ERROR("how can this accident happen?");
return AUCTION_FAIL;
}
TAuctionItemInfo* item_info = item_info_cache->Get(false);
memcpy(&item, c->Get(), sizeof(TPlayerItem));
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::CancelWish (DWORD actor_id, DWORD item_num)
{
if (!Wish.DeleteItemInfoCache (WishBoard::Key (actor_id, item_num)))
{
return AUCTION_FAIL;
}
else
{
return AUCTION_SUCCESS;
}
}
AuctionResult AuctionManager::CancelSale (DWORD actor_id, DWORD item_id, TPlayerItem& item)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
CSaleItemInfoCache* item_info_cache = Sale.GetItemInfoCache(item_id);
if (item_info_cache == NULL)
{
SPDLOG_ERROR("how can this accident happen?");
return AUCTION_FAIL;
}
TSaleItemInfo* item_info = item_info_cache->Get(false);
memcpy(&item, c->Get(), sizeof(TPlayerItem));
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::DeleteAuctionItem (DWORD actor_id, DWORD item_id)
{
if (DeleteItemCache (item_id) == false)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
if (Auction.DeleteItemInfoCache (item_id) == NULL)
{
SPDLOG_ERROR("how can this accident happen?");
return AUCTION_FAIL;
}
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::DeleteSaleItem (DWORD actor_id, DWORD item_id)
{
if (DeleteItemCache (item_id) == false)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
if (Sale.DeleteItemInfoCache (item_id) == NULL)
{
SPDLOG_ERROR("how can this accident happen?");
return AUCTION_FAIL;
}
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::ReBid(DWORD bidder_id, const char* bidder_name, DWORD item_id, DWORD bid_price)
{
CItemCache* c = GetItemCache (item_id);
if (c == NULL)
{
SPDLOG_ERROR("item id : {} does not exist in auction.", item_id);
return AUCTION_FAIL;
}
int money = MyBid.GetMoney (bidder_id, item_id);
if (money == -1)
{
return AUCTION_NOT_IN;
}
CAuctionItemInfoCache* item_cache = Auction.GetItemInfoCache(item_id);
TAuctionItemInfo* item_info = item_cache->Get(false);
if (item_info->is_expired())
{
return AUCTION_EXPIRED;
}
if ((double)(bid_price + money) < (double)item_info->get_bid_price() * 1.05)
{
return AUCTION_NOT_ENOUGH_MONEY;
}
item_info->set_bid_price(bid_price + money);
item_info->bidder_id = bidder_id;
item_info->set_bidder_name (bidder_name);
item_cache->OnFlush();
InsertMyBid (bidder_id, item_id, money + bid_price);
return AUCTION_SUCCESS;
}
AuctionResult AuctionManager::BidCancel (DWORD bidder_id, DWORD item_id)
{
if (MyBid.Delete (bidder_id, item_id))
{
return AUCTION_SUCCESS;
}
else
{
return AUCTION_NOT_IN;
}
}
#endif

View File

@ -1,370 +0,0 @@
#ifdef __AUCTION__
#ifndef __INC_AUCTION_MANAGER_H__
#define __INC_AUCTION_MANAGER_H__
#include <unordered_map>
#include "Cache.h"
#include <common/auction_table.h>
class CItemCache;
class CAuctionItemInfoCache;
class CSaleItemInfoCache;
class CWishItemInfoCache;
template<>
class hash<std::pair <DWORD, DWORD> >
{ // hash functor
public:
typedef std::pair <DWORD, DWORD> _Kty;
size_t operator()(const _Kty& _Keyval) const
{ // hash _Keyval to size_t value by pseudorandomizing transform
ldiv_t _Qrem = ldiv((size_t)_Keyval.first + (size_t)_Keyval.second, 127773);
_Qrem.rem = 16807 * _Qrem.rem - 2836 * _Qrem.quot;
if (_Qrem.rem < 0)
_Qrem.rem += 2147483647;
return ((size_t)_Qrem.rem);
}
};
class AuctionBoard
{
public:
typedef DWORD Key;
typedef CAuctionItemInfoCache ItemInfoCache;
typedef TAuctionItemInfo ItemInfo;
public:
AuctionBoard() {}
~AuctionBoard() {}
void Boot(CPeer* peer)
{
peer->EncodeWORD(sizeof(ItemInfo));
peer->EncodeWORD(item_cache_map.size());
TItemInfoCacheMap::iterator it = item_cache_map.begin();
while (it != item_cache_map.end())
peer->Encode((it++)->second->Get(), sizeof(ItemInfo));
}
size_t Size()
{
return item_cache_map.size();
}
ItemInfoCache* GetItemInfoCache (Key key)
{
TItemInfoCacheMap::iterator it = item_cache_map.find (key);
if (it == item_cache_map.end())
return NULL;
else
return it->second;
}
bool DeleteItemInfoCache (Key key)
{
TItemInfoCacheMap::iterator it = item_cache_map.find (key);
if (it == item_cache_map.end())
return false;
else
{
it->second->Delete();
item_cache_map.erase(it);
return true;
}
}
bool InsertItemInfo (ItemInfo *pNew, bool bSkipQuery = false)
{
ItemInfoCache* c = GetItemInfoCache (Key (pNew->item_id));
if (c != NULL)
{
return false;
}
c = new ItemInfoCache();
c->Put(pNew, bSkipQuery);
item_cache_map.insert(TItemInfoCacheMap::value_type(pNew->item_id, c));
c->Flush();
return true;
}
private:
typedef std::unordered_map <Key, ItemInfoCache *> TItemInfoCacheMap;
TItemInfoCacheMap item_cache_map;
};
class SaleBoard
{
public:
typedef DWORD Key;
typedef CSaleItemInfoCache ItemInfoCache;
typedef TSaleItemInfo ItemInfo;
SaleBoard() {}
~SaleBoard() {}
void Boot(CPeer* peer)
{
peer->EncodeWORD(sizeof(ItemInfo));
peer->EncodeWORD(item_cache_map.size());
TItemInfoCacheMap::iterator it = item_cache_map.begin();
while (it != item_cache_map.end())
peer->Encode((it++)->second->Get(), sizeof(ItemInfo));
}
size_t Size()
{
return item_cache_map.size();
}
ItemInfoCache* GetItemInfoCache (Key key)
{
TItemInfoCacheMap::iterator it = item_cache_map.find (key);
if (it == item_cache_map.end())
return NULL;
else
return it->second;
}
bool DeleteItemInfoCache (Key key)
{
TItemInfoCacheMap::iterator it = item_cache_map.find (key);
if (it == item_cache_map.end())
return false;
else
{
it->second->Delete();
item_cache_map.erase(it);
return true;
}
}
bool InsertItemInfo (ItemInfo *pNew, bool bSkipQuery = false)
{
ItemInfoCache* c = GetItemInfoCache (Key (pNew->item_id));
if (c != NULL)
{
return false;
}
c = new ItemInfoCache();
c->Put(pNew, bSkipQuery);
item_cache_map.insert(TItemInfoCacheMap::value_type(pNew->item_id, c));
c->Flush();
return true;
}
private:
typedef std::unordered_map <Key, ItemInfoCache *> TItemInfoCacheMap;
TItemInfoCacheMap item_cache_map;
};
class WishBoard
{
public:
typedef std::pair <DWORD, DWORD> Key;
typedef CWishItemInfoCache ItemInfoCache;
typedef TWishItemInfo ItemInfo;
WishBoard() {}
virtual ~WishBoard() {}
void Boot(CPeer* peer)
{
peer->EncodeWORD(sizeof(ItemInfo));
peer->EncodeWORD(item_cache_map.size());
TItemInfoCacheMap::iterator it = item_cache_map.begin();
while (it != item_cache_map.end())
peer->Encode((it++)->second->Get(), sizeof(ItemInfo));
}
size_t Size()
{
return item_cache_map.size();
}
ItemInfoCache* GetItemInfoCache (Key key)
{
TItemInfoCacheMap::iterator it = item_cache_map.find (key);
if (it == item_cache_map.end())
return NULL;
else
return it->second;
}
bool DeleteItemInfoCache (Key key)
{
TItemInfoCacheMap::iterator it = item_cache_map.find (key);
if (it == item_cache_map.end())
return false;
else
{
it->second->Delete();
item_cache_map.erase(it);
return true;
}
}
bool InsertItemInfo (ItemInfo *pNew, bool bSkipQuery = false)
{
ItemInfoCache* c = GetItemInfoCache (Key (pNew->item_num, pNew->offer_id));
if (c != NULL)
{
return false;
}
c = new ItemInfoCache();
c->Put(pNew, bSkipQuery);
item_cache_map.insert(TItemInfoCacheMap::value_type(Key (pNew->item_num, pNew->offer_id), c));
c->Flush();
return true;
}
private:
typedef std::unordered_map <Key, ItemInfoCache *> TItemInfoCacheMap;
TItemInfoCacheMap item_cache_map;
};
// pc가 입찰에 참여했던 경매를 관리.
class MyBidBoard
{
public:
MyBidBoard() {}
~MyBidBoard() {}
void Boot(CPeer* peer);
size_t Size();
int GetMoney (DWORD player_id, DWORD item_id);
bool Delete (DWORD player_id, DWORD item_id);
// 이미 있으면 덮어 씌운다.
void Insert (DWORD player_id, DWORD item_id, int money);
private:
typedef std::map <DWORD, int> TItemMap;
typedef std::unordered_map <DWORD, TItemMap*> TMyBidBoard;
TMyBidBoard pc_map;
};
class AuctionManager : public singleton <AuctionManager>
{
private:
// auction에 등록된 아이템들.
typedef std::unordered_map<DWORD, CItemCache *> TItemCacheMap;
TItemCacheMap auction_item_cache_map;
// auction에 등록된 정보 중 가격, 등등 아이템 테이블에 포함되지 않는 정보들을 관리하는 것들
AuctionBoard Auction;
SaleBoard Sale;
WishBoard Wish;
MyBidBoard MyBid;
public:
AuctionManager();
~AuctionManager();
void Initialize ();
void LoadAuctionItem ();
void LoadAuctionInfo ();
void LoadSaleInfo ();
void LoadWishInfo ();
void LoadMyBidInfo ();
void Boot(CPeer* peer);
bool InsertItemCache (CItemCache *item_cache, bool bSkipQuery = false);
bool InsertItemCache (TPlayerItem * pNew, bool bSkipQuery = false);
bool DeleteItemCache (DWORD item_id);
CItemCache* GetItemCache (DWORD item_id);
size_t GetAuctionItemSize()
{
return auction_item_cache_map.size();
}
size_t GetAuctionSize()
{
return Auction.Size();
}
size_t GetSaleSize()
{
return Sale.Size();
}
size_t GetWishSize()
{
return Wish.Size();
}
size_t GetMyBidSize()
{
return MyBid.Size();
}
void InsertAuctionItemInfoCache (TAuctionItemInfo *pNew, bool bSkipQuery = false)
{
Auction.InsertItemInfo (pNew, bSkipQuery);
}
CAuctionItemInfoCache* GetAuctionItemInfoCache (DWORD item_id)
{
return Auction.GetItemInfoCache(item_id);
}
void InsertSaleItemInfoCache (TSaleItemInfo *pNew, bool bSkipQuery = false)
{
Sale.InsertItemInfo (pNew, bSkipQuery);
}
CSaleItemInfoCache* GetSaleItemInfoCache (DWORD item_id)
{
return Sale.GetItemInfoCache(item_id);
}
void InsertWishItemInfoCache (TWishItemInfo *pNew, bool bSkipQuery = false)
{
Wish.InsertItemInfo (pNew, bSkipQuery);
}
CWishItemInfoCache* GetWishItemInfoCache (DWORD item_id, DWORD wisher_id)
{
return Wish.GetItemInfoCache(WishBoard::Key (item_id, wisher_id));
}
void InsertMyBid (DWORD player_id, DWORD item_id, DWORD money)
{
MyBid.Insert (player_id, item_id, money);
}
AuctionResult EnrollInAuction(CItemCache* item_cache, TAuctionItemInfo &item_info);
AuctionResult EnrollInSale(CItemCache* item_cache, TSaleItemInfo &item_info);
AuctionResult EnrollInWish(TWishItemInfo &item_info);
AuctionResult Bid(DWORD bidder_id, const char* bidder_name, DWORD item_id, DWORD bid_price);
AuctionResult Impur(DWORD purchaser_id, const char* purchaser_name, DWORD item_id);
AuctionResult GetAuctionedItem (DWORD actor_id, DWORD item_id, TPlayerItem& item);
AuctionResult BuySoldItem (DWORD actor_id, DWORD item_id, TPlayerItem& item);
AuctionResult CancelAuction (DWORD actor_id, DWORD item_id, TPlayerItem& item);
AuctionResult CancelWish (DWORD actor_id, DWORD item_num);
AuctionResult CancelSale (DWORD actor_id, DWORD item_id, TPlayerItem& item);
AuctionResult DeleteAuctionItem (DWORD actor_id, DWORD item_id);
AuctionResult DeleteSaleItem (DWORD actor_id, DWORD item_id);
AuctionResult ReBid(DWORD bidder_id, const char* bidder_name, DWORD item_id, DWORD bid_price);
AuctionResult BidCancel (DWORD bidder_id, DWORD item_id);
};
#endif
#endif

View File

@ -4,9 +4,6 @@
#include "QID.h"
#include "ClientManager.h"
#ifdef __AUCTION__
#include "AuctionManager.h"
#endif
#include "Main.h"
extern CPacketInfo g_item_info;
@ -18,7 +15,6 @@ extern int g_iItemPriceListTableCacheFlushSeconds;
// END_OF_MYSHOP_PRICE_LIST
//
extern int g_item_count;
const int auctionMinFlushSec = 1800;
CItemCache::CItemCache()
{
@ -267,94 +263,3 @@ void CItemPriceListTableCache::OnFlush()
m_bNeedQuery = false;
}
// END_OF_MYSHOP_PRICE_LIST
#ifdef __AUCTION__
CAuctionItemInfoCache::CAuctionItemInfoCache()
{
m_expireTime = MIN (auctionMinFlushSec, g_iItemCacheFlushSeconds);
}
CAuctionItemInfoCache::~CAuctionItemInfoCache()
{
}
void CAuctionItemInfoCache::Delete()
{
if (m_data.item_num == 0)
return;
SPDLOG_TRACE("CAuctionItemInfoCache::Delete : DELETE {}", m_data.item_id);
m_data.item_num = 0;
m_bNeedQuery = true;
m_lastUpdateTime = time(0);
OnFlush();
delete this;
}
void CAuctionItemInfoCache::OnFlush()
{
char szQuery[QUERY_MAX_LEN];
if (m_data.item_num == 0)
{
snprintf(szQuery, sizeof(szQuery), "DELETE FROM auction where item_id = %d", m_data.item_id);
CDBManager::instance().AsyncQuery(szQuery);
}
else
{
snprintf(szQuery, sizeof(szQuery), "REPLACE INTO auction VALUES (%u, %d, %d, %u, \"%s\", %u, %u, %u, %u)",
m_data.item_num, m_data.offer_price, m_data.price, m_data.offer_id, m_data.shown_name, (DWORD)m_data.empire, (DWORD)m_data.expired_time,
m_data.item_id, m_data.bidder_id);
CDBManager::instance().AsyncQuery(szQuery);
}
}
CSaleItemInfoCache::CSaleItemInfoCache()
{
m_expireTime = MIN (auctionMinFlushSec, g_iItemCacheFlushSeconds);
}
CSaleItemInfoCache::~CSaleItemInfoCache()
{
}
void CSaleItemInfoCache::Delete()
{
}
void CSaleItemInfoCache::OnFlush()
{
char szQuery[QUERY_MAX_LEN];
snprintf(szQuery, sizeof(szQuery), "REPLACE INTO sale VALUES (%u, %d, %d, %u, \"%s\", %u, %u, %u, %u)",
m_data.item_num, m_data.offer_price, m_data.price, m_data.offer_id, m_data.shown_name, (DWORD)m_data.empire, (DWORD)m_data.expired_time,
m_data.item_id, m_data.wisher_id);
CDBManager::instance().AsyncQuery(szQuery);
}
CWishItemInfoCache::CWishItemInfoCache()
{
m_expireTime = MIN (auctionMinFlushSec, g_iItemCacheFlushSeconds);
}
CWishItemInfoCache::~CWishItemInfoCache()
{
}
void CWishItemInfoCache::Delete()
{
}
void CWishItemInfoCache::OnFlush()
{
char szQuery[QUERY_MAX_LEN];
snprintf(szQuery, sizeof(szQuery), "REPLACE INTO wish VALUES (%u, %d, %d, %u, \"%s\", %u, %d)",
m_data.item_num, m_data.offer_price, m_data.price, m_data.offer_id, m_data.shown_name, (DWORD)m_data.empire, (DWORD)m_data.expired_time);
CDBManager::instance().AsyncQuery(szQuery);
}
#endif

View File

@ -3,7 +3,6 @@
#define __INC_DB_CACHE_H__
#include <common/cache.h>
#include <common/auction_table.h>
class CItemCache : public cache<TPlayerItem>
{
@ -35,7 +34,6 @@ class CPlayerTableCache : public cache<TPlayerTable>
class CItemPriceListTableCache : public cache<TItemPriceListTable>
{
public:
/// Constructor
/**
* .
@ -55,43 +53,7 @@ class CItemPriceListTableCache : public cache< TItemPriceListTable >
virtual void OnFlush(void);
private:
static const int s_nMinFlushSec; ///< Minimum cache expire time
};
// END_OF_MYSHOP_PRICE_LIST
#ifdef __AUCTION__
class CAuctionItemInfoCache : public cache <TAuctionItemInfo>
{
public:
typedef TWishItemInfo value_type;
CAuctionItemInfoCache();
virtual ~CAuctionItemInfoCache();
void Delete();
virtual void OnFlush();
};
class CSaleItemInfoCache : public cache <TSaleItemInfo>
{
public:
typedef TWishItemInfo value_type;
CSaleItemInfoCache();
virtual ~CSaleItemInfoCache();
void Delete();
virtual void OnFlush();
};
class CWishItemInfoCache : public cache <TWishItemInfo>
{
public:
typedef TWishItemInfo value_type;
CWishItemInfoCache();
virtual ~CWishItemInfoCache();
void Delete();
virtual void OnFlush();
};
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,6 @@
#include <common/stl.h>
#include <common/building.h>
#include <common/auction_table.h>
#include "Peer.h"
#include "DBManager.h"
@ -77,7 +76,7 @@ class CClientManager : public singleton<CClientManager>
pAccountTable = NULL;
player_id = dwPID;
};
//독일선물기능용 생성자
// Constructor for the German gift feature
ClientHandleInfo(DWORD argHandle, DWORD dwPID, DWORD accountId)
{
dwHandle = argHandle;
@ -151,12 +150,10 @@ class CClientManager : public singleton<CClientManager>
*/
void PutItemPriceListCache(const TItemPriceListTable *pItemPriceList);
/// Flush 시간이 만료된 아이템 가격정보 리스트 캐시를 Flush 해주고 캐시에서 삭제한다.
void UpdateItemPriceListCache(void);
// END_OF_MYSHOP_PRICE_LIST
void SendGuildSkillUsable(DWORD guild_id, DWORD dwSkillVnum, bool bUsable);
void SetCacheFlushCountLimit(int iLimit);
@ -250,10 +247,10 @@ class CClientManager : public singleton<CClientManager>
void QUERY_PLAYER_LOAD(CPeer *peer, DWORD dwHandle, TPlayerLoadPacket *);
void RESULT_COMPOSITE_PLAYER(CPeer *peer, SQLMsg *pMsg, DWORD dwQID);
void RESULT_PLAYER_LOAD(CPeer * peer, MYSQL_RES * pRes, ClientHandleInfo * pkInfo);
void RESULT_ITEM_LOAD(CPeer * peer, MYSQL_RES * pRes, DWORD dwHandle, DWORD dwPID);
void RESULT_QUEST_LOAD(CPeer * pkPeer, MYSQL_RES * pRes, DWORD dwHandle, DWORD dwPID);
void RESULT_AFFECT_LOAD(CPeer * pkPeer, MYSQL_RES * pRes, DWORD dwHandle);
void RESULT_PLAYER_LOAD(CPeer *peer, pqxx::result *pRes, ClientHandleInfo *pkInfo);
void RESULT_ITEM_LOAD(CPeer *peer, pqxx::result *pRes, DWORD dwHandle, DWORD dwPID);
void RESULT_QUEST_LOAD(CPeer *pkPeer, pqxx::result *pRes, DWORD dwHandle, DWORD dwPID);
void RESULT_AFFECT_LOAD(CPeer *pkPeer, pqxx::result *pRes, DWORD dwHandle);
// PLAYER_INDEX_CREATE_BUG_FIX
void RESULT_PLAYER_INDEX_CREATE(CPeer *pkPeer, SQLMsg *msg);
@ -290,7 +287,6 @@ class CClientManager : public singleton<CClientManager>
void QUERY_ITEM_DESTROY(CPeer *pkPeer, const char *c_pData);
void QUERY_ITEM_FLUSH(CPeer *pkPeer, const char *c_pData);
void QUERY_QUEST_SAVE(CPeer *pkPeer, TQuestTable *, DWORD dwLen);
void QUERY_ADD_AFFECT(CPeer *pkPeer, TPacketGDAddAffect *p);
void QUERY_REMOVE_AFFECT(CPeer *pkPeer, TPacketGDRemoveAffect *p);
@ -300,10 +296,10 @@ class CClientManager : public singleton<CClientManager>
void QUERY_SAFEBOX_CHANGE_SIZE(CPeer *pkPeer, DWORD dwHandle, TSafeboxChangeSizePacket *p);
void QUERY_SAFEBOX_CHANGE_PASSWORD(CPeer *pkPeer, DWORD dwHandle, TSafeboxChangePasswordPacket *p);
void RESULT_SAFEBOX_LOAD(CPeer * pkPeer, SQLMsg * msg);
void RESULT_SAFEBOX_CHANGE_SIZE(CPeer * pkPeer, SQLMsg * msg);
void RESULT_SAFEBOX_CHANGE_PASSWORD(CPeer * pkPeer, SQLMsg * msg);
void RESULT_SAFEBOX_CHANGE_PASSWORD_SECOND(CPeer * pkPeer, SQLMsg * msg);
void RESULT_SAFEBOX_LOAD(CPeer *pkPeer, ClientHandleInfo *pi, pqxx::result msg);
void RESULT_SAFEBOX_CHANGE_SIZE(CPeer *pkPeer, ClientHandleInfo *pi, pqxx::result msg);
void RESULT_SAFEBOX_CHANGE_PASSWORD(CPeer *pkPeer, ClientHandleInfo *pi, pqxx::result msg);
void RESULT_SAFEBOX_CHANGE_PASSWORD_SECOND(CPeer *pkPeer, ClientHandleInfo *pi, pqxx::result msg);
void QUERY_EMPIRE_SELECT(CPeer *pkPeer, DWORD dwHandle, TEmpireSelectPacket *p);
void QUERY_SETUP(CPeer *pkPeer, DWORD dwHandle, const char *c_pData);
@ -322,7 +318,7 @@ class CClientManager : public singleton<CClientManager>
void QUERY_RELOAD_PROTO();
void QUERY_CHANGE_NAME(CPeer *peer, DWORD dwHandle, TPacketGDChangeName *p);
void GetPlayerFromRes(TPlayerTable * player_table, MYSQL_RES* res);
void GetPlayerFromRes(TPlayerTable *player_table, pqxx::result *res);
void QUERY_LOGIN_KEY(CPeer *pkPeer, TPacketGDLoginKey *p);
@ -487,7 +483,6 @@ class CClientManager : public singleton<CClientManager>
bool __GetHostInfo(std::vector<std::string> &rIPVec);
// END_ADMIN_MANAGER
// RELOAD_ADMIN
void ReloadAdmin(CPeer *peer, TPacketReloadAdmin *p);
// END_RELOAD_ADMIN
@ -524,7 +519,6 @@ class CClientManager : public singleton<CClientManager>
void SetMonarch(CPeer *peer, DWORD dwHandle, const char *p);
void RMMonarch(CPeer *peer, DWORD dwHandle, const char *p);
void DecMonarchMoney(CPeer *peer, DWORD dwHandle, const char *p);
// END_MONARCH
@ -540,22 +534,6 @@ class CClientManager : public singleton<CClientManager>
void DeleteAwardId(TPacketDeleteAwardID *data);
void UpdateChannelStatus(TChannelStatus *pData);
void RequestChannelStatus(CPeer *peer, DWORD dwHandle);
#ifdef __AUCTION__
void EnrollInAuction (CPeer * peer, DWORD owner_id, AuctionEnrollProductInfo* data);
void EnrollInSale (CPeer * peer, DWORD owner_id, AuctionEnrollSaleInfo* data);
void EnrollInWish (CPeer * peer, DWORD wisher_id, AuctionEnrollWishInfo* data);
void AuctionBid (CPeer * peer, DWORD bidder_id, AuctionBidInfo* data);
void AuctionImpur (CPeer * peer, DWORD purchaser_id, AuctionImpurInfo* data);
void AuctionGetAuctionedItem (CPeer * peer, DWORD actor_id, DWORD item_id);
void AuctionBuySoldItem (CPeer * peer, DWORD actor_id, DWORD item_id);
void AuctionCancelAuction (CPeer * peer, DWORD actor_id, DWORD item_id);
void AuctionCancelWish (CPeer * peer, DWORD actor_id, DWORD item_num);
void AuctionCancelSale (CPeer * peer, DWORD actor_id, DWORD item_id);
void AuctionDeleteAuctionItem (CPeer * peer, DWORD actor_id, DWORD item_id);
void AuctionDeleteSaleItem (CPeer * peer, DWORD actor_id, DWORD item_id);
void AuctionReBid (CPeer * peer, DWORD bidder_id, AuctionBidInfo* data);
void AuctionBidCancel (CPeer * peer, DWORD bidder_id, DWORD item_id);
#endif
};
template <class Func>

View File

@ -97,7 +97,6 @@ bool CClientManager::InitializeTables()
return false;
}
return true;
}
@ -193,7 +192,6 @@ bool CClientManager::InitializeMobTable()
// 5) (최종) 게임 클라이언트에서 제대로 작동 하는지.
//_______________________________________________//
//===============================================//
// 1) 'mob_names.txt' 파일을 읽어서 (a)[localMap] 맵을 만든다.
//<(a)localMap 맵 생성>
@ -205,15 +203,17 @@ bool CClientManager::InitializeMobTable()
{
SPDLOG_ERROR("mob_names.txt Failed to read the file");
isNameFile = false;
} else {
}
else
{
nameData.Next(); // 설명row 생략.
while(nameData.Next()) {
while (nameData.Next())
{
localMap[atoi(nameData.AsStringByIndex(0))] = nameData.AsStringByIndex(1);
}
}
//________________________________________________//
//===============================================//
// 2) 'mob_proto_test.txt'파일과 (a)localMap 맵으로
// (b)[test_map_mobTableByVnum](vnum:TMobTable) 맵을 생성한다.
@ -229,7 +229,8 @@ bool CClientManager::InitializeMobTable()
}
// 2. (c)[test_map_mobTableByVnum](vnum:TMobTable) 맵 생성.
map<DWORD, TMobTable *> test_map_mobTableByVnum;
if (isTestFile) {
if (isTestFile)
{
test_data.Next(); // 설명 로우 넘어가기.
// ㄱ. 테스트 몬스터 테이블 생성.
@ -239,7 +240,8 @@ bool CClientManager::InitializeMobTable()
memset(test_mob_table, 0, sizeof(TMobTable) * test_MobTableSize);
// ㄴ. 테스트 몬스터 테이블에 값을 넣고, 맵에까지 넣기.
while(test_data.Next()) {
while (test_data.Next())
{
if (!Set_Proto_Mob_Table(test_mob_table, test_data, localMap))
{
@ -248,10 +250,8 @@ bool CClientManager::InitializeMobTable()
test_map_mobTableByVnum.insert(std::map<DWORD, TMobTable *>::value_type(test_mob_table->dwVnum, test_mob_table));
++test_mob_table;
}
}
// 3) 'mob_proto.txt' 파일과 (a)[localMap] 맵으로
@ -263,7 +263,8 @@ bool CClientManager::InitializeMobTable()
// 1. 파일 읽기.
cCsvTable data;
if(!data.Load("mob_proto.txt",'\t')) {
if (!data.Load("mob_proto.txt", '\t'))
{
SPDLOG_ERROR("mob_proto.txt Failed to read the file");
return false;
}
@ -271,11 +272,13 @@ bool CClientManager::InitializeMobTable()
// 2. (!)[mob_table] 생성하기
// 2.1 새로 추가되는 갯수를 파악
int addNumber = 0;
while(data.Next()) {
while (data.Next())
{
int vnum = atoi(data.AsStringByIndex(0));
std::map<DWORD, TMobTable *>::iterator it_map_mobTable;
it_map_mobTable = test_map_mobTableByVnum.find(vnum);
if(it_map_mobTable != test_map_mobTableByVnum.end()) {
if (it_map_mobTable != test_map_mobTableByVnum.end())
{
addNumber++;
}
}
@ -304,11 +307,13 @@ bool CClientManager::InitializeMobTable()
bool isSameRow = true;
std::map<DWORD, TMobTable *>::iterator it_map_mobTable;
it_map_mobTable = test_map_mobTableByVnum.find(atoi(data.AsStringByIndex(col)));
if(it_map_mobTable == test_map_mobTableByVnum.end()) {
if (it_map_mobTable == test_map_mobTableByVnum.end())
{
isSameRow = false;
}
// 같은 row 가 있으면 (b)에서 읽어온다.
if(isSameRow) {
if (isSameRow)
{
TMobTable *tempTable = it_map_mobTable->second;
mob_table->dwVnum = tempTable->dwVnum;
@ -357,7 +362,6 @@ bool CClientManager::InitializeMobTable()
mob_table->dwDrainSP = tempTable->dwDrainSP;
mob_table->dwPolymorphItemVnum = tempTable->dwPolymorphItemVnum;
mob_table->Skills[0].bLevel = tempTable->Skills[0].bLevel;
mob_table->Skills[0].dwVnum = tempTable->Skills[0].dwVnum;
mob_table->Skills[1].bLevel = tempTable->Skills[1].bLevel;
@ -374,27 +378,24 @@ bool CClientManager::InitializeMobTable()
mob_table->bGodSpeedPoint = tempTable->bGodSpeedPoint;
mob_table->bDeathBlowPoint = tempTable->bDeathBlowPoint;
mob_table->bRevivePoint = tempTable->bRevivePoint;
} else {
}
else
{
if (!Set_Proto_Mob_Table(mob_table, data, localMap))
{
SPDLOG_ERROR("Mob proto table setup failed.");
}
}
// 셋에 vnum 추가
vnumSet.insert(mob_table->dwVnum);
SPDLOG_TRACE("MOB #{:<5} {:24} {:24} level: {:<3} rank: {} empire: {}", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
++mob_table;
}
//_____________________________________________________//
// 4) (b)[test_map_mobTableByVnum]의 row중, (!)[mob_table]에 없는 것을 추가한다.
// 파일 다시 읽어오기.
test_data.Destroy();
@ -405,7 +406,8 @@ bool CClientManager::InitializeMobTable()
SPDLOG_ERROR("No test file exists, proceed as is.");
isTestFile = false;
}
if(isTestFile) {
if (isTestFile)
{
test_data.Next(); // 설명 로우 넘어가기.
while (test_data.Next()) // 테스트 데이터 각각을 훑어나가며,새로운 것을 추가한다.
@ -413,7 +415,8 @@ bool CClientManager::InitializeMobTable()
// 중복되는 부분이면 넘어간다.
set<int>::iterator itVnum;
itVnum = vnumSet.find(atoi(test_data.AsStringByIndex(0)));
if (itVnum != vnumSet.end()) {
if (itVnum != vnumSet.end())
{
continue;
}
@ -424,7 +427,6 @@ bool CClientManager::InitializeMobTable()
SPDLOG_DEBUG("MOB #{:<5} {:24} {:24} level: {:<3} rank: {} empire: {}", mob_table->dwVnum, mob_table->szName, mob_table->szLocaleName, mob_table->bLevel, mob_table->bRank, mob_table->bEmpire);
++mob_table;
}
}
sort(m_vec_mobTable.begin(), m_vec_mobTable.end(), FCompareVnum());
@ -571,32 +573,32 @@ bool CClientManager::InitializeQuestItemTable()
bool CClientManager::InitializeItemTable()
{
//================== 함수 설명 ==================//
//1. 요약 : 'item_proto.txt', 'item_proto_test.txt', 'item_names.txt' 파일을 읽고,
// <item_table>(TItemTable), <m_map_itemTableByVnum> 오브젝트를 생성한다.
//2. 순서
// 1) 'item_names.txt' 파일을 읽어서 (a)[localMap](vnum:name) 맵을 만든다.
// 2) 'item_proto_text.txt'파일과 (a)[localMap] 맵으로
// (b)[test_map_itemTableByVnum](vnum:TItemTable) 맵을 생성한다.
// 3) 'item_proto.txt' 파일과 (a)[localMap] 맵으로
// (!)[item_table], <m_map_itemTableByVnum>을 만든다.
// <참고>
// 각 row 들 중,
// (b)[test_map_itemTableByVnum],(!)[mob_table] 모두에 있는 row는
// (b)[test_map_itemTableByVnum]의 것을 사용한다.
// 4) (b)[test_map_itemTableByVnum]의 row중, (!)[item_table]에 없는 것을 추가한다.
//3. 테스트
// 1)'item_proto.txt' 정보가 item_table에 잘 들어갔는지. -> 완료
// 2)'item_names.txt' 정보가 item_table에 잘 들어갔는지.
// 3)'item_proto_test.txt' 에서 [겹치는] 정보가 item_table 에 잘 들어갔는지.
// 4)'item_proto_test.txt' 에서 [새로운] 정보가 item_table 에 잘 들어갔는지.
// 5) (최종) 게임 클라이언트에서 제대로 작동 하는지.
// TODO Rework this in order to load multiple locales
//================== Function Description ==================//
// 1. Summary: Reads the files 'item_proto.txt', 'item_proto_test.txt', and 'item_names.txt',
// and generates <item_table>(TItemTable), <m_map_itemTableByVnum> objects.
// 2. Procedure:
// 1) Read the 'item_names.txt' file to create
// (a) [localMap] (vnum:name) map.
// 2) Use 'item_proto_test.txt' and the (a) [localMap]
// to generate (b) [test_map_itemTableByVnum] (vnum:TItemTable) map.
// 3) Use 'item_proto.txt' and the (a) [localMap]
// to create (!) [item_table] and <m_map_itemTableByVnum>.
// <Note>
// Among the rows,
// for those existing in both (b) [test_map_itemTableByVnum] and (!) [item_table],
// use the row from (b) [test_map_itemTableByVnum].
// 4) Add any rows in (b) [test_map_itemTableByVnum] that are not in (!) [item_table].
// 3. Testing:
// 1) Check whether data from 'item_proto.txt' has been correctly entered into item_table. -> Done
// 2) Check whether data from 'item_names.txt' has been correctly entered into item_table.
// 3) Check whether [overlapping] data from 'item_proto_test.txt' has been correctly entered into item_table.
// 4) Check whether [new] data from 'item_proto_test.txt' has been correctly entered into item_table.
// 5) (Final) Verify that it works correctly in the game client.
//_______________________________________________//
//=================================================================================//
// 1) 'item_names.txt' 파일을 읽어서 (a)[localMap](vnum:name) 맵을 만든다.
// 1) Read the 'item_names.txt' file to create (a) [localMap] (vnum:name) map.
//=================================================================================//
bool isNameFile = true;
map<int, const char *> localMap;
@ -605,37 +607,42 @@ bool CClientManager::InitializeItemTable()
{
SPDLOG_ERROR("item_names.txt Failed to read the file");
isNameFile = false;
} else {
}
else
{
nameData.Next();
while(nameData.Next()) {
while (nameData.Next())
{
localMap[atoi(nameData.AsStringByIndex(0))] = nameData.AsStringByIndex(1);
}
}
//_________________________________________________________________//
//=================================================================//
// 2) 'item_proto_text.txt'파일과 (a)[localMap] 맵으로
// (b)[test_map_itemTableByVnum](vnum:TItemTable) 맵을 생성한다.
// 2) Using the 'item_proto_test.txt' file and the (a) [localMap] map,
// generate the (b) [test_map_itemTableByVnum] (vnum:TItemTable) map.
//=================================================================//
map<DWORD, TItemTable *> test_map_itemTableByVnum;
//1. 파일 읽어오기.
// 1. Read the file.
cCsvTable test_data;
if (!test_data.Load("item_proto_test.txt", '\t'))
{
SPDLOG_ERROR("item_proto_test.txt Failed to read the file");
// return false;
} else {
}
else
{
test_data.Next(); // 설명 로우 넘어가기.
//2. 테스트 아이템 테이블 생성.
// 2. Create the test item table.
TItemTable *test_item_table = NULL;
int test_itemTableSize = test_data.m_File.GetRowCount() - 1;
test_item_table = new TItemTable[test_itemTableSize];
memset(test_item_table, 0, sizeof(TItemTable) * test_itemTableSize);
//3. 테스트 아이템 테이블에 값을 넣고, 맵에까지 넣기.
while(test_data.Next()) {
// 3. Insert values into the test item table and populate the map.
while (test_data.Next())
{
if (!Set_Proto_Item_Table(test_item_table, test_data, localMap))
{
@ -644,32 +651,30 @@ bool CClientManager::InitializeItemTable()
test_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(test_item_table->dwVnum, test_item_table));
test_item_table++;
}
}
//______________________________________________________________________//
//========================================================================//
// 3) 'item_proto.txt' 파일과 (a)[localMap] 맵으로
// (!)[item_table], <m_map_itemTableByVnum>을 만든다.
// <참고>
// 각 row 들 중,
// (b)[test_map_itemTableByVnum],(!)[mob_table] 모두에 있는 row는
// (b)[test_map_itemTableByVnum]의 것을 사용한다.
// 3) Using the 'item_proto.txt' file and the (a) [localMap] map,
// create the (!) [item_table] and <m_map_itemTableByVnum>.
// <Note>
// Among the rows,
// for those present in both (b) [test_map_itemTableByVnum] and (!) [mob_table],
// use the row from (b) [test_map_itemTableByVnum].
//========================================================================//
//vnum들을 저장할 셋. 새로운 테스트 아이템을 판별할때 사용된다.
// A set to store vnums. Used to identify new test items.
set<int> vnumSet;
//파일 읽어오기.
// Read the file.
cCsvTable data;
if (!data.Load("item_proto.txt", '\t'))
{
SPDLOG_ERROR("item_proto.txt Failed to read the file");
return false;
}
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
data.Next(); // Exclude the top line (the part describing the item columns).
if (!m_vec_itemTable.empty())
{
@ -678,25 +683,27 @@ bool CClientManager::InitializeItemTable()
m_map_itemTableByVnum.clear();
}
//===== 아이템 테이블 생성 =====//
//새로 추가되는 갯수를 파악한다.
//===== Create item table =====//
// Determine the number of newly added items.
int addNumber = 0;
while(data.Next()) {
while (data.Next())
{
int vnum = atoi(data.AsStringByIndex(0));
std::map<DWORD, TItemTable *>::iterator it_map_itemTable;
it_map_itemTable = test_map_itemTableByVnum.find(vnum);
if(it_map_itemTable != test_map_itemTableByVnum.end()) {
if (it_map_itemTable != test_map_itemTableByVnum.end())
{
addNumber++;
}
}
//data를 다시 첫줄로 옮긴다.(다시 읽어온다;;)
// Move the data back to the first line (re-read it;;)
data.Destroy();
if (!data.Load("item_proto.txt", '\t'))
{
SPDLOG_ERROR("item_proto.txt Failed to read the file");
return false;
}
data.Next(); //맨 윗줄 제외 (아이템 칼럼을 설명하는 부분)
data.Next(); // Skip the top line (the part that describes the item columns).
m_vec_itemTable.resize(data.m_File.GetRowCount() - 1 + addNumber);
memset(&m_vec_itemTable[0], 0, sizeof(TItemTable) * m_vec_itemTable.size());
@ -710,17 +717,17 @@ bool CClientManager::InitializeItemTable()
std::map<DWORD, TItemTable *>::iterator it_map_itemTable;
it_map_itemTable = test_map_itemTableByVnum.find(atoi(data.AsStringByIndex(col)));
if(it_map_itemTable == test_map_itemTableByVnum.end()) {
//각 칼럼 데이터 저장
if (it_map_itemTable == test_map_itemTableByVnum.end())
{
// Store data for each column
if (!Set_Proto_Item_Table(item_table, data, localMap))
{
SPDLOG_ERROR("Item proto table setup failed.");
}
} else { //$$$$$$$$$$$$$$$$$$$$$$$ 테스트 아이템 정보가 있다!
}
else
{ // $$$$$$$$$$$$$$$$$$$$$ There is test item information!
TItemTable *tempTable = it_map_itemTable->second;
item_table->dwVnum = tempTable->dwVnum;
@ -768,7 +775,6 @@ bool CClientManager::InitializeItemTable()
item_table->sAddonType = tempTable->sAddonType;
item_table->bWeight = tempTable->bWeight;
}
vnumSet.insert(item_table->dwVnum);
m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
@ -777,22 +783,25 @@ bool CClientManager::InitializeItemTable()
//_______________________________________________________________________//
//========================================================================//
// 4) (b)[test_map_itemTableByVnum]의 row중, (!)[item_table]에 없는 것을 추가한다.
// 4) Add rows from (b) [test_map_itemTableByVnum] that do not exist in (!) [item_table].
//========================================================================//
test_data.Destroy();
if (!test_data.Load("item_proto_test.txt", '\t'))
{
SPDLOG_ERROR("item_proto_test.txt Failed to read the file");
// return false;
} else {
test_data.Next(); //설명 로우 넘어가기.
while (test_data.Next()) //테스트 데이터 각각을 훑어나가며,새로운 것을 추가한다.
}
else
{
//중복되는 부분이면 넘어간다.
test_data.Next(); // Skip the description row.
while (test_data.Next()) // Iterate through each test data entry and add new ones.
{
// Skip if its a duplicate.
set<int>::iterator itVnum;
itVnum = vnumSet.find(atoi(test_data.AsStringByIndex(0)));
if (itVnum != vnumSet.end()) {
if (itVnum != vnumSet.end())
{
continue;
}
@ -801,16 +810,12 @@ bool CClientManager::InitializeItemTable()
SPDLOG_ERROR("Item proto table setup failed.");
}
m_map_itemTableByVnum.insert(std::map<DWORD, TItemTable *>::value_type(item_table->dwVnum, item_table));
item_table++;
}
}
// QUEST_ITEM_PROTO_DISABLE
// InitializeQuestItemTable();
// END_OF_QUEST_ITEM_PROTO_DISABLE
@ -846,7 +851,6 @@ bool CClientManager::InitializeItemTable()
return true;
}
bool CClientManager::InitializeSkillTable()
{
char query[4096];
@ -1398,8 +1402,7 @@ bool CClientManager::MirrorMobTableIntoDB()
t.Skills[0].dwVnum, t.Skills[0].bLevel, t.Skills[1].dwVnum, t.Skills[1].bLevel, t.Skills[2].dwVnum, t.Skills[2].bLevel,
t.Skills[3].dwVnum, t.Skills[3].bLevel, t.Skills[4].dwVnum, t.Skills[4].bLevel,
t.bBerserkPoint, t.bStoneSkinPoint, t.bGodSpeedPoint, t.bDeathBlowPoint, t.bRevivePoint
);
t.bBerserkPoint, t.bStoneSkinPoint, t.bGodSpeedPoint, t.bDeathBlowPoint, t.bRevivePoint);
}
else
{
@ -1450,8 +1453,7 @@ bool CClientManager::MirrorMobTableIntoDB()
t.Skills[0].dwVnum, t.Skills[0].bLevel, t.Skills[1].dwVnum, t.Skills[1].bLevel, t.Skills[2].dwVnum, t.Skills[2].bLevel,
t.Skills[3].dwVnum, t.Skills[3].bLevel, t.Skills[4].dwVnum, t.Skills[4].bLevel,
t.bBerserkPoint, t.bStoneSkinPoint, t.bGodSpeedPoint, t.bDeathBlowPoint, t.bRevivePoint
);
t.bBerserkPoint, t.bStoneSkinPoint, t.bGodSpeedPoint, t.bDeathBlowPoint, t.bRevivePoint);
}
CDBManager::instance().AsyncQuery(query);

View File

@ -74,4 +74,3 @@ void CClientManager::SendEventFlagsOnSetup(CPeer* peer)
peer->Encode(&p, sizeof(TPacketSetEventFlag));
}
}

View File

@ -7,7 +7,6 @@
#include "QID.h"
#include "GuildManager.h"
void CClientManager::GuildCreate(CPeer *peer, DWORD dwGuildID)
{
SPDLOG_DEBUG("GuildCreate {}", dwGuildID);
@ -241,4 +240,3 @@ void CClientManager::GuildChangeMaster(TPacketChangeGuildMaster* p)
ForwardPacket(HEADER_DG_ACK_CHANGE_GUILD_MASTER, &packet, sizeof(packet));
}
}

View File

@ -37,4 +37,3 @@ void CClientManager::AckHorseName(DWORD dwPID, CPeer* peer)
peer->EncodeHeader(HEADER_DG_ACK_HORSE_NAME, 0, sizeof(TPacketUpdateHorseName));
peer->Encode(&packet, sizeof(TPacketUpdateHorseName));
}

View File

@ -427,7 +427,6 @@ void CClientManager::RESULT_LOGIN(CPeer * peer, SQLMsg * msg)
// END_PREVENT_COPY_ITEM
peer->EncodeHeader(HEADER_DG_LOGIN_SUCCESS, info->dwHandle, sizeof(TAccountTable));
peer->Encode(info->pAccountTable, sizeof(TAccountTable));
}
delete info->pAccountTable;
@ -518,4 +517,3 @@ void CClientManager::QUERY_CHANGE_NAME(CPeer * peer, DWORD dwHandle, TPacketGDCh
strlcpy(pdg.name, p->name, sizeof(pdg.name));
peer->Encode(&pdg, sizeof(TPacketDGChangeName));
}

View File

@ -18,7 +18,8 @@ extern int g_test_server;
//
// Check all SELECT syntax on item table before change this function!!!
//
bool CreateItemTableFromRes(MYSQL_RES * res, std::vector<TPlayerItem> * pVec, DWORD dwPID)
// TODO Finish moving this to pg
bool CreateItemTableFromRes(pqxx::result *res, std::vector<TPlayerItem> *pVec, DWORD dwPID)
{
if (!res)
{
@ -112,8 +113,7 @@ size_t CreatePlayerSaveQuery(char * pszQuery, size_t querySize, TPlayerTable * p
"horse_hp = %d, "
"horse_hp_droptime = %u, "
"horse_stamina = %d, "
"horse_skill_point = %d, "
,
"horse_skill_point = %d, ",
GetTablePostfix(),
pkTab->job,
pkTab->voice,
@ -253,7 +253,9 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
peer->Encode(&logInfo, sizeof(TPacketNeedLoginLogInfo));
}
char szQuery[1024] = { 0, };
char szQuery[1024] = {
0,
};
TItemCacheSet *pSet = GetItemCacheSet(pTab->id);
@ -390,8 +392,6 @@ void CClientManager::QUERY_PLAYER_LOAD(CPeer * peer, DWORD dwHandle, TPlayerLoad
GetTablePostfix(), packet->player_id);
CDBManager::instance().ReturnQuery(queryStr, QID_AFFECT, peer->GetHandle(), new ClientHandleInfo(dwHandle, packet->player_id));
}
}
void CClientManager::ItemAward(CPeer *peer, char *login)
{
@ -612,7 +612,6 @@ void CClientManager::RESULT_COMPOSITE_PLAYER(CPeer * peer, SQLMsg * pMsg, DWORD
break;
*/
}
}
void CClientManager::RESULT_PLAYER_LOAD(CPeer *peer, MYSQL_RES *pRes, ClientHandleInfo *pkInfo)
@ -807,7 +806,8 @@ void CClientManager::__QUERY_PLAYER_CREATE(CPeer *peer, DWORD dwHandle, TPlayerC
MYSQL_ROW row = mysql_fetch_row(pMsg0->Get()->pSQLResult);
DWORD dwPID = 0; str_to_number(dwPID, row[0]);
DWORD dwPID = 0;
str_to_number(dwPID, row[0]);
if (row[0] && dwPID > 0)
{
peer->EncodeHeader(HEADER_DG_PLAYER_CREATE_ALREADY, dwHandle, 0);
@ -1262,4 +1262,3 @@ void CClientManager::FlushPlayerCacheSet(DWORD pid)
delete c;
}
}

View File

@ -138,12 +138,10 @@ bool CConfig::LoadFile(const char* filename)
GetLine(fp, szTmp);
m_valueMap.insert(TValueMap::value_type(comment, szTmp));
mode = 0;
}
// ITEM_ID_RANGE_END
}
// 파일 닫는 부분.
fclose(fp);
return true;
@ -187,7 +185,6 @@ const char * CConfig::Get(const char* key)
return pstStr->c_str();
}
bool CConfig::GetValue(const char *key, int *dest)
{
if (!Search(key))
@ -247,4 +244,3 @@ bool CConfig::GetTwoValue(const char* key, DWORD * dest1, DWORD *dest2)
return true;
}

View File

@ -107,14 +107,17 @@ bool cCsvFile::Load(const char* fileName, const char seperator, const char quote
Assert(seperator != quote);
std::ifstream file(fileName, std::ios::in);
if (!file) return false;
if (!file)
return false;
Destroy(); // 기존의 데이터를 삭제
cCsvRow *row = NULL;
ParseState state = STATE_NORMAL;
std::string token = "";
char buf[2048+1] = {0,};
char buf[2048 + 1] = {
0,
};
while (file.good())
{
@ -122,7 +125,8 @@ bool cCsvFile::Load(const char* fileName, const char seperator, const char quote
buf[sizeof(buf) - 1] = 0;
std::string line(Trim(buf));
if (line.empty() || (state == STATE_NORMAL && line[0] == '#')) continue;
if (line.empty() || (state == STATE_NORMAL && line[0] == '#'))
continue;
std::string text = std::string(line) + " "; // 파싱 lookahead 때문에 붙여준다.
size_t cur = 0;
@ -223,11 +227,18 @@ bool cCsvFile::Save(const char* fileName, bool append, char seperator, char quot
// 출력 모드에 따라 파일을 적당한 플래그로 생성한다.
std::ofstream file;
if (append) { file.open(fileName, std::ios::out | std::ios::app); }
else { file.open(fileName, std::ios::out | std::ios::trunc); }
if (append)
{
file.open(fileName, std::ios::out | std::ios::app);
}
else
{
file.open(fileName, std::ios::out | std::ios::trunc);
}
// 파일을 열지 못했다면, false를 리턴한다.
if (!file) return false;
if (!file)
return false;
char special_chars[5] = {seperator, quote, '\r', '\n', 0};
char quote_escape_string[3] = {quote, quote, 0};
@ -258,15 +269,20 @@ bool cCsvFile::Save(const char* fileName, bool append, char seperator, char quot
for (size_t k = 0; k < token.size(); k++)
{
if (token[k] == quote) line += quote_escape_string;
else line += token[k];
if (token[k] == quote)
line += quote_escape_string;
else
line += token[k];
}
line += quote;
}
// 마지막 셀이 아니라면 ','를 토큰의 뒤에다 붙여줘야한다.
if (j != row.size() - 1) { line += seperator; }
if (j != row.size() - 1)
{
line += seperator;
}
}
// 라인을 출력한다.
@ -427,4 +443,3 @@ const cCsvRow* const cCsvTable::CurRow() const
return m_File[m_CurRow];
}

View File

@ -50,7 +50,6 @@ private:
NAME2INDEX_MAP m_Name2Index; ///< 셀 인덱스 대신으로 사용하기 위한 이름들
INDEX2NAME_MAP m_Index2Name; ///< 잘못된 alias를 검사하기 위한 추가적인 맵
public:
/// \brief 생성자
cCsvAlias() {}
@ -58,7 +57,6 @@ public:
/// \brief 소멸자
virtual ~cCsvAlias() {}
public:
/// \brief 셀을 액세스할 때, 숫자 대신 사용할 이름을 등록한다.
void AddAlias(const char *name, size_t index);
@ -72,7 +70,6 @@ public:
/// \brief 이름을 숫자 인덱스로 변환한다.
size_t operator[](const char *name) const;
private:
/// \brief 복사 생성자 금지
cCsvAlias(const cCsvAlias &) {}
@ -81,7 +78,6 @@ private:
const cCsvAlias &operator=(const cCsvAlias &) { return *this; }
};
////////////////////////////////////////////////////////////////////////////////
/// \class cCsvRow
/// \brief CSV 파일의 한 행을 캡슐화한 클래스
@ -117,7 +113,6 @@ public:
/// \brief 소멸자
~cCsvRow() {}
public:
/// \brief 해당 셀의 데이터를 int 형으로 반환한다.
int AsInt(size_t index) const { return atoi(at(index).c_str()); }
@ -129,21 +124,23 @@ public:
const char *AsString(size_t index) const { return at(index).c_str(); }
/// \brief 해당하는 이름의 셀 데이터를 int 형으로 반환한다.
int AsInt(const char* name, const cCsvAlias& alias) const {
int AsInt(const char *name, const cCsvAlias &alias) const
{
return atoi(at(alias[name]).c_str());
}
/// \brief 해당하는 이름의 셀 데이터를 int 형으로 반환한다.
double AsDouble(const char* name, const cCsvAlias& alias) const {
double AsDouble(const char *name, const cCsvAlias &alias) const
{
return atof(at(alias[name]).c_str());
}
/// \brief 해당하는 이름의 셀 데이터를 문자열로 반환한다.
const char* AsString(const char* name, const cCsvAlias& alias) const {
const char *AsString(const char *name, const cCsvAlias &alias) const
{
return at(alias[name]).c_str();
}
private:
/// \brief 복사 생성자 금지
cCsvRow(const cCsvRow &) {}
@ -152,7 +149,6 @@ private:
const cCsvRow &operator=(const cCsvRow &) { return *this; }
};
////////////////////////////////////////////////////////////////////////////////
/// \class cCsvFile
/// \brief CSV(Comma Seperated Values) 파일을 read/write하기 위한 클래스
@ -190,7 +186,6 @@ private:
ROWS m_Rows; ///< 행 컬렉션
public:
/// \brief 생성자
cCsvFile() {}
@ -198,7 +193,6 @@ public:
/// \brief 소멸자
virtual ~cCsvFile() { Destroy(); }
public:
/// \brief 지정된 이름의 CSV 파일을 로드한다.
bool Load(const char *fileName, const char seperator = ',', const char quote = '"');
@ -218,7 +212,6 @@ public:
/// \brief 행의 갯수를 반환한다.
size_t GetRowCount() const { return m_Rows.size(); }
private:
/// \brief 복사 생성자 금지
cCsvFile(const cCsvFile &) {}
@ -227,7 +220,6 @@ private:
const cCsvFile &operator=(const cCsvFile &) { return *this; }
};
////////////////////////////////////////////////////////////////////////////////
/// \class cCsvTable
/// \brief CSV 파일을 이용해 테이블 데이터를 로드하는 경우가 많은데, 이 클래스는
@ -264,7 +256,6 @@ private:
cCsvAlias m_Alias; ///< 문자열을 셀 인덱스로 변환하기 위한 객체
int m_CurRow; ///< 현재 횡단 중인 행 번호
public:
/// \brief 생성자
cCsvTable();
@ -272,7 +263,6 @@ public:
/// \brief 소멸자
virtual ~cCsvTable();
public:
/// \brief 지정된 이름의 CSV 파일을 로드한다.
bool Load(const char *fileName, const char seperator = ',', const char quote = '"');
@ -307,7 +297,6 @@ public:
/// \brief alias를 포함해 모든 데이터를 삭제한다.
void Destroy();
private:
/// \brief 현재 행을 반환한다.
const cCsvRow *const CurRow() const;

View File

@ -6,183 +6,206 @@ extern std::string g_stLocale;
CDBManager::CDBManager()
{
Initialize();
StartWorkerThread();
}
CDBManager::~CDBManager()
{
Destroy();
Quit();
}
void CDBManager::Initialize()
int CDBManager::Connect(const char *db_address, int db_port, const char *db_name, const char *user, const char *pwd)
{
for (int i = 0; i < SQL_MAX_NUM; ++i)
if (!db_address || !db_name || !user || !pwd)
return false;
try
{
m_mainSQL[i] = NULL;
m_directSQL[i] = NULL;
m_asyncSQL[i] = NULL;
m_connPool = std::make_shared<PgConnectionPool>(
db_address, db_port, db_name, user, pwd,
10, // poolSize
60 // idleTimeoutSeconds
);
// Optionally, do a test connection:
{
auto conn = m_connPool->acquire();
if (!conn || !conn->is_open())
{
SPDLOG_ERROR("Failed to open test connection to DB");
m_connPool.reset();
return false;
}
}
void CDBManager::Destroy()
SPDLOG_INFO("Connected to PostgreSQL at {}:{}, DB: {}", db_address, db_port, db_name);
return true;
}
catch (const std::exception &ex)
{
Clear();
SPDLOG_ERROR("Exception while connecting to DB: {}", ex.what());
return false;
}
}
void CDBManager::Clear()
{
for (int i = 0; i < SQL_MAX_NUM; ++i)
{
if (m_mainSQL[i])
{
delete m_mainSQL[i];
m_mainSQL[i] = NULL;
}
if (m_directSQL[i])
{
delete m_directSQL[i];
m_directSQL[i] = NULL;
}
if (m_asyncSQL[i])
{
delete m_asyncSQL[i];
m_asyncSQL[i] = NULL;
}
}
Initialize();
std::lock_guard<std::mutex> lock(m_queueMutex);
std::queue<std::shared_ptr<PgAsyncQuery>> empty;
m_queryQueue.swap(empty);
}
void CDBManager::Quit()
{
for (int i = 0; i < SQL_MAX_NUM; ++i)
if (m_quit.exchange(1) == 0)
{
if (m_mainSQL[i])
m_mainSQL[i]->Quit();
if (m_asyncSQL[i])
m_asyncSQL[i]->Quit();
if (m_directSQL[i])
m_directSQL[i]->Quit();
}
}
SQLMsg * CDBManager::PopResult()
StopWorkerThread();
if (m_connPool)
{
SQLMsg * p;
for (int i = 0; i < SQL_MAX_NUM; ++i)
if (m_mainSQL[i] && m_mainSQL[i]->PopResult(&p))
return p;
return NULL;
m_connPool.reset();
}
}
}
SQLMsg * CDBManager::PopResult(eSQL_SLOT slot)
std::shared_ptr<PgConnectionPool> CDBManager::GetConnectionPool()
{
SQLMsg * p;
if (m_mainSQL[slot] && m_mainSQL[slot]->PopResult(&p))
return p;
return NULL;
return m_connPool;
}
int CDBManager::Connect(int iSlot, const char * db_address, const int db_port, const char * db_name, const char * user, const char * pwd)
void CDBManager::AsyncQuery(const std::string &query, const pqxx::params &params)
{
if (db_address == NULL || db_name == NULL)
return false;
auto msg = std::make_shared<PgAsyncQuery>(++m_msgCounter, query, params);
if (iSlot < 0 || iSlot >= SQL_MAX_NUM)
return false;
SPDLOG_INFO("CREATING DIRECT_SQL");
m_directSQL[iSlot] = new CAsyncSQL2;
if (!m_directSQL[iSlot]->Setup(db_address, user, pwd, db_name, g_stLocale.c_str(), true, db_port))
{
Clear();
return false;
std::lock_guard<std::mutex> lock(m_queueMutex);
m_queryQueue.push(msg);
}
m_queueCondition.notify_one();
}
SPDLOG_INFO("CREATING MAIN_SQL");
m_mainSQL[iSlot] = new CAsyncSQL2;
if (!m_mainSQL[iSlot]->Setup(db_address, user, pwd, db_name, g_stLocale.c_str(), false, db_port))
void CDBManager::AsyncQuery(const std::string &query, const pqxx::params &params, AsyncQueryCallback callback)
{
Clear();
return false;
}
auto msg = std::make_shared<PgAsyncQuery>(++m_msgCounter, query, params, std::move(callback));
SPDLOG_INFO("CREATING ASYNC_SQL");
m_asyncSQL[iSlot] = new CAsyncSQL2;
if (!m_asyncSQL[iSlot]->Setup(db_address, user, pwd, db_name, g_stLocale.c_str(), false, db_port))
{
Clear();
return false;
std::lock_guard<std::mutex> lock(m_queueMutex);
m_queryQueue.push(msg);
}
return true;
m_queueCondition.notify_one();
}
SQLMsg * CDBManager::DirectQuery(const char * c_pszQuery, int iSlot)
size_t CDBManager::GetPendingQueryCount() const
{
return m_directSQL[iSlot]->DirectQuery(c_pszQuery);
std::lock_guard<std::mutex> lock(m_queueMutex);
return m_queryQueue.size();
}
extern CPacketInfo g_query_info;
extern int g_query_count[2];
void CDBManager::ReturnQuery(const char * c_pszQuery, int iType, IDENT dwIdent, void * udata, int iSlot)
size_t CDBManager::GetCompletedQueryCount() const
{
assert(iSlot < SQL_MAX_NUM);
//SPDLOG_DEBUG("ReturnQuery {}", c_pszQuery);
CQueryInfo * p = new CQueryInfo;
p->iType = iType;
p->dwIdent = dwIdent;
p->pvData = udata;
m_mainSQL[iSlot]->ReturnQuery(c_pszQuery, p);
//g_query_info.Add(iType);
++g_query_count[0];
return m_completedQueries.load();
}
void CDBManager::AsyncQuery(const char * c_pszQuery, int iSlot)
void CDBManager::ResetQueryStats()
{
assert(iSlot < SQL_MAX_NUM);
m_asyncSQL[iSlot]->AsyncQuery(c_pszQuery);
++g_query_count[1];
m_completedQueries = 0;
}
unsigned int CDBManager::EscapeString(void *to, const void *from, unsigned int length, int iSlot)
void CDBManager::StartWorkerThread()
{
assert(iSlot < SQL_MAX_NUM);
return mysql_real_escape_string(m_directSQL[iSlot]->GetSQLHandle(), (char *) to, (const char *) from, length);
}
void CDBManager::SetLocale(const char * szLocale)
if (!m_workerRunning.exchange(true))
{
const std::string stLocale(szLocale);
SPDLOG_DEBUG("SetLocale start");
for (int n = 0; n < SQL_MAX_NUM; ++n)
{
m_mainSQL[n]->SetLocale(stLocale);
m_directSQL[n]->SetLocale(stLocale);
m_asyncSQL[n]->SetLocale(stLocale);
}
SPDLOG_DEBUG("End setlocale {}", szLocale);
}
void CDBManager::QueryLocaleSet()
{
for (int n = 0; n < SQL_MAX_NUM; ++n)
{
m_mainSQL[n]->QueryLocaleSet();
m_directSQL[n]->QueryLocaleSet();
m_asyncSQL[n]->QueryLocaleSet();
m_workerThread = std::thread(&CDBManager::WorkerLoop, this);
}
}
void CDBManager::StopWorkerThread()
{
if (m_workerRunning.exchange(false))
{
m_queueCondition.notify_all();
if (m_workerThread.joinable())
{
m_workerThread.join();
}
}
}
void CDBManager::WorkerLoop()
{
SPDLOG_INFO("AsyncQuery worker thread started");
while (m_workerRunning)
{
std::shared_ptr<PgAsyncQuery> msg;
{
std::unique_lock<std::mutex> lock(m_queueMutex);
m_queueCondition.wait(lock, [this]
{ return !m_queryQueue.empty() || !m_workerRunning; });
if (!m_workerRunning && m_queryQueue.empty())
{
break;
}
if (!m_queryQueue.empty())
{
msg = m_queryQueue.front();
m_queryQueue.pop();
}
}
if (msg)
{
ProcessQuery(msg);
}
}
SPDLOG_INFO("AsyncQuery worker thread stopped");
}
void CDBManager::ProcessQuery(std::shared_ptr<PgAsyncQuery> msg)
{
pqxx::result result;
std::string error;
try
{
if (!m_connPool)
{
throw std::runtime_error("No database connection available");
}
auto conn = m_connPool->acquire();
if (!conn)
{
throw std::runtime_error("Failed to get connection from pool");
}
pqxx::work txn(*conn);
result = txn.exec_params(msg->query, msg->parameters);
txn.commit();
SPDLOG_TRACE("AsyncQuery completed: {} (ID: {})", msg->query, msg->id);
}
catch (const std::exception &e)
{
SPDLOG_ERROR("AsyncQuery failed: {} (query: {}, ID: {})", e.what(), msg->query, msg->id);
}
if (msg->hasCallback && msg->callback)
{
try
{
msg->callback(result, error);
}
catch (const std::exception &e)
{
SPDLOG_ERROR("AsyncQuery callback threw exception: {}", e.what());
}
}
++m_completedQueries;
}

View File

@ -1,97 +1,49 @@
// vim:ts=8 sw=4
#ifndef __INC_METIN2_DB_DBMANAGER_H__
#define __INC_METIN2_DB_DBMANAGER_H__
// 디비 커넥션 클래스의 목적은... 디비에 접속해서 쿼리보내고 결과 받아오는
// 모든 일들을 처리한다.
// 코드 by 꼬붕 후로그래머 아노아~ = _=)b
#include <libsql/include/CAsyncSQL.h>
#define SQL_SAFE_LENGTH(size) (size * 2 + 1)
#define QUERY_SAFE_LENGTH(size) (1024 + SQL_SAFE_LENGTH(size))
class CQueryInfo
{
public:
int iType;
DWORD dwIdent;
void * pvData;
};
enum eSQL_SLOT
{
SQL_PLAYER,
SQL_ACCOUNT,
SQL_COMMON,
SQL_MAX_NUM,
};
#include <libsql/include/PgConnectionPool.h>
#include <libsql/include/PgAsyncQuery.h>
#include <memory>
class CDBManager : public singleton<CDBManager>
{
protected:
void Initialize();
void Destroy();
public:
CDBManager();
virtual ~CDBManager();
int Connect(const char *host, int port, const char *dbname, const char *user, const char *pass);
void Clear();
void Quit();
int Connect(int iSlot, const char * host, int port, const char* dbname, const char* user, const char* pass);
std::shared_ptr<PgConnectionPool> GetConnectionPool();
void ReturnQuery(const char * c_pszQuery, int iType, DWORD dwIdent, void * pvData, int iSlot = SQL_PLAYER);
void AsyncQuery(const char * c_pszQuery, int iSlot = SQL_PLAYER);
SQLMsg * DirectQuery(const char * c_pszQuery, int iSlot = SQL_PLAYER);
// Async Query
SQLMsg * PopResult();
SQLMsg * PopResult(eSQL_SLOT slot );
void AsyncQuery(const std::string &query, const pqxx::params &params = pqxx::params{});
void AsyncQuery(const std::string &query, const pqxx::params &params, AsyncQueryCallback callback);
unsigned int EscapeString(void * to, const void * from, unsigned int length, int iSlot = SQL_PLAYER);
DWORD CountReturnQuery(int i) { return m_mainSQL[i] ? m_mainSQL[i]->CountQuery() : 0; }
DWORD CountReturnResult(int i) { return m_mainSQL[i] ? m_mainSQL[i]->CountResult() : 0; }
DWORD CountReturnQueryFinished(int i) { return m_mainSQL[i] ? m_mainSQL[i]->CountQueryFinished() : 0; }
DWORD CountReturnCopiedQuery(int i) { return m_mainSQL[i] ? m_mainSQL[i]->GetCopiedQueryCount() : 0; }
DWORD CountAsyncQuery(int i) { return m_asyncSQL[i] ? m_asyncSQL[i]->CountQuery() : 0; }
DWORD CountAsyncResult(int i) { return m_asyncSQL[i] ? m_asyncSQL[i]->CountResult() : 0; }
DWORD CountAsyncQueryFinished(int i) { return m_asyncSQL[i] ? m_asyncSQL[i]->CountQueryFinished() : 0; }
DWORD CountAsyncCopiedQuery(int i) { return m_asyncSQL[i] ? m_asyncSQL[i]->GetCopiedQueryCount() : 0; }
void ResetCounter()
{
for (int i = 0; i < SQL_MAX_NUM; ++i)
{
if (m_mainSQL[i])
{
m_mainSQL[i]->ResetQueryFinished();
m_mainSQL[i]->ResetCopiedQueryCount();
}
if (m_asyncSQL[i])
{
m_asyncSQL[i]->ResetQueryFinished();
m_asyncSQL[i]->ResetCopiedQueryCount();
}
}
}
size_t GetPendingQueryCount() const;
size_t GetCompletedQueryCount() const;
void ResetQueryStats();
private:
CAsyncSQL2 * m_mainSQL[SQL_MAX_NUM];
CAsyncSQL2 * m_directSQL[SQL_MAX_NUM];
CAsyncSQL2 * m_asyncSQL[SQL_MAX_NUM];
std::shared_ptr<PgConnectionPool> m_connPool;
std::atomic<int> m_quit{0};
int m_quit; // looping flag
// Async Query
//CHARSET
public:
void SetLocale(const char * szLocale );
void QueryLocaleSet();
private:
void StartWorkerThread();
void StopWorkerThread();
void WorkerLoop();
void ProcessQuery(std::shared_ptr<PgAsyncQuery> msg);
//END_CHARSET
std::queue<std::shared_ptr<PgAsyncQuery>> m_queryQueue;
mutable std::mutex m_queueMutex;
std::condition_variable m_queueCondition;
std::thread m_workerThread;
std::atomic<int> m_msgCounter{0};
std::atomic<size_t> m_completedQueries{0};
std::atomic<bool> m_workerRunning{false};
};
#endif

View File

@ -14,15 +14,24 @@ bool isEurope()
{
do
{
if (g_stLocale.compare("germany") == 0) break;
if (g_stLocale.compare("france") == 0) break;
if (g_stLocale.compare("italy") == 0) break;
if (g_stLocale.compare("spain") == 0) break;
if (g_stLocale.compare("uk") == 0) break;
if (g_stLocale.compare("turkey") == 0) break;
if (g_stLocale.compare("poland") == 0) break;
if (g_stLocale.compare("portugal") == 0) break;
if (g_stLocale.compare("greek") == 0) break;
if (g_stLocale.compare("germany") == 0)
break;
if (g_stLocale.compare("france") == 0)
break;
if (g_stLocale.compare("italy") == 0)
break;
if (g_stLocale.compare("spain") == 0)
break;
if (g_stLocale.compare("uk") == 0)
break;
if (g_stLocale.compare("turkey") == 0)
break;
if (g_stLocale.compare("poland") == 0)
break;
if (g_stLocale.compare("portugal") == 0)
break;
if (g_stLocale.compare("greek") == 0)
break;
return false;
} while (false);
@ -35,8 +44,10 @@ DWORD GetGuildWarWaitStartDuration()
// const int GUILD_WAR_WAIT_START_DURATION = 60;
// const int GUILD_WAR_WAIT_START_DURATION = 5;
if (isEurope() == true) return 60;
else return 5;
if (isEurope() == true)
return 60;
else
return 5;
}
DWORD GetGuildWarReserveSeconds()
@ -44,8 +55,10 @@ DWORD GetGuildWarReserveSeconds()
// const int GUILD_WAR_RESERVE_SECONDS = 180;
// const int GUILD_WAR_RESERVE_SECONDS = 10;
if (isEurope() == true) return 180;
else return 10;
if (isEurope() == true)
return 180;
else
return 10;
}
namespace
@ -228,8 +241,10 @@ void CGuildManager::ResultRanking(MYSQL_RES * pRes)
while ((row = mysql_fetch_row(pRes)))
{
DWORD dwGID = 0; str_to_number(dwGID, row[0]);
int iLadderPoint = 0; str_to_number(iLadderPoint, row[2]);
DWORD dwGID = 0;
str_to_number(dwGID, row[0]);
int iLadderPoint = 0;
str_to_number(iLadderPoint, row[2]);
if (iLadderPoint != iLastLadderPoint)
++iRank;
@ -896,8 +911,7 @@ void CGuildManager::BootReserveWar()
const char *c_apszQuery[2] =
{
"SELECT id, guild1, guild2, UNIX_TIMESTAMP(time), type, warprice, initscore, bet_from, bet_to, power1, power2, handicap FROM guild_war_reservation WHERE started=1 AND winner=-1",
"SELECT id, guild1, guild2, UNIX_TIMESTAMP(time), type, warprice, initscore, bet_from, bet_to, power1, power2, handicap FROM guild_war_reservation WHERE started=0"
};
"SELECT id, guild1, guild2, UNIX_TIMESTAMP(time), type, warprice, initscore, bet_from, bet_to, power1, power2, handicap FROM guild_war_reservation WHERE started=0"};
for (int i = 0; i < 2; ++i)
{
@ -967,7 +981,8 @@ int GetAverageGuildMemberLevel(DWORD dwGID)
MYSQL_ROW row;
row = mysql_fetch_row(msg->Get()->pSQLResult);
int nAverageLevel = 0; str_to_number(nAverageLevel, row[0]);
int nAverageLevel = 0;
str_to_number(nAverageLevel, row[0]);
return nAverageLevel;
}
@ -982,7 +997,8 @@ int GetGuildMemberCount(DWORD dwGID)
MYSQL_ROW row;
row = mysql_fetch_row(msg->Get()->pSQLResult);
DWORD dwCount = 0; str_to_number(dwCount, row[0]);
DWORD dwCount = 0;
str_to_number(dwCount, row[0]);
return dwCount;
}
@ -1488,4 +1504,3 @@ void CGuildWarReserve::End(int iScoreFrom, int iScoreTo)
break;
}
}

View File

@ -6,8 +6,6 @@
#include "ClientManager.h"
DWORD g_dwLastCachedItemAwardID = 0;
ItemAwardManager::ItemAwardManager()
{

View File

@ -33,6 +33,7 @@ class ItemAwardManager : public singleton<ItemAwardManager>
// gift notify
std::map<DWORD, TItemAward *> &GetMapAward();
std::map<std::string, std::set<TItemAward *>> &GetMapkSetAwardByLogin();
private:
// ID, ItemAward pair
std::map<DWORD, TItemAward *> m_map_award;

View File

@ -74,7 +74,8 @@ TItemIDRangeTable CItemIDRangeManager::GetRange()
FCheckCollision f(ret);
CClientManager::instance().for_each_peer(f);
if (f.hasCollision == false) return ret;
if (f.hasCollision == false)
return ret;
}
}
@ -83,32 +84,26 @@ TItemIDRangeTable CItemIDRangeManager::GetRange()
return ret;
}
#include <pqxx/pqxx>
#include <spdlog/spdlog.h>
bool CItemIDRangeManager::BuildRange(DWORD dwMin, DWORD dwMax, TItemIDRangeTable &range)
{
char szQuery[1024];
DWORD dwItemMaxID = 0;
SQLMsg* pMsg = NULL;
MYSQL_ROW row;
snprintf(szQuery, sizeof(szQuery), "SELECT MAX(id) FROM item%s WHERE id >= %u and id <= %u", GetTablePostfix(), dwMin, dwMax);
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
pMsg = CDBManager::instance().DirectQuery(szQuery);
if (pMsg != NULL)
try
{
if (pMsg->Get()->uiNumRows > 0)
{
row = mysql_fetch_row(pMsg->Get()->pSQLResult);
str_to_number(dwItemMaxID, row[0]);
}
delete pMsg;
}
pqxx::work txn(*conn);
if (dwItemMaxID == 0)
dwItemMaxID = dwMin;
else
dwItemMaxID++;
auto maxRow = txn.exec_params1("SELECT MAX(id) FROM item WHERE id >= $1 AND id <= $2", dwMin, dwMax);
if (!maxRow[0].is_null())
dwItemMaxID = maxRow[0].as<DWORD>();
dwItemMaxID = (dwItemMaxID == 0) ? dwMin : dwItemMaxID + 1;
if ((dwMax < dwItemMaxID) || (dwMax - dwItemMaxID < cs_dwMinimumRemainCount))
{
@ -121,18 +116,9 @@ bool CItemIDRangeManager::BuildRange(DWORD dwMin, DWORD dwMax, TItemIDRangeTable
range.dwMax = dwMax;
range.dwUsableItemIDMin = dwItemMaxID;
snprintf(szQuery, sizeof(szQuery), "SELECT COUNT(*) FROM item%s WHERE id >= %u AND id <= %u",
GetTablePostfix(), range.dwUsableItemIDMin, range.dwMax);
auto countRow = txn.exec_params1("SELECT COUNT(*) FROM item WHERE id >= $1 AND id <= $2", range.dwUsableItemIDMin, range.dwMax);
pMsg = CDBManager::instance().DirectQuery(szQuery);
if (pMsg != NULL)
{
if (pMsg->Get()->uiNumRows > 0)
{
DWORD count = 0;
row = mysql_fetch_row(pMsg->Get()->pSQLResult);
str_to_number(count, row[0]);
DWORD count = countRow[0].as<DWORD>();
if (count > 0)
{
@ -146,8 +132,11 @@ bool CItemIDRangeManager::BuildRange(DWORD dwMin, DWORD dwMax, TItemIDRangeTable
}
}
delete pMsg;
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CItemIDRangeManager::BuildRange] Query error: {}", e.what());
}
return false;
@ -162,4 +151,3 @@ void CItemIDRangeManager::UpdateRange(DWORD dwMin, DWORD dwMax)
m_listData.push_back(range);
}
}

View File

@ -2,7 +2,8 @@
#ifndef __INC_METIN_II_ITEM_ID_RANGE_MANAGER_H__
#define __INC_METIN_II_ITEM_ID_RANGE_MANAGER_H__
namespace {
namespace
{
static const uint32_t cs_dwMaxItemID = 4290000000UL;
static const uint32_t cs_dwMinimumRange = 10000000UL;
static const uint32_t cs_dwMinimumRemainCount = 10000UL;

View File

@ -12,39 +12,23 @@ CLock::~CLock()
void CLock::Initialize()
{
m_bLocked = false;
#ifndef __WIN32__
pthread_mutex_init(&m_lock, NULL);
#else
::InitializeCriticalSection(&m_lock);
#endif
}
void CLock::Destroy()
{
assert(!m_bLocked && "lock didn't released");
#ifndef __WIN32__
pthread_mutex_destroy(&m_lock);
#else
::DeleteCriticalSection(&m_lock);
#endif
}
int CLock::Trylock()
{
#ifndef __WIN32__
return pthread_mutex_trylock(&m_lock);
#else
return ::TryEnterCriticalSection(&m_lock);
#endif
}
void CLock::Lock()
{
#ifndef __WIN32__
pthread_mutex_lock(&m_lock);
#else
::EnterCriticalSection(&m_lock);
#endif
m_bLocked = true;
}
@ -52,9 +36,5 @@ void CLock::Unlock()
{
assert(m_bLocked && "lock didn't issued");
m_bLocked = false;
#ifndef __WIN32__
pthread_mutex_unlock(&m_lock);
#else
::LeaveCriticalSection(&m_lock);
#endif
}

View File

@ -2,11 +2,7 @@
#ifndef __INC_LOCK_H__
#define __INC_LOCK_H__
#ifdef __WIN32__
typedef CRITICAL_SECTION lock_t;
#else
typedef pthread_mutex_t lock_t;
#endif
class CLock
{

View File

@ -118,4 +118,3 @@ DWORD * CLoginData::GetPremiumPtr()
{
return &m_aiPremiumTimes[0];
}

View File

@ -10,9 +10,10 @@
#include "Marriage.h"
#include "Monarch.h"
#include "ItemIDRangeManager.h"
#ifndef __INTELLISENSE__
#include <version.h>
#ifdef __AUCTION__
#include "AuctionManager.h"
#else
#include <../../../common/version.h>
#endif
#include <signal.h>
@ -23,7 +24,6 @@ std::string g_stTablePostfix;
std::string g_stLocaleNameColumn = "name";
std::string g_stLocale = "euckr";
BOOL g_test_server = false;
// 단위 초
@ -33,15 +33,10 @@ int g_iItemCacheFlushSeconds = 60*5;
// g_iLogoutSeconds 수치는 g_iPlayerCacheFlushSeconds 와 g_iItemCacheFlushSeconds 보다 길어야 한다.
int g_iLogoutSeconds = 60 * 10;
// MYSHOP_PRICE_LIST
int g_iItemPriceListTableCacheFlushSeconds = 540;
// END_OF_MYSHOP_PRICE_LIST
#ifdef __FreeBSD__
extern const char * _malloc_options;
#endif
void emergency_sig(int sig)
{
if (sig == SIGSEGV)
@ -58,10 +53,6 @@ int main()
WriteVersion();
log_init();
#ifdef __FreeBSD__
_malloc_options = "A";
#endif
CConfig Config;
CDBManager DBManager;
CClientManager ClientManager;
@ -72,18 +63,12 @@ int main()
marriage::CManager MarriageManager;
CMonarch Monarch;
CItemIDRangeManager ItemIDRangeManager;
#ifdef __AUCTION__
AuctionManager auctionManager;
#endif
if (!Start())
return 1;
GuildManager.Initialize();
MarriageManager.Initialize();
ItemIDRangeManager.Build();
#ifdef __AUCTION__
AuctionManager::instance().Initialize();
#endif
SPDLOG_DEBUG("Metin2DBCacheServer Start");
CClientManager::instance().MainLoop();
@ -91,21 +76,23 @@ int main()
signal_timer_disable();
DBManager.Quit();
int iCount;
while (true)
{
iCount = 0;
// TODO Check if this is really needed, this should just be cleaning up queued queries
// int iCount;
iCount += CDBManager::instance().CountReturnQuery(SQL_PLAYER);
iCount += CDBManager::instance().CountAsyncQuery(SQL_PLAYER);
// while (true)
// {
// iCount = 0;
if (iCount == 0)
break;
// iCount += CDBManager::instance().CountReturnQuery(SQL_PLAYER);
// iCount += CDBManager::instance().CountAsyncQuery(SQL_PLAYER);
usleep(1000);
SPDLOG_DEBUG("WAITING_QUERY_COUNT {}", iCount);
}
// if (iCount == 0)
// break;
// usleep(1000);
// SPDLOG_DEBUG("WAITING_QUERY_COUNT {}", iCount);
// }
log_destroy();
@ -194,7 +181,8 @@ int Start()
//
if (CConfig::instance().GetValue("CACHE_FLUSH_LIMIT_PER_SECOND", szBuf, 256))
{
DWORD dwVal = 0; str_to_number(dwVal, szBuf);
DWORD dwVal = 0;
str_to_number(dwVal, szBuf);
CClientManager::instance().SetCacheFlushCountLimit(dwVal);
}
@ -217,58 +205,16 @@ int Start()
int iPort;
char line[256 + 1];
if (CConfig::instance().GetValue("SQL_PLAYER", line, 256)) {
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
SPDLOG_DEBUG("Connecting to MySQL server (player)");
SPDLOG_DEBUG("Connecting to PostgreSQL server");
if (!CDBManager::instance().Connect(SQL_PLAYER, szAddr, iPort, szDB, szUser, szPassword)) {
SPDLOG_CRITICAL("Connection to MySQL server (player) failed!");
return false;
}
SPDLOG_INFO("Connected to MySQL server (player)");
}
else {
SPDLOG_CRITICAL("SQL_PLAYER not configured");
return false;
}
if (CConfig::instance().GetValue("SQL_ACCOUNT", line, 256)) {
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
SPDLOG_DEBUG("Connecting to MySQL server (account)");
if (!CDBManager::instance().Connect(SQL_ACCOUNT, szAddr, iPort, szDB, szUser, szPassword)) {
SPDLOG_CRITICAL("Connection to MySQL server (account) failed!");
return false;
}
SPDLOG_INFO("Connected to MySQL server (account)");
}
else
if (!CDBManager::instance().Connect(szAddr, iPort, szDB, szUser, szPassword))
{
SPDLOG_CRITICAL("SQL_ACCOUNT not configured");
SPDLOG_CRITICAL("Connection to PostgreSQL server failed!");
return false;
}
if (CConfig::instance().GetValue("SQL_COMMON", line, 256))
{
sscanf(line, " %s %s %s %s %d ", szAddr, szDB, szUser, szPassword, &iPort);
SPDLOG_DEBUG("Connecting to MySQL server (common)");
if (!CDBManager::instance().Connect(SQL_COMMON, szAddr, iPort, szDB, szUser, szPassword))
{
SPDLOG_CRITICAL("Connection to MySQL server (common) failed!");
return false;
}
SPDLOG_INFO("Connected to MySQL server (common)");
}
else
{
SPDLOG_CRITICAL("SQL_COMMON not configured");
return false;
}
SPDLOG_INFO("Connected to PostgreSQL server");
if (!CClientManager::instance().Initialize())
{
@ -278,9 +224,7 @@ int Start()
SPDLOG_INFO("ClientManager initialization OK");
#ifndef __WIN32__
signal(SIGUSR1, emergency_sig);
#endif
signal(SIGSEGV, emergency_sig);
return true;
}

View File

@ -2,8 +2,6 @@
#define __INC_MAIN_H__
int Start();
void End();
const char *GetTablePostfix();
const char * GetPlayerDBName();
#endif

View File

@ -34,31 +34,32 @@ namespace marriage
bool CManager::Initialize()
{
char szQuery[1024];
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
snprintf(szQuery, sizeof(szQuery),
"SELECT pid1, pid2, love_point, time, is_married, p1.name, p2.name FROM marriage, player%s as p1, player%s as p2 WHERE p1.id = pid1 AND p2.id = pid2",
GetTablePostfix(), GetTablePostfix());
unique_ptr<SQLMsg> pmsg_delete(CDBManager::instance().DirectQuery("DELETE FROM marriage WHERE is_married = 0"));
unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery));
SQLResult * pRes = pmsg->Get();
SPDLOG_DEBUG("MarriageList(size={})", pRes->uiNumRows);
if (pRes->uiNumRows > 0)
try
{
for (uint uiRow = 0; uiRow != pRes->uiNumRows; ++uiRow)
{
MYSQL_ROW row = mysql_fetch_row(pRes->pSQLResult);
pqxx::work txn{*conn};
txn.exec("DELETE FROM player.marriage WHERE is_married = false");
pqxx::result result = txn.exec("SELECT player_id_1, player_id_2, love_points, created_at, is_married, p1.name, p2.name FROM player.marriage, player.player as p1, player.player as p2 WHERE p1.id = player_id_1 AND p2.id = player_id_2");
DWORD pid1 = 0; str_to_number(pid1, row[0]);
DWORD pid2 = 0; str_to_number(pid2, row[1]);
int love_point = 0; str_to_number(love_point, row[2]);
DWORD time = 0; str_to_number(time, row[3]);
BYTE is_married = 0; str_to_number(is_married, row[4]);
const char* name1 = row[5];
const char* name2 = row[6];
std::size_t const numRows = std::size(result);
SPDLOG_DEBUG("MarriageList(size={})", numRows);
for (auto row : result)
{
DWORD pid1 = 0;
str_to_number(pid1, row[0].c_str());
DWORD pid2 = 0;
str_to_number(pid2, row[1].c_str());
int love_point = 0;
str_to_number(love_point, row[2].c_str());
DWORD time = 0;
str_to_number(time, row[3].c_str());
BYTE is_married = 0;
str_to_number(is_married, row[4].c_str());
const char *name1 = row[5].c_str();
const char *name2 = row[6].c_str();
TMarriage *pMarriage = new TMarriage(pid1, pid2, love_point, time, is_married, name1, name2);
m_Marriages.insert(pMarriage);
@ -67,7 +68,15 @@ namespace marriage
SPDLOG_DEBUG("Marriage {}: LP:{} TM:{} ST:{} {:10}:{:16} {:10}:{:16} ", uiRow, love_point, time, is_married, pid1, name1, pid2, name2);
}
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CManager::Initialize] Query error: {}", e.what());
return false;
}
return true;
}
@ -98,18 +107,29 @@ namespace marriage
Align(dwPID1, dwPID2);
char szQuery[512];
snprintf(szQuery, sizeof(szQuery), "INSERT INTO marriage(pid1, pid2, love_point, time) VALUES (%u, %u, 0, %u)", dwPID1, dwPID2, now);
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery));
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec_params("INSERT INTO player.marriage(player_id_1, player_id_2, love_points, created_at) VALUES ($1, $2, 0, $3) RETURNING id", dwPID1, dwPID2, now);
std::size_t const numRows = std::size(result);
SQLResult* res = pmsg->Get();
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
if (numRows == 0)
{
SPDLOG_ERROR("cannot insert marriage");
return;
}
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CManager::Add] Query error: {}", e.what());
return;
}
SPDLOG_DEBUG("MARRIAGE ADD {} {}", dwPID1, dwPID2);
TMarriage *pMarriage = new TMarriage(dwPID1, dwPID2, 0, now, 0, szName1, szName2);
@ -137,19 +157,29 @@ namespace marriage
Align(dwPID1, dwPID2);
char szQuery[512];
snprintf(szQuery, sizeof(szQuery), "UPDATE marriage SET love_point = %d, is_married = %d WHERE pid1 = %u AND pid2 = %u",
iLovePoint, byMarried, pMarriage->pid1, pMarriage->pid2);
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery));
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec_params("UPDATE player.marriage SET love_points=$1, is_married=$2 WHERE player_id_1=$3 AND player_id_2=$4 RETURNING id", iLovePoint, byMarried, pMarriage->pid1, pMarriage->pid2);
std::size_t const numRows = std::size(result);
SQLResult* res = pmsg->Get();
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
if (numRows == 0)
{
SPDLOG_ERROR("cannot update marriage : PID:{} {}", dwPID1, dwPID2);
return;
}
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CManager::Update] Query error: {}", e.what());
return;
}
SPDLOG_DEBUG("MARRIAGE UPDATE PID:{} {} LP:{} ST:{}", dwPID1, dwPID2, iLovePoint, byMarried);
pMarriage->love_point = iLovePoint;
pMarriage->is_married = byMarried;
@ -184,18 +214,29 @@ namespace marriage
Align(dwPID1, dwPID2);
char szQuery[512];
snprintf(szQuery, sizeof(szQuery), "DELETE FROM marriage WHERE pid1 = %u AND pid2 = %u", dwPID1, dwPID2);
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery));
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec_params("DELETE FROM player.marriage WHERE player_id_1=$1 AND player_id_2=$2", dwPID1, dwPID2);
std::size_t const numRows = std::size(result);
SQLResult* res = pmsg->Get();
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
if (numRows == 0)
{
SPDLOG_ERROR("cannot delete marriage : PID:{} {}", dwPID1, dwPID2);
return;
}
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CManager::Remove] Query error: {}", e.what());
return;
}
SPDLOG_DEBUG("MARRIAGE REMOVE PID:{} {}", dwPID1, dwPID2);
m_Marriages.erase(pMarriage);
@ -227,19 +268,29 @@ namespace marriage
Align(dwPID1, dwPID2);
char szQuery[512];
snprintf(szQuery, sizeof(szQuery), "UPDATE marriage SET is_married = 1 WHERE pid1 = %u AND pid2 = %u",
pMarriage->pid1, pMarriage->pid2);
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
unique_ptr<SQLMsg> pmsg(CDBManager::instance().DirectQuery(szQuery));
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec_params("UPDATE player.marriage SET is_married = 1 WHERE player_id_1=$1 AND player_id_2=$2", pMarriage->pid1, pMarriage->pid2);
std::size_t const numRows = std::size(result);
SQLResult* res = pmsg->Get();
if (res->uiAffectedRows == 0 || res->uiAffectedRows == (uint32_t)-1)
if (numRows == 0)
{
SPDLOG_ERROR("cannot change engage to marriage : PID:{} {}", dwPID1, dwPID2);
return;
}
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CManager::EngageToMarriage] Query error: {}", e.what());
return;
}
SPDLOG_DEBUG("MARRIAGE ENGAGE->MARRIAGE PID:{} {}", dwPID1, dwPID2);
pMarriage->is_married = 1;

View File

@ -27,11 +27,9 @@ bool CMonarch::VoteMonarch(DWORD pid, DWORD selectdpid)
p->selectedpid = selectdpid;
m_map_MonarchElection.insert(MAP_MONARCHELECTION::value_type(pid, p));
char szQuery[256];
snprintf(szQuery, sizeof(szQuery),
"INSERT INTO monarch_election(pid, selectedpid, electiondata) VALUES(%d, %d, now())", pid, selectdpid);
CDBManager::instance().AsyncQuery(szQuery);
CDBManager::instance().AsyncQuery(
"INSERT INTO player.monarch_election(player_id, selected_player_id, election_at) VALUES($1, $2, now())",
pqxx::params(pid, selectdpid));
return 1;
}
@ -85,11 +83,10 @@ bool CMonarch::AddCandidacy(DWORD pid, const char * name)
strlcpy(info.name, name, sizeof(info.name));
m_vec_MonarchCandidacy.push_back(info);
char szQuery[256];
snprintf(szQuery, sizeof(szQuery),
"INSERT INTO monarch_candidacy(pid, date) VALUES(%d, now())", pid);
CDBManager::instance().AsyncQuery(
"INSERT INTO player.monarch_candidacy(player_id, date) VALUES($1, now())",
pqxx::params(pid));
CDBManager::instance().AsyncQuery(szQuery);
return true;
}
@ -100,17 +97,17 @@ bool CMonarch::DelCandidacy(const char * name)
{
if (0 == strncmp(it->name, name, sizeof(it->name)))
{
char szQuery[256];
snprintf(szQuery, sizeof(szQuery),
"DELETE FROM monarch_candidacy WHERE pid=%d ", it->pid);
CDBManager::instance().AsyncQuery(szQuery);
CDBManager::instance().AsyncQuery(
"DELETE FROM player.monarch_candidacy WHERE player_id=$1",
pqxx::params(it->pid));
m_vec_MonarchCandidacy.erase(it);
return true;
}
}
return false;
return false;
}
bool CMonarch::IsMonarch(int Empire, DWORD pid)
@ -129,10 +126,9 @@ bool CMonarch::AddMoney(int Empire, int64_t Money)
int64_t Money64 = m_MonarchInfo.money[Empire];
char szQuery[1024];
snprintf(szQuery, sizeof(szQuery), "UPDATE monarch set money=%ld where empire=%d", Money64, Empire);
CDBManager::instance().AsyncQuery(szQuery);
CDBManager::instance().AsyncQuery(
"UPDATE player.monarch SET money=$1 WHERE empire=$2",
pqxx::params(Money64, Empire));
return true;
}
@ -145,10 +141,10 @@ bool CMonarch::DecMoney(int Empire, int64_t Money)
int64_t Money64 = m_MonarchInfo.money[Empire];
char szQuery[1024];
snprintf(szQuery, sizeof(szQuery), "UPDATE monarch set money=%ld where empire=%d", Money64, Empire);
CDBManager::instance().AsyncQuery(
"UPDATE player.monarch SET money=$1 WHERE empire=$2",
pqxx::params(Money64, Empire));
CDBManager::instance().AsyncQuery(szQuery);
return true;
}
@ -162,11 +158,9 @@ bool CMonarch::TakeMoney(int Empire, DWORD pid, int64_t Money)
m_MonarchInfo.money[Empire] -= Money;
char szQuery[1024];
snprintf(szQuery, sizeof(szQuery),
"UPDATE monarch set money=%ld; where empire=%d", m_MonarchInfo.money[Empire], Empire);
CDBManager::instance().AsyncQuery(szQuery);
CDBManager::instance().AsyncQuery(
"UPDATE player.monarch SET money=$1 WHERE empire=$2",
pqxx::params(m_MonarchInfo.money[Empire], Empire));
SPDLOG_TRACE("[MONARCH] Take money empire({}) money({})", Empire, m_MonarchInfo.money[Empire]);
return true;
@ -175,119 +169,154 @@ bool CMonarch::TakeMoney(int Empire, DWORD pid, int64_t Money)
bool CMonarch::LoadMonarch()
{
MonarchInfo *p = &m_MonarchInfo;
char szQuery[256];
snprintf(szQuery, sizeof(szQuery), "SELECT empire, pid, name, money, windate FROM monarch a, player%s b where a.pid=b.id", GetTablePostfix());
SQLMsg * pMsg = CDBManager::instance().DirectQuery(szQuery, SQL_PLAYER);
if (pMsg->Get()->uiNumRows == 0)
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec("SELECT empire, player_id, name, money, win_at FROM player.monarch m, player.player p WHERE m.player_id=p.id");
std::size_t const numRows = std::size(result);
if (numRows == 0)
{
delete pMsg;
return false;
}
MYSQL_ROW row;
for (int n = 0; (row = mysql_fetch_row(pMsg->Get()->pSQLResult)) != NULL; ++n)
for (auto row : result)
{
int idx = 0;
int Empire = 0; str_to_number(Empire, row[idx++]);
int Empire = row[0].as<int>();
str_to_number(p->pid[Empire], row[1].c_str());
strlcpy(p->name[Empire], row[2].c_str(), sizeof(p->name[Empire]));
str_to_number(p->pid[Empire], row[idx++]);
strlcpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
str_to_number(p->money[Empire], row[idx++]);
strlcpy(p->date[Empire], row[idx++], sizeof(p->date[Empire]));
str_to_number(p->money[Empire], row[3].c_str());
strlcpy(p->date[Empire], row[4].c_str(), sizeof(p->date[Empire]));
SPDLOG_TRACE("[LOAD_MONARCH] Empire {} pid {} money {} windate {}", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
}
delete pMsg;
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CMonarch::LoadMonarch] Query error: {}", e.what());
return false;
}
return true;
}
bool CMonarch::SetMonarch(const char *name)
{
MonarchInfo *p = &m_MonarchInfo;
char szQuery[256];
snprintf(szQuery, sizeof(szQuery), "SELECT empire, pid, name FROM player a where a.name = '%s'", name);
SQLMsg * pMsg = CDBManager::instance().DirectQuery(szQuery, SQL_PLAYER);
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
if (pMsg->Get()->uiNumRows == 0)
try
{
pqxx::work txn{*conn};
// TODO Look at this, this should probably not iterate and just get one value instead
pqxx::result result = txn.exec_params("SELECT empire, player_id, name, money FROM player.player WHERE name=$1", name);
std::size_t const numRows = std::size(result);
if (numRows == 0)
{
delete pMsg;
return false;
}
MYSQL_ROW row;
int Empire = 0;
for (int n = 0; (row = mysql_fetch_row(pMsg->Get()->pSQLResult)) != NULL; ++n)
for (auto row : result)
{
int idx = 0;
str_to_number(Empire, row[idx++]);
Empire = row[0].as<int>();
str_to_number(p->pid[Empire], row[idx++]);
strlcpy(p->name[Empire], row[idx++], sizeof(p->name[Empire]));
p->money[Empire] = atoll(row[idx++]);
str_to_number(p->pid[Empire], row[1].c_str());
strlcpy(p->name[Empire], row[2].c_str(), sizeof(p->name[Empire]));
p->money[Empire] = atoll(row[3].c_str());
SPDLOG_TRACE("[Set_MONARCH] Empire {} pid {} money {} windate {}", Empire, p->pid[Empire], p->money[Empire], p->date[Empire]);
}
delete pMsg;
//db에 입력
snprintf(szQuery, sizeof(szQuery),
"REPLACE INTO monarch (empire, name, windate, money) VALUES(%d, %d, now(), %ld)", Empire, p->pid[Empire], p->money[Empire]);
txn.commit();
CDBManager::instance().AsyncQuery(
"REPLACE INTO player.monarch (empire, name, win_at, money) VALUES($1, $2, now(), $3)",
pqxx::params{Empire, p->pid[Empire], p->money[Empire]});
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CMonarch::SetMonarch] Query error: {}", e.what());
return false;
}
CDBManager::instance().AsyncQuery(szQuery, SQL_PLAYER);
return true;
}
bool CMonarch::DelMonarch(int Empire)
{
char szQuery[256];
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
snprintf(szQuery, sizeof(szQuery), "DELETE from monarch where empire=%d", Empire);
SQLMsg * pMsg = CDBManager::instance().DirectQuery(szQuery, SQL_PLAYER);
if (pMsg->Get()->uiNumRows == 0)
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec_params("DELETE FROM player.monarch WHERE empire=$1 RETURNING id", Empire);
std::size_t const numRows = std::size(result);
if (numRows == 0)
{
delete pMsg;
return false;
}
delete pMsg;
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CMonarch::DelMonarch] Query error: {}", e.what());
return false;
}
memset(m_MonarchInfo.name[Empire], 0, sizeof(m_MonarchInfo.name[Empire]));
m_MonarchInfo.money[Empire] = 0;
m_MonarchInfo.pid[Empire] = 0;
return true;
}
bool CMonarch::DelMonarch(const char *name)
{
for (int n = 1; n < 4; ++n)
{
if (0 == strncmp(m_MonarchInfo.name[n], name, sizeof(m_MonarchInfo.name[n])))
{
char szQuery[256];
auto pool = CDBManager::instance().GetConnectionPool();
auto conn = pool->acquire();
int Empire = n;
snprintf(szQuery, sizeof(szQuery), "DELETE from monarch where name=%d", Empire);
SQLMsg * pMsg = CDBManager::instance().DirectQuery(szQuery, SQL_PLAYER);
if (pMsg->Get()->uiNumRows == 0)
try
{
pqxx::work txn{*conn};
pqxx::result result = txn.exec_params("DELETE FROM player.monarch WHERE name=$1 RETURNING empire", name);
std::size_t const numRows = std::size(result);
if (numRows == 0)
{
SPDLOG_ERROR(" DirectQuery failed({})", szQuery);
delete pMsg;
return false;
}
delete pMsg;
for (auto row : result)
{
int Empire = row[0].as<int>();
memset(m_MonarchInfo.name[Empire], 0, 32);
memset(m_MonarchInfo.name[Empire], 0, sizeof(m_MonarchInfo.name[Empire]));
m_MonarchInfo.money[Empire] = 0;
m_MonarchInfo.pid[Empire] = 0;
return true;
}
txn.commit();
}
catch (const std::exception &e)
{
SPDLOG_ERROR("[CMonarch::DelMonarch(name)] Query error: {}", e.what());
return false;
}
return false;

View File

@ -31,24 +31,6 @@ void CMoneyLog::Save()
}
m_MoneyLogContainer[bType].clear();
}
/*
CPeer* peer = GetPeer();
peer->
for (BYTE bType = 0; bType < MONEY_LOG_TYPE_MAX_NUM; bType++)
{
//"INSERT INTO money_log%s VALUES('%s', %d, %d, %d)", CClientManager::instance().GetTablePostfix(),
typeof(m_MoneyLogContainer[bType].begin()) it;
for (it = m_MoneyLogContainer[bType].begin(); it != m_MoneyLogContainer[bType].end(); ++it)
{
typeof(it->second.begin())
}
}
for (BYTE bType = 0; bType < MONEY_LOG_TYPE_MAX_NUM; bType++)
m_MoneyLogContainer[bType].clear()
*/
}
void CMoneyLog::AddLog(BYTE bType, DWORD dwVnum, int iGold)

View File

@ -68,7 +68,8 @@ bool CPeer::PeekPacket(int & iBytesProceed, BYTE & header, DWORD & dwHandle, DWO
return false;
const char *buf = (const char *)GetRecvBuffer(iBytesProceed + 9);
if (!buf) {
if (!buf)
{
SPDLOG_ERROR("PeekPacket: Failed to get network buffer!");
return false;
}
@ -94,7 +95,8 @@ bool CPeer::PeekPacket(int & iBytesProceed, BYTE & header, DWORD & dwHandle, DWO
// Ensure that all the required data is available in a contiguous area
buf = (const char *)GetRecvBuffer(iBytesProceed + dwLength + 9);
if (!buf) {
if (!buf)
{
SPDLOG_ERROR("PeekPacket: Failed to get network buffer!");
return false;
}
@ -160,7 +162,8 @@ void CPeer::SendSpareItemIDRange()
bool CPeer::SetItemIDRange(TItemIDRangeTable itemRange)
{
if (itemRange.dwMin == 0 || itemRange.dwMax == 0 || itemRange.dwUsableItemIDMin == 0) return false;
if (itemRange.dwMin == 0 || itemRange.dwMax == 0 || itemRange.dwUsableItemIDMin == 0)
return false;
m_itemRange = itemRange;
SPDLOG_DEBUG("ItemIDRange: SET {} {} ~ {} start: {}", GetPublicIP(), m_itemRange.dwMin, m_itemRange.dwMax, m_itemRange.dwUsableItemIDMin);
@ -170,7 +173,8 @@ bool CPeer::SetItemIDRange(TItemIDRangeTable itemRange)
bool CPeer::SetSpareItemIDRange(TItemIDRangeTable itemRange)
{
if (itemRange.dwMin == 0 || itemRange.dwMax == 0 || itemRange.dwUsableItemIDMin == 0) return false;
if (itemRange.dwMin == 0 || itemRange.dwMax == 0 || itemRange.dwUsableItemIDMin == 0)
return false;
m_itemSpareRange = itemRange;
SPDLOG_DEBUG("ItemIDRange: SPARE SET {} {} ~ {} start: {}", GetPublicIP(), m_itemSpareRange.dwMin, m_itemSpareRange.dwMax,
@ -197,5 +201,3 @@ bool CPeer::CheckItemIDRangeCollision(TItemIDRangeTable itemRange)
return true;
}

View File

@ -14,7 +14,8 @@ CPeerBase::~CPeerBase()
void CPeerBase::Destroy()
{
if (m_bufferevent) {
if (m_bufferevent)
{
bufferevent_free(m_bufferevent);
m_bufferevent = nullptr;
}
@ -22,12 +23,14 @@ void CPeerBase::Destroy()
bool CPeerBase::Accept(bufferevent *bufev, sockaddr *addr)
{
if (!bufev) {
if (!bufev)
{
SPDLOG_ERROR("Cannot accept empty bufferevent!");
return false;
}
if (m_bufferevent != nullptr) {
if (m_bufferevent != nullptr)
{
SPDLOG_ERROR("Peer is already initialized");
return false;
}
@ -39,7 +42,8 @@ bool CPeerBase::Accept(bufferevent* bufev, sockaddr* addr)
sockaddr_in *peer;
sockaddr_in6 *peer6;
switch (addr->sa_family) {
switch (addr->sa_family)
{
case AF_INET:
peer = (sockaddr_in *)addr;
inet_ntop(AF_INET, &(peer->sin_addr), m_host, INET_ADDRSTRLEN);
@ -90,7 +94,8 @@ void CPeerBase::Encode(const void* data, size_t size)
return;
}
if (bufferevent_write(m_bufferevent, data, size) != 0) {
if (bufferevent_write(m_bufferevent, data, size) != 0)
{
SPDLOG_ERROR("Buffer write error!");
return;
}

View File

@ -3,7 +3,8 @@
#include <event2/bufferevent.h>
class CPeerBase {
class CPeerBase
{
protected:
virtual void OnAccept() = 0;
virtual void OnClose() = 0;

View File

@ -39,7 +39,8 @@ void CPrivManager::Update()
// ADD_GUILD_PRIV_TIME
// 길드에 중복적으로 보너스가 설정되었을 경우 map 의 value 가 갱신(수정) 되었으므로
// TPrivGuildData 의 포인터가 같을때 실제로 삭제해 주고 게임서버들에게 cast 해 준다.
if (it != m_aPrivGuild[p->type].end() && it->second == p) {
if (it != m_aPrivGuild[p->type].end() && it->second == p)
{
m_aPrivGuild[p->type].erase(it);
SendChangeGuildPriv(p->guild_id, p->type, 0, 0);
// END_OF_ADD_GUILD_PRIV_TIME

View File

@ -18,7 +18,8 @@ struct TPrivEmpireData
TPrivEmpireData(BYTE type, int value, BYTE empire, time_t end_time_sec)
: type(type), value(value), bRemoved(false), empire(empire), end_time_sec(end_time_sec)
{}
{
}
// END_OF_ADD_EMPIRE_PRIV_TIME
};
@ -37,7 +38,8 @@ struct TPrivGuildData
TPrivGuildData(BYTE type, int value, DWORD guild_id, time_t _end_time_sec)
: type(type), value(value), bRemoved(false), guild_id(guild_id), end_time_sec(_end_time_sec)
{}
{
}
// END_OF_ADD_GUILD_PRIV_TIME
};
@ -49,7 +51,8 @@ struct TPrivCharData
DWORD pid;
TPrivCharData(BYTE type, int value, DWORD pid)
: type(type), value(value), bRemoved(false), pid(pid)
{}
{
}
};
/**
@ -76,7 +79,6 @@ class CPrivManager : public singleton<CPrivManager>
void SendPrivOnSetup(CPeer *peer);
private:
// ADD_GUILD_PRIV_TIME
void SendChangeGuildPriv(DWORD guild_id, BYTE type, int value, time_t end_time_sec);
// END_OF_ADD_GUILD_PRIV_TIME

View File

@ -52,11 +52,10 @@ static string* StringSplit(string strOrigin, string strTok)
return strResult; // 결과return
}
int get_Item_Type_Value(string inputString)
{
string arType[] = {"ITEM_NONE", "ITEM_WEAPON",
string arType[] = {
"ITEM_NONE", "ITEM_WEAPON",
"ITEM_ARMOR", "ITEM_USE",
"ITEM_AUTOUSE", "ITEM_MATERIAL",
"ITEM_SPECIAL", "ITEM_TOOL",
@ -81,12 +80,13 @@ int get_Item_Type_Value(string inputString)
"ITEM_BELT", // 35개 (EItemTypes 값으로 치면 34)
};
int retInt = -1;
// cout << "Type : " << typeStr << " -> ";
for (int j=0;j<sizeof(arType)/sizeof(arType[0]);j++) {
for (int j = 0; j < sizeof(arType) / sizeof(arType[0]); j++)
{
string tempString = arType[j];
if (inputString.find(tempString)!=string::npos && tempString.find(inputString)!=string::npos) {
if (inputString.find(tempString) != string::npos && tempString.find(inputString) != string::npos)
{
// cout << j << " ";
retInt = j;
break;
@ -95,7 +95,6 @@ int get_Item_Type_Value(string inputString)
// cout << endl;
return retInt;
}
int get_Item_SubType_Value(int type_value, string inputString)
@ -126,7 +125,8 @@ int get_Item_SubType_Value(int type_value, string inputString)
static string arSub29[] = {"DS_SLOT1", "DS_SLOT2", "DS_SLOT3", "DS_SLOT4", "DS_SLOT5", "DS_SLOT6"};
static string arSub31[] = {"EXTRACT_DRAGON_SOUL", "EXTRACT_DRAGON_HEART"};
static string* arSubType[] = {0, //0
static string *arSubType[] = {
0, // 0
arSub1, // 1
arSub2, // 2
arSub3, // 3
@ -200,7 +200,6 @@ int get_Item_SubType_Value(int type_value, string inputString)
0, // 34 벨트
};
assert(_countof(arSubType) > type_value && "Subtype rule: Out of range!!");
// assert 안 먹히는 듯..
@ -211,14 +210,16 @@ int get_Item_SubType_Value(int type_value, string inputString)
}
// 아이템 타입의 서브타입 어레이가 존재하는지 알아보고, 없으면 0 리턴
if (arSubType[type_value]==0) {
if (arSubType[type_value] == 0)
{
return 0;
}
//
int retInt = -1;
// cout << "SubType : " << subTypeStr << " -> ";
for (int j=0;j<arNumberOfSubtype[type_value];j++) {
for (int j = 0; j < arNumberOfSubtype[type_value]; j++)
{
string tempString = arSubType[type_value][j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -233,10 +234,6 @@ int get_Item_SubType_Value(int type_value, string inputString)
return retInt;
}
int get_Item_AntiFlag_Value(string inputString)
{
@ -244,15 +241,16 @@ int get_Item_AntiFlag_Value(string inputString)
"ANTI_GET", "ANTI_DROP", "ANTI_SELL", "ANTI_EMPIRE_A", "ANTI_EMPIRE_B", "ANTI_EMPIRE_C",
"ANTI_SAVE", "ANTI_GIVE", "ANTI_PKDROP", "ANTI_STACK", "ANTI_MYSHOP", "ANTI_SAFEBOX"};
int retValue = 0;
string *arInputString = StringSplit(inputString, "|"); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arAntiFlag)/sizeof(arAntiFlag[0]);i++) {
for (int i = 0; i < sizeof(arAntiFlag) / sizeof(arAntiFlag[0]); i++)
{
string tempString = arAntiFlag[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -273,15 +271,16 @@ int get_Item_Flag_Value(string inputString)
"ITEM_MAKECOUNT", "ITEM_IRREMOVABLE", "CONFIRM_WHEN_USE", "QUEST_USE", "QUEST_USE_MULTIPLE",
"QUEST_GIVE", "ITEM_QUEST", "LOG", "STACKABLE", "SLOW_QUERY", "REFINEABLE", "IRREMOVABLE", "ITEM_APPLICABLE"};
int retValue = 0;
string *arInputString = StringSplit(inputString, "|"); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arFlag)/sizeof(arFlag[0]);i++) {
for (int i = 0; i < sizeof(arFlag) / sizeof(arFlag[0]); i++)
{
string tempString = arFlag[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -301,15 +300,16 @@ int get_Item_WearFlag_Value(string inputString)
string arWearrFlag[] = {"WEAR_BODY", "WEAR_HEAD", "WEAR_FOOTS", "WEAR_WRIST", "WEAR_WEAPON", "WEAR_NECK", "WEAR_EAR", "WEAR_SHIELD", "WEAR_UNIQUE",
"WEAR_ARROW", "WEAR_HAIR", "WEAR_ABILITY"};
int retValue = 0;
string *arInputString = StringSplit(inputString, "|"); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arWearrFlag)/sizeof(arWearrFlag[0]);i++) {
for (int i = 0; i < sizeof(arWearrFlag) / sizeof(arWearrFlag[0]); i++)
{
string tempString = arWearrFlag[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -330,12 +330,14 @@ int get_Item_Immune_Value(string inputString)
int retValue = 0;
string *arInputString = StringSplit(inputString, "|"); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arImmune)/sizeof(arImmune[0]);i++) {
for (int i = 0; i < sizeof(arImmune) / sizeof(arImmune[0]); i++)
{
string tempString = arImmune[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -349,16 +351,14 @@ int get_Item_Immune_Value(string inputString)
return retValue;
}
int get_Item_LimitType_Value(string inputString)
{
string arLimitType[] = {"LIMIT_NONE", "LEVEL", "STR", "DEX", "INT", "CON", "PC_BANG", "REAL_TIME", "REAL_TIME_FIRST_USE", "TIMER_BASED_ON_WEAR"};
int retInt = -1;
// cout << "LimitType : " << limitTypeStr << " -> ";
for (int j=0;j<sizeof(arLimitType)/sizeof(arLimitType[0]);j++) {
for (int j = 0; j < sizeof(arLimitType) / sizeof(arLimitType[0]); j++)
{
string tempString = arLimitType[j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -373,31 +373,107 @@ int get_Item_LimitType_Value(string inputString)
return retInt;
}
int get_Item_ApplyType_Value(string inputString)
{
string arApplyType[] = {"APPLY_NONE", "APPLY_MAX_HP", "APPLY_MAX_SP", "APPLY_CON", "APPLY_INT", "APPLY_STR", "APPLY_DEX", "APPLY_ATT_SPEED",
"APPLY_MOV_SPEED", "APPLY_CAST_SPEED", "APPLY_HP_REGEN", "APPLY_SP_REGEN", "APPLY_POISON_PCT", "APPLY_STUN_PCT",
"APPLY_SLOW_PCT", "APPLY_CRITICAL_PCT", "APPLY_PENETRATE_PCT", "APPLY_ATTBONUS_HUMAN", "APPLY_ATTBONUS_ANIMAL",
"APPLY_ATTBONUS_ORC", "APPLY_ATTBONUS_MILGYO", "APPLY_ATTBONUS_UNDEAD", "APPLY_ATTBONUS_DEVIL", "APPLY_STEAL_HP",
"APPLY_STEAL_SP", "APPLY_MANA_BURN_PCT", "APPLY_DAMAGE_SP_RECOVER", "APPLY_BLOCK", "APPLY_DODGE", "APPLY_RESIST_SWORD",
"APPLY_RESIST_TWOHAND", "APPLY_RESIST_DAGGER", "APPLY_RESIST_BELL", "APPLY_RESIST_FAN", "APPLY_RESIST_BOW", "APPLY_RESIST_FIRE",
"APPLY_RESIST_ELEC", "APPLY_RESIST_MAGIC", "APPLY_RESIST_WIND", "APPLY_REFLECT_MELEE", "APPLY_REFLECT_CURSE", "APPLY_POISON_REDUCE",
"APPLY_KILL_SP_RECOVER", "APPLY_EXP_DOUBLE_BONUS", "APPLY_GOLD_DOUBLE_BONUS", "APPLY_ITEM_DROP_BONUS", "APPLY_POTION_BONUS",
"APPLY_KILL_HP_RECOVER", "APPLY_IMMUNE_STUN", "APPLY_IMMUNE_SLOW", "APPLY_IMMUNE_FALL", "APPLY_SKILL", "APPLY_BOW_DISTANCE",
"APPLY_ATT_GRADE_BONUS", "APPLY_DEF_GRADE_BONUS", "APPLY_MAGIC_ATT_GRADE", "APPLY_MAGIC_DEF_GRADE", "APPLY_CURSE_PCT",
"APPLY_MAX_STAMINA", "APPLY_ATTBONUS_WARRIOR", "APPLY_ATTBONUS_ASSASSIN", "APPLY_ATTBONUS_SURA", "APPLY_ATTBONUS_SHAMAN",
"APPLY_ATTBONUS_MONSTER", "APPLY_MALL_ATTBONUS", "APPLY_MALL_DEFBONUS", "APPLY_MALL_EXPBONUS", "APPLY_MALL_ITEMBONUS",
"APPLY_MALL_GOLDBONUS", "APPLY_MAX_HP_PCT", "APPLY_MAX_SP_PCT", "APPLY_SKILL_DAMAGE_BONUS", "APPLY_NORMAL_HIT_DAMAGE_BONUS",
"APPLY_SKILL_DEFEND_BONUS", "APPLY_NORMAL_HIT_DEFEND_BONUS", "APPLY_PC_BANG_EXP_BONUS", "APPLY_PC_BANG_DROP_BONUS",
"APPLY_EXTRACT_HP_PCT", "APPLY_RESIST_WARRIOR", "APPLY_RESIST_ASSASSIN", "APPLY_RESIST_SURA", "APPLY_RESIST_SHAMAN",
"APPLY_ENERGY", "APPLY_DEF_GRADE", "APPLY_COSTUME_ATTR_BONUS", "APPLY_MAGIC_ATTBONUS_PER", "APPLY_MELEE_MAGIC_ATTBONUS_PER",
"APPLY_RESIST_ICE", "APPLY_RESIST_EARTH", "APPLY_RESIST_DARK", "APPLY_ANTI_CRITICAL_PCT", "APPLY_ANTI_PENETRATE_PCT",
string arApplyType[] = {
"APPLY_NONE",
"APPLY_MAX_HP",
"APPLY_MAX_SP",
"APPLY_CON",
"APPLY_INT",
"APPLY_STR",
"APPLY_DEX",
"APPLY_ATT_SPEED",
"APPLY_MOV_SPEED",
"APPLY_CAST_SPEED",
"APPLY_HP_REGEN",
"APPLY_SP_REGEN",
"APPLY_POISON_PCT",
"APPLY_STUN_PCT",
"APPLY_SLOW_PCT",
"APPLY_CRITICAL_PCT",
"APPLY_PENETRATE_PCT",
"APPLY_ATTBONUS_HUMAN",
"APPLY_ATTBONUS_ANIMAL",
"APPLY_ATTBONUS_ORC",
"APPLY_ATTBONUS_MILGYO",
"APPLY_ATTBONUS_UNDEAD",
"APPLY_ATTBONUS_DEVIL",
"APPLY_STEAL_HP",
"APPLY_STEAL_SP",
"APPLY_MANA_BURN_PCT",
"APPLY_DAMAGE_SP_RECOVER",
"APPLY_BLOCK",
"APPLY_DODGE",
"APPLY_RESIST_SWORD",
"APPLY_RESIST_TWOHAND",
"APPLY_RESIST_DAGGER",
"APPLY_RESIST_BELL",
"APPLY_RESIST_FAN",
"APPLY_RESIST_BOW",
"APPLY_RESIST_FIRE",
"APPLY_RESIST_ELEC",
"APPLY_RESIST_MAGIC",
"APPLY_RESIST_WIND",
"APPLY_REFLECT_MELEE",
"APPLY_REFLECT_CURSE",
"APPLY_POISON_REDUCE",
"APPLY_KILL_SP_RECOVER",
"APPLY_EXP_DOUBLE_BONUS",
"APPLY_GOLD_DOUBLE_BONUS",
"APPLY_ITEM_DROP_BONUS",
"APPLY_POTION_BONUS",
"APPLY_KILL_HP_RECOVER",
"APPLY_IMMUNE_STUN",
"APPLY_IMMUNE_SLOW",
"APPLY_IMMUNE_FALL",
"APPLY_SKILL",
"APPLY_BOW_DISTANCE",
"APPLY_ATT_GRADE_BONUS",
"APPLY_DEF_GRADE_BONUS",
"APPLY_MAGIC_ATT_GRADE",
"APPLY_MAGIC_DEF_GRADE",
"APPLY_CURSE_PCT",
"APPLY_MAX_STAMINA",
"APPLY_ATTBONUS_WARRIOR",
"APPLY_ATTBONUS_ASSASSIN",
"APPLY_ATTBONUS_SURA",
"APPLY_ATTBONUS_SHAMAN",
"APPLY_ATTBONUS_MONSTER",
"APPLY_MALL_ATTBONUS",
"APPLY_MALL_DEFBONUS",
"APPLY_MALL_EXPBONUS",
"APPLY_MALL_ITEMBONUS",
"APPLY_MALL_GOLDBONUS",
"APPLY_MAX_HP_PCT",
"APPLY_MAX_SP_PCT",
"APPLY_SKILL_DAMAGE_BONUS",
"APPLY_NORMAL_HIT_DAMAGE_BONUS",
"APPLY_SKILL_DEFEND_BONUS",
"APPLY_NORMAL_HIT_DEFEND_BONUS",
"APPLY_PC_BANG_EXP_BONUS",
"APPLY_PC_BANG_DROP_BONUS",
"APPLY_EXTRACT_HP_PCT",
"APPLY_RESIST_WARRIOR",
"APPLY_RESIST_ASSASSIN",
"APPLY_RESIST_SURA",
"APPLY_RESIST_SHAMAN",
"APPLY_ENERGY",
"APPLY_DEF_GRADE",
"APPLY_COSTUME_ATTR_BONUS",
"APPLY_MAGIC_ATTBONUS_PER",
"APPLY_MELEE_MAGIC_ATTBONUS_PER",
"APPLY_RESIST_ICE",
"APPLY_RESIST_EARTH",
"APPLY_RESIST_DARK",
"APPLY_ANTI_CRITICAL_PCT",
"APPLY_ANTI_PENETRATE_PCT",
};
int retInt = -1;
// cout << "ApplyType : " << applyTypeStr << " -> ";
for (int j=0;j<sizeof(arApplyType)/sizeof(arApplyType[0]);j++) {
for (int j = 0; j < sizeof(arApplyType) / sizeof(arApplyType[0]); j++)
{
string tempString = arApplyType[j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -410,20 +486,18 @@ int get_Item_ApplyType_Value(string inputString)
// cout << endl;
return retInt;
}
// 몬스터 프로토도 읽는다.
int get_Mob_Rank_Value(string inputString)
{
string arRank[] = {"PAWN", "S_PAWN", "KNIGHT", "S_KNIGHT", "BOSS", "KING"};
int retInt = -1;
// cout << "Rank : " << rankStr << " -> ";
for (int j=0;j<sizeof(arRank)/sizeof(arRank[0]);j++) {
for (int j = 0; j < sizeof(arRank) / sizeof(arRank[0]); j++)
{
string tempString = arRank[j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -438,14 +512,14 @@ int get_Mob_Rank_Value(string inputString)
return retInt;
}
int get_Mob_Type_Value(string inputString)
{
string arType[] = {"MONSTER", "NPC", "STONE", "WARP", "DOOR", "BUILDING", "PC", "POLYMORPH_PC", "HORSE", "GOTO"};
int retInt = -1;
// cout << "Type : " << typeStr << " -> ";
for (int j=0;j<sizeof(arType)/sizeof(arType[0]);j++) {
for (int j = 0; j < sizeof(arType) / sizeof(arType[0]); j++)
{
string tempString = arType[j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -466,7 +540,8 @@ int get_Mob_BattleType_Value(string inputString)
int retInt = -1;
// cout << "Battle Type : " << battleTypeStr << " -> ";
for (int j=0;j<sizeof(arBattleType)/sizeof(arBattleType[0]);j++) {
for (int j = 0; j < sizeof(arBattleType) / sizeof(arBattleType[0]); j++)
{
string tempString = arBattleType[j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -487,7 +562,8 @@ int get_Mob_Size_Value(string inputString)
int retInt = 0;
// cout << "Size : " << sizeStr << " -> ";
for (int j=0;j<sizeof(arSize)/sizeof(arSize[0]);j++) {
for (int j = 0; j < sizeof(arSize) / sizeof(arSize[0]); j++)
{
string tempString = arSize[j];
string tempInputString = trim(inputString);
if (tempInputString.compare(tempString) == 0)
@ -506,15 +582,16 @@ int get_Mob_AIFlag_Value(string inputString)
{
string arAIFlag[] = {"AGGR", "NOMOVE", "COWARD", "NOATTSHINSU", "NOATTCHUNJO", "NOATTJINNO", "ATTMOB", "BERSERK", "STONESKIN", "GODSPEED", "DEATHBLOW", "REVIVE"};
int retValue = 0;
string *arInputString = StringSplit(inputString, ","); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arAIFlag)/sizeof(arAIFlag[0]);i++) {
for (int i = 0; i < sizeof(arAIFlag) / sizeof(arAIFlag[0]); i++)
{
string tempString = arAIFlag[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -534,12 +611,14 @@ int get_Mob_RaceFlag_Value(string inputString)
int retValue = 0;
string *arInputString = StringSplit(inputString, ","); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arRaceFlag)/sizeof(arRaceFlag[0]);i++) {
for (int i = 0; i < sizeof(arRaceFlag) / sizeof(arRaceFlag[0]); i++)
{
string tempString = arRaceFlag[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -558,12 +637,14 @@ int get_Mob_ImmuneFlag_Value(string inputString)
int retValue = 0;
string *arInputString = StringSplit(inputString, ","); // 프로토 정보 내용을 단어별로 쪼갠 배열.
for(int i =0;i<sizeof(arImmuneFlag)/sizeof(arImmuneFlag[0]);i++) {
for (int i = 0; i < sizeof(arImmuneFlag) / sizeof(arImmuneFlag[0]); i++)
{
string tempString = arImmuneFlag[i];
for (int j = 0; j < 30; j++) // 최대 30개 단어까지. (하드코딩)
{
string tempString2 = arInputString[j];
if (tempString2.compare(tempString)==0) { //일치하는지 확인.
if (tempString2.compare(tempString) == 0)
{ // 일치하는지 확인.
retValue = retValue + pow((float)2, (float)i);
}
@ -574,11 +655,9 @@ int get_Mob_ImmuneFlag_Value(string inputString)
delete[] arInputString;
// cout << "Immune Flag : " << immuneFlagStr << " -> " << retValue << endl;
return retValue;
}
#ifndef __DUMP_PROTO__
// 몹 테이블을 셋팅해준다.
@ -591,10 +670,13 @@ bool Set_Proto_Mob_Table(TMobTable *mobTable, cCsvTable &csvTable,std::map<int,c
// 3. 지역별 이름 넣어주기.
map<int, const char *>::iterator it;
it = nameMap.find(mobTable->dwVnum);
if (it != nameMap.end()) {
if (it != nameMap.end())
{
const char *localeName = it->second;
strlcpy(mobTable->szLocaleName, localeName, sizeof(mobTable->szLocaleName));
} else {
}
else
{
strlcpy(mobTable->szLocaleName, mobTable->szName, sizeof(mobTable->szLocaleName));
}
@ -693,42 +775,66 @@ bool Set_Proto_Item_Table(TItemTable *itemTable, cCsvTable &csvTable,std::map<in
int col = 0;
int dataArray[33];
for (int i=0; i<sizeof(dataArray)/sizeof(dataArray[0]);i++) {
for (int i = 0; i < sizeof(dataArray) / sizeof(dataArray[0]); i++)
{
int validCheck = 0;
if (i==2) {
if (i == 2)
{
dataArray[i] = get_Item_Type_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==3) {
}
else if (i == 3)
{
dataArray[i] = get_Item_SubType_Value(dataArray[i - 1], csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==5) {
}
else if (i == 5)
{
dataArray[i] = get_Item_AntiFlag_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==6) {
}
else if (i == 6)
{
dataArray[i] = get_Item_Flag_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==7) {
}
else if (i == 7)
{
dataArray[i] = get_Item_WearFlag_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==8) {
}
else if (i == 8)
{
dataArray[i] = get_Item_Immune_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==14) {
}
else if (i == 14)
{
dataArray[i] = get_Item_LimitType_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==16) {
}
else if (i == 16)
{
dataArray[i] = get_Item_LimitType_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==18) {
}
else if (i == 18)
{
dataArray[i] = get_Item_ApplyType_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==20) {
}
else if (i == 20)
{
dataArray[i] = get_Item_ApplyType_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else if (i==22) {
}
else if (i == 22)
{
dataArray[i] = get_Item_ApplyType_Value(csvTable.AsStringByIndex(col));
validCheck = dataArray[i];
} else {
}
else
{
str_to_number(dataArray[i], csvTable.AsStringByIndex(col));
}
@ -780,10 +886,13 @@ bool Set_Proto_Item_Table(TItemTable *itemTable, cCsvTable &csvTable,std::map<in
// 지역별 이름 넣어주기.
map<int, const char *>::iterator it;
it = nameMap.find(itemTable->dwVnum);
if (it != nameMap.end()) {
if (it != nameMap.end())
{
const char *localeName = it->second;
strlcpy(itemTable->szLocaleName, localeName, sizeof(itemTable->szLocaleName));
} else {
}
else
{
strlcpy(itemTable->szLocaleName, itemTable->szName, sizeof(itemTable->szLocaleName));
}
itemTable->bType = dataArray[2];
@ -813,7 +922,6 @@ bool Set_Proto_Item_Table(TItemTable *itemTable, cCsvTable &csvTable,std::map<in
if (LIMIT_TIMER_BASED_ON_WEAR == itemTable->aLimits[i].bType)
itemTable->cLimitTimerBasedOnWearIndex = (char)i;
}
for (i = 0; i < ITEM_APPLY_MAX_NUM; ++i)

View File

@ -18,7 +18,6 @@ int get_Item_Immune_Value(std::string inputString);
int get_Item_LimitType_Value(std::string inputString);
int get_Item_ApplyType_Value(std::string inputString);
// 몬스터 프로토도 읽을 수 있다.
int get_Mob_Rank_Value(std::string inputString);
int get_Mob_Type_Value(std::string inputString);

View File

@ -126,4 +126,3 @@ unsigned int CGrid::GetSize()
{
return m_iWidth * m_iHeight;
}

View File

@ -3,12 +3,7 @@
#include <libthecore/include/stdafx.h>
#ifndef __WIN32__
#include <semaphore.h>
#else
#define isdigit iswdigit
#define isspace iswspace
#endif
#include <common/length.h>
#include <common/tables.h>

View File

@ -1,8 +1,12 @@
#include <fmt/core.h>
#ifndef __INTELLISENSE__
#include <version.h>
#else
#include <../../../common/version.h>
#endif
void WriteVersion() {
void WriteVersion()
{
fmt::println("Metin2 DB Cache version {} (rev. {}, date: {})", __COMMIT_TAG__, __REVISION__, __COMMIT_DATE__);
fmt::println("OS: {}, target arch: {}, compiler: {}", __OS_NAME__, __CPU_TARGET__, __COMPILER__);
}

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(game CXX)
@ -26,32 +26,33 @@ target_compile_options(${PROJECT_NAME} PUBLIC -fsigned-char)
# vcpkg dependencies
#
# MariaDB
find_package(unofficial-libmariadb REQUIRED)
target_link_libraries(${PROJECT_NAME} unofficial::libmariadb)
# PostgreSQL with libpqxx (stable vcpkg package)
find_package(PostgreSQL REQUIRED)
find_package(libpqxx CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE libpqxx::pqxx)
# Argon2
find_package(unofficial-argon2 CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} unofficial::argon2::libargon2)
target_link_libraries(${PROJECT_NAME} PRIVATE unofficial::argon2::libargon2)
# Crypto++
find_package(cryptopp CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} cryptopp::cryptopp)
target_link_libraries(${PROJECT_NAME} PRIVATE cryptopp::cryptopp)
# Libevent
find_package(Libevent CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} libevent::core libevent::extra libevent::pthreads)
target_link_libraries(${PROJECT_NAME} PRIVATE libevent::core libevent::extra libevent::pthreads)
# LZO
find_package(LZO REQUIRED)
if (LZO_FOUND)
include_directories(${LZO_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${LZO_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${LZO_LIBRARIES})
endif (LZO_FOUND)
# effolkronium/random
find_package(effolkronium_random CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} effolkronium_random)
target_link_libraries(${PROJECT_NAME} PRIVATE effolkronium_random)
#
# System-provided dependencies
@ -60,18 +61,18 @@ target_link_libraries(${PROJECT_NAME} effolkronium_random)
# DevIL
find_package(DevIL REQUIRED)
include_directories(${IL_INCLUDE_DIR})
target_link_libraries(${PROJECT_NAME} ${IL_LIBRARIES})
target_link_libraries(${PROJECT_NAME} PRIVATE ${IL_LIBRARIES})
# Pthreads
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
target_link_libraries(${PROJECT_NAME} Threads::Threads)
target_link_libraries(${PROJECT_NAME} PRIVATE Threads::Threads)
# LibBSD
target_link_libraries(${PROJECT_NAME} bsd)
target_link_libraries(${PROJECT_NAME} PRIVATE bsd)
#
# Project-provided dependencies
#
target_link_libraries(${PROJECT_NAME} libgame libpoly libsql libthecore liblua)
target_link_libraries(${PROJECT_NAME} PRIVATE libgame libpoly libsql libthecore liblua)

View File

@ -1,10 +1,6 @@
#include "stdafx.h"
#include "MarkManager.h"
#ifdef __WIN32__
#include <direct.h>
#endif
#define OLD_MARK_INDEX_FILENAME "guild_mark.idx"
#define OLD_MARK_DATA_FILENAME "guild_mark.tga"
@ -31,18 +27,10 @@ static Pixel * LoadOldGuildMarkImageFile()
bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
{
// 폴더 생성
#ifndef __WIN32__
mkdir("mark", S_IRWXU);
#else
_mkdir("mark");
#endif
// 인덱스 파일이 있나?
#ifndef __WIN32__
if (0 != access(OLD_MARK_INDEX_FILENAME, F_OK))
#else
if (0 != _access(OLD_MARK_INDEX_FILENAME, 0))
#endif
return true;
// 인덱스 파일 열기
@ -120,13 +108,8 @@ bool GuildMarkConvert(const std::vector<DWORD> & vecGuildID)
fclose(fp);
// 컨버트는 한번만 하면되므로 파일을 옮겨준다.
#ifndef __WIN32__
system("mv -f guild_mark.idx guild_mark.idx.removable");
system("mv -f guild_mark.tga guild_mark.tga.removable");
#else
system("move /Y guild_mark.idx guild_mark.idx.removable");
system("move /Y guild_mark.tga guild_mark.tga.removable");
#endif
SPDLOG_INFO("Guild Mark Converting Complete.");

File diff suppressed because it is too large Load Diff

View File

@ -1,218 +0,0 @@
#ifndef __INC_AUCTION_MANAGER_H
#define __INC_AUCTION_MANAGER_H
#include <libsql/include/AsyncSQL.h>
#include <common/auction_table.h>
#include <unordered_map>
#include <algorithm>
#define GRADE_LOW 30
#define GRADE_MID 60
#define GRADE_HIGH 90
template<>
class hash<std::pair <DWORD, DWORD> >
{ // hash functor
public:
typedef std::pair <DWORD, DWORD> _Kty;
size_t operator()(const _Kty& _Keyval) const
{ // hash _Keyval to size_t value by pseudorandomizing transform
ldiv_t _Qrem = ldiv((size_t)_Keyval.first + (size_t)_Keyval.second, 127773);
_Qrem.rem = 16807 * _Qrem.rem - 2836 * _Qrem.quot;
if (_Qrem.rem < 0)
_Qrem.rem += 2147483647;
return ((size_t)_Qrem.rem);
}
};
bool CompareItemInfoByItemNameAC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByItemNameDC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByCategoryAC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByCategoryDC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByTimeAC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByTimeDC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByCharNameAC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByCharNameDC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByPriceAC (TAuctionItemInfo* i, TAuctionItemInfo* j);
bool CompareItemInfoByPriceDC (TAuctionItemInfo* i, TAuctionItemInfo* j);
class AuctionBoard
{
public:
AuctionBoard() {}
~AuctionBoard() {}
TAuctionItemInfo* GetItemInfo (DWORD key);
bool DeleteItemInfo (DWORD key);
bool InsertItemInfo (TAuctionItemInfo* item_info);
bool UpdateItemInfo (TAuctionItemInfo* item_info);
private:
typedef std::unordered_map <DWORD, TAuctionItemInfo*> TItemInfoMap;
TItemInfoMap item_map;
typedef std::map <DWORD, TAuctionItemInfo*> TItemMap;
typedef std::unordered_map <DWORD, TItemMap*> TPCMap;
TPCMap offer_map;
// sorting을 위한 members
public:
typedef std::vector <TAuctionItemInfo*> TItemInfoVec;
private:
typedef std::map <std::string, TItemInfoVec*> SortByItemName;
SortByItemName item_name_map;
void Sort(TItemInfoVec& vec, BYTE order);
public:
void SortedItemInfos (TItemInfoVec& vec, BYTE grade, BYTE category, int start_idx, BYTE size, BYTE order[5]);
// 나의 경매장을 위한 함수.
void YourItemInfoList (TItemInfoVec& vec, DWORD player_id, int start_idx, BYTE size);
};
class SaleBoard
{
private:
typedef std::unordered_map <DWORD, TSaleItemInfo*> TItemInfoMap;
TItemInfoMap item_map;
typedef std::map <DWORD, TSaleItemInfo*> TItemMap;
typedef std::unordered_map <DWORD, TItemMap*> TPCMap;
TPCMap wisher_map;
TPCMap seller_map;
bool DeleteFromPCMap (TPCMap& pc_map, DWORD player_id, DWORD item_id);
bool InsertInPCMap (TPCMap& pc_map, DWORD player_id, TSaleItemInfo* item_info);
public:
SaleBoard() {}
~SaleBoard() {}
typedef std::vector <TSaleItemInfo*> TItemInfoVec;
void WisherItemInfoList (TItemInfoVec& vec, DWORD wisher_id, int start_idx, BYTE size);
TSaleItemInfo* GetItemInfo (DWORD key);
bool DeleteItemInfo (DWORD key);
bool InsertItemInfo (TSaleItemInfo* item_info);
};
class WishBoard
{
private:
typedef std::map <DWORD, TWishItemInfo*> TItemMap;
typedef std::unordered_map <DWORD, TItemMap*> TPCMap;
TPCMap wisher_map;
public:
typedef TWishItemInfo ItemInfo;
WishBoard() {}
~WishBoard() {}
TWishItemInfo* GetItemInfo (DWORD wisher_id, DWORD item_num);
bool DeleteItemInfo (DWORD wisher_id, DWORD item_num);
bool InsertItemInfo (TWishItemInfo* item_info);
};
class MyBidBoard
{
private:
typedef std::pair <int, bool> BidInfo;
typedef std::map <DWORD, BidInfo > TItemMap;
typedef std::unordered_map <DWORD, TItemMap*> TMyBidBoard;
// bidder_id가 key
TMyBidBoard pc_map;
public:
MyBidBoard() {}
~MyBidBoard() {}
typedef std::vector <DWORD> TItemVec;
void YourBidInfo (TItemVec& vec, DWORD bidder_id, int start_idx, int size);
BidInfo GetMoney (DWORD player_id, DWORD item_id);
bool Delete (DWORD player_id, DWORD item_id);
// 이미 있으면 덮어 씌운다.
void Insert (DWORD player_id, DWORD item_id, int money);
void Lock (DWORD player_id, DWORD item_id);
void UnLock (DWORD player_id, DWORD item_id);
};
class AuctionManager : public singleton <AuctionManager>
{
private :
typedef std::unordered_map<DWORD, LPITEM> TItemMap;
TItemMap auction_item_map;
// auction에 등록된 정보 중 가격, 등등 아이템 테이블에 포함되지 않는 정보들을 관리하는 것들
AuctionBoard Auction;
SaleBoard Sale;
WishBoard Wish;
MyBidBoard MyBid;
public:
bool InsertItem (LPITEM item);
bool InsertItem (TPlayerItem* player_item);
LPITEM GetInventoryItem (DWORD item_id);
bool DeleteItem (DWORD item_id);
bool InsertAuctionItemInfo (TAuctionItemInfo* item_info);
TAuctionItemInfo* GetAuctionItemInfo (DWORD item_id)
{
return Auction.GetItemInfo (item_id);
}
bool InsertSaleItemInfo (TSaleItemInfo* item_info);
TSaleItemInfo* GetSaleItemInfo (DWORD item_id)
{
return Sale.GetItemInfo (item_id);
}
bool InsertWishItemInfo (TWishItemInfo* item_info);
TWishItemInfo* GetWishItemInfo (DWORD wisher_id, DWORD item_id)
{
return Wish.GetItemInfo (wisher_id, item_id);
}
void YourBidItemInfoList (AuctionBoard::TItemInfoVec& vec, DWORD bidder_id, int start_idx, int size);
void Boot (const char* &pdata, WORD size);
void get_auction_list (LPCHARACTER ch, int start_idx, int size, int cond);
void get_my_auction_list (LPCHARACTER ch, int start_idx, int size);
void get_my_purchase_list (LPCHARACTER ch, int start_idx, int size);
void enroll_auction (LPCHARACTER ch, LPITEM item, BYTE empire, int bidPrice, int immidiatePurchasePrice);
void recv_result_auction (DWORD commander_id, TPacketDGResultAuction* cmd_result);
void bid (LPCHARACTER ch, DWORD item_id, int price);
void immediate_purchase (LPCHARACTER ch, DWORD item_id);
void enroll_sale (LPCHARACTER ch, LPITEM item, DWORD wisher_id, int salePrice);
void enroll_wish (LPCHARACTER ch, DWORD item_num, BYTE empire, int wishPrice);
void get_auctioned_item (LPCHARACTER ch, DWORD item_id, DWORD item_num);
void buy_sold_item (LPCHARACTER ch, DWORD item_id);
void cancel_auction (LPCHARACTER ch, DWORD item_id);
void cancel_wish (LPCHARACTER ch, DWORD item_num);
void cancel_sale (LPCHARACTER ch, DWORD item_id);
void rebid (LPCHARACTER ch, DWORD item_id, int price);
void bid_cancel (LPCHARACTER ch, DWORD item_id);
/*
void close_auction (LPCHARACTER ch);*/
};
#endif

View File

@ -1,5 +0,0 @@
typedef struct packet_auction_simple_item_info
{
BYTE header;
BYTE size;
} TPacketGCAuctionItemSimpleInfo;

View File

@ -112,6 +112,9 @@ int CHARACTER::ChangeEmpire(BYTE empire)
// 5. 제국 변경 이력을 추가한다.
SetChangeEmpireCount();
SetEmpire(empire);
UpdatePacket();
return 999;
}
}

View File

@ -44,10 +44,6 @@
#include "buff_on_attributes.h"
#include "belt_inventory_helper.h"
//auction_temp
#ifdef __AUCTION__
#include "auction_manager.h"
#endif
const int ITEM_BROKEN_METIN_VNUM = 28960;
// CHANGE_ITEM_ATTRIBUTES

View File

@ -229,27 +229,6 @@ ACMD(do_click_mall);
ACMD(do_ride);
ACMD(do_get_item_id_list);
ACMD(do_set_socket);
#ifdef __AUCTION__
// temp_auction 임시
ACMD(do_get_auction_list);
ACMD (do_get_my_auction_list);
ACMD (do_get_my_purchase_list);
ACMD(do_get_item_id_list);
ACMD(do_enroll_auction);
ACMD (do_auction_bid);
ACMD (do_auction_impur);
ACMD (do_enroll_wish);
ACMD (do_enroll_sale);
ACMD (do_get_auctioned_item);
ACMD (do_buy_sold_item);
ACMD (do_cancel_auction);
ACMD (do_cancel_wish);
ACMD (do_cancel_sale);
ACMD (do_rebid);
ACMD (do_bid_cancel);
#endif
// 코스츔 상태보기 및 벗기
ACMD(do_costume);
ACMD(do_set_stat);
@ -534,27 +513,7 @@ struct command_info cmd_info[] =
{ "item_id_list", do_get_item_id_list, 0, POS_DEAD, GM_LOW_WIZARD },
{ "set_socket", do_set_socket, 0, POS_DEAD, GM_LOW_WIZARD },
#ifdef __AUCTION__
// auction 임시
{ "auction_list", do_get_auction_list, 0, POS_DEAD, GM_PLAYER },
{ "my_auction_list", do_get_my_auction_list, 0, POS_DEAD, GM_PLAYER },
{ "my_purchase_list", do_get_my_purchase_list, 0, POS_DEAD, GM_PLAYER },
{ "enroll_auction", do_enroll_auction, 0, POS_DEAD, GM_PLAYER },
{ "bid", do_auction_bid, 0, POS_DEAD, GM_PLAYER },
{ "impur", do_auction_impur, 0, POS_DEAD, GM_PLAYER },
{ "enroll_wish", do_enroll_wish, 0, POS_DEAD, GM_PLAYER },
{ "enroll_sale", do_enroll_sale, 0, POS_DEAD, GM_PLAYER },
{ "get_auctioned_item", do_get_auctioned_item, 0, POS_DEAD, GM_PLAYER },
{ "buy_sold_item", do_buy_sold_item, 0, POS_DEAD, GM_PLAYER },
{ "cancel_auction", do_cancel_auction, 0, POS_DEAD, GM_PLAYER },
{ "cancel_wish", do_cancel_wish, 0, POS_DEAD, GM_PLAYER },
{ "cancel_sale", do_cancel_sale, 0, POS_DEAD, GM_PLAYER },
{ "rebid", do_rebid, 0, POS_DEAD, GM_PLAYER },
{ "bid_cancel", do_bid_cancel, 0, POS_DEAD, GM_PLAYER },
#endif
{ "costume", do_costume, 0, POS_DEAD, GM_PLAYER },
{ "tcon", do_set_stat, POINT_HT, POS_DEAD, GM_LOW_WIZARD },

View File

@ -33,9 +33,6 @@
#include <cryptopp/sha.h>
#include <cryptopp/hex.h>
#include <cryptopp/filters.h>
#ifdef __AUCTION__
#include "auction_manager.h"
#endif
extern int g_server_id;
@ -2377,186 +2374,3 @@ ACMD(do_ride)
// 타거나 내릴 수 없을때
ch->ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Please call your Horse first."));
}
#ifdef __AUCTION__
// temp_auction
ACMD(do_get_item_id_list)
{
for (int i = 0; i < INVENTORY_MAX_NUM; i++)
{
LPITEM item = ch->GetInventoryItem(i);
if (item != NULL)
ch->ChatPacket(CHAT_TYPE_INFO, "name : %s id : %d", item->GetProto()->szName, item->GetID());
}
}
// temp_auction
ACMD(do_enroll_auction)
{
char arg1[256];
char arg2[256];
char arg3[256];
char arg4[256];
two_arguments (two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3), arg4, sizeof(arg4));
DWORD item_id = strtoul(arg1, NULL, 10);
BYTE empire = strtoul(arg2, NULL, 10);
int bidPrice = strtol(arg3, NULL, 10);
int immidiatePurchasePrice = strtol(arg4, NULL, 10);
LPITEM item = ITEM_MANAGER::instance().Find(item_id);
if (item == NULL)
return;
AuctionManager::instance().enroll_auction(ch, item, empire, bidPrice, immidiatePurchasePrice);
}
ACMD(do_enroll_wish)
{
char arg1[256];
char arg2[256];
char arg3[256];
one_argument (two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3));
DWORD item_num = strtoul(arg1, NULL, 10);
BYTE empire = strtoul(arg2, NULL, 10);
int wishPrice = strtol(arg3, NULL, 10);
AuctionManager::instance().enroll_wish(ch, item_num, empire, wishPrice);
}
ACMD(do_enroll_sale)
{
char arg1[256];
char arg2[256];
char arg3[256];
one_argument (two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2)), arg3, sizeof(arg3));
DWORD item_id = strtoul(arg1, NULL, 10);
DWORD wisher_id = strtoul(arg2, NULL, 10);
int salePrice = strtol(arg3, NULL, 10);
LPITEM item = ITEM_MANAGER::instance().Find(item_id);
if (item == NULL)
return;
AuctionManager::instance().enroll_sale(ch, item, wisher_id, salePrice);
}
// temp_auction
// packet으로 통신하게 하고, 이건 삭제해야한다.
ACMD(do_get_auction_list)
{
char arg1[256];
char arg2[256];
char arg3[256];
two_arguments (one_argument (argument, arg1, sizeof(arg1)), arg2, sizeof(arg2), arg3, sizeof(arg3));
AuctionManager::instance().get_auction_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10), strtoul(arg3, NULL, 10));
}
//
//ACMD(do_get_wish_list)
//{
// char arg1[256];
// char arg2[256];
// char arg3[256];
// two_arguments (one_argument (argument, arg1, sizeof(arg1)), arg2, sizeof(arg2), arg3, sizeof(arg3));
//
// AuctionManager::instance().get_wish_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10), strtoul(arg3, NULL, 10));
//}
ACMD (do_get_my_auction_list)
{
char arg1[256];
char arg2[256];
two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
AuctionManager::instance().get_my_auction_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
}
ACMD (do_get_my_purchase_list)
{
char arg1[256];
char arg2[256];
two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
AuctionManager::instance().get_my_purchase_list (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
}
ACMD (do_auction_bid)
{
char arg1[256];
char arg2[256];
two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
AuctionManager::instance().bid (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
}
ACMD (do_auction_impur)
{
char arg1[256];
one_argument (argument, arg1, sizeof(arg1));
AuctionManager::instance().immediate_purchase (ch, strtoul(arg1, NULL, 10));
}
ACMD (do_get_auctioned_item)
{
char arg1[256];
char arg2[256];
two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
AuctionManager::instance().get_auctioned_item (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
}
ACMD (do_buy_sold_item)
{
char arg1[256];
char arg2[256];
one_argument (argument, arg1, sizeof(arg1));
AuctionManager::instance().get_auctioned_item (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
}
ACMD (do_cancel_auction)
{
char arg1[256];
one_argument (argument, arg1, sizeof(arg1));
AuctionManager::instance().cancel_auction (ch, strtoul(arg1, NULL, 10));
}
ACMD (do_cancel_wish)
{
char arg1[256];
one_argument (argument, arg1, sizeof(arg1));
AuctionManager::instance().cancel_wish (ch, strtoul(arg1, NULL, 10));
}
ACMD (do_cancel_sale)
{
char arg1[256];
one_argument (argument, arg1, sizeof(arg1));
AuctionManager::instance().cancel_sale (ch, strtoul(arg1, NULL, 10));
}
ACMD (do_rebid)
{
char arg1[256];
char arg2[256];
two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
AuctionManager::instance().rebid (ch, strtoul(arg1, NULL, 10), strtoul(arg2, NULL, 10));
}
ACMD (do_bid_cancel)
{
char arg1[256];
char arg2[256];
two_arguments (argument, arg1, sizeof(arg1), arg2, sizeof(arg2));
AuctionManager::instance().bid_cancel (ch, strtoul(arg1, NULL, 10));
}
#endif

View File

@ -1,8 +1,6 @@
#include "stdafx.h"
#include <sstream>
#ifndef __WIN32__
#include <ifaddrs.h>
#endif
#include "constants.h"
#include "utils.h"
@ -47,9 +45,6 @@ DWORD g_dwTrafficProfileFlushCycle = 3600;
int test_server = 0;
int speed_server = 0;
#ifdef __AUCTION__
int auction_server = 0;
#endif
bool distribution_test_server = false;
bool china_event_server = false;
bool guild_mark_server = true;
@ -809,16 +804,7 @@ void config_init(const string& st_localeServiceName)
continue;
}
#ifdef __AUCTION__
TOKEN("auction_server")
{
printf("-----------------------------------------------\n");
printf("AUCTION_SERVER\n");
printf("-----------------------------------------------\n");
str_to_number(auction_server, value_string);
continue;
}
#endif
TOKEN("distribution_test_server")
{
str_to_number(distribution_test_server, value_string);

View File

@ -41,13 +41,7 @@
#include "DragonSoul.h"
#ifdef __AUCTION__
#include "auction_manager.h"
#endif
extern BYTE g_bAuthServer;
#ifdef __AUCTION__
extern int auction_server;
#endif
extern void gm_insert(const char * name, BYTE level);
extern BYTE gm_get_level(const char * name, const char * host, const char* account );
extern void gm_host_insert(const char * host);
@ -753,10 +747,7 @@ void CInputDB::Boot(const char* data)
for (WORD i = 0; i < size; ++i, ++kObj)
CManager::instance().LoadObject(kObj, true);
}
#ifdef __AUCTION__
// Auction
AuctionManager::instance().Boot(data);
#endif
set_global_time(*(time_t *) data);
data += sizeof(time_t);
@ -2246,12 +2237,6 @@ int CInputDB::Analyze(LPDESC d, BYTE bHeader, const char * c_pData)
case HEADER_DG_RESPOND_CHANNELSTATUS:
RespondChannelStatus(DESC_MANAGER::instance().FindByHandle(m_dwHandle), c_pData);
break;
#ifdef __AUCTION__
case HEADER_DG_AUCTION_RESULT:
if (auction_server)
AuctionManager::instance().recv_result_auction(m_dwHandle, (TPacketDGResultAuction*)c_pData);
break;
#endif
default:
return (-1);
}

View File

@ -1901,52 +1901,6 @@ bool CItem::OnAfterCreatedItem()
return true;
}
#ifdef __AUCTION__
// 경매장
// window를 경매장으로 한다.
bool CItem::MoveToAuction()
{
LPCHARACTER owner = GetOwner();
if (owner == NULL)
{
SPDLOG_ERROR("Item those owner is not exist cannot regist in auction");
return false;
}
if (GetWindow() == AUCTION)
{
SPDLOG_ERROR("Item is already in auction.");
}
SetWindow(AUCTION);
owner->SetItem(m_bCell, NULL);
Save();
ITEM_MANAGER::instance().FlushDelayedSave(this);
return true;
}
void CItem::CopyToRawData (TPlayerItem* new_item)
{
if (new_item != NULL)
return;
new_item->id = m_dwID;
new_item->window = m_bWindow;
new_item->pos = m_bCell;
new_item->count = m_dwCount;
new_item->vnum = GetVnum();
memcpy (new_item->alSockets, m_alSockets, sizeof (m_alSockets));
memcpy (new_item->aAttr, m_aAttr, sizeof (m_aAttr));
new_item->owner = m_pOwner->GetPlayerID();
}
#endif
bool CItem::IsDragonSoul()
{
return GetType() == ITEM_DS;

View File

@ -234,11 +234,6 @@ class CItem : public CEntity
void ClearMountAttributeAndAffect();
bool IsNewMountItem();
#ifdef __AUCTION__
// 경매장
bool MoveToAuction ();
void CopyToRawData (TPlayerItem* item);
#endif
// 독일에서 기존 캐시 아이템과 같지만, 교환 가능한 캐시 아이템을 만든다고 하여,
// 오리지널 아이템에, 교환 금지 플래그만 삭제한 새로운 아이템들을 새로운 아이템 대역에 할당하였다.
// 문제는 새로운 아이템도 오리지널 아이템과 같은 효과를 내야하는데,

View File

@ -123,11 +123,6 @@ void LogManager::HackLog(const char * c_pszHackName, LPCHARACTER ch)
}
}
void LogManager::HackCRCLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP, DWORD dwCRC)
{
Query("INSERT INTO hack_crc_log (time, login, name, ip, server, why, crc) VALUES(NOW(), '%s', '%s', '%s', '%s', '%s', %u)", c_pszLogin, c_pszName, c_pszIP, g_stHostname.c_str(), c_pszHackName, dwCRC);
}
void LogManager::GoldBarLog(DWORD dwPID, DWORD dwItemID, GOLDBAR_HOW eHow, const char* c_pszHint)
{
char szHow[32+1];
@ -294,34 +289,3 @@ void LogManager::DragonSlayLog(DWORD dwGuildID, DWORD dwDragonVnum, DWORD dwStar
get_table_postfix(),
dwGuildID, dwDragonVnum, dwStartTime, dwEndTime);
}
void LogManager::HackShieldLog(unsigned int ErrorCode, LPCHARACTER ch)
{
struct in_addr st_addr;
#ifndef __WIN32__
if (0 == inet_aton(ch->GetDesc()->GetHostName(), &st_addr))
#else
unsigned int in_address;
in_address = inet_addr(ch->GetDesc()->GetHostName());
st_addr.s_addr = in_address;
if (INADDR_NONE == in_address)
#endif
{
Query( "INSERT INTO hackshield_log(time, account_id, login, pid, name, reason, ip) "
"VALUES(NOW(), %u, '%s', %u, '%s', %u, 0)",
ch->GetDesc()->GetAccountTable().id, ch->GetDesc()->GetAccountTable().login,
ch->GetPlayerID(), ch->GetName(),
ErrorCode);
}
else
{
Query( "INSERT INTO hackshield_log(time, account_id, login, pid, name, reason, ip) "
"VALUES(NOW(), %u, '%s', %u, '%s', %u, inet_aton('%s'))",
ch->GetDesc()->GetAccountTable().id, ch->GetDesc()->GetAccountTable().login,
ch->GetPlayerID(), ch->GetName(),
ErrorCode,
ch->GetDesc()->GetHostName());
}
}

View File

@ -36,7 +36,6 @@ class LogManager : public singleton<LogManager>
void MoneyLog(BYTE type, DWORD vnum, int gold);
void HackLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP);
void HackLog(const char * c_pszHackName, LPCHARACTER ch);
void HackCRCLog(const char * c_pszHackName, const char * c_pszLogin, const char * c_pszName, const char * c_pszIP, DWORD dwCRC);
void GoldBarLog(DWORD dwPID, DWORD dwItemID, GOLDBAR_HOW eHow, const char * c_pszHint);
void CubeLog(DWORD dwPID, DWORD x, DWORD y, DWORD item_vnum, DWORD item_uid, int item_count, bool success);
void GMCommandLog(DWORD dwPID, const char * szName, const char * szIP, BYTE byChannel, const char * szCommand);
@ -50,7 +49,6 @@ class LogManager : public singleton<LogManager>
void QuestRewardLog(const char * c_pszQuestName, DWORD dwPID, DWORD dwLevel, int iValue1, int iValue2);
void DetailLoginLog(bool isLogin, LPCHARACTER ch);
void DragonSlayLog(DWORD dwGuildID, DWORD dwDragonVnum, DWORD dwStartTime, DWORD dwEndTime);
void HackShieldLog(unsigned int ErrorCode, LPCHARACTER ch);
private:
void Query(const char * c_pszFormat, ...);

View File

@ -56,33 +56,19 @@
#include "skill_power.h"
#include "SpeedServer.h"
#include "DragonSoul.h"
#ifndef __INTELLISENSE__
#include <version.h>
#else
#include <../../../common/version.h>
#endif
#include <event2/event.h>
#include <event2/listener.h>
#include <event2/dns.h>
#ifdef __AUCTION__
#include "auction_manager.h"
#endif
#ifdef USE_STACKTRACE
#include <execinfo.h>
#endif
//extern const char * _malloc_options;
#if defined(__FreeBSD__) && defined(DEBUG_ALLOC)
extern void (*_malloc_message)(const char* p1, const char* p2, const char* p3, const char* p4);
// FreeBSD _malloc_message replacement
void WriteMallocMessage(const char* p1, const char* p2, const char* p3, const char* p4) {
FILE* fp = ::fopen(DBGALLOC_LOG_FILENAME, "a");
if (fp == NULL) {
return;
}
::fprintf(fp, "%s %s %s %s\n", p1, p2, p3, p4);
::fclose(fp);
}
#endif
// TRAFFIC_PROFILER
static const DWORD TRAFFIC_PROFILE_FLUSH_CYCLE = 3600; ///< TrafficProfiler 의 Flush cycle. 1시간 간격
// END_OF_TRAFFIC_PROFILER
@ -127,9 +113,6 @@ int g_shutdown_core_pulse;
bool g_bShutdown = false;
extern int speed_server;
#ifdef __AUCTION__
extern int auction_server;
#endif
extern void CancelReloadSpamEvent();
void ContinueOnFatalError()
@ -144,7 +127,8 @@ void ContinueOnFatalError()
std::ostringstream oss;
oss << std::endl;
for (std::size_t i = 0; i < size; ++i) {
for (std::size_t i = 0; i < size; ++i)
{
oss << " Stack> " << symbols[i] << std::endl;
}
@ -312,7 +296,8 @@ void heartbeat(LPHEART ht, int pulse)
}
}
static void CleanUpForEarlyExit() {
static void CleanUpForEarlyExit()
{
CancelReloadSpamEvent();
}
@ -375,18 +360,16 @@ int main(int argc, char **argv)
CSpeedServerManager SSManager;
DSManager dsManager;
#ifdef __AUCTION__
AuctionManager auctionManager;
#endif
if (!start(argc, argv)) {
if (!start(argc, argv))
{
CleanUpForEarlyExit();
return 0;
}
quest::CQuestManager quest_manager;
if (!quest_manager.Initialize()) {
if (!quest_manager.Initialize())
{
CleanUpForEarlyExit();
return 0;
}
@ -405,7 +388,8 @@ int main(int argc, char **argv)
if (g_bTrafficProfileOn)
TrafficProfiler::instance().Initialize(TRAFFIC_PROFILE_FLUSH_CYCLE, "ProfileLog");
while (idle());
while (idle())
;
SPDLOG_INFO("<shutdown> Starting...");
g_bShutdown = true;
@ -489,11 +473,6 @@ int start(int argc, char **argv)
{
std::string st_localeServiceName;
//_malloc_options = "A";
#if defined(__FreeBSD__) && defined(DEBUG_ALLOC)
_malloc_message = WriteMallocMessage;
#endif
int ch;
while ((ch = getopt(argc, argv, "n:p:erl:tI:")) != -1)
{
@ -585,24 +564,28 @@ int start(int argc, char **argv)
// Initialize the network stack
// Check if the public and internal IP addresses were configured
if (g_szInternalIP.empty()) {
if (g_szInternalIP.empty())
{
SPDLOG_CRITICAL("Internal IP address could not be automatically detected. Manually set the IP and try again.");
exit(EXIT_FAILURE);
}
if (g_szPublicIP.empty()) {
if (g_szPublicIP.empty())
{
SPDLOG_CRITICAL("Public IP address could not be automatically detected. Manually set the IP and try again.");
exit(EXIT_FAILURE);
}
// Create a new libevent base and listen for new connections
ev_base = event_base_new();
if (!ev_base) {
if (!ev_base)
{
SPDLOG_CRITICAL("Libevent base initialization FAILED!");
exit(EXIT_FAILURE);
}
dns_base = evdns_base_new(ev_base, 1);
if (!dns_base) {
if (!dns_base)
{
SPDLOG_CRITICAL("Libevent DNS base initialization FAILED!");
exit(EXIT_FAILURE);
}
@ -618,9 +601,9 @@ int start(int argc, char **argv)
ev_base,
AcceptTCPConnection, nullptr,
LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE, -1,
(const sockaddr*)&sin, sizeof(sin)
);
if (!tcp_listener) {
(const sockaddr *)&sin, sizeof(sin));
if (!tcp_listener)
{
SPDLOG_CRITICAL("TCP listener initialization FAILED!");
exit(EXIT_FAILURE);
}
@ -636,9 +619,9 @@ int start(int argc, char **argv)
ev_base,
AcceptP2PConnection, nullptr,
LEV_OPT_CLOSE_ON_FREE | LEV_OPT_REUSEABLE, -1,
(const sockaddr*)&sin, sizeof(sin)
);
if (!p2p_listener) {
(const sockaddr *)&sin, sizeof(sin));
if (!p2p_listener)
{
SPDLOG_CRITICAL("P2P listener initialization FAILED!");
exit(EXIT_FAILURE);
}
@ -647,7 +630,8 @@ int start(int argc, char **argv)
// Create client connections
db_clientdesc = DESC_MANAGER::instance().CreateConnectionDesc(ev_base, dns_base, db_addr, db_port, PHASE_DBCLIENT, true);
if (!g_bAuthServer) {
if (!g_bAuthServer)
{
db_clientdesc->UpdateChannelStatus(0, true);
}
@ -659,7 +643,6 @@ int start(int argc, char **argv)
g_pkAuthMasterDesc = DESC_MANAGER::instance().CreateConnectionDesc(ev_base, dns_base, g_stAuthMasterIP.c_str(), g_wAuthMasterPort, PHASE_P2P, true);
P2P_MANAGER::instance().RegisterConnector(g_pkAuthMasterDesc);
g_pkAuthMasterDesc->SetP2P(g_wAuthMasterPort, g_bChannel);
}
else
{
@ -693,22 +676,26 @@ void destroy()
regen_free();
SPDLOG_INFO("<shutdown> Closing network stack...");
if (tcp_listener) {
if (tcp_listener)
{
evconnlistener_free(tcp_listener);
tcp_listener = nullptr;
}
if (p2p_listener) {
if (p2p_listener)
{
evconnlistener_free(p2p_listener);
p2p_listener = nullptr;
}
if (dns_base) {
if (dns_base)
{
evdns_base_free(dns_base, 0);
dns_base = nullptr;
}
if (ev_base) {
if (ev_base)
{
event_base_free(ev_base);
ev_base = nullptr;
}
@ -741,7 +728,8 @@ int idle()
DWORD t;
while (passed_pulses--) {
while (passed_pulses--)
{
heartbeat(thecore_heart, ++thecore_heart->pulse);
// To reduce the possibility of abort() in checkpointing
@ -754,7 +742,8 @@ int idle()
s_dwProfiler[PROF_CHR_UPDATE] += (get_dword_time() - t);
t = get_dword_time();
if (!io_loop(ev_base)) return 0;
if (!io_loop(ev_base))
return 0;
s_dwProfiler[PROF_IO] += (get_dword_time() - t);
gettimeofday(&now, (struct timezone *)0);
@ -784,23 +773,11 @@ int idle()
memset(&s_dwProfiler[0], 0, sizeof(s_dwProfiler));
}
#ifdef __WIN32__
if (_kbhit()) {
int c = _getch();
switch (c) {
case 0x1b: // Esc
return 0; // shutdown
break;
default:
break;
}
}
#endif
return 1;
}
static void AcceptError(evconnlistener *listener, void *ctx) {
static void AcceptError(evconnlistener *listener, void *ctx)
{
struct event_base *base = evconnlistener_get_base(listener);
int err = EVUTIL_SOCKET_ERROR();
SPDLOG_CRITICAL("Got an error {} ({}) on the listener. Shutting down.", err, evutil_socket_error_to_string(err));
@ -834,4 +811,3 @@ int io_loop(event_base * base)
return 1;
}

View File

@ -1630,7 +1630,6 @@ namespace quest
GetCurrentCharacterPtr()->ChatPacket(CHAT_TYPE_PARTY, "LUA_ERROR: quest %s.%s %s", GetCurrentQuestName().c_str(), state_name, event_index_name.c_str() );
}
#ifndef __WIN32__
void CQuestManager::QuestError(const char* func, int line, const char* fmt, ...)
{
char szMsg[4096];
@ -1651,28 +1650,6 @@ namespace quest
}
}
}
#else
void CQuestManager::QuestError(const char* func, int line, const char* fmt, ...)
{
char szMsg[4096];
va_list args;
va_start(args, fmt);
vsnprintf(szMsg, sizeof(szMsg), fmt, args);
va_end(args);
_SPDLOG_ERROR(func, line, "%s", szMsg);
if (test_server)
{
LPCHARACTER ch = GetCurrentCharacterPtr();
if (ch)
{
ch->ChatPacket(CHAT_TYPE_PARTY, "error occurred on [%s:%d]", func,line);
ch->ChatPacket(CHAT_TYPE_PARTY, "%s", szMsg);
}
}
}
#endif
void CQuestManager::AddServerTimer(const std::string& name, DWORD arg, LPEVENT event)
{

View File

@ -5,11 +5,7 @@
#include "questnpc.h"
#ifndef __WIN32__
#define quest_err(fmt, args...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, ##args)
#else
#define quest_err(fmt, ...) quest::CQuestManager::instance().QuestError(__FUNCTION__, __LINE__, fmt, __VA_ARGS__)
#endif
class ITEM;
class CHARACTER;
@ -173,12 +169,7 @@ namespace quest
void ClearError() { m_bError = false; }
bool IsError() { return m_bError; }
void WriteRunningStateToSyserr();
#ifndef __WIN32__
void QuestError(const char* func, int line, const char* fmt, ...);
#else
//void QuestError(const char* fmt, ...);
void QuestError(const char* func, int line, const char* fmt, ...);
#endif
void RegisterNPCVnum(DWORD dwVnum);

View File

@ -38,12 +38,10 @@ inline int DISTANCE_APPROX(int dx, int dy)
( min << 7 ) - ( min << 5 ) + ( min << 3 ) - ( min << 1 )) >> 8 );
}
#ifndef __WIN32__
inline WORD MAKEWORD(BYTE a, BYTE b)
{
return static_cast<WORD>(a) | (static_cast<WORD>(b) << 8);
}
#endif
extern void set_global_time(time_t t);
extern time_t get_global_time();

View File

@ -1,8 +1,12 @@
#include <fmt/core.h>
#ifndef __INTELLISENSE__
#include <version.h>
#else
#include <../../../common/version.h>
#endif
void WriteVersion() {
void WriteVersion()
{
fmt::println("Metin2 Game Server version {} (rev. {}, date: {})", __COMMIT_TAG__, __REVISION__, __COMMIT_DATE__);
fmt::println("OS: {}, target arch: {}, compiler: {}", __OS_NAME__, __CPU_TARGET__, __COMPILER__);
}

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(libgame CXX)
@ -14,6 +14,12 @@ include_directories("include")
# Create shared library
add_library(${PROJECT_NAME} STATIC ${SOURCES})
# Set the default log level based on the build type
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "This is a debug build. Log level will be set to 'trace' for target '${PROJECT_NAME}'.")
target_compile_definitions(${PROJECT_NAME} PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
endif()
# Find and link dependencies
# spdlog

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(liblua CXX)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(libpoly CXX)

View File

@ -9,11 +9,7 @@ using namespace std;
double _random()
{
#ifndef __WIN32__
return random() / (2147483648.0);
#else
return rand() / (2147483648.0);
#endif
}
int CPoly::my_irandom(double start, double end)

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(libsql CXX)
@ -11,14 +11,21 @@ file(GLOB SOURCES
# Include header files
include_directories("include")
# Create shared library
# Create static library
add_library(${PROJECT_NAME} STATIC ${SOURCES})
# Set the default log level based on the build type
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "This is a debug build. Log level will be set to 'trace' for target '${PROJECT_NAME}'.")
target_compile_definitions(${PROJECT_NAME} PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
endif()
# Find and link dependencies
# MariaDB
find_package(unofficial-libmariadb REQUIRED)
target_link_libraries(${PROJECT_NAME} PUBLIC unofficial::libmariadb)
# PostgreSQL with libpqxx (stable vcpkg package)
find_package(PostgreSQL REQUIRED)
find_package(libpqxx CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE libpqxx::pqxx)
# spdlog
find_package(spdlog CONFIG REQUIRED)

View File

@ -8,9 +8,8 @@
#include <queue>
#include <vector>
#include <map>
#include <mysql/mysql.h>
#include <mysql/errmsg.h>
#include <mysql/mysqld_error.h>
#include <iostream>
#include <pqxx/pqxx>
#include "CSemaphore.h"
@ -182,15 +181,9 @@ class CAsyncSQL
volatile bool m_bEnd;
#ifndef __WIN32__
pthread_t m_hThread;
pthread_mutex_t * m_mtxQuery;
pthread_mutex_t * m_mtxResult;
#else
HANDLE m_hThread;
CRITICAL_SECTION* m_mtxQuery;
CRITICAL_SECTION* m_mtxResult;
#endif
CSemaphore m_sem;

View File

@ -1,41 +0,0 @@
#ifndef __INC_METIN_II_LIBSQL_STATEMENT_H__
#define __INC_METIN_II_LIBSQL_STATEMENT_H__
#include "CAsyncSQL.h"
#include <string>
#include <vector>
class CStmt
{
public:
CStmt();
virtual ~CStmt();
bool Prepare(CAsyncSQL * sql, const char * c_pszQuery);
bool BindParam(enum_field_types type, void * p, int iMaxLen=0);
bool BindResult(enum_field_types type, void * p, int iMaxLen=0);
int Execute();
bool Fetch();
void Error(const char * c_pszMsg);
public:
int iRows;
private:
void Destroy();
MYSQL_STMT * m_pkStmt;
std::string m_stQuery;
std::vector<MYSQL_BIND> m_vec_param;
unsigned int m_uiParamCount;
uint64_t * m_puiParamLen;
std::vector<MYSQL_BIND> m_vec_result;
unsigned int m_uiResultCount;
};
#endif

View File

@ -0,0 +1,26 @@
#pragma once
#include <pqxx/pqxx>
#include <string>
#include <functional>
using AsyncQueryCallback = std::function<void(const pqxx::result &, const std::string &error)>;
class PgAsyncQuery
{
public:
int id;
std::string query;
pqxx::params parameters;
bool hasCallback;
AsyncQueryCallback callback;
// Fire and Forget AsyncQuery
PgAsyncQuery(int msgId, const std::string &sql, const pqxx::params &params = pqxx::params{})
: id(msgId), query(sql), parameters(params), hasCallback(false) {}
// Callback AsyncQuery
PgAsyncQuery(int msgId, const std::string &sql, const pqxx::params &params = pqxx::params{}, AsyncQueryCallback cb)
: id(msgId), query(sql), parameters(params), hasCallback(true), callback(std::move(cb)) {}
};

View File

@ -0,0 +1,175 @@
#pragma once
#include <pqxx/pqxx>
#include <mutex>
#include <condition_variable>
#include <queue>
#include <memory>
#include <string>
#include <vector>
#include <chrono>
#include <future>
#include <thread>
#include <atomic>
#include <map>
class PgConnectionPool
{
public:
PgConnectionPool(const char *db_address, int db_port, const char *db_name,
const char *user, const char *pwd,
size_t pool_size = 10,
std::chrono::seconds idle_timeout = std::chrono::seconds(60))
: db_address_(db_address), db_port_(db_port), db_name_(db_name),
user_(user), pwd_(pwd), max_pool_size_(pool_size),
idle_timeout_(idle_timeout), stop_cleaner_(false)
{
for (size_t i = 0; i < max_pool_size_; ++i)
{
auto conn = createConnection();
pool_.push({std::move(conn), std::chrono::steady_clock::now()});
}
// Start cleanup thread
cleaner_thread_ = std::thread(&PgConnectionPool::cleanupIdleConnections, this);
}
~PgConnectionPool()
{
stop_cleaner_ = true;
cond_.notify_all();
if (cleaner_thread_.joinable())
{
cleaner_thread_.join();
}
std::lock_guard<std::mutex> lock(mutex_);
while (!pool_.empty())
{
auto &entry = pool_.front();
if (entry.conn && entry.conn->is_open())
{
entry.conn->close();
}
pool_.pop();
}
}
// Asynchronous acquire
std::future<std::shared_ptr<pqxx::connection>> acquireAsync()
{
return std::async(std::launch::async, [this]()
{ return this->acquire(); });
}
// Blocking acquire
std::shared_ptr<pqxx::connection> acquire()
{
std::unique_lock<std::mutex> lock(mutex_);
cond_.wait(lock, [this]()
{ return !pool_.empty(); });
ConnectionEntry entry = std::move(pool_.front());
pool_.pop();
if (!entry.conn || !entry.conn->is_open())
{
entry.conn = createConnection(); // Reconnect if needed
}
return std::shared_ptr<pqxx::connection>(
entry.conn.release(),
[this](pqxx::connection *p)
{
std::lock_guard<std::mutex> lock(mutex_);
auto now = std::chrono::steady_clock::now();
if (p->is_open())
{
pool_.push({std::unique_ptr<pqxx::connection>(p), now});
}
else
{
delete p;
pool_.push({createConnection(), now});
}
cond_.notify_one();
});
}
private:
struct ConnectionEntry
{
std::unique_ptr<pqxx::connection> conn;
std::chrono::steady_clock::time_point last_used;
};
std::unique_ptr<pqxx::connection> createConnection()
{
std::string conn_str = "host=" + db_address_ +
" port=" + std::to_string(db_port_) +
" dbname=" + db_name_ +
" user=" + user_ +
" password=" + pwd_;
try
{
auto conn = std::make_unique<pqxx::connection>(conn_str);
if (!conn->is_open())
{
throw std::runtime_error("Failed to open DB connection");
}
return conn;
}
catch (const std::exception &e)
{
throw std::runtime_error(std::string("Connection error: ") + e.what());
}
}
void cleanupIdleConnections()
{
while (!stop_cleaner_)
{
std::this_thread::sleep_for(idle_timeout_ / 2); // Clean more frequently
std::lock_guard<std::mutex> lock(mutex_);
size_t current_size = pool_.size();
std::queue<ConnectionEntry> temp;
auto now = std::chrono::steady_clock::now();
while (!pool_.empty())
{
auto entry = std::move(pool_.front());
pool_.pop();
if (std::chrono::duration_cast<std::chrono::seconds>(
now - entry.last_used) > idle_timeout_)
{
if (entry.conn && entry.conn->is_open())
{
entry.conn->close();
}
}
else
{
temp.push(std::move(entry));
}
}
pool_ = std::move(temp);
cond_.notify_all();
}
}
std::string db_address_, db_name_, user_, pwd_;
int db_port_;
size_t max_pool_size_;
std::chrono::seconds idle_timeout_;
std::queue<ConnectionEntry> pool_;
std::mutex mutex_;
std::condition_variable cond_;
std::thread cleaner_thread_;
std::atomic<bool> stop_cleaner_;
};

View File

@ -1,8 +1,6 @@
#ifndef __INC_METIN_II_TELLWAIT_H__
#define __INC_METIN_II_TELLWAIT_H__
#ifndef __WIN32__
extern void TELL_WAIT();
extern void WAIT_CHILD();
@ -12,5 +10,3 @@ extern void WAIT_PARENT();
extern void TELL_PARENT(pid_t pid);
#endif
#endif

View File

@ -1,6 +1,4 @@
#ifndef __WIN32__
#include <sys/time.h>
#endif
#include <cstdlib>
#include <cstring>
@ -8,22 +6,13 @@
#include "CAsyncSQL.h"
// TODO: Consider providing platform-independent mutex class.
#ifndef __WIN32__
#define MUTEX_LOCK(mtx) pthread_mutex_lock(mtx)
#define MUTEX_UNLOCK(mtx) pthread_mutex_unlock(mtx)
#else
#define MUTEX_LOCK(mtx) ::EnterCriticalSection(mtx)
#define MUTEX_UNLOCK(mtx) ::LeaveCriticalSection(mtx)
#endif
CAsyncSQL::CAsyncSQL()
: m_stHost(""), m_stUser(""), m_stPassword(""), m_stDB(""), m_stLocale(""),
m_iMsgCount(0), m_bEnd(false),
#ifndef __WIN32__
m_hThread(0),
#else
m_hThread(INVALID_HANDLE_VALUE),
#endif
m_mtxQuery(NULL), m_mtxResult(NULL),
m_iQueryFinished(0), m_ulThreadID(0), m_bConnected(false), m_iCopiedQuery(0),
m_iPort(0)
@ -51,32 +40,20 @@ void CAsyncSQL::Destroy()
if (m_mtxQuery)
{
#ifndef __WIN32__
pthread_mutex_destroy(m_mtxQuery);
#else
::DeleteCriticalSection(m_mtxQuery);
#endif
delete m_mtxQuery;
m_mtxQuery = NULL;
}
if (m_mtxResult)
{
#ifndef __WIN32__
pthread_mutex_destroy(m_mtxResult);
#else
::DeleteCriticalSection(m_mtxResult);
#endif
delete m_mtxResult;
m_mtxQuery = NULL;
}
}
#ifndef __WIN32__
void * AsyncSQLThread(void * arg)
#else
unsigned int __stdcall AsyncSQLThread(void* arg)
#endif
{
CAsyncSQL * pSQL = ((CAsyncSQL *) arg);
@ -198,7 +175,6 @@ bool CAsyncSQL::Setup(const char * c_pszHost, const char * c_pszUser, const char
return false;
}
*/
#ifndef __WIN32__
m_mtxQuery = new pthread_mutex_t;
m_mtxResult = new pthread_mutex_t;
@ -215,19 +191,6 @@ bool CAsyncSQL::Setup(const char * c_pszHost, const char * c_pszUser, const char
}
pthread_create(&m_hThread, NULL, AsyncSQLThread, this);
#else
m_mtxQuery = new CRITICAL_SECTION;
m_mtxResult = new CRITICAL_SECTION;
::InitializeCriticalSection(m_mtxQuery);
::InitializeCriticalSection(m_mtxResult);
m_hThread = (HANDLE)::_beginthreadex(NULL, 0, AsyncSQLThread, this, 0, NULL);
if (m_hThread == INVALID_HANDLE_VALUE) {
perror("CAsyncSQL::Setup");
return false;
}
#endif
return true;
}
@ -240,18 +203,11 @@ void CAsyncSQL::Quit()
m_bEnd = true;
m_sem.Release();
#ifndef __WIN32__
if (m_hThread)
{
pthread_join(m_hThread, NULL);
m_hThread = NULL;
}
#else
if (m_hThread != INVALID_HANDLE_VALUE) {
::WaitForSingleObject(m_hThread, INFINITE);
m_hThread = INVALID_HANDLE_VALUE;
}
#endif
}
SQLMsg * CAsyncSQL::DirectQuery(const char * c_pszQuery)

View File

@ -1,8 +1,6 @@
#include "stdafx.h"
#include "CSemaphore.h"
#ifndef __WIN32__
CSemaphore::CSemaphore() : m_hSem(NULL)
{
Initialize();
@ -73,70 +71,3 @@ int CSemaphore::Release(int count)
return true;
}
#else
CSemaphore::CSemaphore() : m_hSem(NULL)
{
Initialize();
}
CSemaphore::~CSemaphore()
{
Destroy();
}
int CSemaphore::Initialize()
{
Clear();
m_hSem = ::CreateSemaphore(NULL, 0, 32, NULL);
if (m_hSem == NULL) {
return false;
}
return true;
}
void CSemaphore::Destroy()
{
Clear();
}
void CSemaphore::Clear()
{
if (m_hSem == NULL) {
return;
}
::CloseHandle(m_hSem);
m_hSem = NULL;
}
int CSemaphore::Wait()
{
if (!m_hSem)
return true;
DWORD dwWaitResult = ::WaitForSingleObject(m_hSem, INFINITE);
switch (dwWaitResult) {
case WAIT_OBJECT_0:
return true;
default:
break;
}
return false;
}
int CSemaphore::Release(int count)
{
if (!m_hSem)
return false;
::ReleaseSemaphore(m_hSem, count, NULL);
return true;
}
#endif

View File

@ -1,159 +0,0 @@
#include "CStatement.h"
#include <cstdlib>
#include <cstring>
CStmt::CStmt()
{
m_pkStmt = NULL;
m_uiParamCount = 0;
m_uiResultCount = 0;
iRows = 0;
m_puiParamLen = NULL;
}
CStmt::~CStmt()
{
Destroy();
}
void CStmt::Destroy()
{
if (m_pkStmt)
{
mysql_stmt_close(m_pkStmt);
m_pkStmt = NULL;
}
if (m_puiParamLen)
{
free(m_puiParamLen);
m_puiParamLen = NULL;
}
}
void CStmt::Error(const char * c_pszMsg)
{
SPDLOG_ERROR("SYSERR: {}: [{}] {}", c_pszMsg, mysql_stmt_errno(m_pkStmt), mysql_stmt_error(m_pkStmt));
}
bool CStmt::Prepare(CAsyncSQL * sql, const char * c_pszQuery)
{
m_pkStmt = mysql_stmt_init(sql->GetSQLHandle());
m_stQuery = c_pszQuery;
if (mysql_stmt_prepare(m_pkStmt, m_stQuery.c_str(), m_stQuery.length()))
{
Error("mysql_stmt_prepare");
return false;
}
int iParamCount = 0;
for (unsigned int i = 0; i < m_stQuery.length(); ++i)
if (c_pszQuery[i] == '?')
++iParamCount;
if (iParamCount)
{
m_vec_param.resize(iParamCount);
memset(&m_vec_param[0], 0, sizeof(MYSQL_BIND) * iParamCount);
m_puiParamLen = (uint64_t *) calloc(iParamCount, sizeof(uint64_t));
}
m_vec_result.resize(48);
memset(&m_vec_result[0], 0, sizeof(MYSQL_BIND) * 48);
if (mysql_stmt_bind_result(m_pkStmt, &m_vec_result[0]))
{
Error("mysql_stmt_bind_result");
return 0;
}
return true;
}
bool CStmt::BindParam(enum_field_types type, void * p, int iMaxLen)
{
if (m_uiParamCount >= m_vec_param.size())
{
SPDLOG_ERROR("too many parameter in query: {}", m_stQuery);
return false;
}
MYSQL_BIND * bind = &m_vec_param[m_uiParamCount];
bind->buffer_type = type;
bind->buffer = (void *) p;
bind->buffer_length = iMaxLen;
bind->length = m_puiParamLen + m_uiParamCount;
if (++m_uiParamCount == m_vec_param.size())
{
if (mysql_stmt_bind_param(m_pkStmt, &m_vec_param[0]))
{
Error("mysql_stmt_bind_param");
return false;
}
}
return true;
}
bool CStmt::BindResult(enum_field_types type, void * p, int iMaxLen)
{
if (m_uiResultCount >= m_vec_result.size())
{
SPDLOG_ERROR("too many result in query: {}", m_stQuery);
return false;
}
MYSQL_BIND * bind = &m_vec_result[m_uiResultCount++];
bind->buffer_type = type;
bind->buffer = (void *) p;
bind->buffer_length = iMaxLen;
return true;
}
int CStmt::Execute()
{
if (m_uiParamCount != m_vec_param.size())
{
SPDLOG_ERROR("Parameter not enough {}, expected {} query: {}", m_uiParamCount, m_vec_param.size(), m_stQuery);
return 0;
}
for (unsigned int i = 0; i < m_uiParamCount; ++i)
{
MYSQL_BIND * bind = &m_vec_param[i];
if (bind->buffer_type == MYSQL_TYPE_STRING)
{
*(m_puiParamLen + i) = strlen((const char *) bind->buffer);
SPDLOG_TRACE("param {} len {} buf {}", i, *m_puiParamLen, (const char *) bind->buffer);
}
}
if (mysql_stmt_execute(m_pkStmt))
{
Error("mysql_stmt_execute");
return 0;
}
if (mysql_stmt_store_result(m_pkStmt))
{
Error("mysql_store_result");
return 0;
}
iRows = mysql_stmt_num_rows(m_pkStmt);
return true;
}
bool CStmt::Fetch()
{
return !mysql_stmt_fetch(m_pkStmt);
}

View File

@ -1,5 +1,3 @@
#ifndef __WIN32__
#include <stdio.h>
#include <stdlib.h>
#include <signal.h>
@ -82,6 +80,3 @@ void WAIT_CHILD(void)
exit(1);
}
}
#endif

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(libthecore CXX)
@ -14,6 +14,12 @@ include_directories("include")
# Create shared library
add_library(${PROJECT_NAME} STATIC ${SOURCES})
# Set the default log level based on the build type
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
message(STATUS "This is a debug build. Log level will be set to 'trace' for target '${PROJECT_NAME}'.")
target_compile_definitions(${PROJECT_NAME} PRIVATE SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE)
endif()
# Find and link dependencies
# fmt

View File

@ -8,8 +8,6 @@ typedef uint8_t UBYTE;
typedef int8_t sbyte;
typedef uint16_t sh_int;
#ifndef __WIN32__
typedef uint32_t DWORD;
typedef uint32_t BOOL;
typedef uint8_t BYTE;
@ -19,40 +17,4 @@ typedef uint32_t ULONG;
typedef int32_t INT;
typedef uint32_t UINT;
#else
struct timezone
{
int tz_minuteswest; /* minutes west of Greenwich */
int tz_dsttime; /* type of dst correction */
};
typedef SOCKET socket_t;
#if !defined(_W64)
#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
#define _W64 __w64
#else
#define _W64
#endif
#endif
#ifdef _WIN64
typedef __int64 ssize_t;
#else
typedef _W64 int ssize_t;
#endif
// Fixed-size integer types
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif
typedef unsigned int uint;
#endif
#endif // __INC_LIBTHECORE_TYPEDEF_H__

View File

@ -120,8 +120,4 @@ extern "C++"
#endif
#endif
#ifdef __WIN32__
extern void gettimeofday(struct timeval* t, struct timezone* dummy);
#endif
#endif // __INC_UTILS_H__

View File

@ -15,12 +15,7 @@ unsigned int thecore_profiler[NUM_PF];
int thecore_init(int fps, HEARTFUNC heartbeat_func)
{
#if defined(__WIN32__) || defined(__linux__)
srand(time(0));
#else
srandom(time(0) + getpid() + getuid());
srandomdev();
#endif
signal_setup();
thecore_heart = heart_new(1000000 / fps, heartbeat_func);

View File

@ -7,85 +7,6 @@
#define __LIBTHECORE__
#include "stdafx.h"
#if defined(__WIN32__) || defined(__linux__)
void signal_setup() {}
void signal_timer_disable() {}
void signal_timer_enable(int timeout_seconds) {}
#elif __FreeBSD__
#define RETSIGTYPE void
RETSIGTYPE reap(int sig)
{
while (waitpid(-1, NULL, WNOHANG) > 0);
signal(SIGCHLD, reap);
}
RETSIGTYPE checkpointing(int sig)
{
if (!tics)
{
sys_err("CHECKPOINT shutdown: tics did not updated.");
abort();
}
else
tics = 0;
}
RETSIGTYPE hupsig(int sig)
{
shutdowned = true;
sys_err("SIGHUP, SIGINT, SIGTERM signal has been received. shutting down.");
}
RETSIGTYPE usrsig(int sig)
{
core_dump();
}
void signal_timer_disable(void)
{
struct itimerval itime;
struct timeval interval;
interval.tv_sec = 0;
interval.tv_usec = 0;
itime.it_interval = interval;
itime.it_value = interval;
setitimer(ITIMER_VIRTUAL, &itime, NULL);
}
void signal_timer_enable(int sec)
{
struct itimerval itime;
struct timeval interval;
interval.tv_sec = sec;
interval.tv_usec = 0;
itime.it_interval = interval;
itime.it_value = interval;
setitimer(ITIMER_VIRTUAL, &itime, NULL);
}
void signal_setup(void)
{
signal_timer_enable(30);
signal(SIGVTALRM, checkpointing);
/* just to be on the safe side: */
signal(SIGHUP, hupsig);
signal(SIGCHLD, reap);
signal(SIGINT, hupsig);
signal(SIGTERM, hupsig);
signal(SIGPIPE, SIG_IGN);
signal(SIGALRM, SIG_IGN);
signal(SIGUSR1, usrsig);
}
#endif

View File

@ -210,7 +210,6 @@ struct tm * tm_calc(const struct tm * curr_tm, int days)
return (&new_tm);
}
#ifndef __WIN32__
void thecore_sleep(struct timeval* timeout)
{
if (select(0, (fd_set *) 0, (fd_set *) 0, (fd_set *) 0, timeout) < 0)
@ -251,32 +250,6 @@ uint64_t rdtsc()
}
*/
#else
void thecore_sleep(struct timeval* timeout)
{
Sleep(timeout->tv_sec * 1000 + timeout->tv_usec / 1000);
}
void thecore_msleep(DWORD dwMillisecond)
{
Sleep(dwMillisecond);
}
void gettimeofday(struct timeval* t, struct timezone* dummy)
{
DWORD millisec = GetTickCount();
t->tv_sec = (millisec / 1000);
t->tv_usec = (millisec % 1000) * 1000;
}
void core_dump_unix(const char *who, WORD line)
{
}
#endif
float get_float_time()
{
struct timeval tv;

View File

@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.12)
project(quest CXX)

View File

@ -1,9 +1,7 @@
#ifndef __INC_CRC32_H__
#define __INC_CRC32_H__
#ifndef __WIN32__
#include <unistd.h>
#endif
typedef unsigned int crc_t;

14
vcpkg.json Normal file
View File

@ -0,0 +1,14 @@
{
"dependencies": [
"cryptopp",
"effolkronium-random",
"libevent",
"lzo",
"fmt",
"spdlog",
"argon2",
"libpq",
"libpqxx"
],
"builtin-baseline": "a9eee3b18df395dbb8be71a31bd78ea441056e42"
}