public async Task SetServerGuildData(DeltaConnection conn, DbServer server, DbUser user, DbPlayerProfile profile) { //Get tribe info target_tribe = await conn.GetTribeByTribeIdAsync(server._id, profile.tribe_id); //Set other is_admin = server.CheckIsUserAdmin(user); user_prefs = await server.GetUserPrefs(conn, user.id); }
/// <summary> /// Notifies a player that their access to a server has changed. Tells a user if they have access to a server, if they're admin, and their tribe ID /// </summary> public async Task OnUserServerAccessChangedAsync(DbServer server, DbUser user) { //Fetch the player profile var playerProfile = await server.GetUserPlayerProfile(conn, user); //Check if they are admin bool isAdmin = server.CheckIsUserAdmin(user); //Get payload and send RPCPayloadServerAccessChanged payload = new RPCPayloadServerAccessChanged(isAdmin, playerProfile); RPCMessageTool.SendRPCMsgToUserID(conn, RPC.RPCOpcode.SERVER_ACCESS_CHANGED, payload, user._id, server._id); }