Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 13.32 protocol and features #2110

Merged
merged 15 commits into from
Jan 22, 2024

feat: talkaction for test sendTextMessage

a9c6069
Select commit
Loading
Failed to load commit list.
Sign in for the full log view
Merged

feat: 13.32 protocol and features #2110

feat: talkaction for test sendTextMessage
a9c6069
Select commit
Loading
Failed to load commit list.
GitHub Actions / cppcheck completed Jan 18, 2024 in 0s

reviewdog [cppcheck] report

reported by reviewdog 🐶

Findings (3)

src/creatures/players/player.cpp|7079| Variable 'mapTier' is not assigned a value.
src/creatures/players/wheel/player_wheel.cpp|2040| The scope of the variable 'newCritical' can be reduced.
src/server/network/protocol/protocolgame.cpp|4916| Variable 'tier' is not assigned a value.

Filtered Findings (171)

src/canary_server.cpp|| Too many #ifdef configurations - cppcheck only checks 12 of 24 configurations. Use --force to check all configurations.
src/creatures/creatures_definitions.hpp|1693| Variable 'itemName' is assigned in constructor body. Consider performing initialization in initialization list.
src/security/rsa.hpp|16| Class 'RSA' has a constructor with 1 argument that is not explicit.
src/canary_server.cpp|329| Same expression on both sides of '||' because 'datapackName!="data-canary"&&datapackName!="data-otservbr-global"' and 'datapackName!="data-otservbr-global"&&datapackName!="data-canary"' represent the same value.
src/creatures/creatures_definitions.hpp|1577| Function parameter 'initName' should be passed by const reference.
src/creatures/creatures_definitions.hpp|1577| Function parameter 'initType' should be passed by const reference.
src/game/game.hpp|367| Function parameter 'itemIds' should be passed by const reference.
src/game/scheduling/task.hpp|16| Function parameter 'context' should be passed by const reference.
src/game/scheduling/task.hpp|21| Function parameter 'context' should be passed by const reference.
src/game/scheduling/dispatcher.hpp|101| Function parameter 'context' should be passed by const reference.
src/game/scheduling/dispatcher.hpp|106| Function parameter 'context' should be passed by const reference.
src/game/zones/zone.hpp|205| Unused variable: _
src/canary_server.cpp|210| Skipping configuration 'LUAJIT_VERSION' since the value of 'LUAJIT_VERSION' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/canary_server.cpp|263| Skipping configuration 'NDEBUG;_MSC_VER;_WIN32' since the value of '_MSC_VER' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/canary_server.cpp|263| Skipping configuration '_MSC_VER' since the value of '_MSC_VER' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/canary_server.cpp|263| Skipping configuration '_MSC_VER;_WIN32' since the value of '_MSC_VER' is unknown. Use -D if you want to check it. You can use -U to skip it explicitly.
src/creatures/appearance/outfit/outfit.cpp|72| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/combat/combat.cpp|1485| Identical inner 'if' condition is always true.
src/creatures/combat/combat.cpp|36| Variable 'magicLevelSkill' is assigned a value that is never used.
src/creatures/combat/combat.cpp|1374| Variable 'pos' is not assigned a value.
src/creatures/combat/condition.cpp|1733| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/creature.cpp|1445| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/creature.cpp|1455| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/creature.cpp|1582| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/interactions/chat.cpp|480| The statement 'if (type!=TALKTYPE_CHANNEL_Y) type=TALKTYPE_CHANNEL_Y' is logically equivalent to 'type=TALKTYPE_CHANNEL_Y'.
src/creatures/monsters/monster.cpp|866| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/monsters/monster.cpp|997| Consider using std::count_if algorithm instead of a raw loop.
src/creatures/monsters/monster.cpp|1066| Variable 'x' is not assigned a value.
src/creatures/monsters/monsters.cpp|258| Condition '!combatSpell' is always false
src/creatures/monsters/monsters.cpp|266| Condition 'combatSpell' is always true
src/creatures/monsters/spawns/spawn_monster.cpp|92| The scope of the variable 'boostedrate' can be reduced.
src/creatures/monsters/spawns/spawn_monster.cpp|297| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/monsters/spawns/spawn_monster.cpp|149| Unused variable: _
src/creatures/monsters/spawns/spawn_monster.cpp|200| Variable 'spawnMonsterId' is not assigned a value.
src/creatures/monsters/spawns/spawn_monster.cpp|206| Variable 'id' is not assigned a value.
src/creatures/monsters/spawns/spawn_monster.cpp|327| Variable 'id' is not assigned a value.
src/creatures/monsters/spawns/spawn_monster.cpp|361| Variable 'id' is not assigned a value.
src/creatures/npcs/npc.cpp|268| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/npcs/npc.cpp|378| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/grouping/familiars.cpp|66| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/groups.cpp|104| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/guild.cpp|37| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/guild.cpp|46| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/guild.cpp|55| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/grouping/party.cpp|476| Variable 'highestLevel' is assigned a value that is never used.
src/creatures/players/grouping/party.cpp|751| Variable '(*it).second' is assigned a value that is never used.
src/creatures/players/grouping/party.cpp|778| Variable '(*it).second' is assigned a value that is never used.
src/creatures/players/imbuements/imbuements.cpp|342| Unused variable: key
src/creatures/players/player.cpp|367| Redundant condition: shield. '!A || (A && B)' is equivalent to '!A || B'
src/creatures/players/player.cpp|396| Condition 'weapon' is always false
src/creatures/players/player.cpp|401| Condition 'shield' is always false
src/creatures/players/player.cpp|402| Condition 'weapon!=nullptr' is always false
src/creatures/players/player.cpp|2819| The scope of the variable 'maxBlessing' can be reduced.
src/creatures/players/player.cpp|831| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|1947| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/players/player.cpp|4699| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|4923| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|4944| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/player.cpp|4998| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/players/player.cpp|5007| Consider using std::any_of algorithm instead of a raw loop.
src/creatures/players/player.cpp|7766| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/player.cpp|7825| Consider using std::accumulate algorithm instead of a raw loop.
src/creatures/players/player.cpp|620| Unused variable: key
src/creatures/players/player.cpp|1177| Variable 'npc' is assigned a value that is never used.
src/creatures/players/player.cpp|2950| Unused variable: key
src/creatures/players/player.cpp|3004| Unused variable: key
src/creatures/players/player.cpp|3010| Unused variable: key
src/creatures/players/player.cpp|7779| Variable 'stage' is assigned a value that is never used.
src/creatures/players/vocations/vocation.cpp|214| Consider using std::find_if algorithm instead of a raw loop.
src/creatures/players/wheel/player_wheel.cpp|2011| The scope of the variable 'magicSkill' can be reduced.
src/creatures/players/wheel/player_wheel.cpp|2012| The scope of the variable 'distanceSkill' can be reduced.
src/creatures/players/wheel/player_wheel.cpp|89| struct member 'PromotionScroll::itemId' is never used.
src/creatures/players/wheel/player_wheel.cpp|91| struct member 'PromotionScroll::extraPoints' is never used.
src/creatures/players/wheel/player_wheel.cpp|2810| Variable 'name_it' is not assigned a value.
src/game/scheduling/events_scheduler.cpp|90| Local variable 'eventName' shadows outer variable
src/game/scheduling/save_manager.cpp|19| Unused variable: _
src/game/scheduling/save_manager.cpp|25| Unused variable: _
src/game/zones/zone.cpp|97| Consider using std::copy algorithm instead of a raw loop.
src/game/zones/zone.cpp|141| Unused variable: _
src/game/zones/zone.cpp|149| Unused variable: _
src/game/zones/zone.cpp|157| Unused variable: _
src/game/zones/zone.cpp|172| Unused variable: _
src/io/functions/iologindata_load_player.cpp|842| Unused variable: id
src/io/functions/iologindata_save_player.cpp|38| Condition '!container' is always false
src/io/functions/iologindata_save_player.cpp|330| Variable 'itemId' is not assigned a value.
src/io/functions/iologindata_save_player.cpp|782| Variable 'key' is not assigned a value.
src/io/io_bosstiary.cpp|289| Consider using std::count_if algorithm instead of a raw loop.
src/io/io_bosstiary.cpp|77| Variable 'randomBossId' is not assigned a value.
src/io/io_bosstiary.cpp|157| Variable 'bossRaceId' is not assigned a value.
src/io/iobestiary.cpp|101| Consider using std::find_if algorithm instead of a raw loop.
src/io/iomap.cpp|125| The scope of the variable 'tileIsStatic' can be reduced.
src/io/iomapserialize.cpp|88| Unused variable: key
src/io/iomapserialize.cpp|336| Unused variable: key
src/io/iomapserialize.cpp|352| Unused variable: key
src/items/functions/item/attribute.cpp|50| Consider using std::find_if algorithm instead of a raw loop.
src/items/functions/item/item_parse.cpp|719| Condition 'conditionDamage' is always false
src/items/functions/item/item_parse.cpp|552| Consider using std::transform algorithm instead of a raw loop.
src/items/item.cpp|2960| Condition 'subType!=1' is always true
src/items/item.cpp|1125| The scope of the variable 'isTradeable' can be reduced.
src/items/tile.cpp|1822| Condition 'items' is always true
src/kv/value_wrapper.cpp|40| Unused variable: _
src/lib/metrics/metrics.hpp|95| Class 'method_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|96| Class 'lua_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|97| Class 'query_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|98| Class 'task_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|99| Class 'lock_latency' has a constructor with 1 argument that is not explicit.
src/lib/metrics/metrics.hpp|72| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|72| Function parameter 'attrs' should be passed by const reference.
src/lib/metrics/metrics.hpp|95| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|96| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|97| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|98| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.hpp|99| Function parameter 'name' should be passed by const reference.
src/lib/metrics/metrics.cpp|89| Function parameter 'name' should be passed by const reference.
src/lua/creature/creatureevent.cpp|17| Unused variable: name
src/lua/creature/movement.cpp|135| Consider using std::any_of algorithm instead of a raw loop.
src/lua/functions/core/game/game_functions.cpp|41| Condition '!monsterType' is always false
src/lua/functions/core/game/game_functions.cpp|66| Local variable 'alternateName' shadows outer variable
src/lua/functions/creatures/combat/spell_functions.cpp|617| Either the condition 'vocList.size()>0' is redundant or vocList size can be 1. Expression 'vocList[1]' cause access out of bounds.
src/lua/functions/creatures/creature_functions.cpp|508| Expression is always true because 'else if' condition is opposite to previous condition at line 506.
src/lua/functions/creatures/creature_functions.cpp|811| Condition 'oldPosition.x<position.x' is always true
src/lua/functions/creatures/monster/monster_type_functions.cpp|1008| Unused variable: _
src/lua/functions/creatures/npc/npc_functions.cpp|563| The scope of the variable 'shoppingBagSlots' can be reduced.
src/lua/functions/creatures/npc/npc_functions.cpp|582| Consider using std::find_if algorithm instead of a raw loop.
src/lua/functions/creatures/npc/npc_functions.cpp|588| Unused variable: _
src/lua/functions/creatures/player/player_functions.cpp|483| Condition '!slot' is always false
src/lua/functions/creatures/player/player_functions.cpp|333| Consider using std::any_of algorithm instead of a raw loop.
src/lua/functions/creatures/player/player_functions.cpp|3084| Unused variable: key
src/lua/functions/items/item_functions.cpp|732| Condition 'moveItem' is always false
src/lua/scripts/script_environment.cpp|77| Consider using std::find_if algorithm instead of a raw loop.
src/main.cpp|| Too many #ifdef configurations - cppcheck only checks 12 of 16 configurations. Use --force to check all configurations.
src/map/house/house.cpp|557| Local variable 'line' shadows outer variable
src/map/house/house.cpp|718| Consider using std::find_if algorithm instead of a raw loop.
src/map/map.cpp|705| Consider using std::copy_if algorithm instead of a raw loop.
src/protobuf/appearances.pb.cc|| This file is not analyzed. Cppcheck failed to extract a valid configuration. Use -v for more details.
src/protobuf/kv.pb.cc|| This file is not analyzed. Cppcheck failed to extract a valid configuration. Use -v for more details.
src/security/rsa.cpp|164| The scope of the variable 'buffer' can be reduced.
src/server/network/protocol/protocolgame.cpp|346| Condition 'containerType==0' is always true
src/server/network/protocol/protocolgame.cpp|3083| Condition 'counter>0' is always true
src/server/network/protocol/protocolgame.cpp|57| Consider using std::distance algorithm instead of a raw loop.
src/server/network/protocol/protocolgame.cpp|2877| Unused variable: ss
src/server/network/protocol/protocolgame.cpp|4003| Variable 'flag' is assigned a value that is never used.
src/server/network/protocol/protocolgame.cpp|4011| Variable 'flag' is assigned a value that is never used.
src/server/network/protocol/protocolgame.cpp|4895| Variable 'tier' is not assigned a value.
src/server/network/protocol/protocolgame.cpp|7207| Variable 'masterPlayer' is assigned a value that is never used.
src/server/network/protocol/protocolgame.cpp|8109| Variable 'itemTier' is not assigned a value.
src/server/network/protocol/protocolstatus.cpp|100| Unused variable: key
src/utils/tools.cpp|1622| Condition 'number>=7400' is always true
src/utils/tools.cpp|483| Function parameter 'string' should be passed by const reference.
src/utils/tools.cpp|193| Consider using std::accumulate algorithm instead of a raw loop.
src/utils/tools.cpp|387| Consider using std::transform algorithm instead of a raw loop.
src/utils/tools.cpp|1026| Consider using std::find_if algorithm instead of a raw loop.
src/utils/tools.cpp|415| Variable 'a' is not assigned a value.
src/utils/tools.cpp|453| The function 'formatTime' is never used.
src/utils/tools.cpp|198| The function 'generateToken' is never used.
src/utils/tools.cpp|1557| The function 'getObjectCategoryName' is never used.
src/utils/tools.cpp|1681| The function 'getPlayerObjectPronoun' is never used.
src/utils/tools.cpp|1698| The function 'getPlayerPossessivePronoun' is never used.
src/utils/tools.cpp|1715| The function 'getPlayerReflexivePronoun' is never used.
src/utils/tools.cpp|1664| The function 'getPlayerSubjectPronoun' is never used.
src/utils/tools.cpp|919| The function 'getSkullType' is never used.
src/utils/tools.cpp|939| The function 'getSpawnType' is never used.
src/utils/tools.cpp|1732| The function 'getVerbForPronoun' is never used.
src/utils/tools.cpp|911| The function 'getWeaponAction' is never used.
src/utils/pugicast.cpp|13| The function 'logError' is never used.
src/game/game.cpp|122| The function 'playerCanUseItemWithOnHouseTile' is never used.
src/utils/tools.cpp|283| The function 'toCamelCase' is never used.
src/utils/tools.cpp|339| The function 'toKebabCase' is never used.
src/utils/tools.cpp|323| The function 'toSnakeCase' is never used.
src/utils/tools.cpp|1524| The function 'validateName' is never used.
nofile|| Cppcheck cannot find all the include files (use --check-config for details)

Annotations

Check warning on line 7079 in src/creatures/players/player.cpp

See this annotation in the file changed.

@github-actions github-actions / cppcheck

[cppcheck] src/creatures/players/player.cpp#L7079

Variable 'mapTier' is not assigned a value.
Raw output
src/creatures/players/player.cpp:7079:Variable 'mapTier' is not assigned a value.

Check warning on line 2040 in src/creatures/players/wheel/player_wheel.cpp

See this annotation in the file changed.

@github-actions github-actions / cppcheck

[cppcheck] src/creatures/players/wheel/player_wheel.cpp#L2040

The scope of the variable 'newCritical' can be reduced.
Raw output
src/creatures/players/wheel/player_wheel.cpp:2040:The scope of the variable 'newCritical' can be reduced.

Check warning on line 4916 in src/server/network/protocol/protocolgame.cpp

See this annotation in the file changed.

@github-actions github-actions / cppcheck

[cppcheck] src/server/network/protocol/protocolgame.cpp#L4916

Variable 'tier' is not assigned a value.
Raw output
src/server/network/protocol/protocolgame.cpp:4916:Variable 'tier' is not assigned a value.