RakNet - networking

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

Recommended Posts

I'm checking into RakNet but it's a pain in the ass to setup. All the docs and tutorials are out of date, and compiling their already existing projects are out of the question. are there any other networking libraries anyone can recommend, or any good tutorials on how to start? All my books are out of date (use DirectPlay) and I want to start programming the server/client before any 3D stuff gets in. My goal is to have a basic chat program working, where I can send data to the server and have numerous clients on at one time. Once I learn how to send data, I can then upgrade to game specific code, and finally to the 3D rendering on the clients. Thanks, -Gardon

Share on other sites
Quote:
 compiling their already existing projects are out of the question

Some helpful meta-advice: If you don't want to put in any effort, you're unlikely to learn anything. If you don't know your tools well enough to deal with slight version changes, then you're unlikely to be ready for network programming.

Share on other sites
Knowing how to code and knowing your compiler are two different things. Don't say I can't code because I can't work my compiler.

I've tried compiling their projects that they include in the download. I've checked the linker of those projects, and notice that everything is where it should be. So why do I still get linker errors?

Share on other sites
Quote:
 Original post by heythereKnowing how to code and knowing your compiler are two different things. Don't say I can't code because I can't work my compiler. I've tried compiling their projects that they include in the download. I've checked the linker of those projects, and notice that everything is where it should be. So why do I still get linker errors?

If you don't know and you are reading the errors, how on earth are we supposed to know without them?

<hint>post the errors</hint> [smile]

Share on other sites
The docs are horribly out of date, but the samples (at least the ones I used) compiled fine.

Really, while up to date docs would be great, the source is fairly well documented, and using the samples (I recommend ServerClientTest) as a reference, it should be trivial to implement the functionality you desire.

Don't give up, post the error; once you have it linking, you're really under an hour away from your goal.

Share on other sites
1>LINK : fatal error LNK1104: cannot open file 'ws2_32.lib'

The lib file is included in the linker... so it knows about it. The .dll file is in the current directory. I went to Project->Options->VC++ Directories and told the compiler where it was. Why can't it find it!!?

another problem is dealing with .CRT extentions. It keeps giving me these errors regarding framework and .crt.

Share on other sites
I just tried the "ServerClientTest" Sample. I opened up the visual studio.net 2003 version, and hit build. Here's my list:

ServerClientTest fatal error LNK1120: 5 unresolved externalsc:\Documents and Settings\Jason\Desktop\RakNet30Beta\Samples\ServerClientTest\ServerClientTest.cpp(143): warning C4305: '=' : truncation from 'int' to 'unsigned short'c:\Documents and Settings\Jason\Desktop\RakNet30Beta\Samples\ServerClientTest\ServerClientTest.cpp(143): warning C4309: '=' : truncation of constant valuec:\Documents and Settings\Jason\Desktop\RakNet30Beta\Samples\ServerClientTest\ServerClientTest.cpp(189): warning C4101: 'clientIndex' : unreferenced local variableServerClientTest warning LNK4078: multiple '.CRT' sections found with different attributes (40300040)ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function "public: __thiscall TCPInterface::TCPInterface(void)" (??0TCPInterface@@QAE@XZ)ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __unwindfunclet$?AddReference@StringCompressor@@SAXXZ$0ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function "public: __thiscall Router::Router(void)" (??0Router@@QAE@XZ)ServerClientTest error LNK2019: unresolved external symbol ___CxxFrameHandler3 referenced in function __ehhandler$?GetRakPeerInterface@RakNetworkFactory@@SAPAVRakPeerInterface@@XZServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol ___CxxFrameHandler3ServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: virtual __thiscall CommandParserInterface::~CommandParserInterface(void)" (??1CommandParserInterface@@UAE@XZ)ServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: bool __thiscall ReliabilityLayer::HandleSocketReceiveFromConnectedPlayer(char const *,int,struct SystemAddress,class DataStructures::List<class PluginInterface *> &,int)" (?HandleSocketReceiveFromConnectedPlayer@ReliabilityLayer@@QAE_NPBDHUSystemAddress@@AAV?$List@PAVPluginInterface@@@DataStructures@@H@Z)ServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: __thiscall DataStructures::Map<int,class HuffmanEncodingTree *,&int __cdecl DataStructures::defaultMapKeyComparison<int>(int const &,int const &)>::~Map<int,class HuffmanEncodingTree *,&int __cdecl DataStructures::defaultMapKeyComparison<int>(int const &,int const &)>(void)" (??1?$Map@HPAVHuffmanEncodingTree@@$1??\$defaultMapKeyComparison@H@DataStructures@@YAHABH0@Z@DataStructures@@QAE@XZ)ServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: bool __thiscall Router::Send(char *,unsigned int,enum PacketPriority,enum PacketReliability,char,class SystemAddressList *)" (?Send@Router@@QAE_NPADIW4PacketPriority@@W4PacketReliability@@DPAVSystemAddressList@@@Z)ServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: virtual enum PluginReceiveResult __thiscall ConnectionGraph::OnReceive(class RakPeerInterface *,struct Packet *)" (?OnReceive@ConnectionGraph@@UAE?AW4PluginReceiveResult@@PAVRakPeerInterface@@PAUPacket@@@Z)ServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: virtual bool __thiscall RakPeer::Startup(unsigned short,int,struct SocketDescriptor *,unsigned int)" (?Startup@RakPeer@@UAE_NGHPAUSocketDescriptor@@I@Z)ServerClientTest error LNK2001: unresolved external symbol __wassertServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: void __thiscall ReplicaManager::Construct(class Replica *,bool,struct SystemAddress,bool)" (?Construct@ReplicaManager@@QAEXPAVReplica@@_NUSystemAddress@@1@Z)ServerClientTest error LNK2019: unresolved external symbol __wassert referenced in function "public: virtual bool __thiscall LogCommandParser::OnCommand(char const *,unsigned int,char * *,class TransportInterface *,struct SystemAddress,char const *)" (?OnCommand@LogCommandParser@@UAE_NPBDIPAPADPAVTransportInterface@@USystemAddress@@0@Z)ServerClientTest error LNK2019: unresolved external symbol @_RTC_CheckStackVars2@12 referenced in function "public: virtual bool __thiscall RakPeer::RPC(char const *,char const *,unsigned int,enum PacketPriority,enum PacketReliability,char,struct SystemAddress,bool,unsigned int *,struct NetworkID,class RakNet::BitStream *)" (?RPC@RakPeer@@UAE_NPBD0IW4PacketPriority@@W4PacketReliability@@DUSystemAddress@@_NPAIUNetworkID@@PAVBitStream@RakNet@@@Z)ServerClientTest error LNK2001: unresolved external symbol @_RTC_CheckStackVars2@12ServerClientTest error LNK2019: unresolved external symbol __alloca_probe_16 referenced in function "public: virtual bool __thiscall RakPeer::RPC(char const *,char const *,unsigned int,enum PacketPriority,enum PacketReliability,char,struct SystemAddress,bool,unsigned int *,struct NetworkID,class RakNet::BitStream *)" (?RPC@RakPeer@@UAE_NPBD0IW4PacketPriority@@W4PacketReliability@@DUSystemAddress@@_NPAIUNetworkID@@PAVBitStream@RakNet@@@Z)ServerClientTest error LNK2001: unresolved external symbol __alloca_probe_16ServerClientTest error LNK2019: unresolved external symbol @_RTC_AllocaHelper@12 referenced in function "public: virtual bool __thiscall RakPeer::RPC(char const *,char const *,unsigned int,enum PacketPriority,enum PacketReliability,char,struct SystemAddress,bool,unsigned int *,struct NetworkID,class RakNet::BitStream *)" (?RPC@RakPeer@@UAE_NPBD0IW4PacketPriority@@W4PacketReliability@@DUSystemAddress@@_NPAIUNetworkID@@PAVBitStream@RakNet@@@Z)ServerClientTest error LNK2001: unresolved external symbol @_RTC_AllocaHelper@12

