服务器角色修改,只要修改这段代码应该就可以实现服务器读取角色信息了

该楼层疑似违规已被系统折叠 隐藏此楼查看此楼

5f5a3f7147b1551d718098403450d5f6.png

这些用_data, _data1, _data11, _data12, _data13, _data2 分类的数据应该是还没有完全分析出子类信息的,在游戏世界中角色的数据和在选择角色界面的数据读取顺序好像不一样。

namespace BlackDesertGame.Network.Packets.Send

{

public class SpCharacterInfo : ASendPacket

{

private static string _data, _data1, _data11, _data12, _data13, _data2;

protected Player PlayerData;

public SpCharacterInfo(Player playerData)

{

PlayerData = playerData;

_data = "010000" +

"000100003C2D0000189EC600207EC500" +

"CC9847046788BE0000000080BF763F";

_data1 = "0001000000FA00000058FAFFFFFFFFFF" +

"FF58FAFFFFFFFFFFFF58FAFFFFFFFFFF" +

"FF02946DE49500000000000000000000" +

"00000000000003000000000000000000" +

"00000000000000000089004300000000" +

"00000001000000";

_data11 = "02" +

"00000001000000030000000000000000" +

"006929000000FCFFFF1C000000000000" +

"00000000000005B40100000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000FCFFFF014B0C000001000000" +

"4200440045004D005500000077006E00" +

"55007300650072002400000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000003" +

"02000000";

_data12 = "01C16F";

_data13 = "010000001000000090000080040012" +

"000000B4000009000000000009000000" +

"0000";

_data2 = "00000300000069290000" +

"3000CD29000032000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"050000000080EA120000000000780256" +

"0500000000B026570500000000FD7D94" +

"400100000000000000000047543DEDF9" +

"7F00000000000000000000000080EA12" +

"00000000003054067700000000000000" +

"00000058F1E4D0000000001F20010055" +

"05000058F16C170B0000001800000000" +

"000000000000000000000000000000FA" +

"76000000000000000000000000000000" +

"000000000000000000000090F1E4D000" +

"00000001000000020000000000000095" +

"400100000000000000000058F1E4D000" +

"000000607FD307000800FCFFFF";

}

public override void Write(BinaryWriter writer)

{

WriteD(writer, PlayerData.PlayerId);

WriteD(writer, PlayerData.AccountId);

WriteB(writer, _data);

switch (PlayerData.CharacterData.Race)

{

case Race.Warrior:

WriteC(writer, 1);

break;

case Race.Ranger:

WriteC(writer, 2);

break;

case Race.Sorcerer:

WriteC(writer, 3);

break;

case Race.Giant:

WriteC(writer, 4);

break;

}

WriteB(writer, _data1);

WriteD(writer, PlayerData.PlayerId);

WriteD(writer, PlayerData.AccountId);

WriteB(writer, _data11);

WriteS(writer, PlayerData.CharacterData.Name);

WriteB(writer, new byte[22 - ((PlayerData.CharacterData.Name.Length * 2) + 2)]);

WriteB(writer, _data12);

WriteD(writer, PlayerData.AccountId);

WriteB(writer, _data13);

WriteD(writer, PlayerData.Level);

WriteB(writer, _data2);

}

}

}

创建角色的信息

namespace BlackDesertGame.Network.Packets.Recv

{

class RpCreateCharacter : ARecvPacket

{

protected CharacterData CharacterData;

public override void Read()

{

CharacterData = new CharacterData();

CharacterData.Race = (Race) ReadC();

ReadC();

CharacterData.Name = ReadS();

int size = 60 - (CharacterData.Name.Length * 2);

ReadB(size);

CharacterData.Zodiac = (Zodiac) ReadC();

CharacterData.Face = (byte) ReadC();

CharacterData.Hair = (byte) ReadC();

CharacterData.Unk = (byte) ReadC();

ReadB(41);

CharacterData.CharacterDatas = ReadB(989);

}

public override void Process()

{

PlayerService.CreateNewCharacter(Connection, CharacterData);

}

}

}

在角色创建的发送包代码可以看到

namespace BlackDesertGame.Network.Packets.Send

{

public class SpCreateCharacter : ASendPacket

{

protected static string Data1, Data2;

protected Player PlayerData;

protected Connection Connection;

public SpCreateCharacter(Player playerData, Connection conn)

{

PlayerData = playerData;

Connection = conn;

Data1 =

("00000000009EDB45FEF6" +

"7F000000F08C170B0000000000F4010B" +

"00340000000000230D0000F028B70100" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"00000000000000000000000000000000" +

"0000");

Data2 =

("FFFFFFFF" +

"FFFFFFFF0032420A0000000100000000" +

"000000E0000000000000000000000000" +

"00FFFFFFFFFFFFFFFF00000000000000" +

"0000000000000000000000F0F58C170B" +

"00");

}

public override void Write(BinaryWriter writer)

{

switch (PlayerData.CharacterData.Race)

{

case Race.Warrior:

WriteC(writer, 1);

break;

case Race.Ranger:

WriteC(writer, 2);

break;

case Race.Sorcerer:

WriteC(writer, 3);

break;

case Race.Giant:

WriteC(writer, 4);

break;

}

WriteC(writer, 0);

WriteD(writer, PlayerData.PlayerId);// player id

WriteD(writer, Connection.AccountInfo.Id);// account id

WriteC(writer, 0);

WriteS(writer, PlayerData.CharacterData.Name);

WriteB(writer, new byte[22 - ((PlayerData.CharacterData.Name.Length * 2) + 2)]);

WriteB(writer, Data1.ToBytes());

WriteC(writer, PlayerData.CharacterData.Face); //脸部

WriteC(writer, PlayerData.CharacterData.Hair); //发型

WriteC(writer, PlayerData.CharacterData.Unk); //未知代码

WriteC(writer, 0);

WriteC(writer, 0);

WriteC(writer, 0);

WriteC(writer, (byte)PlayerData.CharacterData.Zodiac); //种族

WriteB(writer, new byte[38]);

WriteB(writer, PlayerData.CharacterData.CharacterDatas);

WriteB(writer, Data2.ToBytes());

}

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值