From 1fb5332135ecd8bd04530ff6eccefe9edbfa27fb Mon Sep 17 00:00:00 2001 From: "Aaron C. Meadows" Date: Sun, 24 May 2015 00:20:31 -0500 Subject: [PATCH] Squashed 'GroupInitiative/' changes from 002ca9d..aeb9983 aeb9983 prod-GroupInitiative: Updated prod version of GroupInitiative at version 0.9.5. git-subtree-dir: GroupInitiative git-subtree-split: aeb99836d0cac1aeab72015332932ec2889a79f7 --- GroupInitiative.js | 27 +++++++++++++++++++++++---- package.json | 2 +- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/GroupInitiative.js b/GroupInitiative.js index 22322fce71..904e8d7d12 100644 --- a/GroupInitiative.js +++ b/GroupInitiative.js @@ -5,8 +5,8 @@ var GroupInitiative = GroupInitiative || (function() { 'use strict'; - var version = '0.9.4', - lastUpdate = 1432171923, + var version = '0.9.5', + lastUpdate = 1432444729, schemaVersion = 0.10, bonusCache = {}, sorters = { @@ -681,9 +681,10 @@ var GroupInitiative = GroupInitiative || (function() { rollSetup, initRolls, cont=false, - manualBonus=0; + manualBonus=0 + ; - if (msg.type !== "api" || !playerIsGM(msg.playerid) ) { + if (msg.type !== "api" ) { return; } @@ -707,10 +708,16 @@ var GroupInitiative = GroupInitiative || (function() { switch(cmds[0]) { case 'help': + if(!playerIsGM(msg.playerid)){ + return; + } showHelp(); break; case 'add-group': + if(!playerIsGM(msg.playerid)){ + return; + } workgroup=[]; workvar={}; @@ -771,6 +778,9 @@ var GroupInitiative = GroupInitiative || (function() { case 'promote': + if(!playerIsGM(msg.playerid)){ + return; + } cmds[1]=Math.max(parseInt(cmds[1],10),1); if(state.GroupInitiative.bonusStatGroups.length >= cmds[1]) { if(1 !== cmds[1]) { @@ -800,6 +810,9 @@ var GroupInitiative = GroupInitiative || (function() { break; case 'del-group': + if(!playerIsGM(msg.playerid)){ + return; + } cmds[1]=Math.max(parseInt(cmds[1],10),1); if(state.GroupInitiative.bonusStatGroups.length >= cmds[1]) { state.GroupInitiative.bonusStatGroups=_.filter(state.GroupInitiative.bonusStatGroups, function(v,k){ @@ -841,6 +854,9 @@ var GroupInitiative = GroupInitiative || (function() { break; default: + if(!playerIsGM(msg.playerid)){ + return; + } sendChat('GroupInitiative', '/w gm ' +'
' +'Not a valid command: '+cmds[0]+'' @@ -982,6 +998,9 @@ var GroupInitiative = GroupInitiative || (function() { } break; case '!group-init-config': + if(!playerIsGM(msg.playerid)){ + return; + } if(_.contains(args,'--help')) { showHelp(); return; diff --git a/package.json b/package.json index 518f7ede7f..db020f10ad 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "GroupInitiative", - "version": "0.9.4", + "version": "0.9.5", "description": "Adds the selected tokens to the turn order after rolling their initiative + configurable data.", "authors": "The Aaron", "roll20userid": "104025",