Sign in to follow this  

Unreal Engine Main Int [Help]

This topic is 370 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all, ive created before started working with UE a basic client that connect at a server with a chat server too, but now I need to implement it to my UE4 project.

Where can i find the int main()? to add it.

Also the basic client is written for a CMD project, how can i change it to be compatible with UE?

 

Thanks in advance

Share this post


Link to post
Share on other sites
You may be looking in the wrong spot to initialize your chat server connections. May I suggest using your own child class of UGameInstance? I would take a look at the Shooter Game Tutorial or UT source code to see where they start up chat client connections. To answer your question though, the main function is a macro. It would be in the engine for the platform specific startup modules.

Share this post


Link to post
Share on other sites
the client on start will be loging in to the server so i need the program on start up (int main() ) to have the code

 

 

In that case you have selected a solution before fully understanding the problem.  Unfortunately for you, the solution you've chosen is unworkable.

 

There are several ways to accomplish your goal, a few have already been described.  If the automatic replication doesn't work for you --- and it can replicate chat data and event data just as easily as replicating object data --- then you'll need to build your own.  Probably the best method for that is to have an Actor with a networking component which has a special name or other way of making it well-known and discoverable.

 

 

If the only way you can think of to solve the problem is by attaching to Unreal's main() function, you're going to suffer from some serious setbacks. That isn't how things are done, it breaks the design and will probably break the entire program.  Since analogies are used frequently, it is like saying that since you need something to happen after the car is turned on the equipment should be hooked up to the key switch so it knows when the car starts. Or if you need to attach a desk lamp in your home it must be directly connected to the power main rather than to a power outlet because the power main is where electricity comes in. Unreal is a large, complex system, and it has designated locations that are meant for you to attach to, places to hook things up safely.  The program's entry point is the wrong place, just like the car's key switch is the wrong place and the home's power main is the wrong place.

Share this post


Link to post
Share on other sites

This topic is 370 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this