mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-17 11:35:08 -04:00
Add /skin singleplayer command
This commit is contained in:
parent
0a5cd607b0
commit
980f90283a
@ -253,6 +253,25 @@ static struct ChatCommand ModelCommand = {
|
||||
}
|
||||
};
|
||||
|
||||
static void SkinCommand_Execute(const cc_string* args, int argsCount) {
|
||||
if (argsCount) {
|
||||
Entity_SetSkin(&Entities.CurPlayer->Base, args);
|
||||
} else {
|
||||
Chat_AddRaw("&e/client skin: &cYou didn't specify a skin name.");
|
||||
}
|
||||
}
|
||||
|
||||
static struct ChatCommand SkinCommand = {
|
||||
"Skin", SkinCommand_Execute,
|
||||
COMMAND_FLAG_SINGLEPLAYER_ONLY | COMMAND_FLAG_UNSPLIT_ARGS,
|
||||
{
|
||||
"&a/client skin [name]",
|
||||
"&eChanges to the skin to the given player",
|
||||
"&a/client skin [url]",
|
||||
"&eChanges skin to a URL linking directly to a .PNG",
|
||||
}
|
||||
};
|
||||
|
||||
static void ClearDeniedCommand_Execute(const cc_string* args, int argsCount) {
|
||||
int count = TextureCache_ClearDenied();
|
||||
Chat_Add1("Removed &e%i &fdenied texture pack URLs.", &count);
|
||||
@ -724,6 +743,7 @@ static void OnInit(void) {
|
||||
Commands_Register(&RenderTypeCommand);
|
||||
Commands_Register(&ResolutionCommand);
|
||||
Commands_Register(&ModelCommand);
|
||||
Commands_Register(&SkinCommand);
|
||||
Commands_Register(&TeleportCommand);
|
||||
Commands_Register(&ClearDeniedCommand);
|
||||
Commands_Register(&MotdCommand);
|
||||
|
@ -935,6 +935,11 @@ static cc_result HttpBackend_Do(struct HttpRequest* req, cc_string* urlStr) {
|
||||
res = HttpBackend_PerformRequest(&state);
|
||||
retried = true;
|
||||
}
|
||||
if (res == ReturnCode_SocketDropped && !retried) {
|
||||
Platform_LogConst("Resetting connection due to being dropped..");
|
||||
res = HttpBackend_PerformRequest(&state);
|
||||
retried = true;
|
||||
}
|
||||
|
||||
if (res || !HttpClient_IsRedirect(req)) break;
|
||||
if (redirects >= 20) return HTTP_ERR_REDIRECTS;
|
||||
|
@ -31,9 +31,11 @@ enum File_SeekFrom { FILE_SEEKFROM_BEGIN, FILE_SEEKFROM_CURRENT, FILE_SEEKFROM_E
|
||||
|
||||
extern const cc_result ReturnCode_FileShareViolation;
|
||||
extern const cc_result ReturnCode_FileNotFound;
|
||||
extern const cc_result ReturnCode_DirectoryExists;
|
||||
extern const cc_result ReturnCode_SocketInProgess;
|
||||
extern const cc_result ReturnCode_SocketWouldBlock;
|
||||
extern const cc_result ReturnCode_DirectoryExists;
|
||||
/* Result code for when a socket connection has been dropped by the other side */
|
||||
extern const cc_result ReturnCode_SocketDropped;
|
||||
|
||||
/* Whether the launcher and game must both be run in the same process */
|
||||
/* (e.g. can't start a separate process on Mobile or Consoles) */
|
||||
|
@ -30,9 +30,10 @@ KOS_INIT_FLAGS(INIT_CONTROLLER | INIT_KEYBOARD | INIT_MOUSE |
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " Dreamcast";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -30,9 +30,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; /* TODO: not used apparently */
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = -EINPROGRESS; // net_XYZ error results are negative
|
||||
const cc_result ReturnCode_SocketWouldBlock = -EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = -EPIPE;
|
||||
|
||||
#ifdef HW_RVL
|
||||
const char* Platform_AppNameSuffix = " Wii";
|
||||
|
@ -23,9 +23,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000;
|
||||
const cc_result ReturnCode_FileNotFound = fnfErr;
|
||||
const cc_result ReturnCode_DirectoryExists = dupFNErr;
|
||||
const cc_result ReturnCode_SocketInProgess = 1000000;
|
||||
const cc_result ReturnCode_SocketWouldBlock = 1000000;
|
||||
const cc_result ReturnCode_DirectoryExists = dupFNErr;
|
||||
const cc_result ReturnCode_SocketDropped = 1000000;
|
||||
static long sysVersion;
|
||||
|
||||
#if TARGET_CPU_68K
|
||||
|
@ -23,9 +23,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " N64";
|
||||
cc_bool Platform_ReadonlyFilesystem = true;
|
||||
|
@ -36,9 +36,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " NDS";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -33,6 +33,7 @@ const cc_result ReturnCode_DirectoryExists = 99999;
|
||||
|
||||
const cc_result ReturnCode_SocketInProgess = -1;
|
||||
const cc_result ReturnCode_SocketWouldBlock = -1;
|
||||
const cc_result ReturnCode_SocketDropped = -1;
|
||||
|
||||
const char* Platform_AppNameSuffix = " PS1";
|
||||
cc_bool Platform_ReadonlyFilesystem = true;
|
||||
|
@ -46,6 +46,7 @@ const cc_result ReturnCode_DirectoryExists = -8;
|
||||
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " PS2";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -35,9 +35,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = 0x80010006; // ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = 0x80010014; // EEXIST
|
||||
const cc_result ReturnCode_SocketInProgess = NET_EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = NET_EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = 0x80010014; // EEXIST
|
||||
const cc_result ReturnCode_SocketDropped = NET_EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " PS3";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -24,9 +24,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " PSP";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -16,9 +16,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = SCE_NET_ERROR_EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = SCE_NET_ERROR_EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = SCE_NET_ERROR_EPIPE;
|
||||
static int epoll_id;
|
||||
static int stdout_fd;
|
||||
|
||||
|
@ -32,9 +32,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; /* TODO: not used apparently */
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
#define SUPPORTS_GETADDRINFO 1
|
||||
|
||||
#if defined CC_BUILD_ANDROID
|
||||
|
@ -31,6 +31,7 @@ const cc_result ReturnCode_DirectoryExists = 99999;
|
||||
|
||||
const cc_result ReturnCode_SocketInProgess = -1;
|
||||
const cc_result ReturnCode_SocketWouldBlock = -1;
|
||||
const cc_result ReturnCode_SocketDropped = -1;
|
||||
|
||||
const char* Platform_AppNameSuffix = " Saturn";
|
||||
cc_bool Platform_ReadonlyFilesystem = true;
|
||||
|
@ -29,9 +29,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; // not used
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " Switch";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -41,9 +41,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; /* TODO: not used apparently */
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " Wii U";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -37,9 +37,10 @@ static BOOL (WINAPI *_CryptUnprotectData)(DATA_BLOB* dataIn, PWSTR* dataDescr, P
|
||||
static HANDLE heap;
|
||||
const cc_result ReturnCode_FileShareViolation = ERROR_SHARING_VIOLATION;
|
||||
const cc_result ReturnCode_FileNotFound = ERROR_FILE_NOT_FOUND;
|
||||
const cc_result ReturnCode_DirectoryExists = ERROR_ALREADY_EXISTS;
|
||||
const cc_result ReturnCode_SocketInProgess = WSAEINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = WSAEWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = ERROR_ALREADY_EXISTS;
|
||||
const cc_result ReturnCode_SocketDropped = WSAECONNRESET;
|
||||
|
||||
const char* Platform_AppNameSuffix = "";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -19,9 +19,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = ERROR_SHARING_VIOLATION;
|
||||
const cc_result ReturnCode_FileNotFound = ERROR_FILE_NOT_FOUND;
|
||||
const cc_result ReturnCode_DirectoryExists = ERROR_ALREADY_EXISTS;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = ERROR_ALREADY_EXISTS;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " XBox";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
@ -25,9 +25,10 @@
|
||||
|
||||
const cc_result ReturnCode_FileShareViolation = 1000000000; /* TODO: not used apparently */
|
||||
const cc_result ReturnCode_FileNotFound = ENOENT;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketInProgess = EINPROGRESS;
|
||||
const cc_result ReturnCode_SocketWouldBlock = EWOULDBLOCK;
|
||||
const cc_result ReturnCode_DirectoryExists = EEXIST;
|
||||
const cc_result ReturnCode_SocketDropped = EPIPE;
|
||||
|
||||
const char* Platform_AppNameSuffix = " XBox 360";
|
||||
cc_bool Platform_ReadonlyFilesystem;
|
||||
|
Loading…
x
Reference in New Issue
Block a user