修正03 00 指令
This commit is contained in:
parent
61df2b8f27
commit
0114bbc5d4
@ -5,29 +5,67 @@ using System.Collections.Generic;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using static PSO2SERVER.Zone.Map;
|
|
||||||
|
|
||||||
namespace PSO2SERVER.Protocol.Packets
|
namespace PSO2SERVER.Protocol.Packets
|
||||||
{
|
{
|
||||||
public class MapTransferPacket : Packet
|
public class MapTransferPacket : Packet
|
||||||
{
|
{
|
||||||
private readonly Map _map;
|
//private readonly Map _map;
|
||||||
private readonly int _playerid;
|
//private readonly int _playerid;
|
||||||
|
|
||||||
|
public ObjectHeader map { get; set; } = new ObjectHeader();
|
||||||
|
public ObjectHeader target { get; set; } = new ObjectHeader();
|
||||||
|
public ZoneSettings _zonesettings { get; set; } = new ZoneSettings();
|
||||||
|
|
||||||
public MapTransferPacket(Map map, int PlayerId)
|
public MapTransferPacket(Map map, int PlayerId)
|
||||||
{
|
{
|
||||||
_map = map;
|
//_map = map;
|
||||||
_playerid = PlayerId;
|
this.map = new ObjectHeader((uint)map.MapID, ObjectType.Map);
|
||||||
|
target = new ObjectHeader((uint)PlayerId, ObjectType.Player);
|
||||||
|
_zonesettings = new ZoneSettings
|
||||||
|
{
|
||||||
|
WorldId = 1,
|
||||||
|
Unk1 = 0,
|
||||||
|
ZoneId = ~(uint)map.Type,
|
||||||
|
MapId = (uint)map.MapID,
|
||||||
|
ZoneType = 0,
|
||||||
|
Seed = map.GenerationArgs.seed,
|
||||||
|
Args = (uint)map.VariantID,
|
||||||
|
SizeX = map.GenerationArgs.xsize,
|
||||||
|
SizeY = map.GenerationArgs.ysize,
|
||||||
|
Unk2 = 1,
|
||||||
|
AreaIndex = 1,
|
||||||
|
SubArea = 0xFFFFFFFF,
|
||||||
|
Unk3 = 0x301,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
#region implemented abstract members of Packet
|
#region implemented abstract members of Packet
|
||||||
|
|
||||||
public override byte[] Build()
|
public override byte[] Build()
|
||||||
{
|
{
|
||||||
|
//PacketWriter writer = new PacketWriter();
|
||||||
|
//writer.WriteStruct(new ObjectHeader(3, ObjectType.Map));
|
||||||
|
//writer.WriteStruct(target);
|
||||||
|
//writer.Write(0x1); // 8 Zeros
|
||||||
|
//writer.Write(0); // 8 Zeros
|
||||||
|
//writer.Write(~(uint)_map.Type); // F4 FF FF FF
|
||||||
|
//writer.Write(_map.MapID); // Map ID maybe
|
||||||
|
//writer.Write((uint)_map.Flags);
|
||||||
|
//writer.Write(_map.GenerationArgs.seed); // 81 8F E6 19 (Maybe seed)
|
||||||
|
//writer.Write(_map.VariantID); // Randomgen enable / disable maybe
|
||||||
|
//writer.Write(_map.GenerationArgs.xsize); // X Size
|
||||||
|
//writer.Write(_map.GenerationArgs.ysize); // Y Size
|
||||||
|
//writer.Write(1);
|
||||||
|
//writer.Write(1);
|
||||||
|
//writer.Write(~0); // FF FF FF FF FF FF FF FF
|
||||||
|
//writer.Write(0x301);
|
||||||
|
|
||||||
|
//return writer.ToArray();
|
||||||
PacketWriter pkt = new PacketWriter();
|
PacketWriter pkt = new PacketWriter();
|
||||||
pkt.WriteStruct(Map);
|
pkt.WriteStruct(map);
|
||||||
pkt.WriteStruct(target);
|
pkt.WriteStruct(target);
|
||||||
pkt.WriteStruct(settings);
|
pkt.WriteStruct(_zonesettings);
|
||||||
return pkt.ToArray();
|
return pkt.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,21 +109,6 @@ namespace PSO2SERVER.Zone
|
|||||||
|
|
||||||
return location;
|
return location;
|
||||||
}
|
}
|
||||||
public struct ZoneSettings
|
|
||||||
{
|
|
||||||
public uint WorldId;
|
|
||||||
public uint Unk1;
|
|
||||||
public uint ZoneId;
|
|
||||||
public uint MapId; // Map layout id.
|
|
||||||
public uint ZoneType;
|
|
||||||
public uint Seed;
|
|
||||||
public uint Args;
|
|
||||||
public uint SizeX;
|
|
||||||
public uint SizeY;
|
|
||||||
public uint Unk2;
|
|
||||||
public uint AreaIndex;
|
|
||||||
public uint SubArea;
|
|
||||||
public uint Unk3;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Spawns a client into a map at a given location
|
/// Spawns a client into a map at a given location
|
||||||
@ -245,7 +230,8 @@ namespace PSO2SERVER.Zone
|
|||||||
public uint WorldId;
|
public uint WorldId;
|
||||||
public uint Unk1;
|
public uint Unk1;
|
||||||
public uint ZoneId;
|
public uint ZoneId;
|
||||||
public uint MapId; // Map layout id.
|
/// Map layout id.
|
||||||
|
public uint MapId;
|
||||||
public uint ZoneType;
|
public uint ZoneType;
|
||||||
public uint Seed;
|
public uint Seed;
|
||||||
public uint Args;
|
public uint Args;
|
||||||
|
Loading…
Reference in New Issue
Block a user