Share on other sites
Here's another example from the book "Multiplayer Game Programming". He includes VC++ projects on his cd that we can use, but it doesn't work. I've linked the DirectX SDK (includes and .lib files), added them to the linker, and check it out:

1>dxutil.cpp1>c:\documents and settings\jason\desktop\game programming folder\multiplayer game programming\html\source\chapter17\rpgquest\dxutil.cpp(10) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory1>Object3DClass.cpp1>c:\documents and settings\jason\desktop\game programming folder\multiplayer game programming\html\source\chapter17\rpgquest\object3dclass.h(1) : fatal error C1083: Cannot open include file: 'd3dx8': No such file or directory1>RPGQuest.cpp1>c:\program files\microsoft directx sdk (april 2007)\include\dplay8.h(13) : fatal error C1083: Cannot open include file: 'ole2.h': No such file or directory1>SoundSystem.cpp1>c:\program files\microsoft directx sdk (april 2007)\include\dmusici.h(13) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory1>Generating Code...1>Build log was saved at "file://c:\Documents and Settings\Jason\Desktop\GAME PROGRAMMING FOLDER\Multiplayer Game Programming\html\Source\Chapter17\RPGQuest\Debug\BuildLog.htm"1>RPGQuest - 4 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

You mean to tell me window.h doesn't exist? Or DirectX? Come on.

Share on other sites
I just started using RakNet also, and I find the DLL version has problems, however, using the source code itself works fine.

While the tutorials are out of date, saying they are 'horribly out of date' is a bit of a exageration. The newest build, the beta 3.x, renamed a few functions and structures, and the tutorials and Doxygen manuals haven't been updated yet, probably because it's still beta and so not everone is using it yet. All you need to do is find the .txt changefile included with the download, and see what has been renamed to what. For instance, the 'PlayerID' struct has been renamed 'SystemAddress'.

I'm sure the tutorials will be updated once it's not longer beta. I do wish I could get the DLL working, though, including 50 or so source files to my projects isn't the neatest solution. [smile]

(Here's a copy and paste of the upgrade in names from version 2.x to version 3.x)
1. Renamed PlayerID SystemAddress2. Replaced RakClient and RakServer with RakPeer (RakPeer is more powerful and does everything the other two did)3. Removed Multiplayer class (Parse your own messages)4. Removed Static Data (Send your own per-system data if you do indeed want per-system data)5. Removed MasterServer / MasterClient (Use lightweight database instead)6. Removed ID_RESERVED9.  Use ID_USER_PACKET_ENUM instead.7. Renamed PacketEnumerations MessageIdentifiers8. Renamed Disconnect Shutdown and OnDisconnect OnShutdown9. Renamed Initialize Startup10. StringCompressor now supports multiple trees, for different encodings such as different languages.11. Added existingReplica to the ReplicaManager::SetReceiveConstructionCB callback.12. Removed SystemIDToDottedIP and IPToSystemID since equivalents of both of those functions are in the SystemAddress structure itself now13. Renamed NetworkTypes.h RakNetTypes.h14. Renamed UNASSIGNED_PLAYER_ID UNASSIGNED_SYSTEM_ADDRESS16. Removed Bitstream_NoTemplate.17. Added more information to RPCParameters and the RPC funtion now takes a pointer to a timestamp, rather than a boolean (for shiftTimestamp).  Pass 0 to not include a timestamp.18. Renamed RakNetStatisticsStruct to RakNetStatistics19. ReplicaManager no longer takes C callbacks.  It instead takes class interfaces.20. Renamed NetworkIDGenerator to NetworkIDObject.

Share on other sites
Quote:
 Original post by heythereI'm checking into RakNet but it's a pain in the ass to setup. All the docs and tutorials are out of date, and compiling their already existing projects are out of the question.

Ah, the utopian world of software development, where documentation is up to date... Or there even is one.

For list of alternate libraries, look into forum FAQ.

Even boost's library is a bit of mess when it comes to documentation. It fails to explain some crucial design issues, and the boost/non-boost documentation differs in depth.

This is the reality of real world software development.

Share on other sites
Quote:
 Original post by heythereHere's another example from the book "Multiplayer Game Programming". He includes VC++ projects on his cd that we can use, but it doesn't work. I've linked the DirectX SDK (includes and .lib files), added them to the linker, and check it out:You mean to tell me window.h doesn't exist? Or DirectX? Come on.
This isn't an issue with the projects, it's an issue with your screwed up IDE. Don't blame the project for improperly configured IDE.

VS2003 out of the box will be set up properly.

Share on other sites
I'll try re-installing it then. Something must be seriously wrong.
The only thing I can think of that might have an effect is that my version consists of the following:

MSVC 2002 full Enterprise Architect Install

MSVC 2003 upgrade from 2002 Enterprise Architect Install

So I install the complete 2002 version, then put the install cd in to upgrade it to 2003. Could that have any effect on the nature of my programs?

Share on other sites
I have been playing around RakNet for about 6 months and all their examples compile fine on my system: Visual Studio 2005 SP1.

Their support is something I would love to see improve. Novice questions are answered very slowly and the developer is very busy working on other projects, which he uses his RakNet lib for.

At my work, we have released a major title that uses RakNet for an online game and it works like a charm. So in terms of being proven in the real world, it is great. I would not abandon it due to compiler frustrations. RakNet compiles perfectly on my system.

Share on other sites
2005 doesn't work on my system either.

Can someone tell me what they do while installing their MSVC compilers? Do you download anything extra to link it to, anything at all?

Here's mysetup:

1) Install MSVC

