Crossfire Client, Trunk  R20507
Macros | Enumerations | Functions | Variables
account.c File Reference

Handle account creation, login, and character selection. More...

#include "client.h"
#include <ctype.h>
#include <gtk/gtk.h>
#include "image.h"
#include "main.h"
#include "metaserver.h"
#include "gtk2proto.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)
 Handles a failure from the server - pretty basic - just throw up the message and let the user try again. More...
 
void account_change_password_failure (char *message)
 
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. More...
 
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. More...
 
static void add_character_to_account (const char *name, const char *password, int force)
 Sends a request to the server add add the character to this account. More...
 
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. More...
 
void choose_character_init ()
 Called when we get the accountplayers command from the server (indirectly via AccountPlayersCmd). More...
 
static void create_new_character ()
 
void create_new_character_failure (char *message)
 Pop up a dialog window with the error from the server. More...
 
static void do_account_change (const char *old, const char *p1, const char *p2)
 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. More...
 
static void do_account_create (const char *name, const char *p1, const char *p2)
 This does sanity checking of the passed in data, and if all is good, sends the request to the server to create an account. More...
 
static void do_account_login (const char *name, const char *password)
 This does the work of doing the login - mostly it just sends the request to the server. More...
 
void hide_all_login_windows ()
 Hides all the login related windows. More...
 
static void init_account_password_window ()
 This initializes the change account password window and sets up the various callbacks. More...
 
static void init_add_character_window ()
 
static void init_choose_char_window ()
 
static void init_create_account_window ()
 This initializes the create account window and sets up the various callbacks. More...
 
static void init_login_window ()
 Sets up all the widget pointers, as well as setting up the callbacks for the login windows widgets. More...
 
static void init_new_character_window ()
 Initializes the new character window. More...
 
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. More...
 
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. More...
 
void on_button_account_password_confirm_clicked (GtkButton *button, gpointer user_data)
 User has hit the validate account password, so handle that. More...
 
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. More...
 
void on_button_create_account_clicked (GtkButton *button, gpointer user_data)
 User hit the create account button. More...
 
void on_button_create_character_clicked (GtkButton *button, gpointer user_data)
 
void on_button_create_new_char_clicked (GtkButton *button, gpointer user_data)
 User hit the create character button. More...
 
void on_button_do_add_character_clicked (GtkButton *button, gpointer user_data)
 User has hit the add character button. More...
 
void on_button_exit_client_clicked (GtkButton *button, gpointer user_data)
 User hit the exit client button. More...
 
void on_button_go_metaserver_clicked (GtkButton *button, gpointer user_data)
 User hit the go to metaserver button. More...
 
void on_button_login_clicked (GtkButton *button, gpointer user_data)
 User hit the login button - just call do_account_login() More...
 
void on_button_new_cancel_clicked (GtkButton *button, gpointer user_data)
 
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. More...
 
void on_button_new_create_account_clicked (GtkButton *button, gpointer user_data)
 User clicked on the create account button. More...
 
void on_button_play_character_clicked (GtkButton *button, gpointer user_data)
 User has hit the play character button. More...
 
void on_button_return_character_select_clicked (GtkButton *button, gpointer user_data)
 User has hit the return to character selection button. More...
 
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. More...
 
void on_entry_account_name_activate (GtkEntry *entry, gpointer user_data)
 User hit return in the name entry box. More...
 
void on_entry_account_password (GtkEntry *entry, gpointer user_data)
 This handles cases where the user hits return in one of the entry boxes. More...
 
void on_entry_character (GtkEntry *entry, gpointer user_data)
 User has hit return in either name or password box. More...
 
void on_entry_new_account (GtkEntry *entry, gpointer user_data)
 This handles cases where the user hits return in one of the entry boxes. More...
 
void on_entry_new_character_name (GtkEntry *entry, gpointer user_data)
 User hit return in the new character name box. More...
 
gboolean on_window_delete_event (GtkWidget *window, gpointer *user_data)
 Prevent delete_event closure and/or hiding of account windows. More...
 
static void play_character (const char *name)
 User has done necessary steps to play a character. More...
 
void start_login (int method)
 Starts the login process. More...
 
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. More...
 
void update_login_info (int type)
 This is called from ReplyInfoCmd when it gets a response from news/motd/rules. More...
 

Variables

char account_password [256]
 
static GtkWidget * account_password_window
 
static GtkWidget * add_character_window
 
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 * choose_char_window
 
static GtkWidget * create_account_window
 
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 * login_window
 
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

#define CHAR_NUM_COLUMNS   8

Definition at line 71 of file account.c.

