Dev Rev 3 release

Welcome in the osRose emulator Project.

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

Re: Dev Rev 3 release

Postby devalex on Sat Jun 16, 2012 11:14 pm

OK so here is all the information I can find pertaining to the Advertise System.

console.cpp

  1.    if(strcasecmp( command, "adver" )==0)
  2.     {
  3.         if ((tmp = strtok(NULL, " ")) == NULL) tmp = 0;
  4.         int adver=atoi(tmp);
  5.  
  6.         if(adver == 1)
  7.         {
  8.             Config.AdvertiseActive = 1;
  9.             DB->QExecute("UPDATE  list_config SET advertise_active = 1");
  10.             Config.AdvertiseTime = clock();
  11.             Advertise();
  12.  
  13.             Log (MSG_CONSOLE, "Advertise system active" );
  14.         }else
  15.         {
  16.             Config.AdvertiseActive = 0;
  17.             DB->QExecute("UPDATE list_config SET advertise_active = 0");
  18.             Log (MSG_CONSOLE, "Advertise system deactivated" );
  19.         }
  20.         return true;
  21.     }
  22.     else
  23.     if(strcasecmp( command, "loadads" )==0)
  24.     {
  25.             LoadAdverds();
  26.             Log (MSG_CONSOLE, "Adverds loaded");
  27.             return true;
  28.     }
  29.     else


MainProcess.cpp

  1.        if(GServer->Config.AdvertiseActive == 1)
  2.         {
  3.             clock_t lastAdverTime = clock() - GServer->Config.AdvertiseTime;
  4.             if(lastAdverTime >= GServer->Config.AdvertiseClock*1000)
  5.             {
  6.                 Advertise();
  7.                 GServer->Config.AdvertiseTime = clock();
  8.             }
  9.         }


startup.cpp

  1. Log( MSG_INFO, "Loading database config" );
  2.     MYSQL_ROW row;
  3.     MYSQL_RES *result = DB->QStore("SELECT exp_rate, drop_rate, zuly_rate, blue_chance, stat_chance, slot_chance, \
  4.         refine_chance, rare_refine, kill_on_fail, player_damage, monster_damage, player_acc, monster_acc, \
  5.         pvp_acc, skill_damage, maxlevel, drop_type, savetime, partygap, maxstat, cfmode, autosave, mapdelay, \
  6.         visualdelay, worlddelay, fairymode, fairystay, fairywait, fairytestmode, osrosever, testgrid, jrose, \
  7.         is_pegasus, monmax, massexport,uwnbplayers,uwside,pc_drop_zuly,drop_rev,advertise_active, advertise_time, item_drop_rate FROM list_config");


worldserver.cpp

  1. bool Advertise()
  2. {
  3.     Log(MSG_INFO,"Ad started");
  4.     if(GServer->Config.lastAd < GServer->Config.numAds && GServer->Config.numAds > 0 )
  5.     {
  6.         BEGINPACKET( pak, 0x0784 );
  7.         ADDSTRING( pak, "" );
  8.         ADDBYTE( pak, 0 );
  9.         ADDSTRING( pak, GServer->Config.Adverd[GServer->Config.lastAd].c_str() );
  10.         ADDBYTE( pak, 0 );
  11.         GServer->SendToAll(&pak);
  12.  
  13.         GServer->Config.lastAd += 1;
  14.  
  15.     }else if(GServer->Config.numAds > 0)
  16.     {
  17.         GServer->Config.lastAd = 0;
  18.  
  19.         BEGINPACKET( pak, 0x0784 );
  20.         ADDSTRING( pak, "" );
  21.         ADDBYTE( pak, 0 );
  22.         ADDSTRING( pak, GServer->Config.Adverd[GServer->Config.lastAd].c_str() );
  23.         ADDBYTE( pak, 0 );
  24.         GServer->SendToAll(&pak);
  25.     }
  26.  
  27.     return true;
  28. }
  29.  
  30. bool LoadAdverds()
  31. {
  32.     #ifndef ADS
  33.     #define ADS
  34.     ifstream in_ads;
  35.     in_ads.open("ads.dat");
  36.     #endif
  37.  
  38.     int i = 0;
  39.  
  40.     if(in_ads.fail())
  41.     {
  42.         GServer->Config.AdvertiseActive = 0;
  43.         Log(MSG_ERROR,"Cant open ads.dat! Ads deactivated for this session!");
  44.         return true;
  45.     }
  46.  
  47.     while(!in_ads.eof())
  48.     {
  49.         getline(in_ads, GServer->Config.Adverd[i], '\n');
  50.         i++;
  51.     }
  52.  
  53.     GServer->Config.numAds = i;
  54.     Log(MSG_INFO,"%i Ads loaded!",i);
  55.  
  56.     //in_ads.close();
  57.  
  58.     return true;
  59. }
  60.  


