aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2013-09-01 00:59:58 +0200
committerShauren <shauren.trinity@gmail.com>2013-09-01 00:59:58 +0200
commitd6fdd05493aaa8600b07eb17dfee222a8379b033 (patch)
tree434b440bc5e5ddfd4ec7d7b48ab54839d2d2f5b9
parent6c8d0e5405a4def3be80c6c4be0abc156a34b031 (diff)
parent1bbd726e88260bb2904698317cd8d665d670ac0b (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4
-rw-r--r--dep/g3dlite/G3D-v8.0_hotfix7.diff13
-rw-r--r--dep/g3dlite/source/Matrix4.cpp2
-rw-r--r--sql/updates/auth/2013_08_30_04_auth_misc.sql24
-rw-r--r--sql/updates/world/2013_08_31_08_world_command.sql12
-rw-r--r--src/server/game/Accounts/RBAC.h6
-rw-r--r--src/server/game/Server/WorldSocket.cpp1
-rw-r--r--src/server/scripts/Commands/cs_bf.cpp16
7 files changed, 64 insertions, 10 deletions
diff --git a/dep/g3dlite/G3D-v8.0_hotfix7.diff b/dep/g3dlite/G3D-v8.0_hotfix7.diff
new file mode 100644
index 00000000000..00ab78f5c7c
--- /dev/null
+++ b/dep/g3dlite/G3D-v8.0_hotfix7.diff
@@ -0,0 +1,13 @@
+diff --git a/dep/g3dlite/source/Matrix4.cpp b/dep/g3dlite/source/Matrix4.cpp
+index 2ce14f6..fbc918f 100644
+--- a/dep/g3dlite/source/Matrix4.cpp
++++ b/dep/g3dlite/source/Matrix4.cpp
+@@ -382,7 +382,7 @@ bool Matrix4::operator==(const Matrix4& other) const {
+ // If the bit patterns are identical, they must be
+ // the same matrix. If not, they *might* still have
+ // equal elements due to floating point weirdness.
+- if (memcmp(this, &other, sizeof(Matrix4) == 0)) {
++ if (memcmp(this, &other, sizeof(Matrix4)) == 0) {
+ return true;
+ }
+
diff --git a/dep/g3dlite/source/Matrix4.cpp b/dep/g3dlite/source/Matrix4.cpp
index 2ce14f6c5d4..fbc918f8f3e 100644
--- a/dep/g3dlite/source/Matrix4.cpp
+++ b/dep/g3dlite/source/Matrix4.cpp
@@ -382,7 +382,7 @@ bool Matrix4::operator==(const Matrix4& other) const {
// If the bit patterns are identical, they must be
// the same matrix. If not, they *might* still have
// equal elements due to floating point weirdness.
- if (memcmp(this, &other, sizeof(Matrix4) == 0)) {
+ if (memcmp(this, &other, sizeof(Matrix4)) == 0) {
return true;
}
diff --git a/sql/updates/auth/2013_08_30_04_auth_misc.sql b/sql/updates/auth/2013_08_30_04_auth_misc.sql
new file mode 100644
index 00000000000..422f0f38c50
--- /dev/null
+++ b/sql/updates/auth/2013_08_30_04_auth_misc.sql
@@ -0,0 +1,24 @@
+/* cs_bf.cpp */
+
+SET @id = 257;
+
+-- Add new permissions
+DELETE FROM `rbac_permissions` WHERE `id` BETWEEN @id AND @id+5;
+INSERT INTO `rbac_permissions` (`id`, `name`) VALUES
+(@id+0, 'bf'),
+(@id+1, 'bf start'),
+(@id+2, 'bf stop'),
+(@id+3, 'bf switch'),
+(@id+4, 'bf timer'),
+(@id+5, 'bf enabled');
+
+-- Add permissions to "corresponding Commands Role"
+DELETE FROM `rbac_role_permissions` WHERE `permissionId` BETWEEN @id AND @id+5;
+INSERT INTO `rbac_role_permissions` (`roleId`, `permissionId`) VALUES
+(4, @id+0),
+(4, @id+1),
+(4, @id+2),
+(4, @id+3),
+(4, @id+4),
+(4, @id+5);
+
diff --git a/sql/updates/world/2013_08_31_08_world_command.sql b/sql/updates/world/2013_08_31_08_world_command.sql
new file mode 100644
index 00000000000..c48180f36b5
--- /dev/null
+++ b/sql/updates/world/2013_08_31_08_world_command.sql
@@ -0,0 +1,12 @@
+/* cs_bf.cpp */
+
+SET @id = 257;
+
+-- Update command table with new RBAC permissions
+UPDATE `command` SET `permission` = @id+0 WHERE `name` = 'bf';
+UPDATE `command` SET `permission` = @id+1 WHERE `name` = 'bf start';
+UPDATE `command` SET `permission` = @id+2 WHERE `name` = 'bf stop';
+UPDATE `command` SET `permission` = @id+3 WHERE `name` = 'bf switch';
+UPDATE `command` SET `permission` = @id+4 WHERE `name` = 'bf timer';
+UPDATE `command` SET `permission` = @id+5 WHERE `name` = 'bf enabled';
+
diff --git a/src/server/game/Accounts/RBAC.h b/src/server/game/Accounts/RBAC.h
index 55f8527a125..be4356f6b54 100644
--- a/src/server/game/Accounts/RBAC.h
+++ b/src/server/game/Accounts/RBAC.h
@@ -154,6 +154,12 @@ enum RBACPermissions
RBAC_PERM_COMMAND_UNBAN_CHARACTER = 254,
RBAC_PERM_COMMAND_UNBAN_IP = 255,
RBAC_PERM_COMMAND_UNBAN_PLAYERACCOUNT = 256,
+ RBAC_PERM_COMMAND_BF = 257,
+ RBAC_PERM_COMMAND_BF_START = 258,
+ RBAC_PERM_COMMAND_BF_STOP = 259,
+ RBAC_PERM_COMMAND_BF_SWITCH = 260,
+ RBAC_PERM_COMMAND_BF_TIMER = 261,
+ RBAC_PERM_COMMAND_BF_ENABLE = 262,
// custom permissions 1000+
RBAC_PERM_MAX
diff --git a/src/server/game/Server/WorldSocket.cpp b/src/server/game/Server/WorldSocket.cpp
index 995e44a6037..15cb32113dd 100644
--- a/src/server/game/Server/WorldSocket.cpp
+++ b/src/server/game/Server/WorldSocket.cpp
@@ -524,7 +524,6 @@ int WorldSocket::handle_input_payload (void)
m_RecvPct.base (NULL, 0);
m_RecvPct.reset();
- delete m_RecvWPct;
m_RecvWPct = NULL;
m_Header.reset();
diff --git a/src/server/scripts/Commands/cs_bf.cpp b/src/server/scripts/Commands/cs_bf.cpp
index 5ab94062a85..0b239219ddd 100644
--- a/src/server/scripts/Commands/cs_bf.cpp
+++ b/src/server/scripts/Commands/cs_bf.cpp
@@ -35,17 +35,17 @@ public:
{
static ChatCommand battlefieldcommandTable[] =
{
- { "start", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldStart, "", NULL },
- { "stop", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnd, "", NULL },
- { "switch", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldSwitch, "", NULL },
- { "timer", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldTimer, "", NULL },
- { "enable", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, &HandleBattlefieldEnable, "", NULL },
- { NULL, 0, false, NULL, "", NULL }
+ { "start", RBAC_PERM_COMMAND_BF_START, false, &HandleBattlefieldStart, "", NULL },
+ { "stop", RBAC_PERM_COMMAND_BF_STOP, false, &HandleBattlefieldEnd, "", NULL },
+ { "switch", RBAC_PERM_COMMAND_BF_SWITCH, false, &HandleBattlefieldSwitch, "", NULL },
+ { "timer", RBAC_PERM_COMMAND_BF_TIMER, false, &HandleBattlefieldTimer, "", NULL },
+ { "enable", RBAC_PERM_COMMAND_BF_ENABLE, false, &HandleBattlefieldEnable, "", NULL },
+ { NULL, 0, false, NULL, "", NULL }
};
static ChatCommand commandTable[] =
{
- { "bf", RBAC_PERM_ADMINISTRATOR_COMMANDS, false, NULL, "", battlefieldcommandTable },
- { NULL, 0, false, NULL, "", NULL }
+ { "bf", RBAC_PERM_COMMAND_BF, false, NULL, "", battlefieldcommandTable },
+ { NULL, 0, false, NULL, "", NULL }
};
return commandTable;
}