Spelare is the swedish word for gamer. I forgot to change it when I translate the code.
The only thing I want is to list all players, but the client don't get all numbers.
But do you mean like this:
Host:
#include <DarkGDK.h>
#include "multisync.h"
int counter = 0;
int gamer[17];
void DarkGDK ( void )
{
dbSyncOn();
int messfrom = 0;
if (NetHost(16))
{
while (LoopGDK())
{
if (NetPlayerJoined() != 0)
{
counter++;
NetPutInt(counter);
NetSendAll();
}
if (counter > 0)
{
while(NetGetMessage() == true)
{
messfrom = NetMessageFrom();
gamer[messfrom] = NetGetInt();
dbText(0, (messfrom * 10), dbStr(messfrom));
}
for(int a = 1; a < 17; a++)
{
if(gamer[a] > 0)
{
NetPutInt(gamer[a]);
}
}
NetSendAll();
}
dbSync();
}
}
}
Client:
#include <DarkGDK.h>
#include "multisync.h"
bool done = false;
int myplayer = 0;
int gamer = 0;
void DarkGDK ( void )
{
dbSyncOn();
int messfrom = 0;
if(NetConnect("127.0.0.1"))
{
while(done == false)
{
NetGetMessage();
myplayer = NetGetInt();
if(myplayer > 0 && myplayer < 100)
{
done = true;
}
dbSync();
}
while (LoopGDK())
{
NetGetMessage();
for(int a = 1; a < 17; a++)
{
gamer = NetGetInt();
if(gamer > 0);
{
dbText(0, (gamer * 10), dbStr(gamer));
}
}
NetPutInt(myplayer);
NetSend(0);
dbSync();
}
}
}
But something is still wrong, the clients get differet values...