caute, mám menší problém, když chci vypsat data hráčů, tak mi to stále vypisuje data jednoho hráče ID 0, je jich tam 6, tak to vypíše 6x, nevím už kde dělám chybu ..
if(OnlinePlayers > 0)
{
array<String^,2>^ data = gcnew array<String^,2>(OnlinePlayers,4);
udpClient->Connect(serverIP, serverPORT);
array<Byte>^sendBytes = Encoding::ASCII->GetBytes( packet );
udpClient->Send(sendBytes, sendBytes->Length );
IPEndPoint^ RemoteIpEndPoint = gcnew IPEndPoint( IPAddress::Any,0 );
array<Byte>^receiveBytes;
receiveBytes = udpClient->Receive( RemoteIpEndPoint );
for(int i=0; i<OnlinePlayers; i++)
{
data[i,0] = Convert::ToString(ord(Encoding::ASCII->GetString(receiveBytes,11,4)));
int nl = Convert::ToInt32(ord(Encoding::ASCII->GetString(receiveBytes,14,2)));
data[i,1] = Encoding::ASCII->GetString(receiveBytes,15,nl);
MessageBox::Show(""+ret[i,1]+"", Text, MessageBoxButtons::OK, MessageBoxIcon::Error);
// message box vypise NICK hráče ..ale porad vypisuje stejneho :(
}
}
TIP: Přetáhni ikonu na hlavní panel pro připnutí webu
![C++] Výpis se upakuje – C / C++ – Fórum – Programujte.com](http://img.cdnprg.webtea.cz/web/logo_new.png)
Newbie

Nahlásit jako SPAM
IP: 89.176.203.–
God of flame
Guru
Zjistit počet nových příspěvků
































