Crossfire Client, Trunk
account.c File Reference
#include "client.h"
#include <ctype.h>
#include <gtk/gtk.h>
#include "image.h"
#include "main.h"
#include "metaserver.h"
#include "gtk2proto.h"
#include "script.h"
+ Include dependency graph for account.c:

Go to the source code of this file.

Macros

#define CHAR_NUM_COLUMNS   8
 
#define TEXTVIEW_MOTD   0
 
#define TEXTVIEW_NEWS   1
 
#define TEXTVIEW_RULES_ACCOUNT   2
 
#define TEXTVIEW_RULES_CHAR   3
 

Enumerations

enum  {
  CHAR_IMAGE, CHAR_NAME, CHAR_CLASS, CHAR_RACE,
  CHAR_LEVEL, CHAR_PARTY, CHAR_MAP, CHAR_ICON
}
 

Functions

void account_add_character_failure (char *message)
 
void account_change_password_failure (char *message)
 
void account_creation_failure (char *message)
 
void account_login_failure (char *message)
 
void account_show_login ()
 
static void add_character_to_account (const char *name, const char *password, int force)
 
void choose_char_window_show ()
 
void choose_character_init ()
 
static void create_new_character ()
 
void create_new_character_failure (char *message)
 
static void do_account_change (const char *old, const char *p1, const char *p2)
 
static void do_account_create (const char *name, const char *p1, const char *p2)
 
static void do_account_login (const char *name, const char *password)
 
void hide_all_login_windows ()
 
static void init_account_password_window ()
 
static void init_add_character_window ()
 
static void init_choose_char_window ()
 
static void init_create_account_window ()
 
static void init_login_window ()
 
static void init_new_character_window ()
 
void on_button_account_password_cancel_clicked (GtkButton *button, gpointer user_data)
 
void on_button_account_password_clicked (GtkButton *button, gpointer user_data)
 
void on_button_account_password_confirm_clicked (GtkButton *button, gpointer user_data)
 
void on_button_add_character_clicked (GtkButton *button, gpointer user_data)
 
void on_button_create_account_clicked (GtkButton *button, gpointer user_data)
 
void on_button_create_character_clicked (GtkButton *button, gpointer user_data)
 
void on_button_create_new_char_clicked (GtkButton *button, gpointer user_data)
 
void on_button_do_add_character_clicked (GtkButton *button, gpointer user_data)
 
void on_button_exit_client_clicked (GtkButton *button, gpointer user_data)
 
void on_button_go_metaserver_clicked (GtkButton *button, gpointer user_data)
 
void on_button_login_clicked (GtkButton *button, gpointer user_data)
 
void on_button_new_cancel_clicked (GtkButton *button, gpointer user_data)
 
void on_button_new_char_cancel_clicked (GtkButton *button, gpointer user_data)
 
void on_button_new_create_account_clicked (GtkButton *button, gpointer user_data)
 
void on_button_play_character_clicked (GtkButton *button, gpointer user_data)
 
void on_button_return_character_select_clicked (GtkButton *button, gpointer user_data)
 
void on_button_return_login_clicked (GtkButton *button, gpointer user_data)
 
void on_entry_account_name_activate (GtkEntry *entry, gpointer user_data)
 
void on_entry_account_password (GtkEntry *entry, gpointer user_data)
 
void on_entry_character (GtkEntry *entry, gpointer user_data)
 
void on_entry_new_account (GtkEntry *entry, gpointer user_data)
 
void on_entry_new_character_name (GtkEntry *entry, gpointer user_data)
 
gboolean on_window_delete_event (GtkWidget *window, gpointer *user_data)
 
static void play_character (const char *name)
 
void start_login (int method)
 
void update_character_choose (const char *name, const char *class, const char *race, const char *face, const char *party, const char *map, int level, int faceno)
 
void update_login_info (int type)
 

Variables

char account_password [256]
 
static GtkWidget * button_account_password
 
static GtkWidget * button_account_password_cancel
 
static GtkWidget * button_account_password_confirm
 
static GtkWidget * button_add_character
 
static GtkWidget * button_create_account
 
static GtkWidget * button_create_character
 
static GtkWidget * button_create_new_char
 
static GtkWidget * button_do_add_character
 
static GtkWidget * button_go_metaserver
 
