Пример #1
0
        /// <summary>
        /// Returns a planet's primary channel
        /// </summary>
        public async Task <TaskResult <PlanetChatChannel> > GetPrimaryChannel(ulong planetid, ulong userid, string token)
        {
            ServerPlanet planet = await ServerPlanet.FindAsync(planetid, Mapper);

            if (!(await planet.AuthorizedAsync(userid, token)))
            {
                return(new TaskResult <PlanetChatChannel>(false, "You are not authorized to access this planet.", null));
            }

            return(new TaskResult <PlanetChatChannel>(true, "Successfully retireved channel.", await planet.GetPrimaryChannelAsync()));
        }