Nuclide
Software Development Kit for id Tech
error.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2023 Vera Visions LLC.
3 *
4 * Permission to use, copy, modify, and distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF MIND, USE, DATA OR PROFITS, WHETHER
13 * IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
14 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15*/
16
17var string g_lastDisconnectReason = "";
18
23bool
25{
26 string disconnectReason;
27
28 disconnectReason = cvar_string("_cl_disconnectreason");
29
30 /* still empty */
31 if (disconnectReason == "") {
32 return false;
33 }
34
35 /* save to cache */
36 g_lastDisconnectReason = disconnectReason;
37 cvar_set("_cl_disconnectreason", "");
38 return true;
39}
40
44string
46{
48}
var string g_lastDisconnectReason
Definition: error.h:17
bool Error_ServerDisconnected(void)
Query if we've been disconnected from the server.
Definition: error.h:24
string Error_GetDisconnectReason(void)
Query the last reason for a server disconnect.
Definition: error.h:45