diff --git a/support/msvc_project_templates/Install/BuildLog.htm b/support/msvc_project_templates/Install/BuildLog.htm new file mode 100644 index 0000000..741edf5 Binary files /dev/null and b/support/msvc_project_templates/Install/BuildLog.htm differ diff --git a/support/msvc_project_templates/MMSProjectTemplate.2005.vcproj b/support/msvc_project_templates/MMSProjectTemplate.2005.vcproj new file mode 100644 index 0000000..f39238c --- /dev/null +++ b/support/msvc_project_templates/MMSProjectTemplate.2005.vcproj @@ -0,0 +1,160 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/msvc_project_templates/MMSProjectTemplate.2008.vcproj b/support/msvc_project_templates/MMSProjectTemplate.2008.vcproj new file mode 100644 index 0000000..189873a --- /dev/null +++ b/support/msvc_project_templates/MMSProjectTemplate.2008.vcproj @@ -0,0 +1,165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/msvc_project_templates/VC/VCProjects/MMSProjectTemplate.ico b/support/msvc_project_templates/VC/VCProjects/MMSProjectTemplate.ico new file mode 100644 index 0000000..9458598 Binary files /dev/null and b/support/msvc_project_templates/VC/VCProjects/MMSProjectTemplate.ico differ diff --git a/support/msvc_project_templates/VC/VCProjects/MMSProjectTemplate.vsz b/support/msvc_project_templates/VC/VCProjects/MMSProjectTemplate.vsz new file mode 100644 index 0000000..0633e43 --- /dev/null +++ b/support/msvc_project_templates/VC/VCProjects/MMSProjectTemplate.vsz @@ -0,0 +1,6 @@ +VSWIZARD 7.0 +Wizard=VsWizard.VsWizardEngine.8.0 + +Param="WIZARD_NAME = MMSProjectTemplate" +Param="RELATIVE_PATH = VCWizards\AppWiz\Metamod" +Param="FALLBACK_LCID = 1033" diff --git a/support/msvc_project_templates/VC/VCProjects/Metamod/MMSProjectTemplate.vsdir b/support/msvc_project_templates/VC/VCProjects/Metamod/MMSProjectTemplate.vsdir new file mode 100644 index 0000000..80dfd7b --- /dev/null +++ b/support/msvc_project_templates/VC/VCProjects/Metamod/MMSProjectTemplate.vsdir @@ -0,0 +1 @@ +..\MMSProjectTemplate.vsz| |Metamod C++ Project|1|This wizard will create a Metamod Source Plugin Project.| |6777| | diff --git a/support/msvc_project_templates/VC/VCProjects/Thumbs.db b/support/msvc_project_templates/VC/VCProjects/Thumbs.db new file mode 100644 index 0000000..108453f Binary files /dev/null and b/support/msvc_project_templates/VC/VCProjects/Thumbs.db differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/DottedHori.gif b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/DottedHori.gif new file mode 100644 index 0000000..67072b8 Binary files /dev/null and b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/DottedHori.gif differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/DottedVert.gif b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/DottedVert.gif new file mode 100644 index 0000000..72e0c7d Binary files /dev/null and b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/DottedVert.gif differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/spacer.gif b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/spacer.gif new file mode 100644 index 0000000..13acffe Binary files /dev/null and b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/Images/spacer.gif differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/NewStyles.css b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/NewStyles.css new file mode 100644 index 0000000..d8c46de --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/1033/NewStyles.css @@ -0,0 +1,782 @@ +/******************************************************************************/ +/*DEFAULT STYLES FOR ALL SECTIONS**********************************************/ +/******************************************************************************/ +body { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + background-color: buttonface; + margin-top: 0px; + margin-left: 0px; + margin-right: 0px; + margin-bottom: 0px; + overflow: auto; } + +a:link { color: captiontext; + text-decoration: none; } + +a:visited { color: captiontext; + text-decoration: none; } + +a:active { color: captiontext; + text-decoration: none; } + +a:hover { color: captiontext; + text-decoration: underline; } + +table { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + width: 100%; } + +table.one { table-layout: fixed; + height: 100%; + width: 100%; } + + +/*DEFAULT STYLES FOR THE 'INTRODUCTION' TABLE**********************************/ +/******************************************************************************/ +table.two { table-layout: fixed; + height: 79px; + width: 100%; + background-color: window; } + +td.image { text-align: right; } + + +/*DEFAULT STYLES FOR THE 'NAVIGATION' TABLE************************************/ +/******************************************************************************/ +table.linkText { line-height: 95%; + width: 1.7in; + height: 2.6em; + position: relative; + left: 0.1in; + z-index: 2; } + +span { position: relative; + z-index: 3; } + +span.horiLine1 { height: 30px; + width: 166px; + position: absolute; + top: -1px; + left: -1px; + bottom: -1px; + z-index: 2; } + + +/*DEFAULT STYLES FOR THE ALL BUTTONS AND THE 'BUTTONS' TABLE*******************/ +/******************************************************************************/ +button { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + height: 23px; + cursor: hand; } + +.buttons { width: 100%; } + +/*DEFAULT STYLES FOR THE 'CONTENT' TABLE***************************************/ +/******************************************************************************/ +table.fixedSize { table-layout: fixed; } + +table.content { table-layout: fixed; + height: 100%; + width: 100%; } + +ol { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + margin-top: -1px; + margin-bottom: 16px; } + +ul { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + margin-top: 3px; + margin-bottom: 16px; } + +li { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + position: relative; + left: -15px; + margin-bottom: 1px; } + +span.itemTextTop { position: relative; } + +span.itemText { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + line-height: 9pt; + position: relative; + top: -3px; } + +span.itemTextIndent { position: relative; + left: 17px; + top: -3px; } + +span.sideBtnHidden { width: 100%; + margin-top: 3px; + margin-bottom: 0px; } + +div.itemTextRadioAa { position: relative; + top: -17px; + left: 17px; + margin-bottom: -25px; } + +div.itemTextRadioA { position: relative; + top: -19px; + left: 17px; + margin-bottom: -25px; } + +div.itemTextRadioB { position: relative; + top: -19px; + left: 25px; + margin-bottom: -25px; } + +div.itemTextRadioIndentA { position: relative; + top: -17px; + left: 30px; + margin-bottom: -25px; } + +div.itemTextRadioIndentB { position: relative; + top: -17px; + left: 42px; + margin-bottom: -25px; } + +div.itemTextCheckboxA { position: relative; + top: -17px; + left: 17px; + margin-bottom: -23px; } + +div.itemTextCheckboxB { position: relative; + top: -18px; + left: 25px; + padding-top: 1px; + margin-bottom: -25px; } + +div.itemTextCheckboxIndentB { position: relative; + top: -16px; + left: 42px; + margin-bottom: -25px; } + +input { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; } + +select { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; } + +.radio { position: relative; + top: -2px; + left: 4px; } + +.radioA { position: relative; + top: -1px; + margin-left: -4px; + z-index: 2; } + +.radioIndent { margin-top: -2px; + margin-left: 17px; } + +.radioIndentA { margin-top: -2px; + margin-left: 9px; } + +.checkbox { position: relative; + top: -1px; + margin-left: -4px; + z-index: 2; } + +.checkboxA { position: relative; + top: -2px; + left: 4px; } + +.checkboxIndent { position:relative; + margin-top: -1px; + margin-left: 21px; } + +.comment { width: 578px; + position: relative; + top: 5px; + bottom: 6px; } + +.commentA { width: 398px; + position: relative; + top: 5px; + bottom: 6px; } + +.commentB { width: 578px; + position: relative; + top: 3px; + bottom: -3px; } + +/****THIS IS THE STANDARD TABBED WIZARD, TWO COLUMN INPUT BOX******************/ +input.sideBtn { width: 193px; + position: relative; + top: 3px; } + +/****THIS IS THE STANDARD THREE COLUMN WIZARD INPUT BOX************************/ +input.sideBtnThreeColumn { width: 185px; + position: relative; + top: 3px; } + +/****THIS IS THE DEFAULT INPUT BOX IN NON-TABBED AND 2 COLUMN WIZARD***********/ +input.itemTextTwoColumnLong { width: 283px; + position: relative; + top: 3px; } + +/****THIS IS AN INPUT BOX INDENTED UNDER A CHECKBOX SECTION********************/ +input.sideBtnIndent { width: 175px; + position: relative; + top: 3px; + left: 18px; + bottom: 6px; } + +/****THIS INPUT BOX HAS IS INDENTED UNDER A HEADING AND RULE SECTION***********/ +input.sideBtnB { width: 185px; + position: relative; + top: 3px; + bottom: 6px; } + +input.sideBtnBA { width: 175px; + position: relative; + top: 3px; + bottom: 6px; } + +/****THIS INPUT BOX HAS A "..." BUTTON BESIDE IT AND IT'S A TABBED WIZARD******/ +input.sideBtn2 { width: 169px; + position: relative; + top: 3px; + bottom: 6px; } + +/****"..." BUTTON IN A NON-TABBED, 3 COLUMN WIZARD*****************************/ +input.sideBtn2ThreeColumn { width: 161px; + position: relative; + top: 3px; + bottom: 6px; } + +/****THIS IS AN INPUT BOX IN NON-TABBED AND 2 COLUMN WIZARD WITH A BUTTON******/ +input.TwoColumnLongButton { width: 259px; + position: relative; + top: 3px; + bottom: 6px; } + +/****THIS INPUT BOX HAS A "..." BUTTON BESIDE IT AND IT'S UNDER A CHECKBOX*****/ +input.sidebtn2Indent { width: 151px; + position: relative; + top: 3px; + left: 18px; + bottom: 6px; } + +/****"..." BUTTON IS UNDER A SECTION IN A TWO COLUMN AND TABBED WIZARD*********/ +input.sidebtn21 { width: 161px; + position: relative; + top: 3px; + bottom: 6px; } + +/****"..." BUTTON IS UNDER A SECTION IN A THREE COLUMN AND TABBED WIZARD*********/ +input.sidebtn21A { width: 153px; + position: relative; + top: 3px; + bottom: 6px; } + +/****THIS IS THE STANDARD TABBED WIZARD, TWO COLUMN SELECTION BOX**************/ +select.sidebtn { width: 193px; + position: relative; + top: 4px; + bottom: -3px; } + +select.sidebtnNoWidth { position: relative; + top: 4px; + bottom: -3px; } + +/****THIS IS THE STANDARD TABBED WIZARD, ONE COLUMN SELECTION BOX**************/ +select.sideBtnOneCLong { width: 398px; + position: relative; + top: 3px; } + +/****THIS IS THE STANDARD THREE COLUMN WIZARD INPUT BOX************************/ +select.sideBtnThreeColumn { width: 185px; + position: relative; + top: 4px; + bottom: -3px; } + +/****THIS IS THE DEFAULT INPUT BOX IN NON-TABBED AND 2 COLUMN WIZARD***********/ +select.itemTextTwoColumnLong { width: 283px; + position: relative; + top: 4px; + bottom: -3px; } + +/****THIS SELECTION BOX IS INDENTED UNDER A HEADING AND RULE SECTION***********/ +select.sidebtnB { width: 164px; + position: relative; + top: 4px; + left: 8px; + bottom: -3px; } + +/****THIS SELECTION BOX IS BELOW AND ASSOCIATED WITH A CHECKBOX****************/ +select.sidebtn2 { width: 164px; + position: relative; + top: 11px; + left: 17px; + bottom: -3px; } + +select.sidebtnIndent { width: 175px; + position: relative; + top: 4px; + left: 18px; + bottom: -3px; } + +/****THIS SELECTION BOX IS BELOW AND ASSOCIATED WITH A CHECKBOX AND HEADING****/ +select.sidebtn2AShort { width: 168px; + position: relative; + top: 4px; + left: 25px; + bottom: -3px; } + +/****THIS SELECTION BOX IS IN A TABBED, TWO COLUM WIZARD AND FOR < << > >>*****/ +select.sidebtn3 { width: 177px; + position: relative; + top: 4px; + bottom: -3px; } + +/****THIS IS A SELECTION BOX IN NON-TABBED AND 2 COLUMN WIZARD WITH A BUTTON***/ +select.TwoColumnLongButton { width: 259px; + position: relative; + top: 4px; + bottom: -3px; } + +/****THIS IS A SELECTION BOX IN NON-TABBED AND 2 COLUMN WIZARD WITH A BUTTON***/ +select.IndentListBoxWithButton { width: 283px; + position: relative; + top: 4px; + bottom: -3px; + left: 18px; } + +/****THIS IS THE DEFAULT OBJECT DROP DOWN IN 2 COLUMN AND TABBED WIZARD********/ +object.itemtext { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + width: 193px; + height: 2em; + position: relative; + top: 4px; + margin-bottom: 0px; } + +/****THIS IS THE DEFAULT OBJECT DROP DOWN IN 3 COLUMN AND NON-TABBED WIZARD****/ +object.itemtextThreeColumn { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + width: 185px; + height: 2em; + position: relative; + top: 4px; + margin-bottom: 0px; } + +/****THIS IS THE DEFAULT OBJECT DROP DOWN IN NON-TABBED AND 2 COLUMN WIZARD****/ +object.itemTextTwoColumnLong{ font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; + width: 283px; + height: 2em; + position: relative; + top: 4px; + margin-bottom: 0px; } + +.dropdowncombo { font-family: Tahoma, MS Sans Serif, Arial, Sans Serif; + font-weight: normal; + font-size: 8pt; + color: buttontext; } + +/****MOVES RADIO TEXT UP A BIT WHEN INLINE*************************************/ +span.upABit { position: relative; + top: -2px; } + +/****THIS DEFINES A STANDARD BUTTON IN THE CONTENT SECTION*********************/ +.buttonClass { margin-top: 0px; + margin-bottom: -6px; } + +/****THIS DEFINES ADD/REMOVE BUTTONS IN THE CONTENT SECTION********************/ +.buttonClass2 { width: 75px; + padding-top: 1px; + margin-top: 7px; } + +/****THIS DEFINES A "..." BUTTON IN THE CONTENT SECTION OUT OF THE SPAN TAG****/ +.buttonClass3 { height: 19px; + width: 20px; + position: relative; + left: 1px; + top: 0px; } + +/****THIS DEFINES A "..." BUTTON IN THE CONTENT SECTION WITHIN THE SPAN TAG***/ +.buttonClass3Custom { height: 19px; + width: 20px; + position: relative; + left: 4px; + top: 3px; } + +/****THIS DEFINES A "..." BUTTON IN THE CONTENT SECTION AND UNDER A CHECKBOX***/ +.buttonClass3Indent { height: 19px; + width: 20px; + position: relative; + top: 0px; + left: 10px; } + +/****THIS DEFINES A ">>" BUTTON IN THE CONTENT SECTION************************/ +.buttonClass4 { margin-bottom: 4px; + width: 25px; } + +/****THIS DEFINES ADD/REMOVE BUTTONS HORIZONTALLY IN THE CONTENT SECTION******/ +.buttonClass5 { position: relative; + top: 4px; + width: 75px; } + +/****THIS SETS THE LEFT MARGIN FOR THE REMOVE BUTTON***************************/ +#removeBtn { margin-left: 4px; } + +/****THIS SETS THE LEFT MARGIN FOR INDENTED SECTION UNDER CHECKBOXES***********/ +label.indent { margin-left: 18px; } + +/****THIS SETS THE LEFT MARGIN FOR INDENTED SECTION UNDER CHECKBOXES***********/ +label.indent2 { margin-left: 25px; } + +/****THIS MOVES CHECK BOX AND RADIO TEXT UP A BIT******************************/ +label.upABit { position: relative; + top: -2px; } + +/****THIS BOLDS < << > >> BUTTONS**********************************************/ +b.bigFont { font-size: 135%; } + +/****THESE ARE CUSTOM VERTICAL SPACING ELEMENTS********************************/ +p.spacer { margin-bottom: -28px; } + +p.elementSpacer { margin-bottom: -12px; } + +p.elementSpacer2 { margin-bottom: -19px; } + +p.elementSpacer3 { margin-bottom: -3px; } + +p.elementSpacer4 { margin-bottom: 7px; } + +p.elementSpacer5 { margin-bottom: 5px; } + +p.elementSpacer6 { margin-bottom: -24px; } + +p.elementSpacer7 { margin-bottom: -11px; } + +p.elementSpacer8 { margin-bottom: -15px; } + +p.elementSpacer9 { margin-bottom: -7px; } + +p.elementSpacer10 { margin-bottom: 6px; } + +p.elementSpacer11 { margin-bottom: -1px; } + +p.elementSpacer12 { margin-bottom: -17px; } + +p.elementSpacer13 { margin-bottom: -23px; } + +p.elementSpacer14 { margin-bottom: -25px; } + +p.elementSpacer15 { margin-bottom: -13px; } + +p.elementSpacer16 { margin-bottom: -22px; } + +p.elementSpacer17 { margin-bottom: -32px; } + +p.elementSpacer18 { margin-bottom: -14px; } + +p.elementSpacer19 { margin-bottom: -10px; } + +p.elementSpacer21 { margin-bottom: -16px; } + +p.elementSpacer22 { margin-bottom: 3px; } + +/*CUSTOM STYLES FOR THE 'CONTENT' FRAME****************************************/ +/******************************************************************************/ + + /*CUSTOM SPACING FOR MFC UI PAGE - SET UP FOR LOC PURPOSES*******************/ + /**************************************************************************/ + p.elementSpacer20 { margin-bottom: -13px; } + + /*CUSTOM STYLE FOR MFC UI PAGE - SET UP FOR LOC PURPOSES*******************/ + /**************************************************************************/ + input.sideBtnLoc { width: 193px; + position: relative; + top: 3px; } + + /*PLACES SPACE BETWEEN ADD/REMOVE BUTTONS**********************************/ + /**************************************************************************/ + span.spacer8 { width: 1px; } + + /*SETS TEXT BOX TO APPROPRIATE WIDTH IN MFCAppWiz**************************/ + /**************************************************************************/ + #CLASS_NAMES { width: 399px; } + + /*MOVES SELECT BOX UP IN CSharpIndexerWiz, Interface, Method,**************/ + /*InterfaceMethod, AND MemFunctionWiz**************************************/ + #PARAMETER_LIST { margin-top: -1px; } + + /*MOVES SELECT BOX UP IN CSharpMethodWiz***********************************/ + /**************************************************************************/ + #PARAMETER_LIST1 { margin-top: -1px; } + + /*SETS SELECTION BOX WIDTH IN CSharpInterfaceMethod AND CSharpMethodWiz****/ + /**************************************************************************/ + #PARAMETER_MODIFIER { width: 58px; } + + /*SETS INDENT FOR ATLCustom AND MFCCustom Wizards**************************/ + /**************************************************************************/ + span.itemTextIndent1 { position: relative; + left: 8px; + top: -3px; } + + /*SETS INDENT ON OBJECT FOR CSharpMethodWiz********************************/ + /**************************************************************************/ + span.customObjectIndent { margin-left: 8px; } + + /*SETS CUSTOM INDENT FOR SECTION IN CSHARPMETHODWIZ************************/ + /**************************************************************************/ + span.sidebtn { position: relative; + top: 4px; + bottom: -3px; } + + /*SETS CUSTOM INDENT FOR SECTION IN CSHARPMETHODWIZ************************/ + /**************************************************************************/ + span.itemtextspecial { position: relative; + top: -20px; + left: 9px; + bottom: -3px; } + + /*SETS CUSTOM INDENT FOR SECTION IN CSHARPMETHODWIZ************************/ + /**************************************************************************/ + span.sidebtnspecial { position: relative; + top: -2px; + left: 53px; + bottom: -3px; } + + /**************************************************************************/ + + + + + /*MODIFIED POSITIONING*****************************************************/ + /**************************************************************************/ + /*Position and border change + link to the script file (absolutely needed)!!*/ + table.three { table-layout: fixed; + height: 100%; + position: absolute; + left: -1px; + border-right: solid 2px Window; } + + /*Color change*/ + span.activeLink { color: WindowText; + text-decoration: none; + word-wrap: break-word; + cursor: hand; + width: 100%; + padding-top: 1px; + padding-bottom: 1px; } + + /*Color change*/ + span.activeLink2 { color: WindowText; + text-decoration: underline; + word-wrap: break-word; + cursor: hand; + width: 100%; + padding-top: 1px; + padding-bottom: 1px; } + + /*Color change*/ + span.inactiveLink { color: GrayText; + text-decoration: none; + word-wrap: break-word; + cursor: default; + width: 100%; + padding-top: 1px; + padding-bottom: 1px; } + + /*Turned off dotted line*/ + span.vertLine1 { height: 100%; + width: 1px; + position: absolute; + top: 0px; + left: -1px; + bottom: 0px; + z-index: 2; } + + /*Style for width-control of the left-side links bar */ + .LinkPane { width: 1.9in; } + + /*Removed bolding of text*/ + table.linkTextSelected { line-height: 95%; + width: 1.7in; + height: 2.6em; + position: relative; + left: 0.1in; + z-index: 2; } + + /*Removed bolding of text and made width bigger*/ + table.linkTextSelectedIndent { line-height: 95%; + width: 1.7in; + height: 2.6em; + position: relative; + top: -2px; + left: 0.2in; + z-index: 2; } + + /*Changed left margin and position of top of element and made width bigger*/ + table.linkTextIndent { line-height: 95%; + width: 1.6in; + height: 2.6em; + position: relative; + top: -2px; + left: 0.2in; + z-index: 2; } + + /*Removed background color, changed top, and bottom margins*/ + div.linkSelected { height: 2.6em; + position: relative; + top: -6px; + left: 0px; + right: 0px; + z-index: 1; + margin-bottom: -.7em; } + + /*Changed top and bottom margins*/ + div.link { height: 2em; + position: relative; + top: -6px; + left: 0px; + right: 0px; + z-index: 1; + margin-bottom: -.7em; } + + /*Comment out + div.vertLine { background: url(Images/DottedVert.gif) repeat; + height: 125%; + width: 1px; + position: relative; + top: -12px; + left: -1px; }*/ + + /*Deleted dotted line*/ + span.vertLine1 { height: 100%; + width: 1px; + position: absolute; + top: 0px; + left: -1px; + bottom: 0px; + z-index: 2; } + + /*Changed background color and add alpha*/ + td.three { background-color: Window; + filter: Alpha(Opacity = 25); } + + /*Removed all background image modification elements and set image to 0 opacity*/ + td.threeCustom { filter: Alpha(Opacity = 0); } + + + /*Comment out + td.dottedline { background: url(Images/DottedHori.gif) repeat; }*/ + + /*Removed border color*/ + div.inlineA { position: relative; + top: 4px; + width: 100%; + height: 1px; } + + /*Changed border color*/ + div.inlineB { position: relative; + top: -9px; + margin-bottom: -20px; + width: 100%; + height: 1px; + border-top: solid ThreeDShadow 1px; } + + /*Changed position of element*/ + h4.head { font-weight: bold; + font-size: 10pt; + color: windowtext; + position: absolute; + top: 16px; + left: 120px; + height: 58px; } + + /*Hide element*/ + p.subhead { display: none; + color: windowtext; + position: relative; + top: -1.5em; + left: 1em; } + + /*Changed alignment to right*/ + td.image { text-align: left; } + + /*Added item to control positioning of element*/ + div.smallA { position: absolute; + top: 0px; + left: 12px; + height: 78px; + width: 110px; + vertical-align: bottom; } + + /*Added item to control positioning of element - 1 misspelling in html so dup of above*/ + div.smalA { position: absolute; + top: 0px; + left: 12px; + height: 78px; + width: 110px; + vertical-align: bottom; } + + /*Added item to control positioning of element*/ + div.small { position: absolute; + top: 0px; + left: 12px; + height: 78px; + width: 110px; + vertical-align: bottom; } + + /*Added all positioning informaiton*/ + img.smallest { background-color: activecaption; + position: relative; + bottom: 1px; } + + /*Added item to control positioning of element*/ + img.small { position: relative; + bottom: 1px; } + + /*Add height specification*/ + td.rule { background-color: window; + height: 1px; } + + /*Info for new button*/ + #PreviousBtn { position: relative; + right: -79px; } + /*Info for new button*/ + #NextBtn { position: relative; + right: -79px; } + + /*Reposition button*/ + #FinishBtn { position: relative; + right: -79px; } + + /*Reposition button*/ + #CancelBtn { position: relative; + right: -79px; } + + /*Hide button*/ + #HelpBtn { display: none; } + + + /**************************************************************************/ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/HTML/1033/default.htm b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/HTML/1033/default.htm new file mode 100644 index 0000000..e52744c --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/HTML/1033/default.htm @@ -0,0 +1,571 @@ + + + + 'MMSProjectTemplate' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+   + +   + +   + +
+ +
+
+   +
+   + + +