static GtkWidget * button_login
 
static GtkWidget * button_new_cancel
 
static GtkWidget * button_new_char_cancel
 
static GtkWidget * button_new_create_account
 
static GtkWidget * button_play_character
 
static GtkWidget * button_return_character_select
 
static GtkWidget * button_return_login
 
GtkListStore * character_store
 
static GtkWidget * entry_account_name
 
static GtkWidget * entry_account_password
 
static GtkWidget * entry_account_password_confirm
 
static GtkWidget * entry_account_password_current
 
static GtkWidget * entry_account_password_new
 
static GtkWidget * entry_character_name
 
static GtkWidget * entry_character_password
 
static GtkWidget * entry_new_account_name
 
static GtkWidget * entry_new_account_password
 
static GtkWidget * entry_new_character_name
 
static GtkWidget * entry_new_confirm_password
 
static int has_init = 0
 
static GtkWidget * label_account_login_status
 
static GtkWidget * label_account_password_status
 
static GtkWidget * label_add_status
 
static GtkWidget * label_create_account_status
 
static GtkWidget * label_new_char_status
 
Info_Pane login_pane [4]
 
static GtkWidget * new_character_window
 
int num_text_views
 
GtkTextBuffer * textbuf_motd
 
GtkTextBuffer * textbuf_news
 
GtkTextBuffer * textbuf_rules_account
 
GtkTextBuffer * textbuf_rules_char
 
static GtkWidget * treeview_choose_character
 

Detailed Description

Handle account creation, login, and character selection

Definition in file account.c.

Macro Definition Documentation

◆ CHAR_NUM_COLUMNS

#define CHAR_NUM_COLUMNS   8

Definition at line 65 of file account.c.

◆ TEXTVIEW_MOTD

#define TEXTVIEW_MOTD   0

Definition at line 79 of file account.c.

◆ TEXTVIEW_NEWS

#define TEXTVIEW_NEWS   1

Definition at line 80 of file account.c.

◆ TEXTVIEW_RULES_ACCOUNT

#define TEXTVIEW_RULES_ACCOUNT   2

Definition at line 81 of file account.c.

◆ TEXTVIEW_RULES_CHAR

#define TEXTVIEW_RULES_CHAR   3

Definition at line 82 of file account.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
CHAR_IMAGE 
CHAR_NAME 
CHAR_CLASS 
CHAR_RACE 
CHAR_LEVEL 
CHAR_PARTY 
CHAR_MAP 
CHAR_ICON 

Definition at line 62 of file account.c.

Function Documentation

◆ account_add_character_failure()

void account_add_character_failure ( char *  message)

Handles a failure from the server - pretty basic - just throw up the message and let the user try again. This is a response to the 'failure accountaddplayer' command. Calling this account_add_character_failure may be a little bit of a misnomer, but all the other routines in this area refer to character, not player.

Parameters
messageMessage to display. Unlike other messages, the first word of this message should be an integer, which denotes if using the 'force' option would allow the user to override this.

Definition at line 282 of file account.c.

References add_character_to_account(), entry_character_name, entry_character_password, and label_add_status.

Referenced by FailureCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ account_change_password_failure()

void account_change_password_failure ( char *  message)

Definition at line 1123 of file account.c.

References label_account_password_status.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ account_creation_failure()

void account_creation_failure ( char *  message)

Handles a failure from the server - pretty basic - just throw up the message and let the user try again.

Parameters
message

Definition at line 692 of file account.c.

References label_create_account_status.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ account_login_failure()

void account_login_failure ( char *  message)

Handles a failure from the server - pretty basic - just throw up the message and let the user try again.

Parameters
message

Definition at line 868 of file account.c.

References label_account_login_status.

Referenced by FailureCmd().

+ Here is the caller graph for this function:

◆ account_show_login()

void account_show_login ( )

Definition at line 1302 of file account.c.

References button_login, entry_account_name, and main_notebook.

Referenced by main().

+ Here is the caller graph for this function:

◆ add_character_to_account()

static void add_character_to_account ( const char *  name,
const char *  password,
int  force 
)
static

Sends a request to the server add add the character to this account.

Parameters
name
password
force

Definition at line 249 of file account.c.

References csocket, ClientSocket::fd, label_add_status, MAX_BUF, SockList_AddChar(), SockList_AddString(), SockList_Init(), and SockList_Send().

