Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
|
A socket to interact with Nakama server. More...
Public Member Functions | |
Task | AcceptPartyMemberAsync (string partyId, IUserPresence presence) |
Accept a party member's request to join the party. | |
Task< IMatchmakerTicket > | AddMatchmakerAsync (string query="*", int minCount=2, int maxCount=8, Dictionary< string, string > stringProperties=null, Dictionary< string, double > numericProperties=null, int? countMultiple=null) |
Join the matchmaker pool and search for opponents on the server. | |
Task< IPartyMatchmakerTicket > | AddMatchmakerPartyAsync (string partyId, string query, int minCount, int maxCount, Dictionary< string, string > stringProperties=null, Dictionary< string, double > numericProperties=null, int? countMultiple=null) |
Begin matchmaking as a party. | |
Task | ClosePartyAsync (string partyId) |
End a party, kicking all party members and closing it. | |
Task | CloseAsync () |
Close the socket connection to the server. | |
Task | ConnectAsync (ISession session, bool appearOnline=false, int connectTimeout=Socket.DefaultConnectTimeout, string langTag="en") |
Connect to the server. | |
Task< IMatch > | CreateMatchAsync (string matchName=null) |
Create a multiplayer match on the server. | |
Task< IParty > | CreatePartyAsync (bool open, int maxSize) |
Create a party. | |
Task< IStatus > | FollowUsersAsync (IEnumerable< IApiUser > users) |
Subscribe to one or more users for their status updates. | |
Task< IStatus > | FollowUsersAsync (IEnumerable< string > userIDs, IEnumerable< string > usernames=null) |
Subscribe to one or more users for their status updates. | |
Task< IChannel > | JoinChatAsync (string target, ChannelType type, bool persistence=false, bool hidden=false) |
Join a chat channel on the server. | |
Task | JoinPartyAsync (string partyId) |
Join a party. | |
Task< IMatch > | JoinMatchAsync (IMatchmakerMatched matched) |
Join a multiplayer match with the matchmaker matched object. | |
Task< IMatch > | JoinMatchAsync (string matchId, IDictionary< string, string > metadata=null) |
Join a multiplayer match by ID. | |
Task | LeaveChatAsync (IChannel channel) |
Leave a chat channel on the server. | |
Task | LeaveChatAsync (string channelId) |
Leave a chat channel on the server. | |
Task | LeaveMatchAsync (IMatch match) |
Leave a multiplayer match on the server. | |
Task | LeaveMatchAsync (string matchId) |
Leave a multiplayer match on the server. | |
Task | LeavePartyAsync (string partyId) |
Leave the party. | |
Task< IPartyJoinRequest > | ListPartyJoinRequestsAsync (string partyId) |
Request a list of pending join requests for a party. | |
Task | PromotePartyMemberAsync (string partyId, IUserPresence partyMember) |
Promote a new party leader. | |
Task< IChannelMessageAck > | RemoveChatMessageAsync (IChannel channel, string messageId) |
Remove a chat message from a chat channel on the server. | |
Task< IChannelMessageAck > | RemoveChatMessageAsync (string channelId, string messageId) |
Remove a chat message from a chat channel on the server. | |
Task | RemoveMatchmakerAsync (IMatchmakerTicket ticket) |
Leave the matchmaker pool with the ticket. | |
Task | RemoveMatchmakerAsync (string ticket) |
Leave the matchmaker pool with the ticket contents. | |
Task | RemoveMatchmakerPartyAsync (string partyId, string ticket) |
Cancel a party matchmaking process using a ticket. | |
Task | RemovePartyMemberAsync (string partyId, IUserPresence presence) |
Kick a party member, or decline a request to join. | |
Task< IApiRpc > | RpcAsync (string funcId, string payload=null) |
Execute an RPC function to the server. | |
Task< IApiRpc > | RpcAsync (string funcId, ArraySegment< byte > payload) |
Execute an RPC function to the server. | |
Task | SendMatchStateAsync (string matchId, long opCode, string state, IEnumerable< IUserPresence > presences=null) |
Send input to a multiplayer match on the server. | |
Task | SendMatchStateAsync (string matchId, long opCode, ArraySegment< byte > state, IEnumerable< IUserPresence > presences=null) |
Send input to a multiplayer match on the server. | |
Task | SendMatchStateAsync (string matchId, long opCode, byte[] state, IEnumerable< IUserPresence > presences=null) |
Send input to a multiplayer match on the server. | |
Task | SendPartyDataAsync (string partyId, long opCode, ArraySegment< byte > data) |
Send data to a party. | |
Task | SendPartyDataAsync (string partyId, long opCode, string data) |
Send data to a party. | |
Task | SendPartyDataAsync (string partyId, long opCode, byte[] data) |
Send data to a party. | |
Task | UnfollowUsersAsync (IEnumerable< IApiUser > users) |
Unfollow one or more users from their status updates. | |
Task | UnfollowUsersAsync (IEnumerable< string > userIDs) |
Unfollow one or more users from their status updates. | |
Task< IChannelMessageAck > | UpdateChatMessageAsync (IChannel channel, string messageId, string content) |
Update a chat message on a chat channel in the server. | |
Task< IChannelMessageAck > | UpdateChatMessageAsync (string channelId, string messageId, string content) |
Update a chat message on a chat channel in the server. | |
Task | UpdateStatusAsync (string status) |
Update the status for the current user online. | |
Task< IChannelMessageAck > | WriteChatMessageAsync (IChannel channel, string content) |
Send a chat message to a chat channel on the server. | |
Task< IChannelMessageAck > | WriteChatMessageAsync (string channelId, string content) |
Send a chat message to a chat channel on the server. | |
Properties | |
bool | IsConnected [get] |
If the socket is connected. | |
bool | IsConnecting [get] |
If the socket is connecting. | |
Events | |
Action | Closed |
Received when a socket is closed. | |
Action | Connected |
Received when a socket is connected. | |
Action< IApiChannelMessage > | ReceivedChannelMessage |
Received a chat channel message. | |
Action< IChannelPresenceEvent > | ReceivedChannelPresence |
Received a presence change for joins and leaves with users in a chat channel. | |
Action< Exception > | ReceivedError |
Received when an error occurs on the socket. | |
Action< IMatchmakerMatched > | ReceivedMatchmakerMatched |
Received a matchmaker matched message. | |
Action< IMatchState > | ReceivedMatchState |
Received a message from a multiplayer match. | |
Action< IMatchPresenceEvent > | ReceivedMatchPresence |
Received a presence change for joins and leaves of users in a multiplayer match. | |
Action< IApiNotification > | ReceivedNotification |
Received a notification for the current user. | |
Action< IParty > | ReceivedParty |
Received a party event. This will occur when the current user's invitation request is accepted by the party leader of a closed party. | |
Action< IPartyClose > | ReceivedPartyClose |
Received a party close event. | |
Action< IPartyData > | ReceivedPartyData |
Received custom party data. | |
Action< IPartyJoinRequest > | ReceivedPartyJoinRequest |
Received a request to join the party. | |
Action< IPartyLeader > | ReceivedPartyLeader |
Received a change in the party leader. | |
Action< IPartyMatchmakerTicket > | ReceivedPartyMatchmakerTicket |
Received a new matchmaker ticket for the party. | |
Action< IPartyPresenceEvent > | ReceivedPartyPresence |
Received a new presence event in the party. | |
Action< IStatusPresenceEvent > | ReceivedStatusPresence |
Received a presence change for when a user updated their online status. | |
Action< IStreamPresenceEvent > | ReceivedStreamPresence |
Received a presence change for joins and leaves on a realtime stream. | |
Action< IStreamState > | ReceivedStreamState |
Received a message from a realtime stream. | |
A socket to interact with Nakama server.
Task Nakama.ISocket.AcceptPartyMemberAsync | ( | string | partyId, |
IUserPresence | presence | ||
) |
Accept a party member's request to join the party.
partyId | The party ID to accept the join request for. |
presence | The presence to accept as a party member. |
Implemented in Nakama.Socket.
Task< IMatchmakerTicket > Nakama.ISocket.AddMatchmakerAsync | ( | string | query = "*" , |
int | minCount = 2 , |
||
int | maxCount = 8 , |
||
Dictionary< string, string > | stringProperties = null , |
||
Dictionary< string, double > | numericProperties = null , |
||
int? | countMultiple = null |
||
) |
Join the matchmaker pool and search for opponents on the server.
query | The matchmaker query to search for opponents. |
minCount | The minimum number of players to compete against in a match. |
maxCount | The maximum number of players to compete against in a match. |
stringProperties | A set of key/value properties to provide to searches. |
numericProperties | A set of key/value numeric properties to provide to searches. |
countMultiple | An optional integer to force the matchmaker to match in multiples of. |
Implemented in Nakama.Socket.
Task< IPartyMatchmakerTicket > Nakama.ISocket.AddMatchmakerPartyAsync | ( | string | partyId, |
string | query, | ||
int | minCount, | ||
int | maxCount, | ||
Dictionary< string, string > | stringProperties = null , |
||
Dictionary< string, double > | numericProperties = null , |
||
int? | countMultiple = null |
||
) |
Begin matchmaking as a party.
partyId | Party ID. |
query | Filter query used to identify suitable users. |
minCount | Minimum total user count to match together. |
maxCount | Maximum total user count to match together. |
stringProperties | String properties. |
numericProperties | Numeric properties. |
countMultiple | An optional integer to force the matchmaker to match in multiples of. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.CloseAsync | ( | ) |
Close the socket connection to the server.
Implemented in Nakama.Socket.
Task Nakama.ISocket.ClosePartyAsync | ( | string | partyId | ) |
End a party, kicking all party members and closing it.
partyId | The ID of the party. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.ConnectAsync | ( | ISession | session, |
bool | appearOnline = false , |
||
int | connectTimeout = Socket.DefaultConnectTimeout , |
||
string | langTag = "en" |
||
) |
Connect to the server.
session | The session of the user. |
appearOnline | If the user who appear online to other users. |
connectTimeout | The time allowed for the socket connection to be established. |
langTag | The language tag of the user on the connected socket. |
Implemented in Nakama.Socket.
Task< IMatch > Nakama.ISocket.CreateMatchAsync | ( | string | matchName = null | ) |
Create a multiplayer match on the server.
Implemented in Nakama.Socket.
Task< IParty > Nakama.ISocket.CreatePartyAsync | ( | bool | open, |
int | maxSize | ||
) |
Create a party.
open | Whether or not the party will require join requests to be approved by the party leader. |
maxSize | Maximum number of party members. |
Implemented in Nakama.Socket.
Subscribe to one or more users for their status updates.
users | The users. |
Implemented in Nakama.Socket.
Task< IStatus > Nakama.ISocket.FollowUsersAsync | ( | IEnumerable< string > | userIDs, |
IEnumerable< string > | usernames = null |
||
) |
Subscribe to one or more users for their status updates.
userIDs | The IDs of users. |
usernames | The usernames of the users. |
Implemented in Nakama.Socket.
Task< IChannel > Nakama.ISocket.JoinChatAsync | ( | string | target, |
ChannelType | type, | ||
bool | persistence = false , |
||
bool | hidden = false |
||
) |
Join a chat channel on the server.
target | The target channel to join. |
type | The type of channel to join. |
persistence | If chat messages should be stored. |
hidden | If the current user should be hidden on the channel. |
Implemented in Nakama.Socket.
Task< IMatch > Nakama.ISocket.JoinMatchAsync | ( | IMatchmakerMatched | matched | ) |
Join a multiplayer match with the matchmaker matched object.
matched | A matchmaker matched object. |
Implemented in Nakama.Socket.
Task< IMatch > Nakama.ISocket.JoinMatchAsync | ( | string | matchId, |
IDictionary< string, string > | metadata = null |
||
) |
Join a multiplayer match by ID.
matchId | The ID of the match to attempt to join. |
metadata | An optional set of key-value metadata pairs to be passed to the match handler. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.JoinPartyAsync | ( | string | partyId | ) |
Join a party.
partyId | Party ID |
Implemented in Nakama.Socket.
Task Nakama.ISocket.LeaveChatAsync | ( | IChannel | channel | ) |
Leave a chat channel on the server.
channel | The chat channel to leave. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.LeaveChatAsync | ( | string | channelId | ) |
Leave a chat channel on the server.
channelId | The ID of the chat channel to leave. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.LeaveMatchAsync | ( | IMatch | match | ) |
Leave a multiplayer match on the server.
match | The multiplayer match to leave. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.LeaveMatchAsync | ( | string | matchId | ) |
Leave a multiplayer match on the server.
matchId | The multiplayer match to leave. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.LeavePartyAsync | ( | string | partyId | ) |
Leave the party.
partyId | Party ID. |
Implemented in Nakama.Socket.
Task< IPartyJoinRequest > Nakama.ISocket.ListPartyJoinRequestsAsync | ( | string | partyId | ) |
Request a list of pending join requests for a party.
partyId | Party ID. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.PromotePartyMemberAsync | ( | string | partyId, |
IUserPresence | partyMember | ||
) |
Promote a new party leader.
partyId | Party ID. |
partyMember | The presence of an existing party member to promote as the new leader. |
Implemented in Nakama.Socket.
Task< IChannelMessageAck > Nakama.ISocket.RemoveChatMessageAsync | ( | IChannel | channel, |
string | messageId | ||
) |
Remove a chat message from a chat channel on the server.
channel | The chat channel with the message to remove. |
messageId | The ID of the chat message to remove. |
Implemented in Nakama.Socket.
Task< IChannelMessageAck > Nakama.ISocket.RemoveChatMessageAsync | ( | string | channelId, |
string | messageId | ||
) |
Remove a chat message from a chat channel on the server.
channelId | The ID of the chat channel with the message to remove. |
messageId | The ID of the chat message to remove. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.RemoveMatchmakerAsync | ( | IMatchmakerTicket | ticket | ) |
Leave the matchmaker pool with the ticket.
ticket | The ticket returned by the matchmaker on join. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.RemoveMatchmakerAsync | ( | string | ticket | ) |
Leave the matchmaker pool with the ticket contents.
ticket | The contents of the ticket returned by the matchmaker on join. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.RemoveMatchmakerPartyAsync | ( | string | partyId, |
string | ticket | ||
) |
Cancel a party matchmaking process using a ticket.
partyId | Party ID. |
ticket | The ticket to cancel. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.RemovePartyMemberAsync | ( | string | partyId, |
IUserPresence | presence | ||
) |
Kick a party member, or decline a request to join.
partyId | Party ID to remove/reject from. |
presence | The presence to remove or reject. |
Implemented in Nakama.Socket.
Task< IApiRpc > Nakama.ISocket.RpcAsync | ( | string | funcId, |
ArraySegment< byte > | payload | ||
) |
Execute an RPC function to the server.
funcId | The ID of the function to execute. |
payload | An (optional) payload sent to the server from the byte buffer. |
Implemented in Nakama.Socket.
Task< IApiRpc > Nakama.ISocket.RpcAsync | ( | string | funcId, |
string | payload = null |
||
) |
Execute an RPC function to the server.
funcId | The ID of the function to execute. |
payload | An (optional) payload to send to the server. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.SendMatchStateAsync | ( | string | matchId, |
long | opCode, | ||
ArraySegment< byte > | state, | ||
IEnumerable< IUserPresence > | presences = null |
||
) |
Send input to a multiplayer match on the server.
matchId | The ID of the match. |
opCode | An operation code for the input. |
state | The input data to send from the byte buffer. |
presences | The presences in the match who should receive the input. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.SendMatchStateAsync | ( | string | matchId, |
long | opCode, | ||
byte[] | state, | ||
IEnumerable< IUserPresence > | presences = null |
||
) |
Send input to a multiplayer match on the server.
///
When no presences are supplied the new match state will be sent to all presences.
matchId | The ID of the match. |
opCode | An operation code for the input. |
state | The input data to send. |
presences | The presences in the match who should receive the input. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.SendMatchStateAsync | ( | string | matchId, |
long | opCode, | ||
string | state, | ||
IEnumerable< IUserPresence > | presences = null |
||
) |
Send input to a multiplayer match on the server.
///
When no presences are supplied the new match state will be sent to all presences.
matchId | The ID of the match. |
opCode | An operation code for the input. |
state | The input data to send. |
presences | The presences in the match who should receive the input. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.SendPartyDataAsync | ( | string | partyId, |
long | opCode, | ||
ArraySegment< byte > | data | ||
) |
Send data to a party.
partyId | Party ID to send to. |
opCode | Op code value. |
data | The input data to send from the byte buffer, if any. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.SendPartyDataAsync | ( | string | partyId, |
long | opCode, | ||
byte[] | data | ||
) |
Send data to a party.
partyId | Party ID to send to. |
opCode | Op code value. |
data | Data payload, if any. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.SendPartyDataAsync | ( | string | partyId, |
long | opCode, | ||
string | data | ||
) |
Send data to a party.
partyId | Party ID to send to. |
opCode | Op code value. |
data | Data payload, if any. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.UnfollowUsersAsync | ( | IEnumerable< IApiUser > | users | ) |
Unfollow one or more users from their status updates.
users | The users to unfollow. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.UnfollowUsersAsync | ( | IEnumerable< string > | userIDs | ) |
Unfollow one or more users from their status updates.
userIDs | The IDs of the users to unfollow. |
Implemented in Nakama.Socket.
Task< IChannelMessageAck > Nakama.ISocket.UpdateChatMessageAsync | ( | IChannel | channel, |
string | messageId, | ||
string | content | ||
) |
Update a chat message on a chat channel in the server.
channel | The chat channel with the message to update. |
messageId | The ID of the message to update. |
content | The new contents of the chat message. |
Implemented in Nakama.Socket.
Task< IChannelMessageAck > Nakama.ISocket.UpdateChatMessageAsync | ( | string | channelId, |
string | messageId, | ||
string | content | ||
) |
Update a chat message on a chat channel in the server.
channelId | The ID of the chat channel with the message to update. |
messageId | The ID of the message to update. |
content | The new contents of the chat message. |
Implemented in Nakama.Socket.
Task Nakama.ISocket.UpdateStatusAsync | ( | string | status | ) |
Update the status for the current user online.
status | The new status for the user. |
Implemented in Nakama.Socket.
Task< IChannelMessageAck > Nakama.ISocket.WriteChatMessageAsync | ( | IChannel | channel, |
string | content | ||
) |
Send a chat message to a chat channel on the server.
channel | The chat channel to send onto. |
content | The contents of the message to send. |
Implemented in Nakama.Socket.
Task< IChannelMessageAck > Nakama.ISocket.WriteChatMessageAsync | ( | string | channelId, |
string | content | ||
) |
Send a chat message to a chat channel on the server.
channelId | The ID of the chat channel to send onto. |
content | The contents of the message to send. |
Implemented in Nakama.Socket.
|
get |
If the socket is connected.
Implemented in Nakama.Socket.
|
get |
If the socket is connecting.
Implemented in Nakama.Socket.
Action Nakama.ISocket.Closed |
Received when a socket is closed.
Action Nakama.ISocket.Connected |
Received when a socket is connected.
Action<IApiChannelMessage> Nakama.ISocket.ReceivedChannelMessage |
Received a chat channel message.
Action<IChannelPresenceEvent> Nakama.ISocket.ReceivedChannelPresence |
Received a presence change for joins and leaves with users in a chat channel.
Action<Exception> Nakama.ISocket.ReceivedError |
Received when an error occurs on the socket.
Action<IMatchmakerMatched> Nakama.ISocket.ReceivedMatchmakerMatched |
Received a matchmaker matched message.
Action<IMatchPresenceEvent> Nakama.ISocket.ReceivedMatchPresence |
Received a presence change for joins and leaves of users in a multiplayer match.
Action<IMatchState> Nakama.ISocket.ReceivedMatchState |
Received a message from a multiplayer match.
Action<IApiNotification> Nakama.ISocket.ReceivedNotification |
Received a notification for the current user.
Action<IParty> Nakama.ISocket.ReceivedParty |
Received a party event. This will occur when the current user's invitation request is accepted by the party leader of a closed party.
Action<IPartyClose> Nakama.ISocket.ReceivedPartyClose |
Received a party close event.
Action<IPartyData> Nakama.ISocket.ReceivedPartyData |
Received custom party data.
Action<IPartyJoinRequest> Nakama.ISocket.ReceivedPartyJoinRequest |
Received a request to join the party.
Action<IPartyLeader> Nakama.ISocket.ReceivedPartyLeader |
Received a change in the party leader.
Action<IPartyMatchmakerTicket> Nakama.ISocket.ReceivedPartyMatchmakerTicket |
Received a new matchmaker ticket for the party.
Action<IPartyPresenceEvent> Nakama.ISocket.ReceivedPartyPresence |
Received a new presence event in the party.
Action<IStatusPresenceEvent> Nakama.ISocket.ReceivedStatusPresence |
Received a presence change for when a user updated their online status.
Action<IStreamPresenceEvent> Nakama.ISocket.ReceivedStreamPresence |
Received a presence change for joins and leaves on a realtime stream.
Action<IStreamState> Nakama.ISocket.ReceivedStreamState |
Received a message from a realtime stream.