Referenced by init_choose_char_window().

#define TEXTVIEW_MOTD   0

Definition at line 85 of file account.c.

Referenced by init_login_window(), and update_login_info().

#define TEXTVIEW_NEWS   1

Definition at line 86 of file account.c.

Referenced by init_login_window(), and update_login_info().

#define TEXTVIEW_RULES_ACCOUNT   2

Definition at line 87 of file account.c.

Referenced by init_create_account_window(), and update_login_info().

#define TEXTVIEW_RULES_CHAR   3

Definition at line 88 of file account.c.

Referenced by init_choose_char_window(), and update_login_info().

Enumeration Type Documentation

anonymous enum
Enumerator
CHAR_IMAGE 
CHAR_NAME 
CHAR_CLASS 
CHAR_RACE 
CHAR_LEVEL 
CHAR_PARTY 
CHAR_MAP 
CHAR_ICON 

Definition at line 68 of file account.c.

Function Documentation

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 291 of file account.c.

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

Referenced by FailureCmd().

Here is the call graph for this function:

Here is the caller graph for this function:

void account_change_password_failure ( char *  message)

Definition at line 1182 of file account.c.

References label_account_password_status.

Referenced by FailureCmd().

Here is the caller graph for this function:

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 725 of file account.c.

References label_create_account_status.

Referenced by FailureCmd().

Here is the caller graph for this function:

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 910 of file account.c.

References label_account_login_status.

Referenced by FailureCmd().

Here is the caller graph for this function:

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 258 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:

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 456 of file account.c.

References choose_char_window.

Referenced by on_button_cc_cancel().

Here is the caller graph for this function:

void choose_character_init ( void  )

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 439 of file account.c.

References add_character_window, character_store, choose_char_window, create_account_window, and login_window.

Referenced by AccountPlayersCmd().

Here is the caller graph for this function:

static void create_new_character ( )
static

Definition at line 162 of file account.c.

References account_password, csocket, entry_new_character_name, ClientSocket::fd, label_new_char_status, MAX_BUF, name, 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:

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 152 of file account.c.

Referenced by FailureCmd().

Here is the caller graph for this function:

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 1091 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:

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 741 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:

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 961 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:

void hide_all_login_windows ( void  )

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 102 of file account.c.

References account_password_window, add_character_window, choose_char_window, create_account_window, create_character_window_hide(), has_init, login_window, new_character_window, and treeview_look.

Referenced by AddMeSuccess(), metaserver_show_prompt(), and on_button_play_character_clicked().

Here is the call graph for this function:

Here is the caller graph for this function:

static void init_account_password_window ( )
static

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

Definition at line 1190 of file account.c.

References account_password_window, 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(), on_entry_account_password(), 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:

static void init_add_character_window ( )
static
static void init_choose_char_window ( )
static
static void init_create_account_window ( )
static
static void init_login_window ( )
static
static void init_new_character_window ( )
static

Initializes the new character window.

Definition at line 222 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:

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 1120 of file account.c.

References account_password_window, and choose_char_window.

Referenced by init_account_password_window().

Here is the caller graph for this function:

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 549 of file account.c.

References account_password_window, choose_char_window, entry_account_password_confirm, entry_account_password_current, and entry_account_password_new.

Referenced by init_choose_char_window().

Here is the caller graph for this function:

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 1132 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:

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 522 of file account.c.

References add_character_window, choose_char_window, entry_character_name, and entry_character_password.

Referenced by init_choose_char_window().

Here is the caller graph for this function:

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 921 of file account.c.

References create_account_window, entry_new_account_name, entry_new_account_password, entry_new_confirm_password, label_create_account_status, and login_window.

Referenced by init_login_window().

Here is the caller graph for this function:

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

Definition at line 505 of file account.c.

References choose_char_window, 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:

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 193 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:

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 343 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:

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 947 of file account.c.

Referenced by init_login_window().

Here is the caller graph for this function:

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 938 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:

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 989 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:

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

Definition at line 792 of file account.c.

References create_account_window, and login_window.

Referenced by init_create_account_window().

Here is the caller graph for this function:

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 214 of file account.c.

References choose_char_window, and new_character_window.

Referenced by init_new_character_window().

Here is the caller graph for this function:

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 771 of file account.c.

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

Referenced by init_create_account_window().

Here is the call graph for this function:

Here is the caller graph for this function:

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 482 of file account.c.

References CHAR_NAME, hide_all_login_windows(), name, play_character(), 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:

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 357 of file account.c.

References add_character_window, and choose_char_window.

Referenced by init_add_character_window().

