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?
cus you are checking if the player was not in the other player dic than spawn it so the way you are doing it its gonna spawn them to each other only one time and than every check is gonna read that yes they are both added to the dic which mean there is not spawning
EDIT:
actually i think i have a better way to do it .
lets see
first thing you need to store the player old x/y every time they jump/walk .
so in your jump/walk handler and before you update the player with the new x/y
client.prevX = client.X;
client.prevY = client.Y;
and than update the clinet.x/client.y
and than in your spawn void you are gonna do something like this
Quote:
int cansee = (int)(18 - Math.Max(Math.Abs(client.PrevX - client.X), Math.Abs(client.PrevY - client.Y)));
var NewSpawns = from C in MapClients.Values where (Math.Max(Math.Abs(C.X - Client.X), Math.Abs(C.Y - Client.Y))) > cansee && !(Math.Max(Math.Abs(C.X - Client.PreviousX), Math.Abs(C.Y - Client.PreviousY)) < 18) select C;
foreach (Character P in NewSpawns)
{
Client.Send(Packets.PlayerSpawn(P));
P.Send(Packets.PlayerSpawn(Client));
}
thats it thought and clients should be able to see each other no adding/removing and if you need to pull the local clients Linq's is a better option
also general data 10010 has a subtype of (case 102) to spawn clients/mobs/npc's and its being done way better than that try to figure it out
In all cases LINQ is slower unless your are using it in conjunction with a database to fill datasets and things.
A few things to note, you need to write your in the same order for both sends in the spawning code, the way you have it written now (this is based on not seeing the rest of your code) you could have it happen that the client attempts to add a target player, the console tells you that its happened, but then a silent exception is thrown somewhere and it doesnt complete, so ideally you would want that to be shown last like in your other handling.
In all cases LINQ is slower unless your are using it in conjunction with a database to fill datasets and things.
A few things to note, you need to write your in the same order for both sends in the spawning code, the way you have it written now (this is based on not seeing the rest of your code) you could have it happen that the client attempts to add a target player, the console tells you that its happened, but then a silent exception is thrown somewhere and it doesnt complete, so ideally you would want that to be shown last like in your other handling.
Yeah, just after i posted this i switch that up and put a try/catch to see if anything was thrown, but there wasn't anything. I decided to try something, It worked. And I have no idea why/how. Could you maybe explain. I changed my original toScreen method to the following.
PHP Code:
public void toScreen(byte[] Data, Client S)
{
try
{
foreach (KeyValuePair<uint, Client> Client in S.LocalClients)
if (S.UID != Client.Value.UID)
Client.Value.Send(Data);
}
catch { }
}
Yeah, just after i posted this i switch that up and put a try/catch to see if anything was thrown, but there wasn't anything. I decided to try something, It worked. And I have no idea why/how. Could you maybe explain. I changed my original toScreen method to the following.
PHP Code:
public void toScreen(byte[] Data, Client S)
{
try
{
foreach (KeyValuePair<uint, Client> Client in S.LocalClients)
if (S.UID != Client.Value.UID)
Client.Value.Send(Data);
}
catch { }
}
From looking at the method, I'm assuming your encryption occurs within the Send method. If that's the case, and you aren't duplicating that buffer, it's probably being encrypted once and sent, then encrypted again and sent again, etc. That results in a malformed packet being sent to the client.
From looking at the method, I'm assuming your encryption occurs within the Send method. If that's the case, and you aren't duplicating that buffer, it's probably being encrypted once and sent, then encrypted again and sent again, etc. That results in a malformed packet being sent to the client.
Mob Spawning 01/02/2016 - Cabal Private Server - 5 Replies Hello communty,
Can one tell me how I can create in the game mobs. wenns goes with the id's
Thanks in advance than in!
MFG: <ZeroCool>
GERMAN:
Hallo kann mir vielleicht einer sagen wie ich im game mob spawne? und hat vielleicht jemand die idīs
Danke als im vorraus."!"
[HELP]Spawning a NPC 05/24/2010 - CO2 Private Server - 3 Replies Hey guys I was wondering if you can help me to spawn a single NPC like this...
I'm using LOTF 5017...
I'm trying to add Blue Mouse Quest and spawn the Blue Mouses....
What I know:
Spawn the mob(s) at a certain time after click.
What I don't know:
mass spawning 03/20/2010 - Dekaron - 9 Replies what crespo dungeon r yall mass spawning on
a b or c?
im lvl 100 now. not sure which one to go to for the fastest kills/exp.
also when i play on my laptop gamecrashes in the middle of doing the dungeon idk why..
Need Spawning 12/19/2009 - Dekaron - 13 Replies Hi Guys
I Need Spawning Code :confused:
Db spawning???? 03/17/2008 - Conquer Online 2 - 2 Replies Hi! I have 117 archer on eagle server, and i want to know , when the db spawns and what places ( min maks, thunder apes, sand elfs etc.) When is the server maintenances and how many hours i need to wait for db spawn on the right place:) Waiting for replies. Thank you.