示例#1
0
        public static async void NotifyChatChannelChange(ServerPlanetChatChannel channel)
        {
            string json = JsonSerializer.Serialize(channel);

            // Send update to members
            await Current.Clients.Group($"p-{channel.Planet_Id}").SendAsync("ChatChannelUpdate", json);
        }
示例#2
0
        /// <summary>
        /// Retrieves a ServerPlanetChatChannel for the given id
        /// </summary>
        public static async Task <ServerPlanetChatChannel> FindAsync(ulong id)
        {
            using (ValourDB db = new ValourDB(ValourDB.DBOptions))
            {
                PlanetChatChannel channel = await db.PlanetChatChannels.FindAsync(id);

                return(ServerPlanetChatChannel.FromBase(channel));
            }
        }