Referenced by account_add_character_failure(), on_button_do_add_character_clicked(), and on_entry_character().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ choose_char_window_show()

void choose_char_window_show ( )

Basic little function - this is used because we make the choose_char_window widget private to this file, but the create_char.c file will need to show this if the user decides to abandon creation of a new character.

Definition at line 436 of file account.c.

References main_notebook.

Referenced by choose_character_init(), on_button_cc_cancel(), and on_button_new_char_cancel_clicked().

+ Here is the caller graph for this function:

◆ choose_character_init()

void choose_character_init ( )

Called when we get the accountplayers command from the server (indirectly via AccountPlayersCmd). This tells us to wipe any data from the treeview, but also hide any other windows and make the choose_character_window visible.

Definition at line 421 of file account.c.

References character_store, choose_char_window_show(), and hide_main_client().

Referenced by AccountPlayersCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_new_character()

static void create_new_character ( )
static

Definition at line 153 of file account.c.

References account_password, csocket, entry_new_character_name, ClientSocket::fd, label_new_char_status, MAX_BUF, SockList_AddChar(), SockList_AddString(), SockList_Init(), and SockList_Send().

Referenced by on_button_create_new_char_clicked(), and on_entry_new_character_name().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create_new_character_failure()

void create_new_character_failure ( char *  message)

Pop up a dialog window with the error from the server. Since both v1 and v2 character creation are supported, either the new_character_window or the create_character_window may be up, so we can not easily display an in window message - a pop up is probably better, but it will also work no matter what window is up.

Parameters
messagemessage - this comes from the server.

Definition at line 142 of file account.c.

References hide_main_client().

Referenced by FailureCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_account_change()

static void do_account_change ( const char *  old,
const char *  p1,
const char *  p2 
)
static

This does sanity checking of the passed in data, and if all is good, sends the request to the server to change an account password. If all the data isn't good, it puts up an error message. In this routine, none of the entries should be NULL - the caller should verify that before callin do_account_change();

Parameters
oldCurrent password.
p1First password - must not be NULL
p2Second (confirmed) password. This routine checks that p1 & p2 are the same, and if not, puts up an error. p2 must not be NULL

Definition at line 1033 of file account.c.

References account_password, csocket, ClientSocket::fd, label_account_password_status, MAX_BUF, SockList_AddChar(), SockList_AddString(), SockList_Init(), and SockList_Send().

Referenced by on_button_account_password_confirm_clicked(), and on_entry_account_password().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_account_create()

static void do_account_create ( const char *  name,
const char *  p1,
const char *  p2 
)
static

This does sanity checking of the passed in data, and if all is good, sends the request to the server to create an account. If all the data isn't good, it puts up an error message. In this routine, none of the entries should be NULL - the caller should verify that before callin do_account_create();

Parameters
nameDesired account name - must not be NULL.
p1First password - must not be NULL
p2Second (confirmed) password. This routine checks that p1 & p2 are the same, and if not, puts up an error. p2 must not be NULL

Definition at line 708 of file account.c.

References account_password, csocket, ClientSocket::fd, label_create_account_status, MAX_BUF, SockList_AddChar(), SockList_AddString(), SockList_Init(), and SockList_Send().

Referenced by on_button_new_create_account_clicked(), and on_entry_new_account().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ do_account_login()

static void do_account_login ( const char *  name,
const char *  password 
)
static

This does the work of doing the login - mostly it just sends the request to the server. However, this might be called from either hitting the login button or entering data in name/password and hitting return.

Parameters
name
password

Definition at line 916 of file account.c.

References account_password, csocket, ClientSocket::fd, label_account_login_status, MAX_BUF, SockList_AddChar(), SockList_AddString(), SockList_Init(), and SockList_Send().

Referenced by on_button_login_clicked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hide_all_login_windows()

void hide_all_login_windows ( )

Hides all the login related windows. This is needed in case the client loses the connection to the server (either through player going to client/disconnect or network failure). get_metaserver() calls this, as well as AddMeSuccess

Definition at line 96 of file account.c.

References connect_window, create_character_window_hide(), has_init, new_character_window, and treeview_look.

Referenced by AddMeSuccess(), and show_main_client().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_account_password_window()

static void init_account_password_window ( )
static

