C++ Problema dice sistem

Înainte de a posta o problemă, caută în acest forum și poate găsești rezolvare.
Închis
Avatar utilizator
Marius Dragomir
Membru Club

Membru Club
Mesaje: 1020
Membru din: 13 Noi 2017, 21:32
Server: HellHound
Regat: Jinno
Aprecieri: 499  
Mulţumiri: 1211  
Discord: Copiază ID
Medalii

*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: http://just4metin.ro/sursa/barbut-syste ... 65220.html
*ServerFiles utilizat: DreamsWorld2
*Syserr:

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?
Continut: Ascuns
Trebuie sa multumesti autorului pentru a putea vedea mesajul.
Afișează semnătura
Avatar utilizator
[RaffaeL]
Software Developer

Software Developer
Mesaje: 3223
Membru din: 19 Mar 2016, 12:58
Server: ...
Aprecieri: 15  
Mulţumiri: 2502  
  Rezolvări prob.: 2
Discord: Copiază ID
 Contact:
Medalii

mariusdrg95 scrie:*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: http://just4metin.ro/sursa/barbut-syste ... 65220.html
*ServerFiles utilizat: DreamsWorld2
*Syserr:

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)
Pentru acest mesaj, [RaffaeL] for the post:
Marius Dragomir
Imagine
Imagine
https://www.youtube.com/watch?v=GhYkCIETEto
Do everything, if you know what you're doing, else... Imagine
Ma gasesti si aici: Discord https://discord.gg/5J5GnyZVSR
Afișează semnătura
Avatar utilizator
Marius Dragomir
Membru Club

Membru Club
Mesaje: 1020
Membru din: 13 Noi 2017, 21:32
Server: HellHound
Regat: Jinno
Aprecieri: 499  
Mulţumiri: 1211  
Discord: Copiază ID
Medalii

[RaffaeL] scrie:
mariusdrg95 scrie:*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: http://just4metin.ro/sursa/barbut-syste ... 65220.html
*ServerFiles utilizat: DreamsWorld2
*Syserr:

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
Pentru acest mesaj, Marius Dragomir for the post:
TiTAN1080p
Continut: Ascuns
Trebuie sa multumesti autorului pentru a putea vedea mesajul.
Afișează semnătura
Închis
Răspunsuri
1
Vizualizări
208
Răspunsuri
4
Vizualizări
623
Răspunsuri
9
Vizualizări
802
Răspunsuri
3
Vizualizări
358

Înapoi la “Probleme rezolvate”

  • Informaţie