房间创建和进入相关逻辑和协议
This commit is contained in:
27
Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs
Normal file
27
Hotfix/Map/Handler/Inner/G2Map_EnterRequestHandler.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Map.Inner;
|
||||
|
||||
public class G2Map_EnterRequestHandler : RouteRPC<Scene, G2Map_EnterRoomRequest, Map2G_EnterRoomResponse>
|
||||
{
|
||||
protected override async FTask Run(Scene entity, G2Map_EnterRoomRequest request, Map2G_EnterRoomResponse response,
|
||||
Action reply)
|
||||
{
|
||||
var roomManageComponent = entity.GetComponent<RoomManageComponent>();
|
||||
if (roomManageComponent == null)
|
||||
{
|
||||
response.ErrorCode = ErrorCode.ErrServer;
|
||||
return;
|
||||
}
|
||||
|
||||
RoomHelper.ParseCode(request.RoomCode, out var serviceId, out var roomId);
|
||||
if (serviceId < 1 || roomId < 1)
|
||||
{
|
||||
response.ErrorCode = ErrorCode.MapRoomIdError;
|
||||
return;
|
||||
}
|
||||
// roomManageComponent.Enter();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user