Author Topic: C# StringCompressor not found  (Read 7589 times)

VSZM

  • Not-a-newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
C# StringCompressor not found
« on: September 17, 2013, 06:35:11 AM »
Hello!

I am developing a c# server application and c++ client application. My problem is with sending strings from the C# server to the C++ clients. The other way around works just fine, I can send strings from C++ to C# using
Code: [Select]
RakNet::StringCompressor compressor;
compressor.EncodeString(VO->name.c_str(),strlen(VO->name.c_str())+1,bs);
on the C++ side, and decoding with   
Code: [Select]
RakString rs = new RakString();
rs.DeserializeCompressed(bs); // name

on the c# side.

However the swig generated c# files do not include any StringCompressor class. Of course I could simply send character arrays, but then I would lose encoding and language specific encoding, so I really don't want to do this.

Rak'kar

  • Administrator
  • Hero Member
  • *****
  • Posts: 6895
  • Karma: 291
    • View Profile
    • RakNet
Re: C# StringCompressor not found
« Reply #1 on: September 18, 2013, 11:04:26 PM »
You can actually use bitStream->WriteCompressed(rakString) which accomplishes the same thing.

VSZM

  • Not-a-newbie
  • *
  • Posts: 17
  • Karma: 0
    • View Profile
Re: C# StringCompressor not found
« Reply #2 on: September 19, 2013, 01:57:51 AM »
Yes, I am using rakstring->SerializeCompressed(bs); which is also the same.