新增相关协议
This commit is contained in:
@@ -122,52 +122,51 @@ public static class SocialSceneHelper
|
||||
|
||||
#region 上线下线
|
||||
|
||||
public static async FTask<(long, long)> Online(Scene scene, RoleSimpleInfo roleSimple, long gateRuntimeId)
|
||||
{
|
||||
var gameSceneConfig = GetSceneConfig();
|
||||
var gameRouteId = gameSceneConfig.RouteId;
|
||||
//连接到游戏中心服
|
||||
var gameResponse = (S2G_EnterResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
gameRouteId, new G2S_EnterRequest()
|
||||
{
|
||||
Role = roleSimple,
|
||||
GateRouteId = gateRuntimeId
|
||||
});
|
||||
|
||||
if (gameResponse.ErrorCode != 0)
|
||||
{
|
||||
return (0, 0);
|
||||
}
|
||||
|
||||
return (gameResponse.RoleRouteId, gameRouteId);
|
||||
// return gameRouteId;
|
||||
}
|
||||
|
||||
public static async FTask Offline(Scene scene, long accountId, long gateRuntimeId, long sceneRouteId)
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var gameResponse = (S2G_ExitResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
sceneRouteId, new G2S_ExitRequest()
|
||||
{
|
||||
AccountId = accountId,
|
||||
GateRouteId = gateRuntimeId
|
||||
});
|
||||
if (gameResponse.ErrorCode == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Log.Error("重试多次还是退出失败,需检查");
|
||||
}
|
||||
|
||||
private static SceneConfig GetSceneConfig()
|
||||
{
|
||||
var gameSceneConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Social);
|
||||
|
||||
return gameSceneConfigs.First();
|
||||
}
|
||||
// public static async FTask<(long, long)> Online(Scene scene, RoleSimpleInfo roleSimple, long gateRuntimeId)
|
||||
// {
|
||||
// var gameSceneConfig = GetSceneConfig();
|
||||
// var gameRouteId = gameSceneConfig.RouteId;
|
||||
// //连接到游戏中心服
|
||||
// var gameResponse = (S2G_EnterResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
// gameRouteId, new G2S_EnterRequest()
|
||||
// {
|
||||
// Role = roleSimple,
|
||||
// GateRouteId = gateRuntimeId
|
||||
// });
|
||||
//
|
||||
// if (gameResponse.ErrorCode != 0)
|
||||
// {
|
||||
// return (0, 0);
|
||||
// }
|
||||
//
|
||||
// return (gameResponse.RoleRouteId, gameRouteId);
|
||||
// }
|
||||
//
|
||||
// public static async FTask Offline(Scene scene, long accountId, long gateRuntimeId, long sceneRouteId)
|
||||
// {
|
||||
// for (int i = 0; i < 10; i++)
|
||||
// {
|
||||
// var gameResponse = (S2G_ExitResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
// sceneRouteId, new G2S_ExitRequest()
|
||||
// {
|
||||
// AccountId = accountId,
|
||||
// GateRouteId = gateRuntimeId
|
||||
// });
|
||||
// if (gameResponse.ErrorCode == 0)
|
||||
// {
|
||||
// return;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// Log.Error("重试多次还是退出失败,需检查");
|
||||
// }
|
||||
//
|
||||
// private static SceneConfig GetSceneConfig()
|
||||
// {
|
||||
// var gameSceneConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Social);
|
||||
//
|
||||
// return gameSceneConfigs.First();
|
||||
// }
|
||||
|
||||
#endregion
|
||||
}
|
||||
Reference in New Issue
Block a user