Jump to content
  • Advertisement
Sign in to follow this  
alextoti99

Unreal Engine Main Int [Help]

This topic is 680 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
Advertisement
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 main this is that 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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!