This initializes the change account password window and sets up the various callbacks.

Definition at line 1131 of file account.c.

References button_account_password_cancel, button_account_password_confirm, dialog_xml, entry_account_password_confirm, entry_account_password_current, entry_account_password_new, label_account_password_status, on_button_account_password_cancel_clicked(), on_button_account_password_confirm_clicked(), and on_entry_account_password().

Referenced by start_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_add_character_window()

static void init_add_character_window ( )
static

Definition at line 388 of file account.c.

References button_do_add_character, button_return_character_select, dialog_xml, entry_character_name, entry_character_password, label_add_status, on_button_do_add_character_clicked(), on_button_return_character_select_clicked(), and on_entry_character().

Referenced by start_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_choose_char_window()

◆ init_create_account_window()

static void init_create_account_window ( )
static

◆ init_login_window()

static void init_login_window ( )
static

Sets up all the widget pointers, as well as setting up the callbacks for the login windows widgets.

Definition at line 962 of file account.c.

References add_style_to_textbuffer(), add_tags_to_textbuffer(), button_create_account, button_go_metaserver, button_login, dialog_xml, entry_account_name, entry_account_password, label_account_login_status, login_pane, on_button_create_account_clicked(), on_button_go_metaserver_clicked(), on_button_login_clicked(), on_entry_account_name_activate(), textbuf_motd, textbuf_news, Info_Pane::textmark, Info_Pane::textview, TEXTVIEW_MOTD, and TEXTVIEW_NEWS.

Referenced by start_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init_new_character_window()

static void init_new_character_window ( )
static

Initializes the new character window.

Definition at line 213 of file account.c.

References button_create_new_char, button_new_char_cancel, dialog_xml, entry_new_character_name, label_new_char_status, new_character_window, on_button_create_new_char_clicked(), on_button_new_char_cancel_clicked(), on_entry_new_character_name(), on_window_delete_event(), and window_root.

Referenced by start_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_account_password_cancel_clicked()

void on_button_account_password_cancel_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the cancel account password, so hide this window, show the account main window.

Parameters
button
user_data

Definition at line 1062 of file account.c.

References main_notebook.

Referenced by init_account_password_window().

+ Here is the caller graph for this function:

◆ on_button_account_password_clicked()

void on_button_account_password_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the change account password, so hide this window, show the account password change dialog.

Parameters
button
user_data

Definition at line 525 of file account.c.

References entry_account_password_confirm, entry_account_password_current, entry_account_password_new, and main_notebook.

Referenced by init_choose_char_window().

+ Here is the caller graph for this function:

◆ on_button_account_password_confirm_clicked()

void on_button_account_password_confirm_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the validate account password, so handle that.

Parameters
button
user_data

Definition at line 1073 of file account.c.

References do_account_change(), entry_account_password_confirm, entry_account_password_current, and entry_account_password_new.

Referenced by init_account_password_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_add_character_clicked()

void on_button_add_character_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the add character button, so hide this window, show the add character window.

Parameters
button
user_data

Definition at line 500 of file account.c.

References entry_character_name, entry_character_password, and main_notebook.

Referenced by init_choose_char_window().

+ Here is the caller graph for this function:

◆ on_button_create_account_clicked()

void on_button_create_account_clicked ( GtkButton *  button,
gpointer  user_data 
)

User hit the create account button. So we need to hide the login window and bring up the create login window.

Parameters
button
user_data

Definition at line 879 of file account.c.

References entry_new_account_name, entry_new_account_password, entry_new_confirm_password, label_create_account_status, and main_notebook.

Referenced by init_login_window().

+ Here is the caller graph for this function:

◆ on_button_create_character_clicked()

void on_button_create_character_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters
button
user_data

Definition at line 484 of file account.c.

References create_character_window_show(), entry_new_character_name, new_character_window, and serverloginmethod.

Referenced by init_choose_char_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_create_new_char_clicked()

void on_button_create_new_char_clicked ( GtkButton *  button,
gpointer  user_data 
)

User hit the create character button. Get data, send to server.

Parameters
button
user_data

Definition at line 184 of file account.c.

References create_new_character().

Referenced by init_new_character_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_do_add_character_clicked()

void on_button_do_add_character_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the add character button. Let add_character_to_account() do all the work.

Parameters
button
user_data

