C++ Problema dice sistem Subiect este rezolvat

Aici găsiţi problemele rezolvate.
Deconectat
Avatar utilizator
mariusdrg95
Nivel 3
Nivel 3
Mesaje: 466
Membru din: 13 Noi 2017
Localitate: Constanta
Status: Sunt bine mersi
Server Metin2: Metin2TSH
Regat: Jinno
Mulțumiri acordate: 35
Mulțumiri primite: 6
Contact:

C++ Problema dice sistem

Mesajde mariusdrg95 » Ieri, , 01:36

*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: sursa/barbut-system-full-t65220.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?

Deconectat
Avatar utilizator
[RaffaeL]
Utilizatorul Lunii Aprilie
Utilizatorul Lunii Aprilie
Mesaje: 2503
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: 571
Contact:

Re: C++ Problema dice sistem  Subiect este rezolvat

Mesajde [RaffaeL] » Ieri, , 03:08

mariusdrg95 scrie:*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: sursa/barbut-system-full-t65220.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)
Imagine
Imagine
► Arată conținutul

► Arată conținutul

Deconectat
Avatar utilizator
mariusdrg95
Nivel 3
Nivel 3
Mesaje: 466
Membru din: 13 Noi 2017
Localitate: Constanta
Status: Sunt bine mersi
Server Metin2: Metin2TSH
Regat: Jinno
Mulțumiri acordate: 35
Mulțumiri primite: 6
Contact:

Re: C++ Problema dice sistem

Mesajde mariusdrg95 » Ieri, , 03:13

[RaffaeL] scrie:
mariusdrg95 scrie:*Problemă: Compilare dice sistem
Tipologie server: -
*Resursă folosită: sursa/barbut-system-full-t65220.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


Înapoi la “Probleme rezolvate”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: crelvis, Floow4512, george04, K0der, lotryy1995 și 11 vizitatori