Kafe.RequestLib
The only class you should use to Interact with RequestLib.
Called whenever we receive the information about the Mods of a remote player in the current Instance. This is useful if you need to update data of a player of whether they have RequestLib or your Mod installed.
Cancels a pending request you sent.
Name | Type | Description |
---|---|---|
request | Kafe.RequestLib.API.Request | The request reference. |
Get the currently pending received requests. This might be useful if you want to answer to the requests via the mod, but you don't want to use an interceptor.
The currently pending request received from your mod from a remote player.
This method has no parameters.
Retrieve the currently pending sent requests. This might be useful if you want to cancel a request, but you didn't save it previously.
The currently pending requests sent by your mod.
This method has no parameters.
Checks whether a remote player in the current Instance has your Mod or not.
Whether the remote player has your mod installed or not.
Name | Type | Description |
---|---|---|
playerGuid | System.String | The Remote Player Guid you want to check. |
Checks whether a remote player in the current Instance has the RequestLib or not.
Whether the remote player has the RequestLib installed or not.
Name | Type | Description |
---|---|---|
playerGuid | System.String | The Remote Player Guid you want to check. |
Registers your Mod from the RequestLib. You should run this during the initialization of your mod.
This method has no parameters.
Registers your Mod from the RequestLib. You should run this during the initialization of your mod.
This method has no parameters.
Resolves manually a currently pending request you received.
Name | Type | Description |
---|---|---|
request | Kafe.RequestLib.API.Request | The request reference, you can get it from GetPendingReceivedRequests. |
result | Kafe.RequestLib.API.RequestResult | Which answer should be sent as the response. |
metadata | System.String | Optional metadata if you want to send extra info to the requester. |
Sends a request to a remote player in the Instance.
Name | Type | Description |
---|---|---|
request | Kafe.RequestLib.API.Request | Instance of the request you want to send. Use it's constructor to create one. |
Kafe.RequestLib.API
Wrapper to hold the information of the Result of an Interceptor.
Generates a response for the case when you want to prevent the display of a request. This means the request won't appear for the user to reply.
An InterceptorResult for you to use on your Interceptor function.
Name | Type | Description |
---|---|---|
resultOverride | Kafe.RequestLib.API.RequestResult | The result that will be sent to the request. Defaults to not sending anything (Time out). |
responseMetadata | System.String | Optional metadata that can be retrieved by the request initiator. |
Generates a response for the case when you don't want to prevent the display of a request. This means a request will still appear for the user to reply to.
An InterceptorResult for you to use on your Interceptor function.
This method has no parameters.
Kafe.RequestLib.API
Player info accessible when when we get a Remote Player's info update. Happens whenever someone with the RequestLib joins the Instance.
The GUID of this Remote Player.
The username of this Remote Player.
Check if the Remote Player has your mod Installed.
Whether this Remote Player has your mod install or not.
This method has no parameters.
Check if the Remote Player has the RequestLib installed.
Whether this Remote Player has the Request Library Installed or not.
This method has no parameters.
Kafe.RequestLib.API
Represents a request of RequestLib.
Constructor of requests, should be used by the Mods to create a request.
Name | Type | Description |
---|---|---|
targetPlayerGuid | System.String | Target player guid |
message | System.String | The message to be displayed on the request. |
onResponse | System.Action{Kafe.RequestLib.API.Request,Kafe.RequestLib.API.Response} | The Action that will be called when the player replies or the request times out |
metadata | System.String | Optional metadata that will be available in the Interceptor. |
Gets the message to be displayed on the request.
Gets the optional metadata that will be available in the Interceptor.
Gets the Guid of the source player from whom the request is originating.
Gets the Guid of the target player to whom the request is being sent.
Kafe.RequestLib.API
Represents the Handlers on the requested side. It allows to setup an interceptor or a sent response listener.
Interceptor for the requests.
Listener for when a response is going to be sent from the requested side.
Kafe.RequestLib.API
The possible results of a Request.
The request was accepted!
The request was declined :(
The request didn't get an answer and timed out. Requests time out after 1 minute.
Kafe.RequestLib.API
Represents a response of RequestLib.
Internal constructor of responses. Should not be used by Mods!
This constructor has no parameters.
Gets the optional metadata related to the response. This metadata might provide additional information about the response.
Gets the result of the request. The result can be TimedOut, Accepted, or Declined.