Jump to content

Fixed problem with Netwerks


ParaToxic
 Share

Recommended Posts

Hey , i have searched for the error in the Netwerks Lib in LEadwerks.I Think lots of people in this forum want netwerk connecting in there games.

 

Josh: The Command in the netwerks.c (ExitFunc make a Linking error),so please delete the codeline #ifndef LEADWERKS_ENGINE_NETWERKS and #endif LEADWERKS...

Then i would works :)

 

I hope iam not the only one with this error and it would helps other.

 

Thanks

Link to comment
Share on other sites

There is no error in netwerks.cpp, but you need to include engine.h before netwerks.h.

Netwerks.h works also without engine.h, but then you must not include engine.h after it.

 

So you have 2 options to use netwerks.h:

 

Leadwerks Engine with Leadwerks Netwerks:

#include "engine.h"
#include "netwerks.h"

or

 

Standalone Leadwerks Netwerks without Leadwerks Engine (for example for a Leadwerks Game Server):

#include "netwerks.h"
// DON'T include engine.h now!

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

It's simply to ensure there is only ever one instance of this defined, any attempt to add a second #include "netwerks.h" will not attempt to redefine the same contents if they have already been defined. It should be left in.

 

netwerks.cpp will reference the header as an include so the include file either needs to be included in your project or at least the path to the include file specified in your compiler options.

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Well the whole idea of #ifdef in C++ is that you don't need to change the source code, since you can control the contents with compiler defines.

I tried to compile it, and it seems there is one letter too much in netwerks.cpp:

It should say #ifdef and not #ifndef.

I have sent Josh the fixed header.

Ryzen 9 RX 6800M ■ 16GB XF8 Windows 11 ■
Ultra ■ LE 2.53DWS 5.6  Reaper ■ C/C++ C# ■ Fortran 2008 ■ Story ■
■ Homepage: https://canardia.com ■

Link to comment
Share on other sites

Ok thats right now:D

 

But i have one Question.I have created a host,peer and a Packet where i write an integer 4 in.So now in the main loop i will read a integer ,the other netuser have sended to my ip.But in the Command ReadLine oder other Read... you need the Objekt TStream,which don`t exist.I mean the Lib doesen`t have any commands for this objekt,so how can i read the message the other netuser broadcasted?

Link to comment
Share on other sites

thanks

It's good to see someone trying the Leadwerks Networking again. I have no need for networking presently so I've never looked at this but I'll look forward to seeing if you manage to get it all working. Good luck!

Intel Core i5 2.66 GHz, Asus P7P55D, 8Gb DDR3 RAM, GTX460 1Gb DDR5, Windows 7 (x64), LE Editor, GMax, 3DWS, UU3D Pro, Texture Maker Pro, Shader Map Pro. Development language: C/C++

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...