Recent Posts

Pages: 1 ... 8 9 [10]
91
SWIG and C# support / RakString between C# client and C++ server
« Last post by Gloryal on June 14, 2014, 05:20:35 PM »
Sup guy !

I work on a C++ server and a C# client (with Unity 3D).

I send the string "parlé" (C#) and I got some strange result on the console (C++) :

I searched and I tried so many solutions but none works.

This is the client code :
Code: [Select]
string message = "parlé";
RakString test = new RakString(message);
RakNet.BitStream sendBitStream = new RakNet.BitStream();
sendBitStream.Write((byte)GameMessages.ID_GENERAL_CHAT);
sendBitStream.Write(test);
rakPeerInterface.Send(sendBitStream, PacketPriority.HIGH_PRIORITY, PacketReliability.RELIABLE_ORDERED, (char)0, SystemAdress, false);

And this is the server code:
Code: [Select]
RakString rs;
BitStream bsIn(packet->data, packet->length, false);
bsIn.IgnoreBytes(sizeof(RakNet::MessageID));
bsIn.Read(rs);
rs.Printf();

Any idea ?
92
RakNet C++ Support / Error code 5 while initializing startup
« Last post by HiYou on June 12, 2014, 08:20:56 PM »
Hi, im new to RakNet and im having an issue while im initializing startup, it says error code 5 but i checked on the documentation about it and it says nothing about error codes.
Code:
Code: [Select]
RakNet::SocketDescriptor socketDescriptor(32352, 0);
rakPeer = RakNet::RakPeerInterface::GetInstance();
RakNet::StartupResult sr = rakPeer->Startup(1, &socketDescriptor, 1);
if (sr != RakNet::RAKNET_STARTED)
{
time_t now = time(0);
tm *tm_struct = localtime(&now);
int hour = tm_struct->tm_hour;
int min = tm_struct->tm_min;
int sec = tm_struct->tm_sec;
char dest[200];
sprintf_s(dest, 200, "[%d:%d:%d] %s | %s We coudnt startup. Error code: %d\r\n", hour, min, sec, ClientInfo.name.c_str(), ClientInfo.address.c_str(), (int)sr);
Basics::WriteToLog(dest);
Basics::Shutdown();
}
rakPeer->AttachPlugin(&rakVoice);
rakVoice.Init(SAMPLE_RATE, FRAMES_PER_BUFFER*sizeof(SAMPLE));
rakPeer->Connect(ClientInfo.address.c_str(), 60000, 0, 0);
Basics::WriteToLog("Connecting...");
By the way its the client-side of a plugin.
93
Version Announcements / RakNet 4.082 released
« Last post by Rak'kar on June 09, 2014, 11:35:48 PM »
Swig build fixed, and other minor changes.
94
RakNet C++ Support / Problem compiling with Marmalade 7.2
« Last post by Stealth977 on May 29, 2014, 04:03:36 AM »
I am porting my existing code to Marmalade and will need to port my existing client code (Server code is just another RakNet project).

The problem is RakNet does not want to compile with Marmalade 7.2. First there is IP_HDRINCLUDED problem mentioned in forums, which can be bypassed by supplying "2" which is the number from VC++ headers. This way it compiles for ARM. But for x86 builds it starts complaining about "tchar.h" which I can not solve, adding VC++ include paths wont solve it because then it starts causing other errors.

Anyone succeeded in compiling RakNet with Marmalade under windows using Visual Studio? If so please supply the modifications needed?
95
RakNet C++ Support / Re: Compiling error in VS 2013
« Last post by rotator on May 24, 2014, 06:23:44 AM »
thanks, that did it.

I had to play with it a while though, but now it works.
Seems like I kinda forgot that^^

Have a nice day, you saved me a lot of work. ;)
96
RakNet C++ Support / Re: Compiling error in VS 2013
« Last post by RuiF on May 23, 2014, 04:46:49 AM »
It looks to me that you setup the include folder right, and  but you didn't add the actual RakNet source files to your project ?
In other words, your main source code can find all of RakNet's headers, so it can compile, but fails on the link stage because you are not compiling RakNet's source files anywhere?

--
Rui
97
RakNet C++ Support / Compiling error in VS 2013
« Last post by rotator on May 21, 2014, 02:18:18 PM »
Hey guys,

I am trying to learn this framework, but I am having a hard time to successfully compile the code...
I want to test out the basics in a Windows Console Application.
I included everything as stated in this link: http://www.jenkinssoftware.com/raknet/manual/compilersetup.html

I want to include the source code directly, but if the dll is easier, fine with me. Just want to get it running.
I created a subfolder, where I have the RakNet Source Files. The subfolder is also included in the project and is recognized.

In my code, I included the libraries like this:
Code: [Select]
#include "stdafx.h"
#include <iostream>

#include "MessageIdentifiers.h"
#include "RakPeerInterface.h"
#include "RakPeerInterface.h"
#include "RakNetTypes.h"
#include "GetTime.h"
#include "BitStream.h"
#include <assert.h>
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include "RakSleep.h"
#include "Gets.h"

