Dev-Rev4 debuff error with client 437

Welcome in the osRose emulator Project.

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

Dev-Rev4 debuff error with client 437

Postby blahplok on Wed Jul 10, 2013 7:44 am

when buff is debuffed, should all buff are disapear at client. but with this client it's not.
is client 437 change packet command to handle this packet?
when buff is debuffed, it's define in refreshbuff() with packet command 0x7b7 sent to client. i have change all packet to 0, but this not make a change. at server buff is back to normal but at client still.
any idea..?
btw for packet data HP and MP, i have make a change to make it's same among client and server, every send a HP MP data, change line 3 and 4 to 0;
this is my code;
  1.  
  2. BEGINPACKET( pak, 0x7ec );
  3. ADDDWORD   ( pak, thisclient->Stats->HP );
  4. ADDDWORD   ( pak, thisclient->Stats->MP );
  5. ADDDWORD   ( pak, 0);
  6. ADDDWORD   ( pak, 0);
  7. thisclient->client->SendPacket( &pak );
  8.  

and i have repair pakmount to fix some bug:
here it is;
first you must uncomment at worldserver.cpp //LoadMountItem( ); to LoadMountItem( );
and change LoadMountItem( ); at startup.cpp to make same with list_mount.stb
  1.  
  2.             int slotmount = GETBYTE((*P), 0);
  3.             if(!CheckInventorySlot( thisclient, slotmount))
  4.             {
  5.                 Log(MSG_DEBUG,"Mount with slot kosong");
  6.                 return false;
  7.             }
  8.             CItem newitem = thisclient->items[slotmount];
  9.             if(newitem.itemtype != 15)
  10.             {
  11.                 Log(MSG_DEBUG,"Mount with wrong item");
  12.                 return false;
  13.             }
  14.  
  15.             CMountData* mountdata = MountList.Index[newitem.itemnum];
  16.             if(mountdata==NULL)
  17.             {
  18.                 Log(MSG_DEBUG,"%s mountdata kosong at id %i",thisclient->CharInfo->charname,newitem.itemnum);
  19.                 return true;
  20.             }
  21.  
  22.             Log(MSG_DEBUG,"Mount id %i mspeed %i wspeed %i duration %i stl %i",
  23.             mountdata->id,mountdata->mspeed,mountdata->wspeed,mountdata->duration,mountdata->STLId);
  24.  
  25.             BEGINPACKET ( pak, 0x858 );
  26.             ADDWORD     ( pak, thisclient->clientid );
  27.             ADDBYTE     ( pak, newitem.itemnum );
  28.             ADDDWORD    ( pak, newitem.itemnum );
  29.             ADDDWORD    ( pak, mountdata->mspeed ); // STB movementspeed
  30.             SendToVisible( &pak, thisclient );
  31.  
  32.             thisclient->Status->Stance = MOUNTED;
  33.             thisclient->Stats->Move_Speed = mountdata->mspeed;
  34.             thisclient->CharInfo->Mount = newitem.itemnum;
  35.             Log(MSG_DEBUG,"%s Mounted %i", thisclient->CharInfo->charname, newitem.itemnum);
  36.  
