private void OnGameLevelEnter(Role role, byte[] buffer) { GameLevelEnterRequestProto proto = GameLevelEnterRequestProto.GetProto(buffer); ChapterLevelEntity entity = ChapterLevelDBModel.Instance.GetList(proto.GameChapterId)[proto.GameLevelId - 1]; Console.WriteLine(string.Format("玩家:{0} 请求进入{1}-{2}副本,难度等级为{3},世界Id={4}", role.RoleName, proto.GameChapterId, proto.GameLevelId, proto.Grade, entity.WorldMapId)); OnGameLevelEnterResponse(role, entity); }
private void OnGameLevelEnterResponse(Role role, ChapterLevelEntity entity) { GameLevelEnterResponseProto proto = new GameLevelEnterResponseProto(); if (entity.WorldMapId == 5) { proto.IsSuccess = true; } else { proto.IsSuccess = false; proto.MsgCode = 1000402; } role.ClientSocket.SendMsg(proto.ToArray()); }