Skip to content

Commit

Permalink
fix: vip groups (#2703)
Browse files Browse the repository at this point in the history
Fix vip groups schema and update warnings of free id and group name already exists to debug to avoid spam in the console in production.
  • Loading branch information
phacUFPE authored Jun 23, 2024
1 parent b4647d1 commit 7b53154
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,3 @@ INSERT INTO `players`
(4, 'Paladin Sample', 1, 1, 8, 3, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0),
(5, 'Knight Sample', 1, 1, 8, 4, 185, 185, 4200, 113, 115, 95, 39, 129, 0, 90, 90, 0, 8, '', 470, 1, 10, 0, 10, 0, 10, 0, 10, 0),
(6, 'GOD', 6, 1, 2, 0, 155, 155, 100, 113, 115, 95, 39, 75, 0, 60, 60, 0, 8, '', 410, 1, 10, 0, 10, 0, 10, 0, 10, 0);

-- Create vip groups for GOD account
INSERT INTO `account_vipgroups` (`name`, `account_id`, `customizable`) VALUES
('Friends', 1, 0),
('Enemies', 1, 0),
('Trading Partners', 1, 0);
4 changes: 2 additions & 2 deletions src/creatures/players/vip/player_vip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ std::shared_ptr<VIPGroup> PlayerVIP::getGroupByName(const std::string &name) con

void PlayerVIP::addGroupInternal(uint8_t groupId, const std::string &name, bool customizable) {
if (getGroupByName(name) != nullptr) {
g_logger().warn("{} - Group name already exists.", __FUNCTION__);
g_logger().debug("{} - Group name already exists.", __FUNCTION__);
return;
}

const auto freeId = getFreeId();
if (freeId == 0) {
g_logger().warn("{} - No id available.", __FUNCTION__);
g_logger().debug("{} - No id available.", __FUNCTION__);
return;
}

Expand Down

0 comments on commit 7b53154

Please sign in to comment.