# GameMode PreLogin Event?

**URL:** <https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695>\
**Category:** Blueprint\
**Tags:** gamemode, unreal-engine, question\
**Created:** [May 24, 2024, 11:17am UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695 "2024-05-24T11:17:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ButDawg69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ButDawg69](https://forums.unrealengine.com/u/ButDawg69)\
**Post date:** [May 24, 2024, 11:17am UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/1 "2024-05-24T11:17:51Z")

</div>

I’m using GameMode with the parent class of (GameMode).

I’d like to validate a users token passed via options on load level to see if they’re allowed on the server, but I can’t seem to expose the PreLogin event to Blueprints? Any suggestions would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![Micropho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Micropho](https://forums.unrealengine.com/u/Micropho)\
**Post date:** [May 24, 2024, 2:40pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/2 "2024-05-24T14:40:57Z")

</div>

You have to create a new C++ class inheriting AGameMode and override the PreLogin function. Then, either use the new class as your active GameMode or base class of your current BP\_GameMode.

---

<div class="post-metadata">

**Author:** ![ButDawg69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ButDawg69](https://forums.unrealengine.com/u/ButDawg69)\
**Post date:** [May 24, 2024, 5:04pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/3 "2024-05-24T17:04:06Z")

</div>

> [@Micropho](#):
>
> of your current BP\_GameMod

Thank you for the reply. Would it be reasonable to create a mechanism where the PreLogin C++ function calls a Blueprint-implementable event?

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 24, 2024, 8:27pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/4 "2024-05-24T20:27:55Z")

</div>

You’ll want to do this before the server is selected to join. Match Making is where this should be.

---

<div class="post-metadata">

**Author:** ![ButDawg69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ButDawg69](https://forums.unrealengine.com/u/ButDawg69)\
**Post date:** [May 24, 2024, 10:17pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/5 "2024-05-24T22:17:34Z")

</div>

My flow is:

1. Client logs in via HTTP request
2. Client receives and stores access token & and IP:PORT of server to connect to from REST API.
3. Client should then connect to IP:PORT(Unreal Dedicated Server) and pass their token for validation

Is #2 considered the match making? I’d assume I’d pass the token via options in OpenLevel on the client, which would be picked up in PreLogin?

---

<div class="post-metadata">

**Author:** ![Rev0verDrive](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/rev0verdrive/32/907214_2.png) [@Rev0verDrive](https://forums.unrealengine.com/u/Rev0verDrive)\
**Post date:** [May 24, 2024, 11:52pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/6 "2024-05-24T23:52:57Z")

</div>

Matchmaking (MM) is a sub-service that’s not a part of the game server. Steam and EOS have these.

MM in general is a server filtering service that provides applicable servers the client can join based on set criteria. So any validation processes per client would be executed here.

You do not want clients connecting to a server, validating then getting kicked. That’s bad design and bad for the server. They should only ever connect if they can actually play.

---

<div class="post-metadata">

**Author:** ![ButDawg69](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ButDawg69](https://forums.unrealengine.com/u/ButDawg69)\
**Post date:** [May 25, 2024, 5:43pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/7 "2024-05-25T17:43:33Z")

</div>

Ok, is there a platform agnostic system?

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [June 24, 2024, 5:43pm UTC](https://forums.unrealengine.com/t/gamemode-prelogin-event/1870695/8 "2024-06-24T17:43:56Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