Work on project, and link/include files as necessary.

Do I have to download any additional libraries of any kind? This is very frustrating, as I would love to use RakNet.

Share on other sites
Your question is broad. DirectX is not needed for RakNet, just for graphics.

If you are installing standard/pro/enterprise edition of visual studio (any version) everything is there (for windows development). You would then get your DX SDK for graphics, RakNet for networking, FMod for sound, etc etc.

If you are using VC++ 2005 Express edition, which I would recommend if you can get it installed, then you will also have to download the Windows 2003 R2 SDK off of MS website. But then business as usual.

Either you are not setting proper directories or not including the libs you need to or your system is hosed.

Share on other sites
I'll try reinstalling.

Share on other sites
Are you linking DLL versions or LIB versions of the RakNet libraries? If you're linking LIB (static) versions, then RakNet has to be built with the same version of MSVC as you are using.

Other tips when debugging MSVC behavior is to look in the Projects settings panel for the IDE, the Library and Include files directory paths. Also, opening up the build log (a HTML file) and reading each command the IDE runs, with its arguments, is often very helpful.

There are options you can pass to the tools (cl and link) that make them print more verbosely what they do. Try adding those options to the command line options in the project, and then look at what they print in the output window and the build log file.

I suggest you try all of these suggestions; if nothing else, then to see them so you remember them the next time you attempt to use more of your tools than just compiling a canned project :-)

This is a general programming question, though, so I'll move it to an appropriate group.

Share on other sites
Just Tried re-installing visual studio.net 2003. Now it won't un-install, and I can't re-install it off the cd. What a pain.

Does anyone know how to re-install visual studio.net 2003?!! Why is this so confusing?

Share on other sites
Installing and uninstalling should not be a problem. It appears that your system is corrupt. You can try to delete all the visual studio directories, then going through the registry and deleting all the obvious entries for visual studio (under local_machine\software and current_user\software).

Re-install then. If it still doesn't work, I would suggest re-installing OS. If after that it doesn't work, your CD might be corrupted (I doubt it). If you get another copy and it still doesn't work, then it's obvious that higher powers do not want you to program. Hell will freeze over. :)

Share on other sites
Oh damn, if I cause hell to freeze over then I would be definitely the shit. Bring it Satan.

Share on other sites

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

Create an account

Register a new account

• Forum Statistics

• Total Topics
628764
• Total Posts
2984571

• 13
• 10
• 25
• 12
• 9