Alright. So this is driving me insane.
My problem: When Player A is off the screen of Player B then jumping onto the Screen of player B Player A can see B but player B cannot see A. The same thing happens when walking.
I have double check the Player Spawn packet, and jump packet so those are correct. I use the same method i did to spawn player B to A as i do to spawn player A to B.
What i think is wrong is the order in which i'm sending the packets to Player B. I'm fairly sure I've tried all the different combinations, some of which crash the client. So if there a certain order?
This is my order atm:
And this is how I spawn to each other:
This is my toScreen Method:
My problem: When Player A is off the screen of Player B then jumping onto the Screen of player B Player A can see B but player B cannot see A. The same thing happens when walking.
I have double check the Player Spawn packet, and jump packet so those are correct. I use the same method i did to spawn player B to A as i do to spawn player A to B.
What i think is wrong is the order in which i'm sending the packets to Player B. I'm fairly sure I've tried all the different combinations, some of which crash the client. So if there a certain order?
This is my order atm:
PHP Code:
C.Send(Packets.GeneralData(C.UID, ToX, ToY, FromX, FromY, 133));
Collections.Maps[C.Map].MovePlayer(C, C.CreatePoint(ToX, ToY));
C.toScreen(Packets.GeneralData(C.UID, ToX, ToY, FromX, FromY, 133));
PHP Code:
foreach (Client G in MapClients.Values)
{
if (OnScreen(Where, G.CreatePoint(G.X, G.Y)))
{
if (!G.LocalClients.ContainsKey(C.UID))
{
G.LocalClients.Add(C.UID, C);
G.Send(Packets.PlayerSpawn(C));
Console.WriteLine("Adding Player " + C.Name + " to the Local Clients of: " + G.Name + " At: " + C.X + "," + C.Y);
}
if (!C.LocalClients.ContainsKey(C.UID))
{
Console.WriteLine("Adding Player " + G.Name + " to the Local Clients of: " + C.Name + " At: " + G.X +","+G.Y);
C.LocalClients.Add(G.UID, G);
C.Send(Packets.PlayerSpawn(G));
}
}
PHP Code:
public void toScreen(byte[] Data)
{
try
{
foreach (Client G in this.LocalClients.Values)
{
if (Collections.Clients.ContainsKey(G.UID))
{
if (this.UID == G.UID)
return;
G.Send(Data);
}
}
}
catch { }
}