Here is the caller graph for this function:

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 537 of file account.c.

References choose_char_window, and login_window.

Referenced by init_choose_char_window().

Here is the caller graph for this function:

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 999 of file account.c.

References entry_account_password.

Referenced by init_login_window().

Here is the caller graph for this function:

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 1149 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:

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 371 of file account.c.

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

Referenced by init_add_character_window().

Here is the call graph for this function:

Here is the caller graph for this function:

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 807 of file account.c.

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

Referenced by init_create_account_window().

Here is the call graph for this function:

Here is the caller graph for this function:

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 203 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:

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 133 of file account.c.

Referenced by init_account_password_window(), init_add_character_window(), init_choose_char_window(), init_create_account_window(), init_login_window(), and init_new_character_window().

Here is the caller graph for this function:

static void play_character ( const char *  name)
static

User has done necessary steps to play a character.

Parameters
name

Definition at line 465 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:

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 1330 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(), login_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:

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 572 of file account.c.

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

Referenced by AccountPlayersCmd().

Here is the caller graph for this function:

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 1241 of file account.c.

References add_marked_text_to_pane(), BIG_BUF, has_init, INFO_MOTD, INFO_NEWS, INFO_RULES, 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

char account_password[256]
GtkWidget * account_password_window
static
GtkWidget* add_character_window
static
GtkWidget * button_account_password
static

Definition at line 47 of file account.c.

Referenced by init_choose_char_window().

GtkWidget * button_account_password_cancel
static

Definition at line 57 of file account.c.

Referenced by init_account_password_window().

GtkWidget * button_account_password_confirm
static

Definition at line 57 of file account.c.

Referenced by init_account_password_window().

GtkWidget * button_add_character
static

Definition at line 47 of file account.c.

Referenced by init_choose_char_window().

GtkWidget * button_create_account
static

Definition at line 37 of file account.c.

Referenced by init_login_window().

GtkWidget * button_create_character
static

Definition at line 47 of file account.c.

Referenced by init_choose_char_window().

GtkWidget * button_create_new_char
static

Definition at line 52 of file account.c.

Referenced by init_new_character_window().

GtkWidget* button_do_add_character
static

Definition at line 74 of file account.c.

Referenced by init_add_character_window().

GtkWidget * button_go_metaserver
static

Definition at line 37 of file account.c.

Referenced by init_login_window().

GtkWidget* button_login
static

Definition at line 37 of file account.c.

Referenced by init_login_window().

GtkWidget * button_new_cancel
static

Definition at line 41 of file account.c.

Referenced by init_create_account_window().

GtkWidget * button_new_char_cancel
static

Definition at line 52 of file account.c.

Referenced by init_new_character_window().

GtkWidget* button_new_create_account
static

Definition at line 41 of file account.c.

Referenced by init_create_account_window().

GtkWidget* button_play_character
static

Definition at line 47 of file account.c.

Referenced by init_choose_char_window().

GtkWidget * button_return_character_select
static

Definition at line 74 of file account.c.

Referenced by init_add_character_window().

GtkWidget * button_return_login
static

Definition at line 47 of file account.c.

Referenced by init_choose_char_window().

GtkListStore* character_store
GtkWidget * choose_char_window
static
GtkWidget * create_account_window
static
GtkWidget * entry_account_name
static

Definition at line 37 of file account.c.

Referenced by init_login_window(), on_button_login_clicked(), and start_login().

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

Definition at line 37 of file account.c.

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

GtkWidget * label_account_password_status
static
GtkWidget * label_add_status
static
GtkWidget * label_create_account_status
static
GtkWidget * label_new_char_status
static

Definition at line 52 of file account.c.

Referenced by create_new_character(), and init_new_character_window().

Info_Pane login_pane[4]

Definition at line 90 of file account.c.

GtkWidget * login_window
static
GtkWidget * new_character_window
static
int num_text_views
GtkTextBuffer* textbuf_motd

Definition at line 78 of file account.c.

Referenced by init_login_window(), and update_login_info().

GtkTextBuffer * textbuf_news

Definition at line 78 of file account.c.

Referenced by init_login_window(), and update_login_info().

GtkTextBuffer * textbuf_rules_account

Definition at line 78 of file account.c.

Referenced by init_create_account_window(), and update_login_info().

GtkTextBuffer * textbuf_rules_char

Definition at line 78 of file account.c.

Referenced by init_choose_char_window(), and update_login_info().

GtkWidget * treeview_choose_character
static

Definition at line 47 of file account.c.

Referenced by init_choose_char_window(), and on_button_play_character_clicked().