mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-15 18:45:23 -04:00
minor code tidyup
This commit is contained in:
parent
800cfe03d4
commit
65b2a861e6
@ -58,8 +58,8 @@ void Chat_SetLogName(const cc_string* name);
|
|||||||
/* Disables chat logging and closes currently open chat log file. */
|
/* Disables chat logging and closes currently open chat log file. */
|
||||||
void Chat_DisableLogging(void);
|
void Chat_DisableLogging(void);
|
||||||
/* Sends a chat message, raising ChatEvents.ChatSending event. */
|
/* Sends a chat message, raising ChatEvents.ChatSending event. */
|
||||||
/* NOTE: If logUsage is true, can press 'up' in chat input menu later to retype this. */
|
/* NOTE: If logUsage is true, can press 'up' in chat input menu later to retype this. */
|
||||||
/* NOTE: /client is always interpreted as client-side commands. */
|
/* NOTE: /client is always interpreted as client-side commands. */
|
||||||
/* In multiplayer this is sent to the server, in singleplayer just Chat_Add. */
|
/* In multiplayer this is sent to the server, in singleplayer just Chat_Add. */
|
||||||
CC_API void Chat_Send(const cc_string* text, cc_bool logUsage);
|
CC_API void Chat_Send(const cc_string* text, cc_bool logUsage);
|
||||||
/* Shorthand for Chat_AddOf(str, MSG_TYPE_NORMAL) */
|
/* Shorthand for Chat_AddOf(str, MSG_TYPE_NORMAL) */
|
||||||
|
@ -169,11 +169,11 @@ CC_API void TabList_Remove(EntityID id);
|
|||||||
CC_API void TabList_Set(EntityID id, const cc_string* player, const cc_string* list, const cc_string* group, cc_uint8 rank);
|
CC_API void TabList_Set(EntityID id, const cc_string* player, const cc_string* list, const cc_string* group, cc_uint8 rank);
|
||||||
|
|
||||||
/* Raw unformatted name (for Tab name auto complete) */
|
/* Raw unformatted name (for Tab name auto complete) */
|
||||||
#define TabList_UNSAFE_GetPlayer(id) StringsBuffer_UNSAFE_Get(&TabList._buffer, TabList.NameOffsets[id] - 3);
|
#define TabList_UNSAFE_GetPlayer(id) StringsBuffer_UNSAFE_Get(&TabList._buffer, TabList.NameOffsets[id] - 3)
|
||||||
/* Formatted name for display in tab list. */
|
/* Formatted name for display in tab list. */
|
||||||
#define TabList_UNSAFE_GetList(id) StringsBuffer_UNSAFE_Get(&TabList._buffer, TabList.NameOffsets[id] - 2);
|
#define TabList_UNSAFE_GetList(id) StringsBuffer_UNSAFE_Get(&TabList._buffer, TabList.NameOffsets[id] - 2)
|
||||||
/* Name of the group this entry is in (e.g. rank name, map name) */
|
/* Name of the group this entry is in (e.g. rank name, map name) */
|
||||||
#define TabList_UNSAFE_GetGroup(id) StringsBuffer_UNSAFE_Get(&TabList._buffer, TabList.NameOffsets[id] - 1);
|
#define TabList_UNSAFE_GetGroup(id) StringsBuffer_UNSAFE_Get(&TabList._buffer, TabList.NameOffsets[id] - 1)
|
||||||
|
|
||||||
/* Represents another entity in multiplayer */
|
/* Represents another entity in multiplayer */
|
||||||
struct NetPlayer {
|
struct NetPlayer {
|
||||||
|
@ -483,13 +483,13 @@ cc_result Socket_Connect(cc_socket* s, const cc_string* address, int port) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cc_result Socket_Read(cc_socket s, cc_uint8* data, cc_uint32 count, cc_uint32* modified) {
|
cc_result Socket_Read(cc_socket s, cc_uint8* data, cc_uint32 count, cc_uint32* modified) {
|
||||||
int recvCount = recv(s, data, count, 0);
|
int recvCount = recv(s, (char*)data, count, 0);
|
||||||
if (recvCount != -1) { *modified = recvCount; return 0; }
|
if (recvCount != -1) { *modified = recvCount; return 0; }
|
||||||
*modified = 0; return WSAGetLastError();
|
*modified = 0; return WSAGetLastError();
|
||||||
}
|
}
|
||||||
|
|
||||||
cc_result Socket_Write(cc_socket s, const cc_uint8* data, cc_uint32 count, cc_uint32* modified) {
|
cc_result Socket_Write(cc_socket s, const cc_uint8* data, cc_uint32 count, cc_uint32* modified) {
|
||||||
int sentCount = send(s, data, count, 0);
|
int sentCount = send(s, (const char*)data, count, 0);
|
||||||
if (sentCount != -1) { *modified = sentCount; return 0; }
|
if (sentCount != -1) { *modified = sentCount; return 0; }
|
||||||
*modified = 0; return WSAGetLastError();
|
*modified = 0; return WSAGetLastError();
|
||||||
}
|
}
|
||||||
|
@ -173,6 +173,7 @@ int Convert_ToBase64(const void* data, int len, char* dst) {
|
|||||||
return (int)(dst - beg);
|
return (int)(dst - beg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Maps a base 64 character back into a 6 bit integer */
|
||||||
CC_NOINLINE static int DecodeBase64(char c) {
|
CC_NOINLINE static int DecodeBase64(char c) {
|
||||||
if (c >= 'A' && c <= 'Z') return (c - 'A');
|
if (c >= 'A' && c <= 'Z') return (c - 'A');
|
||||||
if (c >= 'a' && c <= 'z') return (c - 'a') + 26;
|
if (c >= 'a' && c <= 'z') return (c - 'a') + 26;
|
||||||
|
@ -3,7 +3,6 @@
|
|||||||
#include "Logger.h"
|
#include "Logger.h"
|
||||||
#include "Constants.h"
|
#include "Constants.h"
|
||||||
|
|
||||||
|
|
||||||
/*########################################################################################################################*
|
/*########################################################################################################################*
|
||||||
*---------------------------------------------------------Memory----------------------------------------------------------*
|
*---------------------------------------------------------Memory----------------------------------------------------------*
|
||||||
*#########################################################################################################################*/
|
*#########################################################################################################################*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user