QuickSloting DEV's

Results 1 to 11 of 11
  1. #1
    Server Developer luiz45 is offline
    MemberRank
    Apr 2006 Join Date
    233Posts

    QuickSloting DEV's

    Yo guys anyone know why the hell i can only load slots from 1~32?

    because if you get the const variable you see something like NTL_CHAR_QUICK_SLOT_MAX_COUNT = 48
    but if you throw him in a loop...example
    Code:
    //Code Example
    for(int i=0i<NTL_CHAR_QUICK_SLOT_MAX_COUNT;i++)
    {
                    res->asQuickSlotData[i].bySlot = i;
    		res->asQuickSlotData[i].tblidx = pSkillData->tblidx;
    		res->asQuickSlotData[i].byType = QUICK_SLOT_TYPE_SKILL;	
                    i++
    }
    freeze and you loose the connection...
    BUT if i do a loop like this:
    Code:
    //Code Example Only edited For count
    for(int i=0i<=32;i++)
    {
                    res->asQuickSlotData[i].bySlot = i;
    		res->asQuickSlotData[i].tblidx = pSkillData->tblidx;
    		res->asQuickSlotData[i].byType = QUICK_SLOT_TYPE_SKILL;	
                    i++
    }
    then you can send only slots from 1 to 32...without freezes and continue in loading world
    anyone know what i'm doing wrong?
    or if anyone see already have seen this..
    @Jupey
    How did you do your QuickSlot Events?
    i don't know if you already have this problem when coding...but...
    can you help-me?
    Last edited by luiz45; 24-07-14 at 12:40 AM. Reason: Tag Jupey


  2. #2
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: QuickSloting DEV's

    Why if you do a for you do i++ again?

  3. #3
    Member Jupeyy is offline
    MemberRank
    Jun 2014 Join Date
    74Posts

    Re: QuickSloting DEV's

    please learn c++ before starting with this project.
    I know that many of you really want to help getting dbo back and think, that you can learn it by using all of this code.
    You might think you understand the code, because mostly code is written to understand it, but you have to understand all the syntax...
    Code:
    for(int i=0i<NTL_CHAR_QUICK_SLOT_MAX_COUNT;i++)
    {
                    res->asQuickSlotData[i].bySlot = i;
            res->asQuickSlotData[i].tblidx = pSkillData->tblidx;
            res->asQuickSlotData[i].byType = QUICK_SLOT_TYPE_SKILL;    
                    i++
    }
    you do 2 wrong things:
    - int i = 0i<...
    - i++ twice

    you are saying the compiler that you want an int named i that has the value 0i<NTL...

    what has the compiler to think about it=?

    and your for loop also says, like nicolas said, if i < QUICK_SLOT_MAX_COUNT it should increase i by 1.
    then after adding stuff, you increase i by 1 !??!?!?!

    seriously how did you even compile it?

    it should stuck even before compiling with newer VS.

    I don't know if it was just a stupid mistake or if you just have no experiences, but this is not only for you, sometimes, when i see questions i think, come on guys, give me 5 seconds at google and i found a solution. But that might be my problem

    correct these errors and look if it works

  4. #4
    Connoisseur of Fine Code SanGawku is offline
    ModeratorRank
    Oct 2006 Join Date
    CyberSpanksLocation
    643Posts

    Re: QuickSloting DEV's

    No he wrote example code @Jupeyy he should have put the real code for quick slots

    Code:
    int i = 0;
     int skill = 0;
     int slotID = 0;
     while (i <= 32)
     {
      std::string query = "slotId_" + std::to_string(i);
      printf("LOading slot %s\n", query.c_str());
      skill = app->db->getInt(query.c_str());
      res->asQuickSlotData[i].bySlot = 255;
      res->asQuickSlotData[i].tblidx = 0;
      sSKILL_TBLDAT* pSkillData = reinterpret_cast<sSKILL_TBLDAT*>(pSkillTable->FindData(skill));
      if (pSkillData)
      {
       res->asQuickSlotData[i].bySlot = i;
       res->asQuickSlotData[i].tblidx = pSkillData->tblidx;
       res->asQuickSlotData[i].byType = QUICK_SLOT_TYPE_SKILL;
      }
      i++;
     }
    He is using i < 32 cause NTL_CHAR_QUICK_SLOT_MAX_COUNT will cause a crash after 32.

  5. #5
    Server Developer luiz45 is offline
    MemberRank
    Apr 2006 Join Date
    233Posts

    Re: QuickSloting DEV's

    i<=32 not i<32
    xD

    because if i put
    i<=33(or more)
    KABOOM! hahahaha
    crashed
    and i don't know why he don't load the first slot(" 0 ")...he only load the second(" 1 ") slot to 32...
    i don't know if i missed something... ^^''
    Thank's for answer Jupey!
    And Nicolas321
    ^^

  6. #6
    DBO Developer Nicolas321 is offline
    MemberRank
    May 2014 Join Date
    482Posts

    Re: QuickSloting DEV's

    I just wanna know why you do that, doble i++, just that ._.

  7. #7
    Server Developer luiz45 is offline
    MemberRank
    Apr 2006 Join Date
    233Posts

    Re: QuickSloting DEV's

    because i've writed fast man...was a example code not the real....the real code bro is what kalisto posted above
    ^^
    don't be nervous
    ^^

  8. #8
    Member Jupeyy is offline
    MemberRank
    Jun 2014 Join Date
    74Posts

    Re: QuickSloting DEV's

    Quote Originally Posted by kalisto2002 View Post
    No he wrote example code @Jupeyy he should have put the real code for quick slots

    Code:
    int i = 0;
     int skill = 0;
     int slotID = 0;
     while (i <= 32)
     {
      std::string query = "slotId_" + std::to_string(i);
      printf("LOading slot %s\n", query.c_str());
      skill = app->db->getInt(query.c_str());
      res->asQuickSlotData[i].bySlot = 255;
      res->asQuickSlotData[i].tblidx = 0;
      sSKILL_TBLDAT* pSkillData = reinterpret_cast<sSKILL_TBLDAT*>(pSkillTable->FindData(skill));
      if (pSkillData)
      {
       res->asQuickSlotData[i].bySlot = i;
       res->asQuickSlotData[i].tblidx = pSkillData->tblidx;
       res->asQuickSlotData[i].byType = QUICK_SLOT_TYPE_SKILL;
      }
      i++;
     }
    He is using i < 32 cause NTL_CHAR_QUICK_SLOT_MAX_COUNT will cause a crash after 32.
    ähhhm? one question.

    i never looked at the "real" source code from kalisto or whomever... But do you make a query that is like "slotId_1" and "slotId_2" and so on.... i mean did you made 48 columns?
    maybe the server crashes because the pSkillData is empty, but i is increased though, i never tested if the game crashes if you send empty quickslot datas... :D

  9. #9
    Server Developer luiz45 is offline
    MemberRank
    Apr 2006 Join Date
    233Posts

    Re: QuickSloting DEV's

    Yes @Jupeyy 48 columns per char...
    well it's not work if you send "NULL DATA" or if you fill their data....
    suposse your first slot(pos 0) have a skill/Item placed
    and my other slot(pos 33) have a skill/item placed
    He don't load my first pos,... because, idk...
    and load up from other slots from 1 to 32
    when he goes load 33....will cause crash...
    if you send a "INVALID_BYTE" the client send's a UG_QUICKSLOT_DEL_REQ only to cleanup the Invalid slot's...(i suposse that you already know this ^^)
    then we know that client don't crash if you fill other's slots with empty Q.S datas(bySlot=255 and tblidx=0) =D

  10. #10
    Member Jupeyy is offline
    MemberRank
    Jun 2014 Join Date
    74Posts

    Re: QuickSloting DEV's

    ... okey, i don't know why but i wouldn't do this style of programming. First of all change the stupid tables... who the hell needs 48 columns per character; do a new table and join it with you character table Oo.
    Second:
    you have the variable

    int slotID = 0;
    use it to define the slot:
    you test if the skilldata is empty, if not you increase slotid by one
    Code:
      sSKILL_TBLDAT* pSkillData = reinterpret_cast<sSKILL_TBLDAT*>(pSkillTable->FindData(skill));
      if (pSkillData)
      {
       res->asQuickSlotData[slotID].bySlot = i;
       res->asQuickSlotData[slotID].tblidx = pSkillData->tblidx;
       res->asQuickSlotData[slotID].byType = QUICK_SLOT_TYPE_SKILL;
    slotID++;
      }
    seriusly do not hope that the client deletes all the slots that are invalid :O

    and at the end you can adjust packetlength by packetheader size etc. and slotID * sizeof quickslotdata <-- the structure of it :)

  11. #11
    Server Developer luiz45 is offline
    MemberRank
    Apr 2006 Join Date
    233Posts

    Re: QuickSloting DEV's

    Thank's a lot Jupeyy!
    Got it Fixed ^^



Advertisement