Xonotic
dialog_termsofservice.qh File Reference
#include "rootdialog.qh"
+ Include dependency graph for dialog_termsofservice.qh:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  XonoticToSDialog
 

Functions

void XonoticToS_OnGet (entity fh, entity me, int status)
 

Variables

int autocvar__termsofservice_accepted
 
const string termsofservice_url = "http://update.xonotic.org/tos.txt"
 

Function Documentation

◆ XonoticToS_OnGet()

void XonoticToS_OnGet ( entity  fh,
entity  me,
int  status 
)

Definition at line 31 of file dialog_termsofservice.qc.

References strcat(), strfree, strzone(), url_fclose(), url_fgets(), URL_READY_CANREAD, URL_READY_CLOSED, and URL_READY_ERROR.

Referenced by XonoticToSDialog_loadXonoticToS().

32 {
33  switch (status) {
34  case URL_READY_CLOSED:
35  {
36  break;
37  }
38  case URL_READY_ERROR:
39  {
40  me.text = strzone("Error reading ToS");
41  me.textBox.setText(me.textBox, me.text);
42  break;
43  }
44  case URL_READY_CANREAD:
45  {
46  strfree(me.text);
47  string temp = "";
48  for (string s; (s = url_fgets(fh)); )
49  {
50  if (temp != "")
51  temp = strcat(temp, "\n", s);
52  else
53  temp = s;
54  }
55  url_fclose(fh);
56  me.text = strzone(temp);
57  me.textBox.setText(me.textBox, me.text);
58  break;
59  }
60  default:
61  {
62  break;
63  }
64  }
65 }
const float URL_READY_CANREAD
Definition: urllib.qh:17
const float URL_READY_CLOSED
Definition: urllib.qh:15
spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 spree_cen s1 f1 s1 strcat(_("Level %s: "), "^BG%s\3\, _("^BGPress ^F2%s^BG to enter the game"))
ERASEABLE void url_fclose(entity e)
Definition: urllib.qc:207
const float URL_READY_ERROR
Definition: urllib.qh:14
#define strfree(this)
Definition: string.qh:56
ERASEABLE string url_fgets(entity e)
Definition: urllib.qc:287
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ autocvar__termsofservice_accepted

int autocvar__termsofservice_accepted

Definition at line 3 of file dialog_termsofservice.qh.

Referenced by XonoticToSDialog_fill(), and XonoticToSDialog_shouldShow().

◆ termsofservice_url

const string termsofservice_url = "http://update.xonotic.org/tos.txt"

Definition at line 4 of file dialog_termsofservice.qh.

Referenced by XonoticToSDialog_loadXonoticToS().