部分修正

This commit is contained in:
Sancaros 2024-11-30 02:58:35 +08:00
parent c6e85c4f20
commit d1d7a73b5d
5 changed files with 11 additions and 22 deletions

View File

@ -712,7 +712,7 @@ namespace PSO2SERVER
};
var fakePacket = new CharacterSpawnPacket(fakeChar, new PSOLocation(0f, 1f, 0f, 0f, x, y, z), false)
var fakePacket = new CharacterSpawnPacket(fakeChar, new PSOLocation(0f, 1f, 0f, 0f, x, y, z), false, 0)
{
};
client.SendPacket(fakePacket);

View File

@ -37,6 +37,9 @@ namespace PSO2SERVER.Protocol.Handlers
if (context._account == null || context.Character == null)
return;
// Unlock Controls
context.SendPacket(new UnlockControlsPacket()); // Inital spawn only, move this!
context.SendPacket(new LoadingScreenRemovePacket());
}

View File

@ -8,15 +8,6 @@ namespace PSO2SERVER.Protocol.Packets
{
public class LoadingScreenRemovePacket : Packet
{
private readonly byte _subtype;
private readonly byte _type;
public LoadingScreenRemovePacket()
{
_type = 0x03;
_subtype = 0x23;
}
#region implemented abstract members of Packet
public override byte[] Build()
@ -26,11 +17,7 @@ namespace PSO2SERVER.Protocol.Packets
public override PacketHeader GetHeader()
{
return new PacketHeader
{
Type = _type,
Subtype = _subtype
};
return new PacketHeader(0x03, 0x23, PacketFlags.None);
}
#endregion

View File

@ -18,6 +18,7 @@ namespace PSO2SERVER.Protocol.Packets
private readonly Character _character;
public bool IsItMe = true;
public uint IsGM = 0;
public PSOLocation Position;
public CharacterSpawnPacket(Character character, PSOLocation locatiion)
@ -26,11 +27,12 @@ namespace PSO2SERVER.Protocol.Packets
Position = locatiion;
}
public CharacterSpawnPacket(Character character, PSOLocation locatiion, bool isme)
public CharacterSpawnPacket(Character character, PSOLocation locatiion, bool isme, uint isgm)
{
_character = character;
IsItMe = isme;
Position = locatiion;
IsGM = isgm;
}
#region implemented abstract members of Packet
@ -70,7 +72,7 @@ namespace PSO2SERVER.Protocol.Packets
writer.WriteFixedLengthUtf16("", 32); // title?
writer.Write((uint)0); // 0x204
writer.Write((uint)0); // gmflag?
writer.Write(IsGM); // gmflag?
writer.WriteFixedLengthUtf16(_character.Account.Nickname, 16); // Nickname, maybe not 16 chars?
for (var i = 0; i < 64; i++)
writer.Write((byte)0);

View File

@ -161,16 +161,13 @@ namespace PSO2SERVER.Zone
}
// Spawn for others, Spawn others for me
CharacterSpawnPacket spawnMe = new CharacterSpawnPacket(c.Character, location, false);
CharacterSpawnPacket spawnMe = new CharacterSpawnPacket(c.Character, location, false, 1);
foreach (Client other in Clients)
{
other.SendPacket(spawnMe);
c.SendPacket(new CharacterSpawnPacket(other.Character, other.CurrentLocation, false));
c.SendPacket(new CharacterSpawnPacket(other.Character, other.CurrentLocation, false, 1));
}
// Unlock Controls
c.SendPacket(new UnlockControlsPacket()); // Inital spawn only, move this!
Clients.Add(c);
Logger.Write("[MAP] {0} 已生成至 {1}.", c._account.Username, Name);