So I am trying to get this working without having to comment out any of the code. So far here is what I have done, my little change log.

  1. added advertise_time, advertise_active, item_drop_rate FIELDS into list_config TABLE
  2. created map_exp TABLE
  3. added id, map_exp, map_id FIELDS to map_exp TABLE
  4.  


These changes have gotten rid of all the Advertising System errors preventing me from opening the WorldServer but now I have errors preventing it from opening caused by the WorldServer wanting to choose a "random exp map" I am guessing this is because my mapid FIELD in my map_exp TABLE is empty - this is what I am working on now - any help or input is greatly appreciated.

Image
devalex
Little soul
Little soul
 
Posts: 7
Joined: Tue Jun 05, 2012 5:12 pm

Re: Dev Rev 3 release

Postby devalex on Sun Jun 17, 2012 12:20 am

OK so I have fixed the above problems with getting the random exp map working.

What I did was create the max_exp TABLE then created 24 rows and gave each row 3 FIELDS (id,mapid,map_name) and now the WorldServer correctly finds a random map.

Now the WorldServer still won't start because of the missing LOTTO tables etc.. So I am now getting these to work.
devalex
Little soul
Little soul
 
Posts: 7
Joined: Tue Jun 05, 2012 5:12 pm

Re: Dev Rev 3 release

Postby devalex on Sun Jun 17, 2012 12:36 am

I have fixed the issue where the LOTTO wasn't working and causing the WorldServer not to start by doing this:

  1. lotto_config TABLE created
  2. added accesslevel,active,type,ZulieCost,ZulieLimit FIELDS into lotto_config TABLE


Now the WorldServer will not start because of waypoints. Fixing this now.

EDIT:

Fixed the Waypoints issue by executing the SQL file list_waypoints.sql

Then my WorldServer still wouldn't start because of a Spawns TABLE error, so I executed the file spawns.sql and now my WorldServer is running with out any FATAL ERRORS! SUCCESS! - For some reason list_waypoints.sql and spawns.sql don't get installed during the "FULL INSTALL" using the .BAT installer - I will create a new .BAT installer as well as a complete backup of all these fixes/changed to the database so people in the future will have a instant working WorldServer with no problems!

EDIT:

It seems I spoke too soon, right after managing to create a character and right before choosing to go in to the ROSE world for the first time the WorldServer spit out another FATAL ERROR in regards to the TABLE warning_system not being found, fixing this now.

EDIT:

Fixed the warning_system FATAL ERROR by creating a new table named warning_system and adding 3 fields to it named account_id, time_remaining, ban_type -These issues have been fixed now.

EDIT:

Now when I go to select my character and try to enter the ROSE world the WorldServer gives another FATAL ERROR this time in regards to the FIELD ExpansionTime missing somewhere, fixing this now.

EDIT:

It seems like the FIELD ExpansionTime was missing from the accounts TABLE - I added this field to the proper table and viola! It works and I am in game 100% - after about 10 or 20 seconds though I got another FATAL error about the field counter not being found somewhere, fixing this now.

EDIT:

It appears that the FIELD counter was also missing from the accounts TABLE, fixed.
devalex
Little soul
Little soul
 
Posts: 7
Joined: Tue Jun 05, 2012 5:12 pm

Re: Dev Rev 3 release

Postby PurpleYouko on Sun Jun 17, 2012 3:09 pm

Sounds like you've been having a really fun time with this. lol.

If you build a database batch file to fix all this stuff then please upload it and I'll add it to the SVN.
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: Dev Rev 3 release

Postby thriel on Sun Jun 17, 2012 3:27 pm

no need to scratch in source for the errors. there seems to be missing fields or tables from the DB posted, its probably just an outdated earlier version, most likely everyone forgot to update the DB in SVN. the correct DB to use with Dev Rev III is the following one :

RoseZa-DB.rar
Database for Dev Rev III
(2.34 MiB) Downloaded 1179 times


