Subversion Repositories WoWGM

Rev

Rev 34 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
36 tristanc 1
/******************************************************************************
34 tristanc 2
*
3
*   ClientCommands.cpp
4
*
5
*
36 tristanc 6
*   By Tristan Cormier - 11/20/2024
7
*
34 tristanc 8
***/
9
 
36 tristanc 10
 
3 tristanc 11
#include "pch.h"
12
#pragma hdrstop
13
 
14
#include "ClientCommands.h"
6 tristanc 15
 
3 tristanc 16
#include <ClientDebugCommands.h>
6 tristanc 17
#include <ClientGMCommands.h>
3 tristanc 18
#include <Console/ConsoleClient.h>
19
#include <FrameScript/FrameScript.h>
20
#include <WowSvcs/ClientServices.h>
21
 
31 tristanc 22
 
36 tristanc 23
/******************************************************************************
24
*
25
*   Exports
26
*
27
***/
33 tristanc 28
 
36 tristanc 29
//=============================================================================
30
BOOL CCommand_Beastmaster (char const * commandStr, char const * arguments) {
31
    bool enable = SStrCmpI(arguments, "off") != 0;
32
 
33
    CDataStore msg;
34
    msg.Put(CMSG_BEASTMASTER);
35
    msg.Put(enable);
36
    msg.Finalize();
34 tristanc 37
 
36 tristanc 38
    ClientServices_Send(&msg);
39
 
40
    return TRUE;
41
}
34 tristanc 42
 
36 tristanc 43
//=============================================================================
44
BOOL CCommand_Bug (char const * commandStr, char const * arguments) {
45
    unsigned int category;
46
    if (!SStrCmpI(commandStr, "bug"))
47
        category = 0;
48
    else if (!SStrCmpI(commandStr, "suggestion"))
49
        category = 1;
34 tristanc 50
 
36 tristanc 51
    if (ClientServices_Report(category, arguments))
52
        ConsolePrintf("%s submitted", commandStr);
53
    else
54
        ConsolePrintf("%s submission failed", commandStr);
34 tristanc 55
 
36 tristanc 56
    return TRUE;
34 tristanc 57
}
58
 
36 tristanc 59
//=============================================================================
60
BOOL CCommand_Godmode (char const * commandStr, char const * arguments) {	
61
    if (arguments && *arguments) {
62
        int enable = atoi(arguments);
3 tristanc 63
 
36 tristanc 64
        CDataStore msg;
65
        msg.Put(CMSG_GODMODE);
66
        msg.Put(enable);
67
        msg.Finalize();
3 tristanc 68
 
36 tristanc 69
        ClientServices_Send(&msg);
70
    }
31 tristanc 71
 
36 tristanc 72
    return TRUE;
3 tristanc 73
}
36 tristanc 74
 
75
 
76
//===================================
77
// MIT License
78
//
79
// Copyright (c) 2024 by Tristan Cormier
80
//
81
// Permission is hereby granted, free of charge, to any person obtaining a copy
82
// of this software and associated documentation files (the "Software"), to deal
83
// in the Software without restriction, including without limitation the rights
84
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
85
// copies of the Software, and to permit persons to whom the Software is
86
// furnished to do so, subject to the following conditions:
87
//
88
// The above copyright notice and this permission notice shall be included in
89
// all copies or substantial portions of the Software.
90
// 
91
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
92
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
93
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
94
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
95
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
96
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
97
// THE SOFTWARE.
98
//===================================