using System; using System.Collections.Generic; using CommonLang.IO; using CommonLang.IO.Attribute; using RoomService.Net.BsClient; using CommonLang.Protocol; using CommonAI.ZoneServer; namespace RoomService.Net.BsServer { /// /// 客户端进入房间请求 /// [MessageType(0x00020000)] public class EnterRoomRequestC2B : NetMessage { public string PlayerUUID; public string Token; public string RoomID; /// /// 测试数据,模拟战斗管理服报文 /// public PlayerWillConnectRequestR2B TestToken; public override void WriteExternal(IOutputStream output) { output.PutS32(MessageID); output.PutUTF(PlayerUUID); output.PutUTF(Token); output.PutUTF(RoomID); output.PutExt(TestToken); } public override void ReadExternal(IInputStream input) { this.MessageID = input.GetS32(); this.PlayerUUID = input.GetUTF(); this.Token = input.GetUTF(); this.RoomID = input.GetUTF(); this.TestToken = input.GetExt(); } } /// /// 客户端进入房间回馈 /// [MessageType(0x00020001)] public class EnterRoomResponseB2C : NetMessage { public const byte RESULT_OK = 1; public const byte RESULT_FAILE = 2; public byte Result; /// /// 创建房间的扩展属性(用于游戏逻辑) /// public CreateRoomInfoR2B RoomData; /// /// 角色的扩展属性(用于游戏逻辑) /// public CreateUnitInfoR2B PlayerData; public override void WriteExternal(IOutputStream output) { output.PutS32(MessageID); output.PutU8(Result); if (Result == RESULT_OK) { output.PutExt(RoomData); output.PutExt(PlayerData); } } public override void ReadExternal(IInputStream input) { this.MessageID = input.GetS32(); this.Result = input.GetU8(); if (Result == RESULT_OK) { this.RoomData = (CreateRoomInfoR2B)input.GetExtAny(); this.PlayerData = (CreateUnitInfoR2B)input.GetExtAny(); } } } /// /// 客户端离开房间请求 /// [MessageType(0x00020002)] public class LeaveRoomRequestC2B : NetMessage { public override void WriteExternal(IOutputStream output) { } public override void ReadExternal(IInputStream input) { } } /// /// 被服务端踢掉 /// [MessageType(0x00020003)] public class KickedByServerNotifyB2C : NetMessage { public string message; public override void WriteExternal(IOutputStream output) { output.PutUTF(message); } public override void ReadExternal(IInputStream input) { this.message = input.GetUTF(); } } }