How bizarre

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

How bizarre

Postby PurpleYouko on Wed May 28, 2008 7:07 pm

OK this is just plain messed up :(

For a long time now, i have been using a 'debugmode' setting in my evo server.
I use it all over the place. I use a custom gm command /debugmode to toggle it on and off then get readbacks from all kinds of stuff in the code while logged into the game.
It all works perfectly and has done for ages.

This is where it gets weird.
I decided to transplant the system into osProse to help debug some stuff.
I just put in a limited amount of code, compiled it and entered the server.
Or rather I tried to enter the server.
Immediately after selecting my character it disconnected me.
Server logs show that my character loaded in from the database with a zero length string "" for her name. User id number, password and account name came over perfectly. Just the character name failed to load from the database.

I backtracked all the stuff i had added, commenting each part out as i went and recompiling at each stage.
It finally came down to this line in Player.h
class CPlayer: public CCharacter
{

public:
CPlayer( CClientSocket* );
~CPlayer( );

//
CClientSocket* client;
bool questdebug;// Show Quest message in console?
bool codedebug; // Shows debug messages as server whispers.
bool Saved;// already save this player?(used ondisconnect/returnchar)
bool isInvisibleMode;

If i comment it out then all works perfectly but as soon as i add this boolean variable to the structure, it fails to load my character names.
I tried loads of different names for this variable and none of them work.
Any variable in this place kills the whole damn server.
What the hell is going on??? :?
This has to be one of the most bizarre failures i have ever seen. There just doesn't seem to be any valid reason for it to fail.

I'm gonna try the whole thing with my boolean in a different structure. I might try putting it in Session or something.
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: How bizarre

Postby PurpleYouko on Wed May 28, 2008 7:20 pm

OK i just transplanted the whole thing into the Session structure and it works just fine in there.

This code is horribly fussy at times :(
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: How bizarre

Postby Drakia on Wed May 28, 2008 8:03 pm

My guess would be it's casting something to a CPlayer or a CPlayer to something else, and by sticking that in there, you're screwing with the cast.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: How bizarre

Postby Maxxon on Wed May 28, 2008 8:07 pm

my guess would be that you just linked against old object files.
Image
an anymous comment on a program called reloader:
what if a fatal error happens, will it restart it?
User avatar
Maxxon
Hawker's pet
Hawker's pet
 
Posts: 1305
Joined: Sat Nov 10, 2007 12:42 pm

Re: How bizarre

Postby Drakia on Wed May 28, 2008 8:16 pm

Using Dev-C++ or CodeBlocks it would recompile any file that links to that header if you changed it.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: How bizarre

Postby lmame on Wed May 28, 2008 8:17 pm

It happened to me once for a structure :)
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: How bizarre

Postby Drakia on Wed May 28, 2008 8:21 pm

Hmm, maybe it is an old obj file, I just threw that change in, and did a "Rebuild All" and it worked fine.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: How bizarre

Postby Maxxon on Wed May 28, 2008 8:30 pm

normally all IDEs do a proper rebuild (and even the linker should complain about unresolved symbols) but i happend to me as well on Visual Studio several times. And everytime a "Clean" and "rebuild all" helped.
Image
an anymous comment on a program called reloader:
what if a fatal error happens, will it restart it?
User avatar
Maxxon
Hawker's pet
Hawker's pet
 
Posts: 1305
Joined: Sat Nov 10, 2007 12:42 pm

Re: How bizarre

Postby PurpleYouko on Wed May 28, 2008 8:39 pm

Drakia wrote:My guess would be it's casting something to a CPlayer or a CPlayer to something else, and by sticking that in there, you're screwing with the cast.

Something like that probably but i can't see any reason why that would be the case.
I have found some cases where it's necessary to add dummy 'virtual' functions in weird places. That mainly happened because the CCharacter and CMonster classes got joined together though.

Lmame added the questdebug boolean in exactly the same spot without any issues. My new one mirrored his in every way yet it still didn't work.

Maxxon wrote:my guess would be that you just linked against old object files.

Tried a full rebuild. Didn't help
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: How bizarre

Postby Drakia on Wed May 28, 2008 8:52 pm

I also added it in the exact same place you put it in your first post and it worked fine.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Next

Return to Support - OspRose Emulator

Who is online

Users browsing this forum: No registered users and 9 guests