Jump to content

  • Log In with Google      Sign In   
  • Create Account

brightening-eyes

Member Since 20 Oct 2013
Offline Last Active Jun 13 2016 12:27 PM

Posts I've Made

In Topic: Do you usually prefix your classes with the letter 'C' or something e...

08 June 2016 - 07:18 PM

hello,

why for example cResourceManager

i write my classes and functions like this:

class resource_manager
{
private:
std::vector<resource> resources;
public:
resource get_resource(int id);
};

in my idea (just in my idea itself), it's the best style for coding


In Topic: std::stringstream crash

08 June 2016 - 06:53 PM

hi,

it has been fixed by changing ss<<data; to ss<<*data;

i don't know why it fixe's the crash, although data somehow refer's to nullptr

and, trace_handler() doesn't do anything with data pointer, it just retrieve's it's contents and put's it into the log file

thank you all again


In Topic: std::stringstream crash

06 June 2016 - 07:33 PM

hi again,
this is a sample test app that i've written, but it doesn't crash

//a test app that allow's me to test my gamedata struct with stringstream in order to serialize it
#include <iostream>
#include <string>
#include <sstream>
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/serialization/string.hpp>
#include <boost/serialization/serialization.hpp>
#include "gamedata.hpp"

//uses
using namespace std;
using namespace boost;
using namespace boost::archive;
using namespace boost::serialization;

int main(int argc, char** argv)
{
gamedata gd; //i want to serialize this
gd.username="test";
gd.password="test";
gd.rank=3;
gd.userpass_incorrect=false;
gd.account_not_exist=true;
gd.mac_address="00:00:00:00";
gd.hdd_serial="0x8FE00";
gd.ip_address="127.0.0.1";
gd.x=500;
gd.y=800;
gd.z=0;
gd.health=100;
gd.is_banned=false;
gd.kicked=false;
gd.notify=true;
gd.pm_user="test_pm";
gd.chat_user="test_chat";
gd.message="this is a test message";
gd.came_online=false;
gd.went_offline=false;
gd.server_message="server\'s message";
gd.motd="message of the day";
stringstream st; //this is needed for serializing the struct
text_oarchive oa(st);
oa<<gd;
cout<<"serialized data: "<<st.str()<<std::endl;
system("pause");
return 0;
}
i don't know what make's my app to crash
i've initialized all the variables in my gamedata structure

In Topic: Operating System Questions in Assembly

09 May 2016 - 09:15 AM

hello,

i recommend you to checkout

here

and

here

you will find many tutorials there


In Topic: sending and receiving struct using eNet and boost.serialization

04 May 2016 - 10:56 AM

hello,

this problem has been fixed

thanks for your helps

the problem was that, i wanted to serialize an empty stream to my g (a gamedata* local variable(better to say pointer))

and that exception occured

thanks in advance for your helps


PARTNERS