Definition at line 334 of file account.c.

References add_character_to_account(), entry_character_name, and entry_character_password.

Referenced by init_add_character_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_exit_client_clicked()

void on_button_exit_client_clicked ( GtkButton *  button,
gpointer  user_data 
)

User hit the exit client button. Pretty simple in this case.

Parameters
button
user_data

Definition at line 904 of file account.c.

References script_killall().

+ Here is the call graph for this function:

◆ on_button_go_metaserver_clicked()

void on_button_go_metaserver_clicked ( GtkButton *  button,
gpointer  user_data 
)

User hit the go to metaserver button. Need to disconnect from The server, and by clearing the csocket_fd, the main loop routine will bring up the metaserver window.

Parameters
button
user_data

Definition at line 895 of file account.c.

References client_disconnect().

Referenced by init_login_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_login_clicked()

void on_button_login_clicked ( GtkButton *  button,
gpointer  user_data 
)

User hit the login button - just call do_account_login()

Parameters
button
user_data

Definition at line 944 of file account.c.

References do_account_login(), entry_account_name, and entry_account_password.

Referenced by init_login_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_new_cancel_clicked()

void on_button_new_cancel_clicked ( GtkButton *  button,
gpointer  user_data 
)
Parameters
button
user_data

Definition at line 759 of file account.c.

References main_notebook.

Referenced by init_create_account_window().

+ Here is the caller graph for this function:

◆ on_button_new_char_cancel_clicked()

void on_button_new_char_cancel_clicked ( GtkButton *  button,
gpointer  user_data 
)

User his hit the cancel button in the new character window, so hide the new character window, show the choose character window.

Parameters
button
user_data

Definition at line 205 of file account.c.

References choose_char_window_show(), and new_character_window.

Referenced by init_new_character_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_new_create_account_clicked()

void on_button_new_create_account_clicked ( GtkButton *  button,
gpointer  user_data 
)

User clicked on the create account button. In this case, we just process the data and call do_account_create();

Parameters
button
user_data

Definition at line 738 of file account.c.

References do_account_create(), entry_new_account_name, entry_new_account_password, entry_new_confirm_password, and label_create_account_status.

Referenced by init_create_account_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_play_character_clicked()

void on_button_play_character_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the play character button. Grab the selected entry, if there is one.

Parameters
button
user_data

Definition at line 462 of file account.c.

References CHAR_NAME, play_character(), show_main_client(), and treeview_choose_character.

Referenced by init_choose_char_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_button_return_character_select_clicked()

void on_button_return_character_select_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the return to character selection button. Pretty simple - just hide this window, activate the other window.

Parameters
button
user_data

Definition at line 348 of file account.c.

References main_notebook.

Referenced by init_add_character_window().

+ Here is the caller graph for this function:

◆ on_button_return_login_clicked()

void on_button_return_login_clicked ( GtkButton *  button,
gpointer  user_data 
)

User has hit the return to login window, so hide this window, show the account login window.

Parameters
button
user_data

Definition at line 514 of file account.c.

References main_notebook.

Referenced by init_choose_char_window().

+ Here is the caller graph for this function:

◆ on_entry_account_name_activate()

void on_entry_account_name_activate ( GtkEntry *  entry,
gpointer  user_data 
)

User hit return in the name entry box.

Parameters
entry
user_data

Definition at line 954 of file account.c.

References entry_account_password.

Referenced by init_login_window().

+ Here is the caller graph for this function:

◆ on_entry_account_password()

void on_entry_account_password ( GtkEntry *  entry,
gpointer  user_data 
)

This handles cases where the user hits return in one of the entry boxes. We use the same callback for all 3 entry boxes, since the processing is basically the same - if there is valid data in all of them, we try to create an account - otherwise, we move to the next box.

Parameters
entryEntry box used to figure out what the next box is.
user_dataNot used.

Definition at line 1090 of file account.c.

References do_account_change(), entry_account_password_confirm, entry_account_password_current, and entry_account_password_new.

Referenced by init_account_password_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_entry_character()

void on_entry_character ( GtkEntry *  entry,
gpointer  user_data 
)

User has hit return in either name or password box. If both boxes have non empty data, process request. Otherwise, either stay in same box if this box is empty, or move to the other box.

Parameters
entryEntry widget which generated this callback.
user_data

