Commit 8b95f39a authored by Jonathan Michalon's avatar Jonathan Michalon

libovcc/ovcc-network-list-tables-message: flatten variant format, thx b4n

parent 5eb716f4
...@@ -33,8 +33,7 @@ public class OVCC.Network.ListTablesMessage : VariantMessage ...@@ -33,8 +33,7 @@ public class OVCC.Network.ListTablesMessage : VariantMessage
{ {
Variant[] list = {}; Variant[] list = {};
foreach (var d in descriptions) { foreach (var d in descriptions) {
Variant tmp = d.player_nicks; // triggers internal vala magics with VariantBuilder etc. list += new Variant ("(si^as)", d.name, d.state, d.player_nicks);
list += new Variant ("(siv)", d.name, d.state, tmp);
} }
Variant v = list; // triggers internal vala magics with VariantBuilder etc. Variant v = list; // triggers internal vala magics with VariantBuilder etc.
...@@ -51,7 +50,7 @@ public class OVCC.Network.ListTablesMessage : VariantMessage ...@@ -51,7 +50,7 @@ public class OVCC.Network.ListTablesMessage : VariantMessage
foreach (var v in list) { foreach (var v in list) {
string name = v.get_child_value (0).get_string (); string name = v.get_child_value (0).get_string ();
GameState state = (GameState) v.get_child_value (1).get_int32 (); GameState state = (GameState) v.get_child_value (1).get_int32 ();
string[] player_nicks = (string[]) v.get_child_value (2).get_variant (); string[] player_nicks = v.get_child_value (2).get_strv ();
tmplist += new GameDescription (name, state, player_nicks); tmplist += new GameDescription (name, state, player_nicks);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment