C++ Problema dice sistem

Aici găsiţi problemele rezolvate.
Închis
Neconectat
Avatar utilizator
mariusdrg95
Nivel 3
Nivel 3
Mesaje: 475
Membru din: 13 Noi 2017
Localitate: Constanta
Status: Discord [Marius]#7653
Server Metin2: Metin2TSH
Regat: Jinno
Mulţumiri acordate: 35  
Mulţumiri primite: 6  
Contact:

C++ Problema dice sistem

Mesaj de mariusdrg95 » 18 Mai 2019, 01:36

*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: http://just4metin.ro/sursa/barbut-syste ... 65220.html
*ServerFiles utilizat: DreamsWorld2
*Syserr:
Trebuie să fii logat sau înregistrat pentru a vedea acest link.
Poză: -
exchange.cpp: In function 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)':
exchange.cpp:43:19: error: invalid conversion from 'int (*)(int, int)' to 'BYTE {aka unsigned char}' [-fpermissive]
  pack_exchg.dice  = dice;
                   ^
exchange.cpp: In member function 'bool CHARACTER::ExchangeStart(LPCHARACTER, BYTE)':
exchange.cpp:111:75: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
   exchange_packet(this, EXCHANGE_SUBHEADER_GC_ALREADY, 0, 0, NPOS, 0, dice);
                                                                           ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp:138:81: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
  exchange_packet(victim, EXCHANGE_SUBHEADER_GC_START, 0, GetVID(), NPOS, 0, dice);
                                                                                 ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp:139:87: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
  exchange_packet(this, EXCHANGE_SUBHEADER_GC_START, 0, victim->GetVID(), NPOS, 0, dice);
                                                                                       ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp: In constructor 'CExchange::CExchange(LPCHARACTER, BYTE)':
exchange.cpp:158:2: error: 'm_lDice' was not declared in this scope
  m_lDice = dice;
  ^
exchange.cpp: In member function 'bool CExchange::AddItem(TItemPos, BYTE)':
exchange.cpp:236:5: error: 'm_lDice' was not declared in this scope
     m_lDice,
     ^
exchange.cpp: In member function 'bool CExchange::RemoveItem(BYTE)':
exchange.cpp:270:82: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ITEM_DEL, true, pos, NPOS, 0, m_lDice);
                                                                                  ^
exchange.cpp: In member function 'bool CExchange::AddGold(long long int)':
exchange.cpp:291:6: error: 'm_lDice' was not declared in this scope
  if (m_lDice == 1)
      ^
exchange.cpp:297:79: error: 'm_lDice' was not declared in this scope
   exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0, m_lDice);
                                                                               ^
exchange.cpp:309:86: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0, m_lDice);
                                                                                      ^
exchange.cpp: In member function 'bool CExchange::Accept(bool)':
exchange.cpp:616:7: error: 'm_lDice' was not declared in this scope
   if (m_lDice == 1)
       ^
exchange.cpp:679:87: error: 'm_lDice' was not declared in this scope
   exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0, m_lDice);
                                                                                       ^
exchange.cpp: In member function 'void CExchange::Cancel()':
exchange.cpp:688:72: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0, m_lDice);
*Detalii suplimentare: Inteleg ca trebuie sa declar acea functie dar in ce parte? Sau e vorba de altceva?

Neconectat
Avatar utilizator
[RaffaeL]
Software Developer
Software Developer
Mesaje: 2705
Membru din: 19 Mar 2016
Localitate: Everywhere
Reputație: ==================
► Helper Experimentat J4M
► Membru Club Permanent
==================
►►►►►UITUC►►►►►
Pentru ca...am uitat mai multe
decat altii vor sti vreodata.
==================
Status: Incerc sa ajut,cum stiu,cum pot..pe toti
Server Metin2: ...
Mulţumiri acordate: 3  
Mulţumiri primite: 638  

Re: C++ Problema dice sistem

Mesaj de [RaffaeL] » 18 Mai 2019, 03:08

mariusdrg95 scrie:*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: http://just4metin.ro/sursa/barbut-syste ... 65220.html
*ServerFiles utilizat: DreamsWorld2
*Syserr:
Trebuie să fii logat sau înregistrat pentru a vedea acest link.
Poză: -
exchange.cpp: In function 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)':
exchange.cpp:43:19: error: invalid conversion from 'int (*)(int, int)' to 'BYTE {aka unsigned char}' [-fpermissive]
  pack_exchg.dice  = dice;
                   ^
exchange.cpp: In member function 'bool CHARACTER::ExchangeStart(LPCHARACTER, BYTE)':
exchange.cpp:111:75: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
   exchange_packet(this, EXCHANGE_SUBHEADER_GC_ALREADY, 0, 0, NPOS, 0, dice);
                                                                           ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp:138:81: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
  exchange_packet(victim, EXCHANGE_SUBHEADER_GC_START, 0, GetVID(), NPOS, 0, dice);
                                                                                 ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp:139:87: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
  exchange_packet(this, EXCHANGE_SUBHEADER_GC_START, 0, victim->GetVID(), NPOS, 0, dice);
                                                                                       ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp: In constructor 'CExchange::CExchange(LPCHARACTER, BYTE)':
exchange.cpp:158:2: error: 'm_lDice' was not declared in this scope
  m_lDice = dice;
  ^
exchange.cpp: In member function 'bool CExchange::AddItem(TItemPos, BYTE)':
exchange.cpp:236:5: error: 'm_lDice' was not declared in this scope
     m_lDice,
     ^
exchange.cpp: In member function 'bool CExchange::RemoveItem(BYTE)':
exchange.cpp:270:82: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ITEM_DEL, true, pos, NPOS, 0, m_lDice);
                                                                                  ^
exchange.cpp: In member function 'bool CExchange::AddGold(long long int)':
exchange.cpp:291:6: error: 'm_lDice' was not declared in this scope
  if (m_lDice == 1)
      ^
exchange.cpp:297:79: error: 'm_lDice' was not declared in this scope
   exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0, m_lDice);
                                                                               ^
exchange.cpp:309:86: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0, m_lDice);
                                                                                      ^
exchange.cpp: In member function 'bool CExchange::Accept(bool)':
exchange.cpp:616:7: error: 'm_lDice' was not declared in this scope
   if (m_lDice == 1)
       ^
exchange.cpp:679:87: error: 'm_lDice' was not declared in this scope
   exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0, m_lDice);
                                                                                       ^
exchange.cpp: In member function 'void CExchange::Cancel()':
exchange.cpp:688:72: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0, m_lDice);
*Detalii suplimentare: Inteleg ca trebuie sa declar acea functie dar in ce parte? Sau e vorba de altceva?
Ai limita de yang scoasa? Daca da, ai grija sa declari "m_lDice" in ambele situatii.(Verifica exchange.h)
These users thanked the author [RaffaeL] for the post:
mariusdrg95
Imagine
Imagine
► Arată conținutul
► Arată conținutul

Neconectat
Avatar utilizator
mariusdrg95
Nivel 3
Nivel 3
Mesaje: 475
Membru din: 13 Noi 2017
Localitate: Constanta
Status: Discord [Marius]#7653
Server Metin2: Metin2TSH
Regat: Jinno
Mulţumiri acordate: 35  
Mulţumiri primite: 6  
Contact:

Re: C++ Problema dice sistem

Mesaj de mariusdrg95 » 18 Mai 2019, 03:13

[RaffaeL] scrie:
mariusdrg95 scrie:*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: http://just4metin.ro/sursa/barbut-syste ... 65220.html
*ServerFiles utilizat: DreamsWorld2
*Syserr:
Trebuie să fii logat sau înregistrat pentru a vedea acest link.
Poză: -
exchange.cpp: In function 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)':
exchange.cpp:43:19: error: invalid conversion from 'int (*)(int, int)' to 'BYTE {aka unsigned char}' [-fpermissive]
  pack_exchg.dice  = dice;
                   ^
exchange.cpp: In member function 'bool CHARACTER::ExchangeStart(LPCHARACTER, BYTE)':
exchange.cpp:111:75: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
   exchange_packet(this, EXCHANGE_SUBHEADER_GC_ALREADY, 0, 0, NPOS, 0, dice);
                                                                           ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp:138:81: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
  exchange_packet(victim, EXCHANGE_SUBHEADER_GC_START, 0, GetVID(), NPOS, 0, dice);
                                                                                 ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp:139:87: error: invalid conversion from 'BYTE {aka unsigned char}' to 'void*' [-fpermissive]
  exchange_packet(this, EXCHANGE_SUBHEADER_GC_START, 0, victim->GetVID(), NPOS, 0, dice);
                                                                                       ^
exchange.cpp:27:6: error:   initializing argument 7 of 'void exchange_packet(LPCHARACTER, BYTE, bool, long long int, TItemPos, DWORD, void*)' [-fpermissive]
 void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, void * pvData)
      ^
exchange.cpp: In constructor 'CExchange::CExchange(LPCHARACTER, BYTE)':
exchange.cpp:158:2: error: 'm_lDice' was not declared in this scope
  m_lDice = dice;
  ^
exchange.cpp: In member function 'bool CExchange::AddItem(TItemPos, BYTE)':
exchange.cpp:236:5: error: 'm_lDice' was not declared in this scope
     m_lDice,
     ^
exchange.cpp: In member function 'bool CExchange::RemoveItem(BYTE)':
exchange.cpp:270:82: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ITEM_DEL, true, pos, NPOS, 0, m_lDice);
                                                                                  ^
exchange.cpp: In member function 'bool CExchange::AddGold(long long int)':
exchange.cpp:291:6: error: 'm_lDice' was not declared in this scope
  if (m_lDice == 1)
      ^
exchange.cpp:297:79: error: 'm_lDice' was not declared in this scope
   exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_LESS_GOLD, 0, 0, NPOS, 0, m_lDice);
                                                                               ^
exchange.cpp:309:86: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_GOLD_ADD, true, m_lGold, NPOS, 0, m_lDice);
                                                                                      ^
exchange.cpp: In member function 'bool CExchange::Accept(bool)':
exchange.cpp:616:7: error: 'm_lDice' was not declared in this scope
   if (m_lDice == 1)
       ^
exchange.cpp:679:87: error: 'm_lDice' was not declared in this scope
   exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_ACCEPT, true, m_bAccept, NPOS, 0, m_lDice);
                                                                                       ^
exchange.cpp: In member function 'void CExchange::Cancel()':
exchange.cpp:688:72: error: 'm_lDice' was not declared in this scope
  exchange_packet(GetOwner(), EXCHANGE_SUBHEADER_GC_END, 0, 0, NPOS, 0, m_lDice);
*Detalii suplimentare: Inteleg ca trebuie sa declar acea functie dar in ce parte? Sau e vorba de altceva?
Ai limita de yang scoasa? Daca da, ai grija sa declari "m_lDice" in ambele situatii.(Verifica exchange.h)
Am limita scoasa si nu am declarat in ambele situatii "m_lDice" , multumesc pentru atragerea atentiei.

Pentru cei cu aceeasi problema, trebuie declarat si in exchange.cpp si in exchange.h, exemplu mai jos
#ifdef ENABLE_YANG_LIMIT
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, long long arg1, TItemPos arg2, DWORD arg3, BYTE dice, void * pvData = NULL);
#else
void exchange_packet(LPCHARACTER ch, BYTE sub_header, bool is_me, DWORD arg1, TItemPos arg2, DWORD arg3, BYTE dice, void * pvData = NULL);
#endif

Închis

Înapoi la “Probleme rezolvate”