Definition at line 361 of file account.c.

References add_character_to_account(), entry_character_name, and entry_character_password.

Referenced by init_add_character_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_entry_new_account()

void on_entry_new_account ( GtkEntry *  entry,
gpointer  user_data 
)

This handles cases where the user hits return in one of the entry boxes. We use the same callback for all 3 entry boxes, since the processing is basically the same - if there is valid data in all of them, we try to create an account - otherwise, we move to the next box.

Parameters
entryEntry box used to figure out what the next box is.
user_dataNot used.

Definition at line 773 of file account.c.

References do_account_create(), entry_new_account_name, entry_new_account_password, and entry_new_confirm_password.

Referenced by init_create_account_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_entry_new_character_name()

void on_entry_new_character_name ( GtkEntry *  entry,
gpointer  user_data 
)

User hit return in the new character name box. Like above, get data and send to server.

Parameters
entry
user_data

Definition at line 194 of file account.c.

References create_new_character().

Referenced by init_new_character_window().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ on_window_delete_event()

gboolean on_window_delete_event ( GtkWidget *  window,
gpointer *  user_data 
)

Prevent delete_event closure and/or hiding of account windows. All account system windows ignore delete events and remain visible unless the user clicks an appropriate button.

Parameters
windowPointer to an account window that received a delete_event.
user_dataUnused.

Definition at line 123 of file account.c.

Referenced by init_new_character_window().

+ Here is the caller graph for this function:

◆ play_character()

static void play_character ( const char *  name)
static

User has done necessary steps to play a character.

Parameters
name

Definition at line 445 of file account.c.

References csocket, ClientSocket::fd, MAX_BUF, SockList_AddString(), SockList_Init(), and SockList_Send().

Referenced by on_button_play_character_clicked().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start_login()

void start_login ( int  method)

Starts the login process. If not already done, gets widgets, sets up callboacks, etc. This is at the end of the file so all the callbacks are defined before this function - in that way, we do not need forward declarations. This is called from SetupCmd in common/commands.c

Parameters
methodLogin method that the server suppots.

Definition at line 1263 of file account.c.

References entry_account_name, entry_account_password, has_init, INFO_MOTD, INFO_NEWS, INFO_RULES, init_account_password_window(), init_add_character_window(), init_choose_char_window(), init_create_account_window(), init_login_window(), init_new_character_window(), serverloginmethod, and update_login_info().

Referenced by SetupCmd().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update_character_choose()

void update_character_choose ( const char *  name,
const char *  class,
const char *  race,
const char *  face,
const char *  party,
const char *  map,
int  level,
int  faceno 
)

This gets data and adds it to the list store. This is called from AccountPlayersCmd and data is from the accountplayers protocol command. The parameters are data to add to the list store.

Parameters
name
class
race
face
party
map
level
faceno

Definition at line 547 of file account.c.

References CHAR_CLASS, CHAR_ICON, CHAR_IMAGE, CHAR_LEVEL, CHAR_MAP, CHAR_NAME, CHAR_PARTY, CHAR_RACE, character_store, map, and pixmaps.

Referenced by AccountPlayersCmd().

+ Here is the caller graph for this function:

◆ update_login_info()

void update_login_info ( int  type)

This is called from ReplyInfoCmd when it gets a response from news/motd/rules. It is very possible that the window will get displayed before we got a reply response, so this tells the client to update it.

Parameters
typeWhat data just got updated - text string of motd/news/rules

Definition at line 1174 of file account.c.

References add_marked_text_to_pane(), BIG_BUF, has_init, INFO_MOTD, INFO_NEWS, INFO_RULES, login_pane, motd, news, rules, textbuf_motd, textbuf_news, textbuf_rules_account, textbuf_rules_char, TEXTVIEW_MOTD, TEXTVIEW_NEWS, TEXTVIEW_RULES_ACCOUNT, and TEXTVIEW_RULES_CHAR.

Referenced by ReplyInfoCmd(), and start_login().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ account_password

char account_password[256]

◆ button_account_password

GtkWidget * button_account_password
static

Definition at line 42 of file account.c.

Referenced by init_choose_char_window().

◆ button_account_password_cancel

GtkWidget * button_account_password_cancel
static

Definition at line 53 of file account.c.

Referenced by init_account_password_window().

