# SDK Java not client.rpc(httpsercetkey…)

**URL:** <https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098>\
**Category:** Client Libraries\
**Tags:** server-framework, sdk-java, typescript\
**Created:** [March 28, 2024, 11:54am UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098 "2024-03-28T11:54:36Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![dhforever](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@dhforever](https://forum.heroiclabs.com/u/dhforever)\
**Post date:** [March 28, 2024, 11:54am UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/1 "2024-03-28T11:54:36Z")

</div>

Hello,  
I am using Nakama Java SDK, however in java there is only:  
client.rpc(session…) but not client.rpc(httpsercetkey…).  
In unity, I often use client.RpcAsync(httpsercetkey…). Can Nakama Java SDK be updated further?  
Thank you.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [March 28, 2024, 1:26pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/2 "2024-03-28T13:26:18Z")

</div>

Hello @dhforever, we’d encourage you to open a PR to add support for this method if you can, contributions are greatly appreciated.

Best.

---

<div class="post-metadata">

**Author:** ![dhforever](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@dhforever](https://forum.heroiclabs.com/u/dhforever)\
**Post date:** [April 1, 2024, 12:45pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/3 "2024-04-01T12:45:35Z")

</div>

I really want to do that. But my experience is poor.

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [April 1, 2024, 1:04pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/4 "2024-04-01T13:04:54Z")

</div>

You can still call the RPC’s via REST using a regular Java HTTP client, you should add the http key as a query param called `http_key`.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![dhforever](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@dhforever](https://forum.heroiclabs.com/u/dhforever)\
**Post date:** [April 1, 2024, 1:50pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/5 "2024-04-01T13:50:37Z")

</div>

Thank you. I’m doing it.  
Sorry for bothering you, can I ask something else besides this topic?  
I don’t really understand the matchkick method yet, it is described below. How can a match owner kick another client out of that match?

```auto
let matchkick = function matchLoop(ctx, logger, nk, dispatcher, tick, state, messages) {
     logger.debug('Lobby match loop executed');

     dispatcher.matchKick(messages.map(function (message) {
         return message.sender;
     }));

     return {
         state: state
     };
}

```

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [April 1, 2024, 1:59pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/6 "2024-04-01T13:59:53Z")

</div>

As in your example above, just call `dispatcher.matchKick()` and pass the presence of the users to kick. Although in your example it seems like you’re kicking all clients that are sending a message to the match.

If you need a reference for how to implement match handlers, have a look at our [project template](https://github.com/heroiclabs/nakama-project-template/blob/master/match_handler.ts).

---

<div class="post-metadata">

**Author:** ![dhforever](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@dhforever](https://forum.heroiclabs.com/u/dhforever)\
**Post date:** [April 1, 2024, 2:23pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/7 "2024-04-01T14:23:23Z")

</div>

There are no examples of Matchkick specifically. I searched them all.  
Can you write an RPC function to kick 1 player with 1 userid from match?

---

<div class="post-metadata">

**Author:** ![sesposito](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/sesposito/32/2594_2.png) [@sesposito](https://forum.heroiclabs.com/u/sesposito)\
**Post date:** [April 1, 2024, 2:37pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/8 "2024-04-01T14:37:07Z")

</div>

There’s no example for kicking a player specifically, but you’d treat it like any of the other messages in the template.

First, define a message with an opcode to kick a player(s);  
Then, have a [case statement](https://github.com/heroiclabs/nakama-project-template/blob/master/match_handler.ts#L295) to handle the kick message. The client should send the list of players to kick in the payload of the message, you’d unmarshal it and call `dispatcher.matchKick()` with the list of said players.

---

<div class="post-metadata">

**Author:** ![dhforever](https://avatars.discourse-cdn.com/v4/letter/d/ebca7d/32.png) [@dhforever](https://forum.heroiclabs.com/u/dhforever)\
**Post date:** [April 1, 2024, 2:42pm UTC](https://forum.heroiclabs.com/t/sdk-java-not-client-rpc-httpsercetkey/5098/9 "2024-04-01T14:42:49Z")

</div>

thank you. have a goodday