+

+
+   +
+ + + + + +
+ +
+
+
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + +
+   +
+   + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Author:  This is the name of the author.
+
+
+ URL:  This is the URL to the author's web site
+
+
+ License:  This is the plugin's license.
+
+
+ Plugin Name:  This is the name of the plugin.
+
+
+ Plugin Description:  This is the plugin's description.
+
+ Plugin DLL:  This is the name of the plugin's .dll file.
+
+ Plugin Class:   This is the name of the plugin's class.
+
+
+ + + + + +
+ Function Hooks:  These functions will be auto generated. 
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+
+
+
+
+   +
+   +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ +
+
+   +
+   + +   + + + +   + + + +   + + + +   +
+   +
+ +
+ +
+ + + + + + + + + + + + + diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/MMSProjectTemplate.gif b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/MMSProjectTemplate.gif new file mode 100644 index 0000000..b0206c7 Binary files /dev/null and b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/MMSProjectTemplate.gif differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/MMSProjectTemplate_Background.gif b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/MMSProjectTemplate_Background.gif new file mode 100644 index 0000000..7615277 Binary files /dev/null and b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/MMSProjectTemplate_Background.gif differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/Thumbs.db b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/Thumbs.db new file mode 100644 index 0000000..bf7a290 Binary files /dev/null and b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Images/Thumbs.db differ diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js new file mode 100644 index 0000000..6d9142d --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Scripts/1033/default.js @@ -0,0 +1,497 @@ +/////////////////////////////////////////////////////////////////////////////////////////// +// // +// // +// File: Default.js // +// // +// // +/////////////////////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////////////////// +// Use wizard.ReportError to display a message box for debugging + +// wizard.ReportError("", true); + + +/////////////////////////////////////////////////////////////////////////////////////////// +// OnFinish + +function OnFinish(selProj, selObj) +{ + try + { + // Get the new project name and path + + var strProjectName = wizard.FindSymbol('PROJECT_NAME'); + var strProjectPath = wizard.FindSymbol('PROJECT_PATH'); + + var strProjectTemplateName = wizard.FindSymbol('PLUGIN_TEMPLATE_NAME'); // Defined in default.htm + + // Get the current date and add a symbol CURRENT_DATE + + var curr_time = new Date(); + + var month = curr_time.getMonth() + 1; + var day = curr_time.getDate(); + var year = curr_time.getFullYear(); + var today = year + '-' + month + '-' + day; + + wizard.AddSymbol('CURRENT_DATE', today); + + // Set the path to where the template is installed + + var strPluginPath = wizard.FindSymbol('PROJECT_TEMPLATE_PATH') + + "\\AppWiz\\Metamod\\" + + strProjectTemplateName + "\\"; + + wizard.AddSymbol('PLUGIN_INSTALL_PATH', strPluginPath); + wizard.AddSymbol('PLUGIN_SOURCE_FILES', "Plugin Source Files"); + wizard.AddSymbol('PLUGIN_HEADER_FILES', "Plugin Header Files"); + wizard.AddSymbol('PLUGIN_RESOURCE_FILES', "Resource Files"); + + // Create the custom project + + selProj = CreateCustomProject(strProjectName, strProjectPath); + + AddConfig(selProj, strProjectName); + AddFilters(selProj); + + // Create the custom .inf file + + var InfFile = CreateCustomInfFile(); + + AddFilesToCustomProj(selProj, strProjectName, strProjectPath, InfFile); + PchSettings(selProj); + + InfFile.Delete(); + + // Save the project + + selProj.Object.Save(); + } + + // Catch Exceptions + + catch(ex) + { + if(ex.description.length != 0) + { + SetErrorInfo(ex); + } + + return ex.number + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// CreateCustomProject + +function CreateCustomProject(strProjectName, strProjectPath) +{ + try + { + // Create the project's solution + + var strInstallPath = wizard.FindSymbol('PLUGIN_INSTALL_PATH'); + var strProjTemplate = strInstallPath + '\\Templates\\1033\\plugin.vcproj'; + + if(wizard.FindSymbol("CLOSE_SOLUTION")) + { + var Solution = dte.Solution; + Solution.Close(); + + var strSolutionName = wizard.FindSymbol("VS_SOLUTION_NAME"); + + if(strSolutionName.length) + { + var strSolutionPath = strProjectPath.substr(0, strProjectPath.length - strProjectName.length); + + Solution.Create(strSolutionPath, strSolutionName); + } + } + + // Override the new solution with our custom plugin.vcproj file + + var oTarget = wizard.FindSymbol("TARGET"); + var strProjectNameWithExt = strProjectName + '.vcproj'; + + if(wizard.FindSymbol("WIZARD_TYPE") == vsWizardAddSubProject) + { + return oTarget.AddFromTemplate(strProjTemplate, strProjectNameWithExt).SubProject; + } + + return oTarget.AddFromTemplate(strProjTemplate, strProjectPath, strProjectNameWithExt); + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// CreateCustomInfFile + +function CreateCustomInfFile() +{ + try + { + var fso = new ActiveXObject('Scripting.FileSystemObject'); + var TemporaryFolder = 2; + + var tfolder = fso.GetSpecialFolder(TemporaryFolder); + var strTempFolder = tfolder.Drive + '\\' + tfolder.Name; + var strWizTempFile = strTempFolder + "\\" + fso.GetTempName(); + + var strTemplatePath = wizard.FindSymbol('TEMPLATES_PATH'); + var strInfFile = strTemplatePath + '\\Templates.inf'; + + wizard.RenderTemplate(strInfFile, strWizTempFile); + + return fso.GetFile(strWizTempFile); + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// DelFile + +function DelFile(fso, strWizTempFile) +{ + try + { + // Delete the file + + if(fso.FileExists(strWizTempFile)) + { + var tmpFile = fso.GetFile(strWizTempFile); + + tmpFile.Delete(); + } + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// AddFilters + +function AddFilters(proj) +{ + // Our plugin.vcproj has filters +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// AddConfig + +function AddConfig(proj, strProjectName) +{ + try + { + // Get the plugin dll name + + var plugin_dll = wizard.FindSymbol('PLUGIN_DLL'); + + if(plugin_dll.indexOf(".dll") < 0) + { + plugin_dll = plugin_dll + ".dll"; + } + + var project_exports = strProjectName.toUpperCase() + "_EXPORTS"; + project_exports = project_exports.replace(/ /g, "_") + ";"; + + // Debug - Original -> Configuration Properties -> C/C++ -> Preprocessor + + var config = proj.Object.Configurations('Debug - Original'); + var CLTool = config.Tools('VCCLCompilerTool'); + var LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Release - Original -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Release - Original'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + + // Debug - Orange Box -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Debug - Orange Box'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Release - Orange Box -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Release - Orange Box'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + + // Debug - Left 4 Dead -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Debug - Left 4 Dead'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + + // Release - Left 4 Dead -> Configuration Properties -> C/C++ -> Preprocessor + + config = proj.Object.Configurations('Release - Left 4 Dead'); + CLTool = config.Tools('VCCLCompilerTool'); + LinkTool = config.Tools('VCLinkerTool'); + + CLTool.PreprocessorDefinitions = project_exports + CLTool.PreprocessorDefinitions; + LinkTool.OutputFile = "$(ProjectDir)\\Bin\\$(ConfigurationName)\\" + plugin_dll; + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// PchSettings + +function PchSettings(proj) +{ + // TODO: specify pch settings +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// GetTargetName + +function GetTargetName(strName) +{ + try + { + var strTarget = strName; + var strPluginName = wizard.FindSymbol('PLUGIN_NAME'); + var strPluginClass = wizard.FindSymbol('PLUGIN_CLASS'); + + // Target ReadMe File + + if(strName == "ReadMe.txt") + { + strTarget = "ReadMe.txt"; + } + + // Target StdMMS File + + else if(strName == "StdMMS.h") + { + strTarget = "StdMMS.h"; + } + + // Target plugin_mm File + + else if(strName == "plugin_mm.h") + { + strTarget = "Plugin\\" + strPluginClass + ".h"; + } + + // Target plugin_mm File + + else if(strName == "plugin_mm.cpp") + { + strTarget = "Plugin\\" + strPluginClass + ".cpp"; + } + + // Target plugin_hooks File + + else if(strName == "plugin_hooks.h") + { + strTarget = "Plugin\\" + strPluginClass + "Hooks.h"; + } + + // Target plugin_hooks File + + else if(strName == "plugin_hooks.cpp") + { + strTarget = "Plugin\\" + strPluginClass + "Hooks.cpp"; + } + + // Target plugin_engine File + + else if(strName == "plugin_engine.h") + { + strTarget = "Plugin\\" + strPluginClass + "Engine.h"; + } + + // Target plugin_mm File + + else if(strName == "plugin.vdf") + { + if(strPluginName.length) + { + strPluginName = strPluginName.replace(/ /g, ""); + + strTarget = "Bin\\" + strPluginName + ".vdf"; + } + } + + return strTarget; + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// AddFilesToCustomProj + +function AddFilesToCustomProj(proj, strProjectName, strProjectPath, InfFile) +{ + try + { + var vcProjectItems = proj.ProjectItems; + var vcProjectFilters = proj.Object.Filters; + + // Get references to the filters of the project + + var vcFilterSource = vcProjectFilters.Item(wizard.FindSymbol('PLUGIN_SOURCE_FILES')); + var vcFilterHeader = vcProjectFilters.Item(wizard.FindSymbol('PLUGIN_HEADER_FILES')); + var vcFilterRez = vcProjectFilters.Item(wizard.FindSymbol('PLUGIN_RESOURCE_FILES')); + + var strTemplatePath = wizard.FindSymbol('PLUGIN_INSTALL_PATH') + "Templates\\1033\\"; + var FileStream = InfFile.OpenAsTextStream(1, -2); + + // Process the template files + + while(!FileStream.AtEndOfStream) + { + var strLine = FileStream.ReadLine(); + + if(strLine == '') + { + continue; + } + + // Retrieve the file parameters + + var strName = strLine; + var strTargetFile = GetTargetName(strName); + var strTemplateFile = strTemplatePath + '\\' + strLine; + var strProjectFile = strProjectPath + '\\' + strTargetFile; + + // "true" will only copy the file from template_file + // to target_file without rendering / adding to the project + + var bCopyOnly = false; + var strExt = strName.substr(strName.lastIndexOf(".")); + + if(strExt == ".bmp" || + strExt == ".ico" || + strExt == ".gif" || + strExt == ".rtf" || + strExt == ".css") + { + bCopyOnly = true; + } + + wizard.RenderTemplate(strTemplateFile, strProjectFile, bCopyOnly); + + if(!KeepOutsideProject(strName)) + { + // Add source files to the 'Plugin Source Files' filter + + if(strExt == '.cpp' || + strExt == '.cxx' || + strExt == '.c') + { + vcFilterSource.AddFile(strTargetFile); + } + + // Add header files to the 'Plugin Header Files' filter + + else if(strExt == '.hpp' || + strExt == '.h') + { + vcFilterHeader.AddFile(strTargetFile); + } + + // Add resource files to the 'Resource Files' filter + + else if(strExt == '.rc2' || strExt == '.ico' || + strExt == '.gif' || strExt == '.bmp' || + strExt == '.vdf' || strExt == '.rc') + { + vcFilterRez.AddFile(strTargetFile); + } + + // Just add the rest to the project + + else + { + proj.Object.AddFile(strTargetFile); + } + } + } + + FileStream.Close(); + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} + +/////////////////////////////////////////////////////////////////////////////////////////// +// KeepOutsideProject + +function KeepOutsideProject(strName) +{ + try + { + var bAdd = false; + + if(strName == "ReadMe.txt") + { + bAdd = true; + } + + return bAdd; + } + + // Catch Exceptions + + catch(ex) + { + throw ex; + } +} diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/ReadMe.txt b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/ReadMe.txt new file mode 100644 index 0000000..0608be9 --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/ReadMe.txt @@ -0,0 +1,5 @@ +======================================================================== + [!output PLUGIN_NAME] : Project Overview +======================================================================== + +MMS Plugin Project has created this [!output PLUGIN_NAME] project for you as a starting point. diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/StdMMS.h b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/StdMMS.h new file mode 100644 index 0000000..e48a4d8 --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/StdMMS.h @@ -0,0 +1,44 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File: StdMMS.h +// Author: [!output PLUGIN_AUTHOR] +// Date: [!output CURRENT_DATE] +// +// License: [!output PLUGIN_LICENSE] +// +// This software is provided 'as-is', without any express or +// implied warranty. In no event will the authors be held liable +// for any damages arising from the use of this software. +// +// Based on code written by AlliedModders LLC. Sample Plugin +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _StdMMS_H +#define _StdMMS_H + +/////////////////////////////////////////////////////// +// Include Standard Headers + +#include + +/////////////////////////////////////////////////////// +// Include MetaMod Headers + +#include +#include +#include +#include + +/////////////////////////////////////////////////////// +// Include [!output PROJECT_NAME] Headers + +#include "Plugin/[!output PLUGIN_CLASS]Hooks.h" +#include "Plugin/[!output PLUGIN_CLASS].h" +#include "Plugin/[!output PLUGIN_CLASS]Engine.h" + +// TODO: Add your own headers here. + +// ex. #include "MyCode/MyInclude.h" + +#endif // _StdMMS_H diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/Templates.inf b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/Templates.inf new file mode 100644 index 0000000..51593be --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/Templates.inf @@ -0,0 +1,8 @@ +StdMMS.h +plugin_mm.h +plugin_mm.cpp +plugin_hooks.h +plugin_hooks.cpp +plugin_engine.h +plugin.vdf +ReadMe.txt diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj new file mode 100644 index 0000000..6f17cdb --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vcproj @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf new file mode 100644 index 0000000..73723db --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin.vdf @@ -0,0 +1,5 @@ +"Metamod Plugin" +{ + "alias" "[!output PLUGIN_NAME]" + "file" "Addons/Metamod/Plugins/[!output PLUGIN_NAME]/Bin/[!output PLUGIN_DLL]" +} diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h new file mode 100644 index 0000000..89f437e --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_engine.h @@ -0,0 +1,124 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File: [!output PLUGIN_CLASS]Engine.h +// Author: [!output PLUGIN_AUTHOR] +// Date: [!output CURRENT_DATE] +// +// License: [!output PLUGIN_LICENSE] +// +// This software is provided 'as-is', without any express or +// implied warranty. In no event will the authors be held liable +// for any damages arising from the use of this software. +// +// Based on code written by AlliedModders LLC. Sample Plugin +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _MMS_ENGINE_H +#define _MMS_ENGINE_H + +#include + +///////////////////////////////////////////////////////////////////////// +// Class [!output PLUGIN_CLASS] + +class [!output PLUGIN_CLASS]; + +///////////////////////////////////////////////////////////////////////// +// Episode One + +#if SOURCE_ENGINE == SE_EPISODEONE + +///////////////////////////////////////////////////////////////////////// + +#if !defined METAMOD_PLAPI_VERSION + +#define GetEngineFactory engineFactory +#define GetServerFactory serverFactory + +#define MM_Format snprintf +#define GetCGlobals pGlobals + +#else + +#error "Metamod:Source 1.6 is not supported on the old engine." + +#endif + +///////////////////////////////////////////////////////////////////////// +// Wrap the CCommand class so our code looks the same for both engines. + +class CCommand +{ + public: + + const char *ArgS() + { + return [!output PLUGIN_CLASS]::EngineServer->Cmd_Args(); + } + + int ArgC() + { + return [!output PLUGIN_CLASS]::EngineServer->Cmd_Argc(); + } + + const char *Arg(int index) + { + return [!output PLUGIN_CLASS]::EngineServer->Cmd_Argv(index); + } +}; + +#define CVAR_INTERFACE_VERSION VENGINE_CVAR_INTERFACE_VERSION +#define ENGINE_CALL(func) SH_CALL(m_engine_server, func) + +///////////////////////////////////////////////////////////////////////// +// Episode Orange Box or newer + +#elif SOURCE_ENGINE >= SE_ORANGEBOX + +#define ENGINE_CALL(func) SH_CALL([!output PLUGIN_CLASS]::EngineServer, func) +#define MM_Format g_SMAPI->Format + +#endif + +///////////////////////////////////////////////////////////////////////// +// Left 4 Dead engine removed these from IVEngineServer + +#if SOURCE_ENGINE >= SE_LEFT4DEAD + +inline int IndexOfEdict(const edict_t* edict) +{ + return (int)(edict - [!output PLUGIN_CLASS]::GlobalVars->baseEdict); +} + +inline edict_t* PEntityOfEntIndex(int entity_index) +{ + if (entity_index >= 0 && entity_index < [!output PLUGIN_CLASS]::GlobalVars->maxEntities) + { + return (edict_t *)([!output PLUGIN_CLASS]::GlobalVars->baseEdict + entity_index); + } + return NULL; +} + +#else + +inline int IndexOfEdict(const edict_t* edict) +{ + return [!output PLUGIN_CLASS]::EngineServer->IndexOfEdict(edict); +} + +inline edict_t* PEntityOfEntIndex(int entity_index) +{ + return [!output PLUGIN_CLASS]::EngineServer->PEntityOfEntIndex(entity_index); +} + +#endif + +///////////////////////////////////////////////////////////////////////// +// Define snprintf + +#if defined WIN32 && !defined snprintf +#define snprintf _snprintf +#endif + +#endif // _MMS_ENGINE_H diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp new file mode 100644 index 0000000..268a5de --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.cpp @@ -0,0 +1,675 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File: [!output PLUGIN_CLASS]Hooks.cpp +// Author: [!output PLUGIN_AUTHOR] +// Date: [!output CURRENT_DATE] +// +// License: [!output PLUGIN_LICENSE] +// +// This software is provided 'as-is', without any express or +// implied warranty. In no event will the authors be held liable +// for any damages arising from the use of this software. +// +// Based on code written by AlliedModders LLC. Sample Plugin +// +/////////////////////////////////////////////////////////////////////////////// + +#include "StdMMS.h" + +///////////////////////////////////////////////////////////////////////// +// Declare the Hooks + +[!if IServerGameDLL_ServerActivate] +SH_DECL_HOOK3_void(IServerGameDLL, ServerActivate, SH_NOATTRIB, 0, edict_t*, int, int); +[!endif] +[!if IServerGameDLL_GameInit] +SH_DECL_HOOK0(IServerGameDLL, GameInit, SH_NOATTRIB, 0, bool); +[!endif] +[!if IServerGameDLL_GameFrame] +SH_DECL_HOOK1_void(IServerGameDLL, GameFrame, SH_NOATTRIB, 0, bool); +[!endif] +[!if IServerGameDLL_GameShutdown] +SH_DECL_HOOK0_void(IServerGameDLL, GameShutdown, SH_NOATTRIB, 0); +[!endif] +[!if IServerGameDLL_LevelInit] +SH_DECL_HOOK6(IServerGameDLL, LevelInit, SH_NOATTRIB, 0, bool, char const*, char const*, char const*, char const*, bool, bool); +[!endif] +[!if IServerGameDLL_LevelShutdown] +SH_DECL_HOOK0_void(IServerGameDLL, LevelShutdown, SH_NOATTRIB, 0); +[!endif] +[!if IServerGameDLL_GetAllServerClasses] +SH_DECL_HOOK0(IServerGameDLL, GetAllServerClasses, SH_NOATTRIB, 0, ServerClass*); +[!endif] +[!if IServerGameDLL_GetTickInterval] +SH_DECL_HOOK0(IServerGameDLL, GetTickInterval, const, 0, float); +[!endif] +[!if IServerGameDLL_GetGameDescription] +SH_DECL_HOOK0(IServerGameDLL, GetGameDescription, SH_NOATTRIB, 0, const char*); +[!endif] + +[!if IServerGameClients_ClientActive] +SH_DECL_HOOK2_void(IServerGameClients, ClientActive, SH_NOATTRIB, 0, edict_t*, bool); +[!endif] +[!if IServerGameClients_ClientConnect] +SH_DECL_HOOK5(IServerGameClients, ClientConnect, SH_NOATTRIB, 0, bool, edict_t*, const char*, const char *, char *, int); +[!endif] +[!if IServerGameClients_ClientDisconnect] +SH_DECL_HOOK1_void(IServerGameClients, ClientDisconnect, SH_NOATTRIB, 0, edict_t*); +[!endif] +[!if IServerGameClients_ClientPutInServer] +SH_DECL_HOOK2_void(IServerGameClients, ClientPutInServer, SH_NOATTRIB, 0, edict_t*, char const *); +[!endif] +[!if IServerGameClients_ClientSettingsChanged] +SH_DECL_HOOK1_void(IServerGameClients, ClientSettingsChanged, SH_NOATTRIB, 0, edict_t*); +[!endif] +[!if IServerGameClients_ClientSetupVisibility] +SH_DECL_HOOK4_void(IServerGameClients, ClientSetupVisibility, SH_NOATTRIB, 0, edict_t*, edict_t*, unsigned char*, int); +[!endif] +[!if IServerGameClients_ClientEarPosition] +SH_DECL_HOOK2_void(IServerGameClients, ClientEarPosition, SH_NOATTRIB, 0, edict_t*, Vector*); +[!endif] +[!if IServerGameClients_PostClientMessagesSent] +SH_DECL_HOOK0_void(IServerGameClients, PostClientMessagesSent, SH_NOATTRIB, 0); +[!endif] +[!if IServerGameClients_ProcessUsercmds] +SH_DECL_HOOK7(IServerGameClients, ProcessUsercmds, SH_NOATTRIB, 0, float, edict_t*, bf_read*, int, int, int, bool, bool); +[!endif] +[!if IServerGameClients_GetPlayerLimits] +SH_DECL_HOOK3_void(IServerGameClients, GetPlayerLimits, const, 0, int&, int&, int&); +[!endif] +[!if IServerGameClients_GetPlayerState] +SH_DECL_HOOK1(IServerGameClients, GetPlayerState, SH_NOATTRIB, 0, CPlayerState*, edict_t*); +[!endif] +[!if IServerGameClients_GetReplayDelay] +SH_DECL_HOOK2(IServerGameClients, GetReplayDelay, SH_NOATTRIB, 0, int, edict_t*, int&); +[!endif] +[!if IServerGameClients_GetBugReportInfo] +SH_DECL_HOOK2_void(IServerGameClients, GetBugReportInfo, SH_NOATTRIB, 0, char*, int); +[!endif] +[!if IServerGameClients_SetCommandClient] +SH_DECL_HOOK1_void(IServerGameClients, SetCommandClient, SH_NOATTRIB, 0, int); +[!endif] +SH_DECL_HOOK2(IGameEventManager2, FireEvent, SH_NOATTRIB, 0, bool, IGameEvent*, bool); + +#if SOURCE_ENGINE >= SE_ORANGEBOX + +[!if IServerGameClients_NetworkIDValidated] +SH_DECL_HOOK2_void(IServerGameClients, NetworkIDValidated, SH_NOATTRIB, 0, const char *, const char *); +[!endif] +[!if IServerGameClients_ClientCommand] +SH_DECL_HOOK2_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t*, const CCommand&); +[!endif] + +#else + +[!if IServerGameClients_ClientCommand] +SH_DECL_HOOK1_void(IServerGameClients, ClientCommand, SH_NOATTRIB, 0, edict_t*); +[!endif] + +#endif + + +///////////////////////////////////////////////////////////////////////// +// AddHooks + +void [!output PLUGIN_CLASS]::AddHooks() +{ + // Add the ServerGameDLL hooks + +[!if IServerGameDLL_ServerActivate] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedServerActivate, true); +[!endif] +[!if IServerGameDLL_GameInit] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameInit, true); +[!endif] +[!if IServerGameDLL_GameFrame] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameFrame, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameFrame, true); +[!endif] +[!if IServerGameDLL_GameShutdown] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GameShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameShutdown, true); +[!endif] +[!if IServerGameDLL_LevelInit] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelInit, true); +[!endif] +[!if IServerGameDLL_LevelShutdown] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelShutdown, true); +[!endif] +[!if IServerGameDLL_GetAllServerClasses] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GetAllServerClasses, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetAllServerClasses, true); +[!endif] +[!if IServerGameDLL_GetTickInterval] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GetTickInterval, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetTickInterval, true); +[!endif] +[!if IServerGameDLL_GetGameDescription] + SH_ADD_HOOK_MEMFUNC(IServerGameDLL, GetGameDescription, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetGameDescription, true); +[!endif] + + // Add the ServerGameClients hooks + +[!if IServerGameClients_ClientActive] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientActive, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientActive, true); +[!endif] +[!if IServerGameClients_ClientConnect] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientConnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientConnect, true); +[!endif] +[!if IServerGameClients_ClientDisconnect] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientDisconnect, true); +[!endif] +[!if IServerGameClients_ClientCommand] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientCommand, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientCommand, true); +[!endif] +[!if IServerGameClients_ClientPutInServer] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientPutInServer, true); +[!endif] +[!if IServerGameClients_ClientSettingsChanged] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSettingsChanged, true); +[!endif] +[!if IServerGameClients_ClientSetupVisibility] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientSetupVisibility, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSetupVisibility, true); +[!endif] +[!if IServerGameClients_ClientEarPosition] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ClientEarPosition, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientEarPosition, true); +[!endif] +[!if IServerGameClients_PostClientMessagesSent] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, PostClientMessagesSent, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedPostClientMessagesSent, true); +[!endif] +[!if IServerGameClients_ProcessUsercmds] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, ProcessUsercmds, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedProcessUsercmds, false); +[!endif] +[!if IServerGameClients_GetPlayerLimits] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetPlayerLimits, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerLimits, true); +[!endif] +[!if IServerGameClients_GetPlayerState] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetPlayerState, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerState, true); +[!endif] +[!if IServerGameClients_GetReplayDelay] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetReplayDelay, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetReplayDelay, true); +[!endif] +[!if IServerGameClients_GetBugReportInfo] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, GetBugReportInfo, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetBugReportInfo, true); +[!endif] +[!if IServerGameClients_SetCommandClient] + SH_ADD_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedSetCommandClient, true); +[!endif] + +[!if IServerGameClients_NetworkIDValidated] + #if SOURCE_ENGINE >= SE_ORANGEBOX + + SH_ADD_HOOK_MEMFUNC(IServerGameClients, NetworkIDValidated, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedNetworkIDValidated, true); + + #endif +[!endif] +} + +///////////////////////////////////////////////////////////////////////// +// RemoveHooks + +void [!output PLUGIN_CLASS]::RemoveHooks() +{ + // Remove the ServerGameDLL hooks + +[!if IServerGameDLL_ServerActivate] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, ServerActivate, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedServerActivate, true); +[!endif] +[!if IServerGameDLL_GameInit] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameInit, true); +[!endif] +[!if IServerGameDLL_GameFrame] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameFrame, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameFrame, true); +[!endif] +[!if IServerGameDLL_GameShutdown] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GameShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGameShutdown, true); +[!endif] +[!if IServerGameDLL_LevelInit] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelInit, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelInit, true); +[!endif] +[!if IServerGameDLL_LevelShutdown] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, LevelShutdown, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedLevelShutdown, true); +[!endif] +[!if IServerGameDLL_GetAllServerClasses] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GetAllServerClasses, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetAllServerClasses, true); +[!endif] +[!if IServerGameDLL_GetTickInterval] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GetTickInterval, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetTickInterval, true); +[!endif] +[!if IServerGameDLL_GetGameDescription] + SH_REMOVE_HOOK_MEMFUNC(IServerGameDLL, GetGameDescription, [!output PLUGIN_CLASS]::GameServer, this, &[!output PLUGIN_CLASS]::HookedGetGameDescription, true); +[!endif] + + // Remove the ServerGameClients hooks + +[!if IServerGameClients_ClientActive] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientActive, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientActive, true); +[!endif] +[!if IServerGameClients_ClientConnect] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientConnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientConnect, true); +[!endif] +[!if IServerGameClients_ClientDisconnect] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientDisconnect, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientDisconnect, true); +[!endif] +[!if IServerGameClients_ClientCommand] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientCommand, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientCommand, true); +[!endif] +[!if IServerGameClients_ClientPutInServer] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientPutInServer, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientPutInServer, true); +[!endif] +[!if IServerGameClients_ClientSettingsChanged] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientSettingsChanged, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSettingsChanged, true); +[!endif] +[!if IServerGameClients_ClientSetupVisibility] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientSetupVisibility, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientSetupVisibility, true); +[!endif] +[!if IServerGameClients_ClientEarPosition] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ClientEarPosition, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedClientEarPosition, true); +[!endif] +[!if IServerGameClients_PostClientMessagesSent] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, PostClientMessagesSent, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedPostClientMessagesSent, true); +[!endif] +[!if IServerGameClients_ProcessUsercmds] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, ProcessUsercmds, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedProcessUsercmds, true); +[!endif] +[!if IServerGameClients_GetPlayerLimits] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetPlayerLimits, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerLimits, true); +[!endif] +[!if IServerGameClients_GetPlayerState] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetPlayerState, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetPlayerState, true); +[!endif] +[!if IServerGameClients_GetReplayDelay] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetReplayDelay, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetReplayDelay, true); +[!endif] +[!if IServerGameClients_GetBugReportInfo] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, GetBugReportInfo, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedGetBugReportInfo, true); +[!endif] +[!if IServerGameClients_SetCommandClient] + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, SetCommandClient, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedSetCommandClient, true); +[!endif] + +[!if IServerGameClients_NetworkIDValidated] + #if SOURCE_ENGINE >= SE_ORANGEBOX + + SH_REMOVE_HOOK_MEMFUNC(IServerGameClients, NetworkIDValidated, [!output PLUGIN_CLASS]::GameClients, this, &[!output PLUGIN_CLASS]::HookedNetworkIDValidated, true); + + #endif +[!endif] +} + + +[!if IServerGameDLL_ServerActivate] +///////////////////////////////////////////////////////////////////////// +// HookedServerActivate + +// The server is about to activate + +void [!output PLUGIN_CLASS]::HookedServerActivate(edict_t* edict_list, int edict_count, int client_max) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameDLL_GameInit] +///////////////////////////////////////////////////////////////////////// +// HookedGameInit + +// This is called when a new game is started. (restart, map) + +bool [!output PLUGIN_CLASS]::HookedGameInit() +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, true); +} + +[!endif] +[!if IServerGameDLL_GameFrame] +///////////////////////////////////////////////////////////////////////// +// HookedGameFrame + +// The server should run physics / think on all edicts + +void [!output PLUGIN_CLASS]::HookedGameFrame(bool simulating) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameDLL_GameShutdown] +///////////////////////////////////////////////////////////////////////// +// HookedGameShutdown + +// This is called when a game ends (server disconnect, death, +// restart, load). NOT on level transitions within a game + +void [!output PLUGIN_CLASS]::HookedGameShutdown() +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameDLL_LevelInit] +///////////////////////////////////////////////////////////////////////// +// HookedLevelInit + +// Called any time a new level is started (after +// GameInit() also on level transitions within a game) + +bool [!output PLUGIN_CLASS]::HookedLevelInit(const char* map_name, char const* map_entities, char const* old_level, + char const* landmark_name, bool load_game, bool bkgnd) +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, true); +} + +[!endif] +[!if IServerGameDLL_LevelShutdown] +///////////////////////////////////////////////////////////////////////// +// HookedLevelShutdown + +// Called when a level is shutdown (including changing levels) + +void [!output PLUGIN_CLASS]::HookedLevelShutdown() +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameDLL_GetAllServerClasses] +///////////////////////////////////////////////////////////////////////// +// HookedGetAllServerClasses + +// Gets the list of datatable classes to the engine. The engine +// matches class names from here with edict_t::classname to figure +// out how to encode a class's data for networking + +ServerClass* [!output PLUGIN_CLASS]::HookedGetAllServerClasses() +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, NULL); +} + +[!endif] +[!if IServerGameDLL_GetTickInterval] +///////////////////////////////////////////////////////////////////////// +// HookedGetTickInterval + +// Get the simulation interval (must be compiled with identical values +// into both client and game .dll for MOD!!!). Right now this is only +// requested at server startup time so it can't be changed on the fly, etc. + +float [!output PLUGIN_CLASS]::HookedGetTickInterval() const +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, 0.0f); +} + +[!endif] +[!if IServerGameDLL_GetGameDescription] +///////////////////////////////////////////////////////////////////////// +// HookedGetGameDescription + +// Returns string describing current .dll. +// e.g. TeamFortress 2, Half-Life 2 + +const char* [!output PLUGIN_CLASS]::HookedGetGameDescription() +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, ""); +} + +[!endif] +[!if IServerGameClients_ClientActive] +///////////////////////////////////////////////////////////////////////// +// HookedClientActive + +// Client is going active. If load_game is true, don't +// spawn the player because its state is already setup. + +void [!output PLUGIN_CLASS]::HookedClientActive(edict_t* entity, bool load_game) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ClientConnect] +///////////////////////////////////////////////////////////////////////// +// HookedClientConnect + +// Client is connecting to server (return false to reject the connection) +// You can specify a rejection message by writing it into reject + +bool [!output PLUGIN_CLASS]::HookedClientConnect(edict_t* entity, const char* name, const char* address, char* reject, int reject_len) +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, true); +} + +[!endif] +[!if IServerGameClients_ClientDisconnect] +///////////////////////////////////////////////////////////////////////// +// HookedClientDisconnect + +// Client is disconnecting from server + +void [!output PLUGIN_CLASS]::HookedClientDisconnect(edict_t* entity) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ClientCommand] +///////////////////////////////////////////////////////////////////////// +// HookedClientCommand + +// The client has typed a command at the console + +#if SOURCE_ENGINE >= SE_ORANGEBOX +void [!output PLUGIN_CLASS]::HookedClientCommand(edict_t* entity, const CCommand& args) +#else +void [!output PLUGIN_CLASS]::HookedClientCommand(edict_t* entity) +#endif +{ + // Verify the parameters + + #if SOURCE_ENGINE == SE_EPISODEONE + CCommand args; + #endif + + if(!entity || entity->IsFree()) + { + RETURN_META(MRES_IGNORED); + } + + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ClientPutInServer] +///////////////////////////////////////////////////////////////////////// +// HookedClientPutInServer + +// Client is connected and should be put in the game + +void [!output PLUGIN_CLASS]::HookedClientPutInServer(edict_t* entity, char const* name) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ClientSettingsChanged] +///////////////////////////////////////////////////////////////////////// +// HookedClientSettingsChanged + +// A player changed one / several replicated cvars (name etc...) + +void [!output PLUGIN_CLASS]::HookedClientSettingsChanged(edict_t* edict) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ClientSetupVisibility] +///////////////////////////////////////////////////////////////////////// +// HookedClientSetupVisibility + +// Determine PVS origin and set PVS for the player / view entity + +void [!output PLUGIN_CLASS]::HookedClientSetupVisibility(edict_t* view_entity, edict_t* client, unsigned char *pvs, int pvs_size) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ClientEarPosition] +///////////////////////////////////////////////////////////////////////// +// HookedClientEarPosition + +// Get the ear position for a specified client + +void [!output PLUGIN_CLASS]::HookedClientEarPosition(edict_t* entity, Vector* ear_origin) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_PostClientMessagesSent] +///////////////////////////////////////////////////////////////////////// +// HookedPostClientMessagesSent + +// Let the game .dll do stuff after messages have been sent +// to all of the clients once the server frame is complete + +void [!output PLUGIN_CLASS]::HookedPostClientMessagesSent() +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_ProcessUsercmds] +///////////////////////////////////////////////////////////////////////// +// HookedProcessUsercmds + +// A block of CUserCmds has arrived from the user, decode +// them and buffer for execution during player simulation + +float [!output PLUGIN_CLASS]::HookedProcessUsercmds(edict_t* player, bf_read* buf, int num_cmds, int total_cmds, + int dropped_packets, bool ignore, bool paused) +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, 0.0f); +} + +[!endif] +[!if IServerGameClients_NetworkIDValidated] +///////////////////////////////////////////////////////////////////////// +// HookedNetworkIDValidated + +// A user has had their network id setup and validated + +void [!output PLUGIN_CLASS]::HookedNetworkIDValidated(const char* user_name, const char* network_id) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_GetPlayerLimits] +///////////////////////////////////////////////////////////////////////// +// HookedGetPlayerLimits + +// Get server max players and lower bound for the same + +void [!output PLUGIN_CLASS]::HookedGetPlayerLimits(int& min_players, int& max_players, int& default_max) const +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_GetPlayerState] +///////////////////////////////////////////////////////////////////////// +// HookedGetPlayerState + +// For players, looks up the CPlayerState structure corresponding to the player + +CPlayerState* [!output PLUGIN_CLASS]::HookedGetPlayerState(edict_t* player) +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, NULL); +} + +[!endif] +[!if IServerGameClients_GetReplayDelay] +///////////////////////////////////////////////////////////////////////// +// HookedGetReplayDelay + +// Returns number of delay ticks if player is in Replay mode (0 = no delay) + +int [!output PLUGIN_CLASS]::HookedGetReplayDelay(edict_t* player, int& entity) +{ + // TODO: Implement Method + + RETURN_META_VALUE(MRES_IGNORED, 0); +} + +[!endif] +[!if IServerGameClients_GetBugReportInfo] +///////////////////////////////////////////////////////////////////////// +// HookedGetBugReportInfo + +// Anything this game .dll wants to add to the bug reporter text +//(e.g., the entity/model under the picker crosshair) can be added here + +void [!output PLUGIN_CLASS]::HookedGetBugReportInfo(char* buf, int size) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] +[!if IServerGameClients_SetCommandClient] +///////////////////////////////////////////////////////////////////////// +// HookedSetCommandClient + +// Sets the client index for the client who typed the command into his / her console + +void [!output PLUGIN_CLASS]::HookedSetCommandClient(int index) +{ + // TODO: Implement Method + + RETURN_META(MRES_IGNORED); +} + +[!endif] diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.h b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.h new file mode 100644 index 0000000..da90c19 --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_hooks.h @@ -0,0 +1,278 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File: [!output PLUGIN_CLASS]Hooks.h +// Author: [!output PLUGIN_AUTHOR] +// Date: [!output CURRENT_DATE] +// +// License: [!output PLUGIN_LICENSE] +// +// This software is provided 'as-is', without any express or +// implied warranty. In no event will the authors be held liable +// for any damages arising from the use of this software. +// +// Based on code written by AlliedModders LLC. Sample Plugin +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _PLUGIN_HOOKS_H +#define _PLUGIN_HOOKS_H + +[!if IServerGameDLL_ServerActivate] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_SERVER_ACTIVATE + +#define DECL_HOOK_SERVER_ACTIVATE \ + \ + void HookedServerActivate(edict_t* edict_list, \ + int edict_count, \ + int client_max) + +[!endif] +[!if IServerGameDLL_GameInit] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GAME_INIT + +#define DECL_HOOK_GAME_INIT \ + \ + bool HookedGameInit() + +[!endif] +[!if IServerGameDLL_GameFrame] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GAME_FRAME + +#define DECL_HOOK_GAME_FRAME \ + \ + void HookedGameFrame(bool simulating) + +[!endif] +[!if IServerGameDLL_GameShutdown] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GAME_SHUTDOWN + +#define DECL_HOOK_GAME_SHUTDOWN \ + \ + void HookedGameShutdown() + +[!endif] +[!if IServerGameDLL_LevelInit] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_LEVEL_INIT + +#define DECL_HOOK_LEVEL_INIT \ + \ + bool HookedLevelInit(const char* map_name, \ + char const* map_entities, \ + char const* old_level, \ + char const* landmark_name, \ + bool load_game, bool bkgnd) + +[!endif] +[!if IServerGameDLL_LevelShutdown] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_LEVEL_SHUTDOWN + +#define DECL_HOOK_LEVEL_SHUTDOWN \ + \ + void HookedLevelShutdown(); + +[!endif] +[!if IServerGameDLL_GetAllServerClasses] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_ALL_SERVER_CLASSES + +#define DECL_HOOK_GET_ALL_SERVER_CLASSES \ + \ + ServerClass* HookedGetAllServerClasses() + +[!endif] +[!if IServerGameDLL_GetTickInterval] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_TICK_INTERVAL + +#define DECL_HOOK_GET_TICK_INTERVAL \ + \ + float HookedGetTickInterval() const + +[!endif] +[!if IServerGameDLL_GetGameDescription] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_GAME_DESC + +#define DECL_HOOK_GET_GAME_DESC \ + \ + const char* HookedGetGameDescription() + +[!endif] +[!if IServerGameClients_ClientActive] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_ACTIVE + +#define DECL_HOOK_CLIENT_ACTIVE \ + \ + void HookedClientActive(edict_t* entity, \ + bool load_game) + +[!endif] +[!if IServerGameClients_ClientConnect] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_CONNECT + +#define DECL_HOOK_CLIENT_CONNECT \ + \ + bool HookedClientConnect(edict_t* entity, \ + const char* name, \ + const char* address, \ + char* reject, \ + int reject_len) + +[!endif] +[!if IServerGameClients_ClientDisconnect] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_DISCONNECT + +#define DECL_HOOK_CLIENT_DISCONNECT \ + \ + void HookedClientDisconnect(edict_t* entity) + +[!endif] +[!if IServerGameClients_ClientCommand] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_COMMAND + +#if SOURCE_ENGINE >= SE_ORANGEBOX +#define DECL_HOOK_CLIENT_COMMAND \ + \ + void HookedClientCommand(edict_t* entity, \ + const CCommand& args) +#else +#define DECL_HOOK_CLIENT_COMMAND \ + \ + void HookedClientCommand(edict_t* entity) +#endif + +[!endif] +[!if IServerGameClients_ClientPutInServer] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_PUT_IN_SERVER + +#define DECL_HOOK_CLIENT_PUT_IN_SERVER \ + \ + void HookedClientPutInServer(edict_t* entity, \ + char const* name) + +[!endif] +[!if IServerGameClients_ClientSettingsChanged] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_SETTINGS_CHANGED + +#define DECL_HOOK_CLIENT_SETTINGS_CHANGED \ + \ + void HookedClientSettingsChanged(edict_t* edict) + +[!endif] +[!if IServerGameClients_ClientSetupVisibility] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_SETUP_VISIBILITY + +#define DECL_HOOK_CLIENT_SETUP_VISIBILITY \ + \ + void HookedClientSetupVisibility(edict_t* view_entity, \ + edict_t* client, \ + unsigned char *pvs, \ + int pvs_size) + +[!endif] +[!if IServerGameClients_ClientEarPosition] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_CLIENT_EAR_POSITION + +#define DECL_HOOK_CLIENT_EAR_POSITION \ + \ + void HookedClientEarPosition(edict_t* entity, \ + Vector* ear_origin) + +[!endif] +[!if IServerGameClients_PostClientMessagesSent] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_POST_CLIENT_MESSAGES_SENT + +#define DECL_HOOK_POST_CLIENT_MESSAGES_SENT \ + \ + void HookedPostClientMessagesSent() + +[!endif] +[!if IServerGameClients_ProcessUsercmds] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_PROCESS_USER_CMDS + +#define DECL_HOOK_PROCESS_USER_CMDS \ + \ + float HookedProcessUsercmds(edict_t* player, \ + bf_read* buf, \ + int num_cmds, \ + int total_cmds, \ + int dropped_packets, \ + bool ignore, \ + bool paused) + +[!endif] +[!if IServerGameClients_NetworkIDValidated] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_NETWORK_ID_VALIDATED + +#define DECL_HOOK_NETWORK_ID_VALIDATED \ + \ + void HookedNetworkIDValidated(const char* user_name, \ + const char* network_id) + +[!endif] +[!if IServerGameClients_GetPlayerLimits] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_PLAYER_LIMITS + +#define DECL_HOOK_GET_PLAYER_LIMITS \ + \ + void HookedGetPlayerLimits(int& min_players, \ + int& max_players, \ + int& default_max) const + +[!endif] +[!if IServerGameClients_GetPlayerState] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_PLAYER_STATE + +#define DECL_HOOK_GET_PLAYER_STATE \ + \ + CPlayerState* HookedGetPlayerState(edict_t* player) + +[!endif] +[!if IServerGameClients_GetReplayDelay] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_REPLAY_DELAY + +#define DECL_HOOK_GET_REPLAY_DELAY \ + \ + int HookedGetReplayDelay(edict_t* player, \ + int& entity) + +[!endif] +[!if IServerGameClients_GetBugReportInfo] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_GET_BUG_REPORT_INFO + +#define DECL_HOOK_GET_BUG_REPORT_INFO \ + \ + void HookedGetBugReportInfo(char* buf, int size) + +[!endif] +[!if IServerGameClients_SetCommandClient] +///////////////////////////////////////////////////////////////////////// +// Define DECL_HOOK_SET_COMMAND_CLIENT + +#define DECL_HOOK_SET_COMMAND_CLIENT \ + \ + void HookedSetCommandClient(int index) + +[!endif] +#endif // _PLUGIN_HOOKS_H diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp new file mode 100644 index 0000000..12f8699 --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.cpp @@ -0,0 +1,215 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File: [!output PLUGIN_CLASS].cpp +// Author: [!output PLUGIN_AUTHOR] +// Date: [!output CURRENT_DATE] +// +// License: [!output PLUGIN_LICENSE] +// +// This software is provided 'as-is', without any express or +// implied warranty. In no event will the authors be held liable +// for any damages arising from the use of this software. +// +// Based on code written by AlliedModders LLC. Sample Plugin +// +/////////////////////////////////////////////////////////////////////////////// + +#include "StdMMS.h" + +///////////////////////////////////////////////////////////////////////// +// Global Variables + +IServerGameDLL* [!output PLUGIN_CLASS]::GameServer(NULL); +IServerGameClients* [!output PLUGIN_CLASS]::GameClients(NULL); +IVEngineServer* [!output PLUGIN_CLASS]::EngineServer(NULL); +IServerPluginHelpers* [!output PLUGIN_CLASS]::PluginHelpers(NULL); +IGameEventManager2* [!output PLUGIN_CLASS]::GameEvents(NULL); +IServerPluginCallbacks* [!output PLUGIN_CLASS]::VspCallbacks(NULL); +IPlayerInfoManager* [!output PLUGIN_CLASS]::PlayerInfoManager(NULL); +ICvar* [!output PLUGIN_CLASS]::CVar(NULL); +CGlobalVars* [!output PLUGIN_CLASS]::GlobalVars(NULL); + + +///////////////////////////////////////////////////////////////////////// +// Class BaseAccessor + +// This is needed to register cvars / CON_COMMANDs + +class BaseAccessor : public IConCommandBaseAccessor +{ + public: + + bool RegisterConCommandBase(ConCommandBase *pCommandBase) + { + // Always call META_REGCVAR instead + // of going through the [!output PLUGIN_CLASS]::EngineServer + + return META_REGCVAR(pCommandBase); + } +} +s_BaseAccessor; + + +/////////////////////////////////////////////////////////////////////////////// +// Expose the Plugin + +[!output PLUGIN_CLASS] [!output PLUGIN_CLASS]::Global; + +PLUGIN_EXPOSE([!output PLUGIN_CLASS], [!output PLUGIN_CLASS]::Global); + + +///////////////////////////////////////////////////////////////////////// +// Load + +bool [!output PLUGIN_CLASS]::Load(PluginId id, ISmmAPI* ismm, char* error, size_t maxlen, bool late) +{ + PLUGIN_SAVEVARS(); + + // Get the current Enginefactory interfaces + + GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::EngineServer, IVEngineServer, INTERFACEVERSION_VENGINESERVER); + GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::GameEvents, IGameEventManager2, INTERFACEVERSION_GAMEEVENTSMANAGER2); + GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::PluginHelpers, IServerPluginHelpers, INTERFACEVERSION_ISERVERPLUGINHELPERS); + GET_V_IFACE_CURRENT(GetEngineFactory, [!output PLUGIN_CLASS]::CVar, ICvar, CVAR_INTERFACE_VERSION); + + // Get the current ServerFactory interfaces + + GET_V_IFACE_ANY(GetServerFactory, [!output PLUGIN_CLASS]::GameServer, IServerGameDLL, INTERFACEVERSION_SERVERGAMEDLL); + GET_V_IFACE_ANY(GetServerFactory, [!output PLUGIN_CLASS]::GameClients, IServerGameClients, INTERFACEVERSION_SERVERGAMECLIENTS); + GET_V_IFACE_ANY(GetServerFactory, [!output PLUGIN_CLASS]::PlayerInfoManager, IPlayerInfoManager, INTERFACEVERSION_PLAYERINFOMANAGER); + + // Get the current Globals interfaces + + [!output PLUGIN_CLASS]::GlobalVars = ismm->GetCGlobals(); + + // Load the VSP listener. This is usually needed for IServerPluginHelpers + + #if defined METAMOD_PLAPI_VERSION + if (([!output PLUGIN_CLASS]::VspCallbacks = ismm->GetVSPInfo(NULL)) == NULL) + #endif + { + ismm->AddListener(this, this); + ismm->EnableVSPListener(); + } + + // Add the hooks + + AddHooks(); + + // Get the engine server interface + + #if SOURCE_ENGINE == SE_EPISODEONE + + m_engine_server = SH_GET_CALLCLASS([!output PLUGIN_CLASS]::EngineServer); + + #endif + + ENGINE_CALL(&IVEngineServer::LogPrint)("All hooks started!\n"); + + // Register the base accessor + + #if SOURCE_ENGINE >= SE_ORANGEBOX + + g_pCVar = [!output PLUGIN_CLASS]::CVar; + ConVar_Register(0, &s_BaseAccessor); + + #else + + ConCommandBaseMgr::OneTimeInit(&s_BaseAccessor); + + #endif + + return true; +} + +///////////////////////////////////////////////////////////////////////// +// Unload + +bool [!output PLUGIN_CLASS]::Unload(char *error, size_t maxlen) +{ + // Remove the hooks + + RemoveHooks(); + + // Release the engine server interface + + #if SOURCE_ENGINE == SE_EPISODEONE + + SH_RELEASE_CALLCLASS(m_engine_server); + + #endif + + return true; +} + +///////////////////////////////////////////////////////////////////////// +// OnVSPListening + +void [!output PLUGIN_CLASS]::OnVSPListening(IServerPluginCallbacks* vsp_callbacks) +{ + [!output PLUGIN_CLASS]::VspCallbacks = vsp_callbacks; +} + +///////////////////////////////////////////////////////////////////////// +// GetVersion + +const char* [!output PLUGIN_CLASS]::GetVersion() +{ + return "1.0.0.0"; +} + +///////////////////////////////////////////////////////////////////////// +// GetDate + +const char* [!output PLUGIN_CLASS]::GetDate() +{ + return __DATE__; +} + +///////////////////////////////////////////////////////////////////////// +// GetLogTag + +const char* [!output PLUGIN_CLASS]::GetLogTag() +{ + return "[!output PLUGIN_NAME]Log"; +} + +///////////////////////////////////////////////////////////////////////// +// GetLicense + +const char* [!output PLUGIN_CLASS]::GetLicense() +{ + return "[!output PLUGIN_LICENSE]"; +} + +///////////////////////////////////////////////////////////////////////// +// GetAuthor + +const char* [!output PLUGIN_CLASS]::GetAuthor() +{ + return "[!output PLUGIN_AUTHOR]"; +} + +///////////////////////////////////////////////////////////////////////// +// GetDescription + +const char* [!output PLUGIN_CLASS]::GetDescription() +{ + return "[!output PLUGIN_DESC]"; +} + +///////////////////////////////////////////////////////////////////////// +// GetName + +const char* [!output PLUGIN_CLASS]::GetName() +{ + return "[!output PLUGIN_NAME]"; +} + +///////////////////////////////////////////////////////////////////////// +// GetURL + +const char* [!output PLUGIN_CLASS]::GetURL() +{ + return "[!output PLUGIN_URL]"; +} diff --git a/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h new file mode 100644 index 0000000..fe934a8 --- /dev/null +++ b/support/msvc_project_templates/VC/VCWizards/AppWiz/Metamod/MMSProjectTemplate/Templates/1033/plugin_mm.h @@ -0,0 +1,173 @@ +/////////////////////////////////////////////////////////////////////////////// +// +// File: [!output PLUGIN_CLASS].h +// Author: [!output PLUGIN_AUTHOR] +// Date: [!output CURRENT_DATE] +// +// License: [!output PLUGIN_LICENSE] +// +// This software is provided 'as-is', without any express or +// implied warranty. In no event will the authors be held liable +// for any damages arising from the use of this software. +// +// Based on code written by AlliedModders LLC. Sample Plugin +// +/////////////////////////////////////////////////////////////////////////////// + +#ifndef _PLUGIN_H +#define _PLUGIN_H + +///////////////////////////////////////////////////////////////////////// + +class CCommand; + +///////////////////////////////////////////////////////////////////////// +// Class [!output PLUGIN_CLASS] + +class [!output PLUGIN_CLASS] : public ISmmPlugin, public IMetamodListener +{ + //////////////////////////////////////// + // Plugin Interface + + public: + + virtual bool Load(PluginId id, + ISmmAPI* ismm, + char* error, + size_t maxlen, + bool late); + + virtual bool Unload(char* error, size_t maxlen); + virtual void OnVSPListening(IServerPluginCallbacks* vsp_callbacks); + + //////////////////////////////////////// + // Plugin Info + + public: + + virtual const char* GetAuthor(); + virtual const char* GetName(); + virtual const char* GetDescription(); + virtual const char* GetURL(); + virtual const char* GetLicense(); + virtual const char* GetVersion(); + virtual const char* GetDate(); + virtual const char* GetLogTag(); + + //////////////////////////////////////// + // Plugin Globals + + public: + + static IServerGameDLL* GameServer; + static IServerGameClients* GameClients; + static IVEngineServer* EngineServer; + static IServerPluginHelpers* PluginHelpers; + static IGameEventManager2* GameEvents; + static IServerPluginCallbacks* VspCallbacks; + static IPlayerInfoManager* PlayerInfoManager; + static ICvar* CVar; + static CGlobalVars* GlobalVars; + + static [!output PLUGIN_CLASS] Global; + + //////////////////////////////////////// + // Hooks + + private: + + void AddHooks(); + void RemoveHooks(); + +[!if IServerGameDLL_ServerActivate] + DECL_HOOK_SERVER_ACTIVATE; +[!endif] +[!if IServerGameDLL_GameInit] + DECL_HOOK_GAME_INIT; +[!endif] +[!if IServerGameDLL_GameFrame] + DECL_HOOK_GAME_FRAME; +[!endif] +[!if IServerGameDLL_GameShutdown] + DECL_HOOK_GAME_SHUTDOWN; +[!endif] +[!if IServerGameDLL_LevelInit] + DECL_HOOK_LEVEL_INIT; +[!endif] +[!if IServerGameDLL_LevelShutdown] + DECL_HOOK_LEVEL_SHUTDOWN; +[!endif] +[!if IServerGameDLL_GetAllServerClasses] + DECL_HOOK_GET_ALL_SERVER_CLASSES; +[!endif] +[!if IServerGameDLL_GetTickInterval] + DECL_HOOK_GET_TICK_INTERVAL; +[!endif] +[!if IServerGameDLL_GetGameDescription] + DECL_HOOK_GET_GAME_DESC; +[!endif] +[!if IServerGameClients_ClientActive] + DECL_HOOK_CLIENT_ACTIVE; +[!endif] +[!if IServerGameClients_ClientConnect] + DECL_HOOK_CLIENT_CONNECT; +[!endif] +[!if IServerGameClients_ClientDisconnect] + DECL_HOOK_CLIENT_DISCONNECT; +[!endif] +[!if IServerGameClients_ClientCommand] + DECL_HOOK_CLIENT_COMMAND; +[!endif] +[!if IServerGameClients_ClientPutInServer] + DECL_HOOK_CLIENT_PUT_IN_SERVER; +[!endif] +[!if IServerGameClients_ClientSettingsChanged] + DECL_HOOK_CLIENT_SETTINGS_CHANGED; +[!endif] +[!if IServerGameClients_ClientSetupVisibility] + DECL_HOOK_CLIENT_SETUP_VISIBILITY; +[!endif] +[!if IServerGameClients_ClientEarPosition] + DECL_HOOK_CLIENT_EAR_POSITION; +[!endif] +[!if IServerGameClients_PostClientMessagesSent] + DECL_HOOK_POST_CLIENT_MESSAGES_SENT; +[!endif] +[!if IServerGameClients_ProcessUsercmds] + DECL_HOOK_PROCESS_USER_CMDS; +[!endif] +[!if IServerGameClients_NetworkIDValidated] + DECL_HOOK_NETWORK_ID_VALIDATED; +[!endif] +[!if IServerGameClients_GetPlayerLimits] + DECL_HOOK_GET_PLAYER_LIMITS; +[!endif] +[!if IServerGameClients_GetPlayerState] + DECL_HOOK_GET_PLAYER_STATE; +[!endif] +[!if IServerGameClients_GetReplayDelay] + DECL_HOOK_GET_REPLAY_DELAY; +[!endif] +[!if IServerGameClients_GetBugReportInfo] + DECL_HOOK_GET_BUG_REPORT_INFO; +[!endif] +[!if IServerGameClients_SetCommandClient] + DECL_HOOK_SET_COMMAND_CLIENT; +[!endif] + + //////////////////////////////////////// + // Plugin Variables + + protected: + + #if SOURCE_ENGINE == SE_EPISODEONE + SourceHook::CallClass* m_engine_server; + #endif +}; + +///////////////////////////////////////////////////////////////////////// +// Global Vars + +PLUGIN_GLOBALVARS(); + +#endif // _PLUGIN_H