using namespace std;

I get following compiling errors:

Error   1   error LNK2019: unresolved external symbol "public: __thiscall RakNet::SocketDescriptor::SocketDescriptor(unsigned short,char const *)" (??0SocketDescriptor@RakNet@@QAE@GPBD@Z) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   2   error LNK2019: unresolved external symbol "public: __thiscall RakNet::SystemAddress::SystemAddress(void)" (??0SystemAddress@RakNet@@QAE@XZ) referenced in function "void __cdecl RakNet::`dynamic initializer for 'UNASSIGNED_SYSTEM_ADDRESS''(void)" (??__EUNASSIGNED_SYSTEM_ADDRESS@RakNet@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   3   error LNK2019: unresolved external symbol "public: char const * __thiscall RakNet::SystemAddress::ToString(bool,char)const " (?ToString@SystemAddress@RakNet@@QBEPBD_ND@Z) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   4   error LNK2019: unresolved external symbol "public: char const * __thiscall RakNet::RakNetGUID::ToString(void)const " (?ToString@RakNetGUID@RakNet@@QBEPBDXZ) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   5   error LNK2019: unresolved external symbol "public: static class RakNet::RakPeerInterface * __cdecl RakNet::RakPeerInterface::GetInstance(void)" (?GetInstance@RakPeerInterface@RakNet@@SAPAV12@XZ) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   6   error LNK2019: unresolved external symbol "unsigned int __cdecl RakNet::GetTimeMS(void)" (?GetTimeMS@RakNet@@YAIXZ) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   7   error LNK2019: unresolved external symbol "public: __thiscall RakNet::BitStream::BitStream(unsigned char *,unsigned int,bool)" (??0BitStream@RakNet@@QAE@PAEI_N@Z) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   8   error LNK2019: unresolved external symbol "public: __thiscall RakNet::BitStream::~BitStream(void)" (??1BitStream@RakNet@@QAE@XZ) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   9   error LNK2019: unresolved external symbol "public: void __thiscall RakNet::BitStream::IgnoreBytes(unsigned int)" (?IgnoreBytes@BitStream@RakNet@@QAEXI@Z) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   10   error LNK2019: unresolved external symbol "public: bool __thiscall RakNet::BitStream::ReadBits(unsigned char *,unsigned int,bool)" (?ReadBits@BitStream@RakNet@@QAE_NPAEI_N@Z) referenced in function "public: bool __thiscall RakNet::BitStream::Read<unsigned int>(unsigned int &)" (??$Read@I@BitStream@RakNet@@QAE_NAAI@Z)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   11   error LNK2019: unresolved external symbol "public: static bool __cdecl RakNet::BitStream::IsNetworkOrderInternal(void)" (?IsNetworkOrderInternal@BitStream@RakNet@@SA_NXZ) referenced in function "public: static bool __cdecl RakNet::BitStream::IsNetworkOrder(void)" (?IsNetworkOrder@BitStream@RakNet@@SA_NXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   12   error LNK2019: unresolved external symbol "public: static void __cdecl RakNet::BitStream::ReverseBytes(unsigned char *,unsigned char *,unsigned int)" (?ReverseBytes@BitStream@RakNet@@SAXPAE0I@Z) referenced in function "public: bool __thiscall RakNet::BitStream::Read<unsigned int>(unsigned int &)" (??$Read@I@BitStream@RakNet@@QAE_NAAI@Z)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   13   error LNK2019: unresolved external symbol "void __cdecl RakSleep(unsigned int)" (?RakSleep@@YAXI@Z) referenced in function "void __cdecl hostServer(void)" (?hostServer@@YAXXZ)   E:\devArea\RakNet_Test_1\RakNet_Test1\RakNet_Test1\RakNet_Test1.obj
Error   14   error LNK1120: 13 unresolved externals   E:\devArea\RakNet_Test_1\RakNet_Test1\Debug\RakNet_Test1.exe

I have never been good at figuring out linking errors, so I really hope somebody can help me.
I would really appreciate it.

Thanks a lot!
98
Humm. Indeed.. It's possible that although it seems to work, it may in fact be working incorrectly. Unfortunately i don't know enough about this area to assert the solution :/
If you or someone else gets to a better solution/explanation please make sure you post here!

Cheers,
99
2 is already defined as IP_TTL? I suspect you're just setting a different option so packets may be malformed, if I had to guess they'll contain 2 Headers with the first one not being the one RakNet intends.

From <netinet/in.h>
Code: [Select]
#define IP_TOS      1
#define IP_TTL      2
#define IP_OPTIONS  4
#define IP_PKTINFO  8
#define IP_MULTICAST_IF 32
#define IP_MULTICAST_TTL 33
#define IP_MULTICAST_LOOP 34
#define IP_ADD_MEMBERSHIP 35
#define IP_DROP_MEMBERSHIP 36
100
The magic number that allows it to run in the emulator is the 2. Found this value on a semi obscure ws2ipdef.h file.
I have yet to test it on a real device though....

Cheers,
Pages: 1 ... 8 9 [10]