# Client/Server. Force client to connect to server after launch

**URL:** <https://forums.unrealengine.com/t/client-server-force-client-to-connect-to-server-after-launch/410918>\
**Category:** Multiplayer & Networking\
**Tags:** startup, Networking, client, client-server, unreal-engine, question, CPP\
**Created:** [November 29, 2017, 8:15pm UTC](https://forums.unrealengine.com/t/client-server-force-client-to-connect-to-server-after-launch/410918 "2017-11-29T20:15:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lord\_Northern](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lord_northern/32/882928_2.png) [@Lord\_Northern](https://forums.unrealengine.com/u/Lord_Northern)\
**Post date:** [November 29, 2017, 8:15pm UTC](https://forums.unrealengine.com/t/client-server-force-client-to-connect-to-server-after-launch/410918/1 "2017-11-29T20:15:52Z")

</div>

Hi.  
I’m trying to figure out how to create a pure client configuration for a game.  
For simplicity, assume that we’re working on a fresh third person C++ template, called Test.  
I added a file TestClient.Target.cs with the following contents:

```
using UnrealBuildTool;
using System.Collections.Generic;

public class TestClientTarget : TargetRules
{
	public TestClientTarget(TargetInfo Target) : base(Target)
	{
		Type = TargetType.Client;

		ExtraModuleNames.AddRange( new string[] { "Test" } );
	}
}

```

and I also created a target for the server, built it and it works fine.

How can I make the client behave purely as a client? So, that when I star it, it will attempt to connect to the server instead of first running as a standalone game? Where exactly do I catch it? Which classes run at the initialization process for the client?

Any info on the topic would be highly appreciated!  
Thanks!

---

<div class="post-metadata">

**Author:** ![ZenoTasedro](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@ZenoTasedro](https://forums.unrealengine.com/u/ZenoTasedro)\
**Post date:** [November 29, 2017, 9:22pm UTC](https://forums.unrealengine.com/t/client-server-force-client-to-connect-to-server-after-launch/410918/2 "2017-11-29T21:22:47Z")

</div>

I’ve been using the command line arguments so far to get clients to connect to a server, following the examples from this document:

> **[Client-Server Model](https://docs.unrealengine.com/4.27/en-US/InteractiveExperiences/Networking/Server/)**
>
> An overview of the role of the server in multiplayer.

I made a few shortcuts on my desktop to make it quicker to test.