Just extract and import and all your errors should be gone.
We Have it all at RoseZA... Image
Image
User avatar
thriel
Rackie
Rackie
 
Posts: 194
Joined: Fri Jun 05, 2009 7:36 am
Location: South Africa

Re: Dev Rev 3 release

Postby devalex on Sun Jun 17, 2012 7:44 pm

@Purple - I would have but since Thriel has posted his updated DB I don't need to now.

@Thriel - Wish I would of had that yesterday before I went and did all that to get it working :) but it's OK. Thanks for the upload! After looking at it, this database is a lot different (old one 5mb new one 87mb).

It seems in game there are some problems, any time you equip an item, unequip an item it causes an instant client crash (avatar and costume) - trying to locate the source of these problems now for a fix. If anyone has knowledge of this already and has a possible solution/fix it would be greatly appreciated to share this information!

EDIT:

It also appears that when you pick up any drop the client crashes as well. I am trying to trap these crashes inside of CodeBlocks but it seems when I run the debugger on the WorldServer I can't do anything in game (move, add/take away items from avatar/costumes etc..) so it's being a pain to find what is going on here. Also since I have changed to the updated database above all newly created chars are spawning in Junon and not AP, something else I will have to fix.

EDIT:

Perhaps I am unable to move in game or do anything because of the first error that the debugger catches/traps, it is trapped the second i choose the character I want to go in to game with, check the image below.

Image

It seems like there is some issue with WayPoints that I may have to fix before doing anything else. More to come soon, but if someone see's this before my next post/update then please chime in if you have any knowledge, thanks in advanced.
devalex
Little soul
Little soul
 
Posts: 7
Joined: Tue Jun 05, 2012 5:12 pm

Re: Dev Rev 3 release

Postby thriel on Sun Jun 17, 2012 11:29 pm

the difference in DB size is because one DB is blank and the other has all the spawns and stuff in it, also i think there was a mix up and the original db posted was slightly older and missing some fields.

The problem is not the code. its your setup, we used this code with this DB for a while on our test server without crash problems.

Make sure you use the new spawn extractor purple posted to get your spawns from client, also go through the normal client / server setup to extract your gates/waypoints, skills and other stuff. also make sure you have the same stb, qsd and aip from client also server side.

If you do your setup correctly then all will work fine. But be warned, as said before, there is bugs with this code, namely Quest timer issues, Quest item issues and probly some item problems as well, nothing that will crash the server, but definitely not fully polished yet.
We Have it all at RoseZA... Image
Image
User avatar
thriel
Rackie
Rackie
 
Posts: 194
Joined: Fri Jun 05, 2009 7:36 am
Location: South Africa

Re: Dev Rev 3 release

Postby rl2171 on Mon Jun 18, 2012 5:40 am

@Purple will you be adding everything that has been updated here in to the Dev Rev 3 too?

I see the updates made by at least Alex and a database update as well.
Image
rl2171
Admin
Admin
 
Posts: 1706
Joined: Mon Aug 06, 2007 5:17 pm
Location: Sacramento, CA USA - GMT-8

Re: Dev Rev 3 release

Postby PurpleYouko on Mon Jun 18, 2012 2:01 pm

I've been so busy lately I haven't had the chance to update anything.
Not sure when I'll be able to get around to it.

@devalex
Do you see the notes around the section where it crashes?
"PY Doing TD stuff"
You don't need any of that yet. It is the embryo of a feature that is in development.
Anything related to Waypoints and TD (tower defense) can be temporarily commented out if it causes problems.
None of that stuff was fully put into the actual RoseZA source. A bit was but most was only on my test server.
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: Dev Rev 3 release

Postby Sousie on Mon Jun 18, 2012 8:34 pm

Look I live, just check in here to see what change and i saw you guys posted the roseza server code. :shock:

Its cool that people actually want to use/test it, if you have any question I will see if I answer them since I coded some of the custom code like the advertisement stuff. Most of the code is not perfect since I am still a beginner programmer.

Edit:

@devalex The reason why your client crashes could be because your using a to old client or to new client. I noted that older client crashed when you pick up equipment that didn't have the costume system, because slots changed.
Sousie
Smoulie
Smoulie
 
Posts: 42
Joined: Sun Oct 24, 2010 2:38 pm

PreviousNext

Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 11 guests

cron