升级框架
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class C2S_DeleteMailRequestHandler : RouteRPC<SocialUnit, C2S_DeleteMailRequest, S2C_DeleteMailResponse>
|
||||
public class C2S_DeleteMailRequestHandler : AddressRPC<SocialUnit, C2S_DeleteMailRequest, S2C_DeleteMailResponse>
|
||||
{
|
||||
protected override async FTask Run(SocialUnit entity, C2S_DeleteMailRequest request,
|
||||
S2C_DeleteMailResponse response, Action reply)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Diagnostics;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
@@ -6,7 +7,7 @@ using Fantasy.Network.Interface;
|
||||
namespace NB.Chat;
|
||||
|
||||
public class
|
||||
C2S_GetConversationsRequestHandler : RouteRPC<SocialUnit, C2S_GetConversationsRequest, S2C_GetConversationsResponse>
|
||||
C2S_GetConversationsRequestHandler : AddressRPC<SocialUnit, C2S_GetConversationsRequest, S2C_GetConversationsResponse>
|
||||
{
|
||||
protected override async FTask Run(SocialUnit entity, C2S_GetConversationsRequest request,
|
||||
S2C_GetConversationsResponse response, Action reply)
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
using Fantasy;
|
||||
using System;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network.Interface;
|
||||
|
||||
namespace NB.Chat;
|
||||
|
||||
public class C2S_SendMailRequestHandler : RouteRPC<SocialUnit, C2S_SendMailRequest, S2C_SendMailResponse>
|
||||
public class C2S_SendMailRequestHandler : AddressRPC<SocialUnit, C2S_SendMailRequest, S2C_SendMailResponse>
|
||||
{
|
||||
protected override async FTask Run(SocialUnit entity, C2S_SendMailRequest request, S2C_SendMailResponse response,
|
||||
Action reply)
|
||||
@@ -55,14 +56,14 @@ public class C2S_SendMailRequestHandler : RouteRPC<SocialUnit, C2S_SendMailReque
|
||||
Key = conversation.Key
|
||||
};
|
||||
//同步客户端
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(entity.GateRouteId, res);
|
||||
entity.Scene.NetworkMessagingComponent.Send(entity.GateRouteId, res);
|
||||
|
||||
var chatUnit = chatUnitManage.Get(request.Target);
|
||||
|
||||
if (chatUnit != null)
|
||||
{
|
||||
//对方在线
|
||||
entity.Scene.NetworkMessagingComponent.SendInnerRoute(chatUnit.GateRouteId, res);
|
||||
entity.Scene.NetworkMessagingComponent.Send(chatUnit.GateRouteId, res);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Helper;
|
||||
using NB.Game;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Helper;
|
||||
using Fantasy.Serialize;
|
||||
@@ -8,10 +9,11 @@ namespace NB.Chat;
|
||||
|
||||
public static class MailFactory
|
||||
{
|
||||
private static readonly ISerialize _serializer = SerializerManager.GetSerializer(FantasySerializerType.Bson);
|
||||
private static readonly ISerialize _serializer = SerializerManager.BsonPack;
|
||||
|
||||
public static Mail Create(Scene scene, string content, List<AwardItem> items = null)
|
||||
{
|
||||
|
||||
var mail = Entity.Create<Mail>(scene, true, true);
|
||||
mail.Content = content;
|
||||
mail.State = MailState.Unread;
|
||||
@@ -21,7 +23,7 @@ public static class MailFactory
|
||||
{
|
||||
foreach (var item in items)
|
||||
{
|
||||
mail.Items.Add(_serializer.Clone(item));
|
||||
// mail.Items.Add(_serializer.Clone(item));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Linq;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
using Fantasy.Helper;
|
||||
@@ -42,7 +43,7 @@ public static class MailComponentSystem
|
||||
if (sync)
|
||||
{
|
||||
//同步客户端
|
||||
self.Scene.NetworkMessagingComponent.SendInnerRoute(0,new S2C_HaveMail()
|
||||
self.Scene.NetworkMessagingComponent.Send(0,new S2C_HaveMail()
|
||||
{
|
||||
Mail = mail.ToMailInfo(),
|
||||
});
|
||||
@@ -65,7 +66,7 @@ public static class MailComponentSystem
|
||||
if (sync)
|
||||
{
|
||||
//同步客户端
|
||||
self.Scene.NetworkMessagingComponent.SendInnerRoute(0,new S2C_MailState()
|
||||
self.Scene.NetworkMessagingComponent.Send(0,new S2C_MailState()
|
||||
{
|
||||
MailState = (int)MailState.Deleted,
|
||||
MailId = mailId,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas.Interface;
|
||||
using Fantasy.Helper;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Entitas;
|
||||
using Fantasy.Entitas.Interface;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using Fantasy;
|
||||
using System.Collections.Generic;
|
||||
using Fantasy;
|
||||
using Fantasy.Entitas.Interface;
|
||||
using NB.Game;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user