◆ button_account_password_confirm

GtkWidget * button_account_password_confirm
static

Definition at line 52 of file account.c.

Referenced by init_account_password_window().

◆ button_add_character

GtkWidget * button_add_character
static

Definition at line 42 of file account.c.

Referenced by init_choose_char_window().

◆ button_create_account

GtkWidget * button_create_account
static

Definition at line 31 of file account.c.

Referenced by init_login_window().

◆ button_create_character

GtkWidget * button_create_character
static

Definition at line 41 of file account.c.

Referenced by init_choose_char_window().

◆ button_create_new_char

GtkWidget * button_create_new_char
static

Definition at line 47 of file account.c.

Referenced by init_new_character_window().

◆ button_do_add_character

GtkWidget* button_do_add_character
static

Definition at line 68 of file account.c.

Referenced by init_add_character_window().

◆ button_go_metaserver

GtkWidget * button_go_metaserver
static

Definition at line 31 of file account.c.

Referenced by init_login_window().

◆ button_login

GtkWidget* button_login
static

Definition at line 31 of file account.c.

Referenced by account_show_login(), and init_login_window().

◆ button_new_cancel

GtkWidget * button_new_cancel
static

Definition at line 35 of file account.c.

Referenced by init_create_account_window().

◆ button_new_char_cancel

GtkWidget * button_new_char_cancel
static

Definition at line 48 of file account.c.

Referenced by init_new_character_window().

◆ button_new_create_account

GtkWidget* button_new_create_account
static

Definition at line 35 of file account.c.

Referenced by init_create_account_window().

◆ button_play_character

GtkWidget* button_play_character
static

Definition at line 41 of file account.c.

Referenced by init_choose_char_window().

◆ button_return_character_select

GtkWidget * button_return_character_select
static

Definition at line 69 of file account.c.

Referenced by init_add_character_window().

◆ button_return_login

GtkWidget * button_return_login
static

Definition at line 42 of file account.c.

Referenced by init_choose_char_window().

◆ character_store

GtkListStore* character_store

◆ entry_account_name

GtkWidget * entry_account_name
static

◆ entry_account_password

GtkWidget * entry_account_password
static

◆ entry_account_password_confirm

GtkWidget * entry_account_password_confirm
static

◆ entry_account_password_current

GtkWidget* entry_account_password_current
static

◆ entry_account_password_new

GtkWidget * entry_account_password_new
static

◆ entry_character_name

◆ entry_character_password

◆ entry_new_account_name

GtkWidget * entry_new_account_name
static

◆ entry_new_account_password

GtkWidget * entry_new_account_password
static

◆ entry_new_character_name

GtkWidget* entry_new_character_name
static

◆ entry_new_confirm_password

GtkWidget * entry_new_confirm_password
static

◆ has_init

◆ label_account_login_status

GtkWidget * label_account_login_status
static

Definition at line 32 of file account.c.

Referenced by account_login_failure(), do_account_login(), and init_login_window().

◆ label_account_password_status

GtkWidget * label_account_password_status
static

◆ label_add_status

GtkWidget * label_add_status
static

◆ label_create_account_status

GtkWidget * label_create_account_status
static

◆ label_new_char_status

GtkWidget * label_new_char_status
static

Definition at line 47 of file account.c.

Referenced by create_new_character(), and init_new_character_window().

◆ login_pane

◆ new_character_window

GtkWidget * new_character_window
static

◆ num_text_views

int num_text_views

◆ textbuf_motd

GtkTextBuffer* textbuf_motd

Definition at line 72 of file account.c.

Referenced by init_login_window(), and update_login_info().

◆ textbuf_news

GtkTextBuffer * textbuf_news

Definition at line 72 of file account.c.

Referenced by init_login_window(), and update_login_info().

◆ textbuf_rules_account

GtkTextBuffer * textbuf_rules_account

Definition at line 72 of file account.c.

Referenced by init_create_account_window(), and update_login_info().

◆ textbuf_rules_char

GtkTextBuffer * textbuf_rules_char

Definition at line 73 of file account.c.

Referenced by init_choose_char_window(), and update_login_info().

◆ treeview_choose_character

GtkWidget * treeview_choose_character
static

Definition at line 43 of file account.c.

Referenced by init_choose_char_window(), and on_button_play_character_clicked().