I get it!
Almost... :S
Host:
#include <DarkGDK.h>
#include "multisync.h"
int counter = 0;
char* playername[2];
void DarkGDK ( void )
{
dbSyncOn();
playername[0] = "Host";
if (NetHost(16))
{
while (LoopGDK())
{
if (NetPlayerJoined() != 0)
{
counter++;
}
if (counter > 0)
{
while(NetGetMessage() == true)
{
playername[1] = new char[100];
NetGetString(playername[1], 80);
}
NetPutString(playername[0]);
NetSendAll();
}
dbSync();
}
}
}
Client:
#include <DarkGDK.h>
#include "multisync.h"
char* playername[2];
void DarkGDK ( void )
{
dbSyncOn();
playername[1] = "Client";
if (NetConnect("127.0.0.1"))
{
while (LoopGDK())
{
while(NetGetMessage() == true)
{
playername[0] = new char[100];
NetGetString(playername[0], 80);
}
NetPutString(playername[1]);
NetSendAll();
dbSync();
}
}
}
But I get an popup with this error:
"Message full, cannot write."
Should I empty the char array, and how?