From: Dario Z. <ev...@us...> - 2005-03-03 12:29:39
|
Update of /cvsroot/gaim-bnet/gaim-bnet/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27707 Modified Files: conn.c conn.h proto.c Log Message: Added PvPGN support and fixed a bug during login. See ChangeLog for details. Index: proto.c =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/proto.c,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** proto.c 2 Mar 2005 22:39:47 -0000 1.25 --- proto.c 3 Mar 2005 12:29:11 -0000 1.26 *************** *** 278,281 **** --- 278,291 ---- static void + bnet_proto_info_fl_end(BNetConn *conn, GList *args) { + gaim_debug_info("bnet", "bnet_proto_info_fl_end\n"); + + /* With PvPGN servers we can simply use this message, instead of waiting + * a whoami reply (who seems to be buggy, using "" inside themselves) + */ + conn->fl_listing = FALSE; + } + + static void bnet_proto_info_fl_added(BNetConn *conn, GList *args) { GList *w = args; *************** *** 462,466 **** { "$x's record:", bnet_proto_info_record_bg }, { "Normal games: $x", bnet_proto_info_record_n }, ! { "Ladder games: $x", bnet_proto_info_record_l } }; --- 472,480 ---- { "$x's record:", bnet_proto_info_record_bg }, { "Normal games: $x", bnet_proto_info_record_n }, ! { "Ladder games: $x", bnet_proto_info_record_l }, ! ! /* support for PvPGN servers */ ! { "Hello $x, welcome to a PvPGN Server!", bnet_proto_info_welcome }, ! { "End of Friends List", bnet_proto_info_fl_end }, }; Index: conn.c =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/conn.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** conn.c 2 Mar 2005 22:39:47 -0000 1.13 --- conn.c 3 Mar 2005 12:29:11 -0000 1.14 *************** *** 147,150 **** --- 147,151 ---- bnet_conn_parse_msg(BNetConn *conn, const gchar *msg) { GaimConnection *gc; + const gchar *p; gc = gaim_account_get_connection(conn->account); *************** *** 154,158 **** break; case BNET_CS_USER: ! if (!strcmp(msg, "Username: ")) { bnet_conn_send(conn, "%s\n", conn->user); bnet_conn_update_progress(conn, BNET_CS_PASS); --- 155,160 ---- break; case BNET_CS_USER: ! p = msg+strlen(msg)-10; ! if (p >= msg && !strcmp(p, "Username: ")) { bnet_conn_send(conn, "%s\n", conn->user); bnet_conn_update_progress(conn, BNET_CS_PASS); *************** *** 161,165 **** break; case BNET_CS_PASS: ! if (!strcmp(msg, "Password: ")) { bnet_conn_send(conn, "%s\n", conn->pass); bnet_conn_update_progress(conn, BNET_CS_VRFY); --- 163,168 ---- break; case BNET_CS_PASS: ! p = msg+strlen(msg)-10; ! if (p >= msg && !strcmp(p, "Password: ")) { bnet_conn_send(conn, "%s\n", conn->pass); bnet_conn_update_progress(conn, BNET_CS_VRFY); *************** *** 168,185 **** break; case BNET_CS_VRFY: ! conn->vrfy_attempts++; ! ! if (!strstr(msg, "incorrect")) { bnet_conn_update_progress(conn, BNET_CS_CONN); gaim_connection_set_state(gc, GAIM_CONNECTED); bnet_conn_request_friends_list(conn); - } else { - if (conn->vrfy_attempts > 1) - /* We must stop to try... our user/pass are not valid - */ - gaim_connection_error(gc, _("Invalid user/pass")); - - bnet_conn_update_progress(conn, BNET_CS_USER); } --- 171,181 ---- break; case BNET_CS_VRFY: ! if (!strcmp(msg, "Login failed.") || strstr(msg, "incorrect")) { ! gaim_connection_error(gc, _("Invalid user/pass")); ! } else { bnet_conn_update_progress(conn, BNET_CS_CONN); gaim_connection_set_state(gc, GAIM_CONNECTED); bnet_conn_request_friends_list(conn); } *************** *** 277,281 **** gc); ! bnet_conn_send(conn, "\003\004%s", conn->user); bnet_conn_update_progress(conn, BNET_CS_USER); } --- 273,277 ---- gc); ! bnet_conn_send(conn, "\003\004"); bnet_conn_update_progress(conn, BNET_CS_USER); } Index: conn.h =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/conn.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** conn.h 2 Mar 2005 22:39:47 -0000 1.10 --- conn.h 3 Mar 2005 12:29:11 -0000 1.11 *************** *** 50,54 **** BNetConnState state; - guint vrfy_attempts; gint fd; --- 50,53 ---- |