while ((g_scanner_get_next_token (scan) != G_TOKEN_INT) && !g_scanner_eof (scan));
num = scan->value.v_int;
-
- while ((g_scanner_get_next_token (scan) != G_TOKEN_COMMENT_SINGLE) && !g_scanner_eof (scan));
- utf8 = g_locale_to_utf8 (scan->value.v_comment, -1, NULL, NULL, NULL);
- name = g_strconcat ("#", utf8, NULL);
-
- while ((g_scanner_get_next_token (scan) != G_TOKEN_IDENTIFIER) && !g_scanner_eof (scan));
- players = g_strdup (scan->value.v_identifier);
- if (strncmp (players, "FULL", 4))
+ g_scanner_get_next_token (scan); /* dump the ')' */
+
+ if (g_scanner_peek_next_token (scan) == G_TOKEN_LEFT_BRACE)
{
+ scan->config->cpair_comment_single = "# ";
+
while ((g_scanner_get_next_token (scan) != G_TOKEN_INT) && !g_scanner_eof (scan));
actual = scan->value.v_int;
-
+
while ((g_scanner_get_next_token (scan) != G_TOKEN_INT) && !g_scanner_eof (scan));
max = scan->value.v_int;
- g_snprintf (final, 1024, "%d/%d %s", actual, max, players);
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_COMMENT_SINGLE) && !g_scanner_eof (scan));
+ utf8 = g_locale_to_utf8 (scan->value.v_comment, -1, NULL, NULL, NULL);
+ name = g_strconcat ("#", utf8, NULL);
+
+ g_snprintf (final, 1024, "%d/%d", actual, max);
+
+ scan->config->cpair_comment_single = "{}";
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_COMMENT_SINGLE) && !g_scanner_eof (scan));
+ if (!g_scanner_eof (scan))
+ state = g_strdup (scan->value.v_comment);
+ else
+ state = g_strdup ("IDLE");
+
+ desc = g_strdup ("");
+ players = g_strdup ("");
}
else
- g_snprintf (final, 1024, "6/6 %s", players);
+ {
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_COMMENT_SINGLE) && !g_scanner_eof (scan));
+ utf8 = g_locale_to_utf8 (scan->value.v_comment, -1, NULL, NULL, NULL);
+ name = g_strconcat ("#", utf8, NULL);
- g_scanner_get_next_token (scan); /* dump the ')' */
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_IDENTIFIER) && !g_scanner_eof (scan));
+ players = g_strdup (scan->value.v_identifier);
+
+ if (strncmp (players, "FULL", 4))
+ {
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_INT) && !g_scanner_eof (scan));
+ actual = scan->value.v_int;
+
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_INT) && !g_scanner_eof (scan));
+ max = scan->value.v_int;
+
+ g_snprintf (final, 1024, "%d/%d %s", actual, max, players);
+ }
+ else
+ g_snprintf (final, 1024, "6/6 %s", players);
- if (g_scanner_get_next_token (scan) == G_TOKEN_LEFT_CURLY)
- {
- g_scanner_get_next_token (scan);
- state = g_strdup (scan->value.v_identifier);
- }
- else
- state = g_strdup ("IDLE");
+ g_scanner_get_next_token (scan); /* dump the ')' */
- while ((g_scanner_get_next_token (scan) != G_TOKEN_RIGHT_PAREN) && !g_scanner_eof (scan));
- if (line[scan->position] != 0)
- desc = g_strstrip (g_locale_to_utf8 (&line[scan->position], -1, NULL, NULL, NULL));
- else
- desc = g_strdup ("");
+ if (g_scanner_get_next_token (scan) == G_TOKEN_LEFT_CURLY)
+ {
+ g_scanner_get_next_token (scan);
+ state = g_strdup (scan->value.v_identifier);
+ }
+ else
+ state = g_strdup ("IDLE");
+
+ while ((g_scanner_get_next_token (scan) != G_TOKEN_RIGHT_PAREN) && !g_scanner_eof (scan));
+ if (line[scan->position] != 0)
+ desc = g_strstrip (g_locale_to_utf8 (&line[scan->position], -1, NULL, NULL, NULL));
+ else
+ desc = g_strdup ("");
+ }
gtk_list_store_append (work_model, &iter);
case IN_CONNECT:
list_issued = 0;
up_chan_list_source = g_timeout_add (30000, (GSourceFunc) partyline_update_channel_list, NULL);
+ partyline_joining_channel ("");
break;
case IN_DISCONNECT:
if (!connected) {
}
}
/* show partyline on successful connect */
+ partyline_update_channel_list ();
show_partyline_page ();
break;
case IN_PLAYERJOIN:
break;
token = strtok (NULL, "");
if (token == NULL) token = "";
+ //printf ("* %s\n", token);
if (pnum == 0) {
if (strncmp (token, "\04\04\04\04\04\04\04\04", 8) == 0) {
/* tetrix identification string */
tetrix = TRUE;
}
- else if (tetrix) {
- gchar *line = nocolor (token);
+ else
+ {
+ gchar *line = nocolor (token);
- if (list_issued > 0)
+ if (list_issued > 0)
+ {
+ if (*line == '(')
{
- if (*line == '(')
- {
- partyline_add_channel (line);
- break;
- }
-
- if (!strncmp ("List", line, 4))
- {
- partyline_more_channel_lines ();
- break;
- }
-
- if (!strncmp ("TetriNET", line, 8))
- break;
-
- if (!strncmp ("You", line, 3))
- {
- /* we will use the error message as list stopper */
- list_issued--;
- if (list_issued <= 0)
- stop_list();
- break;
- }
-
- //if (line != NULL) g_free (line);
+ partyline_add_channel (line);
+ break;
}
- /* detect whenever we have joined a channel */
- if (!strncmp ("has joined", &line[strlen (playernames[playernum])+1], 10))
- {
- partyline_joining_channel (&line[strlen (playernames[playernum])+20]);
- }
- else if (!strncmp ("Joined existing Channel", line, 23))
+
+ if (!strncmp ("List", line, 4))
{
- partyline_joining_channel (&line[26]);
+ partyline_more_channel_lines ();
+ break;
}
- else if (!strncmp ("Created new Channel", line, 19))
+
+ if (!strncmp ("TetriNET", line, 8))
+ break;
+
+ if (!strncmp ("You do NOT", line, 10))
{
- partyline_joining_channel (&line[22]);
+ /* we will use the error message as list stopper */
+ list_issued--;
+ if (list_issued <= 0)
+ stop_list();
+ break;
}
+
+ //if (line != NULL) g_free (line);
+ }
+ /* detect whenever we have joined a channel */
+ if (!strncmp ("has joined", &line[strlen (playernames[playernum])+1], 10))
+ {
+ partyline_joining_channel (&line[strlen (playernames[playernum])+20]);
+ }
+ else if (!strncmp ("Joined existing Channel", line, 23))
+ {
+ partyline_joining_channel (&line[26]);
+ }
+ else if (!strncmp ("Created new Channel", line, 19))
+ {
+ partyline_joining_channel (&line[22]);
+ }
+ else if (!strncmp ("You have joined", line, 15))
+ {
+ partyline_joining_channel (&line[16]);
+ }
+ if (tetrix) {
g_snprintf (buf, sizeof(buf), "*** %s", token);
partyline_text (buf);
break;
+ }
+ else
+ plinemsg ("Server", token);
}
- else
- plinemsg ("Server", token);
}
else
{