Dev rev4 testing home.... http://www.dinastyonline.uk.to
90% done, waiting to fix buff disappear after pakdoid... :(
blahplok
Jelly Bean
Jelly Bean
 
Posts: 21
Joined: Fri Jul 10, 2009 4:46 pm

Re: Dev-Rev4 debuff error with client 437

Postby AnimalCrackerz on Wed Jul 17, 2013 4:49 am

Just so if anyone hasn't noticed since I haven't seen a response to Blahpoks post.. his code correction works and has fixed the mount error. I have tested it and it works super...he has rewritten the code and linked it to the Mount.stb as it should be instead of the MySql database..Thumbs UP!! Great JOB!! ..Ty for sharing your fix Blahpok. As to the Crystal defenders and other quests that arent working properly..it appears that all timed quests are broken due to timer change made by RoseNa..PurpleYouko has gone into some detail on this error ..somewhere here on the forum..might be even in this topic..I have tried to alter the code using replacing time(NULL) with clock_t()..but its not working out very well for me..anyways thank you again for sharing your mount fix! :mrgreen:
AnimalCrackerz
Pomic
Pomic
 
Posts: 102
Joined: Tue Apr 20, 2010 1:58 pm

Re: Dev-Rev4 debuff error with client 437

Postby PurpleYouko on Wed Jul 17, 2013 1:49 pm

the timer code is a bit more involved than that.
The new time data is sent in 4 bytes instead of two and it is NOT just the remaining time on the quest. It is the time stamp for the exact time at which the quest will expire. It is measured in seconds since midnight on October 31st 2006 if I remember correctly.
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-Rev4 debuff error with client 437

Postby blahplok on Thu Jul 18, 2013 2:27 am

now in project to modify game arena. thank to purple for his help.
btw, i'm still confusing on timer problem. Can you give me an example code that not work because of timer problem?
Dev rev4 testing home.... http://www.dinastyonline.uk.to
90% done, waiting to fix buff disappear after pakdoid... :(
blahplok
Jelly Bean
Jelly Bean
 
Posts: 21
Joined: Fri Jul 10, 2009 4:46 pm

Re: Dev-Rev4 debuff error with client 437

Postby PurpleYouko on Thu Jul 18, 2013 1:58 pm

Go and talk to Lampa just outside Zant and take the timed quest that he gives you.
It will show that the quest time has already expired because the server is sending the packet (can't remember which one off top of my head but it's pretty easy to find) with the 2 byte value for the duration of the quest in seconds. In this case the quest is 30 minutes long (if i remember right) so it is sending a value of 1800 seconds.
What it should be doing is sending a 4 byte value containing the number of seconds between midnight on October 31st 2006 and the present + 1800
I'm not even going to attempt to work that out right now lol.

So anyway poor old lampa is expecting some big ass number in the region of hundreds of millions and he gets 1800 so he thinks "Dude you are SOOOO out of time" :lol:
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-Rev4 debuff error with client 437

Postby blahplok on Fri Jul 19, 2013 2:09 pm

very hard to find calculated system time in client 437;
i try change code on SendQuestUpdate();
this is just poc; not 100% rigth i think; but just to make a quest work for a while;
this is my code:
  1. void CPlayer::SendQuestUpdate()
  2. {
  3.     //1167537599
  4.     long int waktu2=time(NULL)-131076;
  5.     long int waktu3=time(NULL)-waktu2;
  6.  
  7.     BEGINPACKET (pak, 0x723);
  8.     for(dword i = 0; i < 5; i++) ADDWORD( pak, quest.EpisodeVar[i]);
  9.     for(dword i = 0; i < 3; i++) ADDWORD( pak, quest.JobVar[i]);
  10.     for(dword i = 0; i < 7; i++) ADDWORD( pak, quest.PlanetVar[i]);
  11.     for(dword i = 0; i < 10; i++) ADDWORD( pak, quest.UnionVar[i]);
  12.  
  13.     for( unsigned i = 0; i < 10; i++ )
  14.     {
  15.         ADDWORD( pak,  quest.quests[i].QuestID );
  16.         long int Time = 0;
  17.         //Log( MSG_DEBUG, "Initialized Time");
  18.         //Log( MSG_DEBUG, "This Quest quest id = %i",quest.quests[i].QuestID);
  19.         //Log( MSG_DEBUG, "This Quest timer = %i",GServer->STB_QUEST.rows[quest.quests[i].QuestID][1]);
  20.         if (quest.quests[i].QuestID > 0 && GServer->STB_QUEST.rows[quest.quests[i].QuestID][1] > 0)
  21.         {
  22.             //Log( MSG_DEBUG, "This Quest timer = %i",GServer->STB_QUEST.rows[quest.quests[i].QuestID][1]);
  23.             Time += quest.quests[i].StartTime; // Start time
  24.             //Log( MSG_DEBUG, "start time = %i",quest.quests[i].StartTime);
  25.             //Time += GServer->STB_QUEST.rows[quest.quests[i].QuestID][1] * 1000; // Time to finish
  26.             Time+= GServer->STB_QUEST.rows[quest.quests[i].QuestID][1]*10;
  27.             //Log( MSG_DEBUG, "time at finish = %i",Time);
  28.             Time -= time(NULL); // Current time
  29.             //Log( MSG_DEBUG, "current time = %i",time(NULL));
  30.             if (Time < 0) Time = 0; // Time is up
  31.             else
  32.             {
  33.                 Time /= 10;
  34.                 Time += waktu3;
  35.             }
  36.             //Time+= GServer->STB_QUEST.rows[quest.quests[i].QuestID][1];
  37.  
  38.             //Time /= 10; // Divide to get 10's of seconds
  39.  
  40.             //1374230282
  41.             //long int timeawal = 1374230282-GServer->Config.hitungan;
  42.             //Time = time(NULL)-timeawal;
  43.             //nol /nol 131086
  44.             //Time = 131086;
  45.             //Time+= GServer->STB_QUEST.rows[quest.quests[i].QuestID][1];
  46.             //Time = ((GServer->STB_QUEST.rows[quest.quests[i].QuestID][1]/60)*GServer->Config.hitungan);
  47.  
  48.             Log( MSG_DEBUG, "This Quest time remaining = %i",Time-waktu3);
  49.         }
  50.         ADDDWORD( pak, Time ); // Time Left
  51.         //ADDDWORD   ( pak, 0x00001800 );
  52.  
  53.         for(dword j = 0; j < 10; j++) ADDWORD( pak, quest.quests[i].Variables[j]);
  54.         for(dword j = 0; j < 4; j++) ADDBYTE( pak, quest.quests[i].Switches[j]);
  55.         for(dword j = 0; j < 6; j++)
  56.         {
  57.             if (quest.quests[i].Items[j].itemnum != 0)
  58.             {
  59.                 //ADDWORD( pak,  thisclient->quest.quests[i].Items[j].GetPakHeader() );
  60.                 //ADDDWORD( pak,  thisclient->quest.quests[i].Items[j].GetPakData() );
  61.                 ADDDWORD( pak, GServer->BuildItemHead( quest.quests[i].Items[j] ) );
  62.                 ADDDWORD( pak, GServer->BuildItemData( quest.quests[i].Items[j] ) );
  63.                 ADDDWORD( pak, 0x00000000 );
  64.                 ADDWORD ( pak, 0x0000 );
  65.             }
  66.             else
  67.             {
  68.                 //ADDWORD( pak,  0 );
  69.                 //ADDDWORD( pak, 0 );
  70.                 ADDDWORD( pak, 0 );
  71.                 ADDDWORD( pak, 0 );
  72.                 ADDDWORD( pak, 0x00000000 );
  73.                 ADDWORD ( pak, 0x0000 );
  74.             }
  75.         }
  76.     }
  77.     for( unsigned i = 0; i < 0x40; i++ )
  78.         ADDBYTE( pak, quest.flags[i] );
  79.  
  80.     //LMA: new fields:
  81.     //beginning of clan vars?
  82.     for( unsigned i = 0; i < 12; i++ )
  83.         ADDBYTE( pak, 0x00 );
  84.  
  85.     //clan vars?
  86.     for( unsigned i = 0; i < 8; i++ )
  87.         ADDBYTE( pak, 0x00 );
  88.     client->SendPacket(&pak);
  89.  
  90.     //GServer->Config.hitungan++;
  91.     //Log(MSG_WARNING,"Sending packet");
  92. }


edit....
last try.. :D

btw, anyone know a packet command to send valor,honor and premium data to client?
Dev rev4 testing home.... http://www.dinastyonline.uk.to
90% done, waiting to fix buff disappear after pakdoid... :(
blahplok
Jelly Bean
Jelly Bean
 
Posts: 21
Joined: Fri Jul 10, 2009 4:46 pm

Re: Dev-Rev4 debuff error with client 437

Postby tonnie1391 on Sun Mar 09, 2014 10:54 am

the packet 0x7ec make the hp dont jump but the dead is no longer correctly.
tonnie1391
Jelly Bean
Jelly Bean
 
Posts: 15
Joined: Sat Dec 07, 2013 3:49 pm

Re: Dev-Rev4 debuff error with client 437

Postby hasan38 on Thu Jul 10, 2014 9:34 pm

Where exactly do you put that HP packet fix that you mentioned earlier. I also seem to be getting an error with the mount fix. The error messages are the following:

In member function 'bool CWorldServer::LoadMountItem()':|
2264|error: 'P' was not declared in this scope|
2265|error: 'thisclient' was not declared in this scope|
2270|error: 'thisclient' was not declared in this scope|
hasan38
Rackie
Rackie
 
Posts: 246
Joined: Wed Apr 22, 2009 1:43 am


Return to Support - OsRose Emulator

Who is online

Users browsing this forum: No registered users and 7 guests