DCAS handbook

How old guild settings (aks json settings) are implemented

Note: this is dirty workaround. It is done in this way cuz I (Somobu) expect that DC client will completely migrate from JSON settings to protobuf ones, and that DC will do it earlier than I find some free time to refactor this piece of stinky code.

  1. Add/update server settings:

    • User posts guild settings update (PATCH /users/@me/guilds/settings);
    • Server reads guild settings map from server/settings/{user}/guilds.json;
    • Server merges new settings into that file as-is;
    • Server iterates over newly-updated guilds;
    • Server transforms each guild from stored format to “client-expected user guild settings format”;
    • Server sends User Guild Settings Update event for each guild;
  2. Generate READY payload:

    • Server iterates over all user’s guilds settings;
    • Server transforms each guild in the same way it is done for the settings update case;