One word: DEBUG
There's no way we could know how to fix such a specific issue without seeing any code.
figured. i dunno what i need to show tho, like all my code?
i'll give ya this, it's my receiver
Thread activity = new Thread(this);
MulticastSocket so;
ArrayList<Pig> players;
Receiver(MulticastSocket sock, ArrayList<Pig> players)
{
so = sock;
this.players = players;
activity.start();
}
public void run() {
byte[] data = new byte[1024];
while (true)
try {
DatagramPacket packet = new DatagramPacket(data, data.length);
so.receive(packet);
String mess = new String(data, 0, packet.getLength());
Scanner get = new Scanner(mess);
String name = get.next();
Double x = get.nextDouble();
Double y = get.nextDouble();
Double h = get.nextDouble();
boolean here = false;
for(int i = 0;i<players.size();i++)
{
if(name.equals(players.get(i).name))
{
here = true;
players.get(i).x=x;
players.get(i).y=y;
players.get(i).h=h;
}
}
if(!here)
{
players.add(new Pig(x,y,h,name));
}
}
catch (IOException e) {break;}
}
and this is in my initialize method
try{iadr = InetAddress.getLocalHost();}catch(UnknownHostException e){}
try{so = new MulticastSocket(port);}catch(IOException e){}
try{so.joinGroup(iadr);}catch(IOException e){}
new Receiver(so,players);
and Pig is the name of the player class