UFO: Alien Invasion
Loading...
Searching...
No Matches
web_cgame.h File Reference

UFOAI web interface management. c(lient)game related stuff. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

bool WEB_CGameUpload (const char *cgameId, int category, const char *filename)
 Uploads a file to the server.
bool WEB_CGameDelete (const char *cgameId, int category, const char *filename)
 Deletes a user owned file on the server.
bool WEB_CGameDownloadFromUser (const char *cgameId, int category, const char *filename, int userId=-1)
 Downloads a file from the server and store it in the user directory.
int WEB_CGameListForUser (const char *cgameId, int category, int userId=-1)
 Shows the uploaded files for the particular cgame category and the given userid.
void WEB_CGameCvars (void)
void WEB_CGameCommands (void)

Detailed Description

UFOAI web interface management. c(lient)game related stuff.

Definition in file web_cgame.h.

Function Documentation

◆ WEB_CGameCommands()

void WEB_CGameCommands ( void )

◆ WEB_CGameCvars()

void WEB_CGameCvars ( void )

◆ WEB_CGameDelete()

bool WEB_CGameDelete ( const char * cgameId,
int category,
const char * filename )

Deletes a user owned file on the server.

Parameters
[in]cgameIdThe cgame id that is used to get the file.
[in]categoryThe category of the cgame.
[in]filenameThe filename to replace in the URL.
Note
The current authenticated user will be taken.
Returns
true if the deletion of the file was successful, false otherwise.

Definition at line 152 of file web_cgame.cpp.

References Com_Printf(), Com_SkipPath(), Com_StripExtension(), MAX_VAR, UI_ExecuteConfunc(), URL_SIZE, web_cgamedeleteurl, WEB_CGameGetURL(), WEB_CheckAuth(), WEB_GetURL(), and web_userid.

Referenced by GAME_WebDelete(), TEST_F(), and WEB_DeleteCGame_f().

◆ WEB_CGameDownloadFromUser()

bool WEB_CGameDownloadFromUser ( const char * cgameId,
int category,
const char * filename,
int userId )

Downloads a file from the server and store it in the user directory.

Parameters
[in]cgameIdThe cgame id that is used to get the file.
[in]categoryThe category of the cgame.
[in]filenameThe filename to replace in the URL.
[in]userIdThe user id to get the file for. If this is -1 (the default), the current authenticated user will be taken.
Returns
true if the download of the file was successful, false otherwise.

Definition at line 187 of file web_cgame.cpp.

References Com_Printf(), f, FILE_WRITE, FS_OpenFile(), GAME_GetRelativeSavePath(), HTTP_GetToFile(), MAX_OSPATH, Q_strcat(), URL_SIZE, web_cgamedownloadurl, and WEB_CGameGetURL().

Referenced by GAME_WebDownloadFromUser(), TEST_F(), and WEB_DownloadCGame_f().

◆ WEB_CGameListForUser()

int WEB_CGameListForUser ( const char * cgameId,
int category,
int userId )

Shows the uploaded files for the particular cgame category and the given userid.

Parameters
[in]cgameIdThe cgame id that is used to get a filelist for.
[in]categoryThe category of the cgame.
[in]userIdThe user id to get the file list for. If this is -1 (the default), the current authenticated user will be taken.
Returns
The amount of files that were found on the server. Or -1 on error.

Definition at line 310 of file web_cgame.cpp.

References Com_Printf(), count, UI_ExecuteConfunc(), URL_SIZE, WEB_CGameGetURL(), web_cgamelisturl, WEB_CheckAuth(), WEB_GetURL(), WEB_ListCGameFilesCallback(), and web_userid.

Referenced by GAME_WebListForUser(), TEST_F(), and WEB_ListCGame_f().

◆ WEB_CGameUpload()

bool WEB_CGameUpload ( const char * cgameId,
int category,
const char * filename )

Uploads a file to the server.

Parameters
[in]cgameIdThe cgame id that is used to upload the file.
[in]categoryThe category of the cgame.
[in]filenameThe filename part below the gamedir
Note
The current authenticated user will be taken.
Files can only get uploaded from within the user directory. You can't upload game provided content.
Returns
true if the upload of the file was successful, false otherwise.

Definition at line 106 of file web_cgame.cpp.

References Com_Printf(), FS_FileExists(), FS_Gamedir(), Q_strnull(), UI_ExecuteConfunc(), URL_SIZE, va(), WEB_CGameGetURL(), web_cgameuploadurl, WEB_CheckAuth(), and WEB_PutFile().

Referenced by GAME_WebUpload(), TEST_F(), and WEB_UploadCGame_f().