/// <inheritdoc cref="LeaveChatAsync(string)"/> public Task LeaveChatAsync(string channelId) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", ChannelLeave = new ChannelLeaveMessage { ChannelId = channelId } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="LeaveMatchAsync(string)"/> public Task LeaveMatchAsync(string matchId) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", MatchLeave = new MatchLeaveMessage { MatchId = matchId } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="UpdateStatusAsync"/> public Task UpdateStatusAsync(string status) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", StatusUpdate = new StatusUpdateMessage { Status = status } }; return(SendAsync(envelope)); }
/// <inheritdoc /> public async Task UpdateStatusAsync(string status) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), StatusUpdate = new StatusUpdateMessage { Status = status } }; await SendAsync(envelope); }
/// <inheritdoc /> public async Task UnfollowUsersAsync(IEnumerable <string> userIds) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), StatusUnfollow = new StatusUnfollowMessage { UserIds = new List <string>(userIds) } }; await SendAsync(envelope); }
/// <inheritdoc cref="RemoveMatchmakerAsync(string)"/> public Task RemoveMatchmakerAsync(string ticket) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", MatchmakerRemove = new MatchmakerRemoveMessage { Ticket = ticket } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="UnfollowUsersAsync(System.Collections.Generic.IEnumerable{string})"/> public Task UnfollowUsersAsync(IEnumerable <string> userIDs) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", StatusUnfollow = new StatusUnfollowMessage { UserIds = new List <string>(userIDs) } }; return(SendAsync(envelope)); }
/// <inheritdoc /> public async Task LeaveMatchAsync(string matchId) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), MatchLeave = new MatchLeaveMessage { MatchId = matchId } }; await SendAsync(envelope).ConfigureAwait(false); }
/// <inheritdoc /> public async Task RemoveMatchmakerAsync(string ticket) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), MatchmakerRemove = new MatchmakerRemoveMessage { Ticket = ticket } }; await SendAsync(envelope).ConfigureAwait(false); }
/// <inheritdoc cref="UpdateStatusAsync"/> public Task UpdateStatusAsync(string status) { int cid = Interlocked.Increment(ref _cid); var envelope = new WebSocketMessageEnvelope { Cid = $"{cid}", StatusUpdate = new StatusUpdateMessage { Status = status } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="SendPartyDataAsync(string,long,ArraySegment{byte})"/> public Task SendPartyDataAsync(string partyId, long opCode, ArraySegment <byte> data) { var envelope = new WebSocketMessageEnvelope { PartyDataSend = new PartyDataSend { PartyId = partyId, OpCode = Convert.ToString(opCode), Data = Convert.ToBase64String(data.Array, data.Offset, data.Count) } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="SendPartyDataAsync(string,long,byte[])"/> public Task SendPartyDataAsync(string partyId, long opCode, byte[] data) { var envelope = new WebSocketMessageEnvelope { PartyDataSend = new PartyDataSend { PartyId = partyId, OpCode = Convert.ToString(opCode), Data = Convert.ToBase64String(data) } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="RemoveMatchmakerAsync(string)"/> public Task RemoveMatchmakerAsync(string ticket) { int cid = Interlocked.Increment(ref _cid); var envelope = new WebSocketMessageEnvelope { Cid = $"{cid}", MatchmakerRemove = new MatchmakerRemoveMessage { Ticket = ticket } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="LeavePartyAsync"/> public Task LeavePartyAsync(string partyId) { int cid = Interlocked.Increment(ref _cid); var envelope = new WebSocketMessageEnvelope { Cid = $"{cid}", PartyLeave = new PartyLeave { PartyId = partyId } }; return(SendAsync(envelope)); }
/// <inheritdoc /> public async Task <IMatch> JoinMatchAsync(string matchId) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), MatchJoin = new MatchJoinMessage { MatchId = matchId } }; var response = await SendAsync(envelope).ConfigureAwait(false); return(response.Match); }
/// <inheritdoc="RemoveMatchmakerPartyAsync"/> public Task RemoveMatchmakerPartyAsync(string partyId, string ticket) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", PartyMatchmakerRemove = new PartyMatchmakerRemove { PartyId = partyId, Ticket = ticket } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="AcceptPartyMemberAsync"/> public Task AcceptPartyMemberAsync(string partyId, IUserPresence presence) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", PartyAccept = new PartyAccept { PartyId = partyId, Presence = presence as UserPresence // TODO serialize interface directly in protobuf } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="PromotePartyMember"/> public Task PromotePartyMember(string partyId, IUserPresence partyMember) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", PartyPromote = new PartyPromote { PartyId = partyId, Presence = partyMember as UserPresence // TODO serialize interface directly in protobuf } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="LeaveChatAsync(string)"/> public Task LeaveChatAsync(string channelId) { int cid = Interlocked.Increment(ref _cid); var envelope = new WebSocketMessageEnvelope { Cid = $"{cid}", ChannelLeave = new ChannelLeaveMessage { ChannelId = channelId } }; return(SendAsync(envelope)); }
/// <inheritdoc="RemovePartyMemberAsync"/> public Task RemovePartyMemberAsync(string partyId, IUserPresence presence) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", PartyMemberRemove = new PartyMemberRemove { PartyId = partyId, Presence = presence as UserPresence } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="LeaveMatchAsync(string)"/> public Task LeaveMatchAsync(string matchId) { int cid = Interlocked.Increment(ref _cid); var envelope = new WebSocketMessageEnvelope { Cid = $"{cid}", MatchLeave = new MatchLeaveMessage { MatchId = matchId } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="UnfollowUsersAsync(System.Collections.Generic.IEnumerable{string})"/> public Task UnfollowUsersAsync(IEnumerable <string> userIDs) { int cid = Interlocked.Increment(ref _cid); var envelope = new WebSocketMessageEnvelope { Cid = $"{cid}", StatusUnfollow = new StatusUnfollowMessage { UserIds = new List <string>(userIDs) } }; return(SendAsync(envelope)); }
/// <inheritdoc cref="JoinMatchAsync(string)"/> public async Task <IMatch> JoinMatchAsync(string matchId) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", MatchJoin = new MatchJoinMessage { MatchId = matchId } }; var response = await SendAsync(envelope); return(response.Match); }
/// <inheritdoc cref="FollowUsersAsync(System.Collections.Generic.IEnumerable{string})"/> public async Task <IStatus> FollowUsersAsync(IEnumerable <string> userIDs) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", StatusFollow = new StatusFollowMessage { UserIds = new List <string>(userIDs) } }; var response = await SendAsync(envelope); return(response.Status); }
/// <inheritdoc cref="WriteChatMessageAsync(string,string)"/> public async Task <IChannelMessageAck> WriteChatMessageAsync(string channelId, string content) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", ChannelMessageSend = new ChannelSendMessage { ChannelId = channelId, Content = content } }; var response = await SendAsync(envelope); return(response.ChannelMessageAck); }
/// <inheritdoc cref="RpcAsync"/> public async Task <IApiRpc> RpcAsync(string funcId, string payload = null) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", Rpc = new ApiRpc { Id = funcId, Payload = payload } }; var response = await SendAsync(envelope); return(response.Rpc); }
/// <inheritdoc cref="RemoveChatMessageAsync(string,string)"/> public async Task <IChannelMessageAck> RemoveChatMessageAsync(string channelId, string messageId) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", ChannelMessageRemove = new ChannelRemoveMessage { ChannelId = channelId, MessageId = messageId } }; var response = await SendAsync(envelope); return(response.ChannelMessageAck); }
/// <inheritdoc cref="JoinMatchAsync(string,IDictionary{string, string})"/> public async Task <IMatch> JoinMatchAsync(string matchId, IDictionary <string, string> metadata = null) { var envelope = new WebSocketMessageEnvelope { Cid = $"{_cid++}", MatchJoin = new MatchJoinMessage { MatchId = matchId, Metadata = metadata } }; var response = await SendAsync(envelope); return(response.Match); }
/// <inheritdoc /> public async Task <IChannelMessageAck> WriteChatMessageAsync(string channelId, string content) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), ChannelMessageSend = new ChannelSendMessage { ChannelId = channelId, Content = content } }; var response = await SendAsync(envelope).ConfigureAwait(false); return(response.ChannelMessageAck); }
/// <inheritdoc /> public async Task <IApiRpc> RpcAsync(string id, string content) { var envelope = new WebSocketMessageEnvelope { Cid = Guid.NewGuid().ToString(), Rpc = new ApiRpc { Id = id, Payload = content } }; var response = await SendAsync(envelope).ConfigureAwait(false); return(response.Rpc); }