Game State Visualizer
The perfect tool to debug server data and find differences with client and UI.
Setup
Add the following text on ServerManagerLocal.cs
to allow GSV to get server data and compare with client data.
public GameServer GameServer { get { return server; } }
Remember to add using GSV;
of top files to be able to use Attributes.
Attributes
GSVField:
Description: set special name to override field's name, also could be used as header of arrays/lists.
MaxWidth: set max width to make room for more fields in lines.
CompareField: set the field used to compare object from server and client data.
StripeLines: enable stripe lines for specific list.
CompareUI: set the field on CardUI to find respective object.
Examples

Game.cs
[GSVField]
public GameState state = GameState.Connecting;
[GSVField]
public GamePhase phase = GamePhase.None;
//Players
[GSVField(description:"Players", compare_field: "player_id")]
public Player[] players;
//Selector
[GSVField]
public SelectorType selector = SelectorType.None;
[GSVField]
public int selector_player_id = 0;
[GSVField]
public string selector_ability_id;
[GSVField]
public string selector_caster_uid;
Player.cs
[GSVField]
public int player_id;
[GSVField]
public int hp;
[GSVField]
public int hp_max;
[GSVField]
public int mana = 0;
[GSVField]
public int mana_max = 0;
[GSVField]
public int kill_count = 0;
[GSVField(description: "Deck", stripe_lines:true)]
public List<Card> cards_deck = new List<Card>();
[GSVField(description: "Hand", stripe_lines: true)]
public List<Card> cards_hand = new List<Card>();
[GSVField(description: "Board", stripe_lines: true)]
public List<Card> cards_board = new List<Card>();
Card.cs
[GSVField]
public string card_id;
[GSVField(max_width: 75)]
public Slot slot;
[GSVField]
public string card_id;
[GSVField(max_width: 75)]
public Slot slot;
[GSVField(max_width: 75)]
public int mana = 0;
[GSVField(max_width: 75)]
public int attack = 0;
[GSVField(max_width: 75)]
public int hp = 0;
public override string ToString()
{
return $"[{x},{y}]";
}
Last updated