mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(console): implement ConsoleInitializeClientCommand
This commit is contained in:
parent
08faeb135d
commit
fb0934af0f
@ -1,10 +1,24 @@
|
|||||||
#include "console/Client.hpp"
|
#include "console/Client.hpp"
|
||||||
#include "CVar.hpp"
|
#include "CommandHandlers.hpp"
|
||||||
|
#include "console/CVar.hpp"
|
||||||
|
#include "console/Command.hpp"
|
||||||
|
|
||||||
static const char* s_filename;
|
static const char* s_filename;
|
||||||
|
|
||||||
|
void ConsoleInitializeCommonCommand() {
|
||||||
|
ConsoleCommandRegister("quit", ConsoleCommand_Quit, DEFAULT, NOHELP);
|
||||||
|
ConsoleCommandRegister("ver", ConsoleCommand_Ver, DEFAULT, NOHELP);
|
||||||
|
ConsoleCommandRegister("setmap", ConsoleCommand_SetMap, DEFAULT, NOHELP);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConsoleInitializeDebugCommand() {
|
||||||
|
// Unknown without debug build
|
||||||
|
}
|
||||||
|
|
||||||
void ConsoleInitializeClientCommand() {
|
void ConsoleInitializeClientCommand() {
|
||||||
// TODO
|
ConsoleCommandInitialize();
|
||||||
|
ConsoleInitializeCommonCommand();
|
||||||
|
ConsoleInitializeDebugCommand();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConsoleInitializeClientCVar(const char* filename) {
|
void ConsoleInitializeClientCVar(const char* filename) {
|
||||||
|
|||||||
@ -3,6 +3,6 @@
|
|||||||
|
|
||||||
void ConsoleInitializeClientCommand();
|
void ConsoleInitializeClientCommand();
|
||||||
|
|
||||||
void ConsoleInitializeClientCVar(const char* a1);
|
void ConsoleInitializeClientCVar(const char* filename);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
#include "console/Command.hpp"
|
#include "console/Command.hpp"
|
||||||
|
#include "console/CommandHandlers.hpp"
|
||||||
#include <storm/Error.hpp>
|
#include <storm/Error.hpp>
|
||||||
|
|
||||||
int32_t ValidateFileName(const char* filename) {
|
int32_t ValidateFileName(const char* filename) {
|
||||||
@ -68,19 +69,3 @@ void ConsoleCommandUnregister(const char* command) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int32_t ConsoleCommand_Help(const char* command, const char* arguments) {
|
|
||||||
// TODO
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t ConsoleCommand_Quit(const char* command, const char* arguments) {
|
|
||||||
// TODO
|
|
||||||
// ConsolePostClose()
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t ConsoleCommand_Ver(const char* command, const char* arguments) {
|
|
||||||
// TODO
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -48,10 +48,4 @@ int32_t ConsoleCommandRegister(const char* command, int32_t (*handler)(const cha
|
|||||||
|
|
||||||
void ConsoleCommandUnregister(const char* command);
|
void ConsoleCommandUnregister(const char* command);
|
||||||
|
|
||||||
int32_t ConsoleCommand_Help(const char* command, const char* arguments);
|
|
||||||
|
|
||||||
int32_t ConsoleCommand_Quit(const char* command, const char* arguments);
|
|
||||||
|
|
||||||
int32_t ConsoleCommand_Ver(const char* command, const char* arguments);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
24
src/console/CommandHandlers.cpp
Normal file
24
src/console/CommandHandlers.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "console/CommandHandlers.hpp"
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_Help(const char* command, const char* arguments) {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_Quit(const char* command, const char* arguments) {
|
||||||
|
// TODO
|
||||||
|
// ConsolePostClose()
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_SetMap(const char* command, const char* arguments) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_Ver(const char* command, const char* arguments) {
|
||||||
|
// TODO
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
14
src/console/CommandHandlers.hpp
Normal file
14
src/console/CommandHandlers.hpp
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#ifndef CONSOLE_COMMAND_HANDLERS_HPP
|
||||||
|
#define CONSOLE_COMMAND_HANDLERS_HPP
|
||||||
|
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_Help(const char* command, const char* arguments);
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_Quit(const char* command, const char* arguments);
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_SetMap(const char* command, const char* arguments);
|
||||||
|
|
||||||
|
int32_t ConsoleCommand_Ver(const char* command, const char* arguments);
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in New Issue
Block a user