Subversion Repositories WoWGM

Rev

Rev 34 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34 Rev 36
Line 1... Line 1...
1
/****************************************************************************
1
/******************************************************************************
2
*
2
*
3
*   ClientCommands.cpp
3
*   ClientCommands.cpp
4
*
4
*
-
 
5
*
5
*   Client game commands
6
*   By Tristan Cormier - 11/20/2024
6
*
7
*
7
***/
8
***/
8
 
9
 
-
 
10
 
9
#include "pch.h"
11
#include "pch.h"
10
#pragma hdrstop
12
#pragma hdrstop
11
 
13
 
12
#include "ClientCommands.h"
14
#include "ClientCommands.h"
13
 
15
 
Line 16... Line 18...
16
#include <Console/ConsoleClient.h>
18
#include <Console/ConsoleClient.h>
17
#include <FrameScript/FrameScript.h>
19
#include <FrameScript/FrameScript.h>
18
#include <WowSvcs/ClientServices.h>
20
#include <WowSvcs/ClientServices.h>
19
 
21
 
20
 
22
 
-
 
23
/******************************************************************************
-
 
24
*
-
 
25
*   Exports
-
 
26
*
-
 
27
***/
-
 
28
 
21
//===========================================================================
29
//=============================================================================
22
BOOL CCommand_Beastmaster (char const* commandStr, char const* arguments) {
30
BOOL CCommand_Beastmaster (char const * commandStr, char const * arguments) {
-
 
31
    bool enable = SStrCmpI(arguments, "off") != 0;
-
 
32
    
23
  CDataStore msg;
33
    CDataStore msg;
24
  msg.Put(CMSG_BEASTMASTER);
34
    msg.Put(CMSG_BEASTMASTER);
25
  BYTE val = SStrCmpI(arguments, "off") != 0;
-
 
26
  msg.Put(val);
35
    msg.Put(enable);
27
  msg.Finalize();
36
    msg.Finalize();
-
 
37
 
28
  ClientServices_Send(&msg);
38
    ClientServices_Send(&msg);
-
 
39
    
29
  return TRUE;
40
    return TRUE;
30
}
41
}
31
 
42
 
32
//===========================================================================
43
//=============================================================================
33
BOOL CCommand_Bug (char const* command, char const* args) {
44
BOOL CCommand_Bug (char const * commandStr, char const * arguments) {
34
  //TODO:
-
 
35
  //ASSERT(command);
-
 
36
 
-
 
37
  unsigned int category;
45
    unsigned int category;
38
 
-
 
39
  if (!SStrCmpI(command, "bug"))
46
    if (!SStrCmpI(commandStr, "bug"))
40
    category = 0;
47
        category = 0;
41
  else if (!SStrCmpI(command, "suggestion"))
48
    else if (!SStrCmpI(commandStr, "suggestion"))
42
    category = 1;
49
        category = 1;
43
 
50
 
44
  if (ClientServices_Report(category, args))
51
    if (ClientServices_Report(category, arguments))
45
    ConsolePrintf("%s submitted", command);
52
        ConsolePrintf("%s submitted", commandStr);
46
  else
53
    else
47
    ConsolePrintf("%s submission failed", command);
54
        ConsolePrintf("%s submission failed", commandStr);
48
 
55
 
49
  return TRUE;
56
    return TRUE;
50
}
57
}
51
 
58
 
52
//===========================================================================
59
//=============================================================================
53
BOOL CCommand_Godmode (const char* cmd, const char* arguments) {	
60
BOOL CCommand_Godmode (char const * commandStr, char const * arguments) {	
54
	if (arguments && *arguments) {
61
    if (arguments && *arguments) {
55
		int enable = atoi(arguments);
62
        int enable = atoi(arguments);
56
 
63
 
57
		CDataStore msg;
64
        CDataStore msg;
58
		msg.Put(CMSG_GODMODE);
65
        msg.Put(CMSG_GODMODE);
59
		msg.Put(enable);
66
        msg.Put(enable);
60
		msg.Finalize();
67
        msg.Finalize();
61
 
68
 
62
		ClientServices_Send(&msg);
69
        ClientServices_Send(&msg);
63
	}
70
    }
64
 
71
 
65
	return TRUE;
72
    return TRUE;
66
}
73
}
-
 
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
//===================================
67
 
99