广播聊天
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.Net;
|
||||
using Fantasy;
|
||||
using Fantasy.Async;
|
||||
using Fantasy.Network;
|
||||
using Fantasy.Platform.Net;
|
||||
|
||||
@@ -7,10 +8,30 @@ namespace NB.Game;
|
||||
|
||||
public static class GameSceneHelper
|
||||
{
|
||||
public static SceneConfig GetSceneConfig(Session session)
|
||||
private static SceneConfig GetSceneConfig()
|
||||
{
|
||||
var gameSceneConfigs = SceneConfigData.Instance.GetSceneBySceneType(SceneType.Game);
|
||||
|
||||
return gameSceneConfigs.First();
|
||||
}
|
||||
|
||||
public static async FTask<long> Online(Scene scene, long accountID, long gateRuntimeId)
|
||||
{
|
||||
var gameSceneConfig = GetSceneConfig();
|
||||
var gameRouteId = gameSceneConfig.RouteId;
|
||||
//连接到游戏中心服
|
||||
var gameResponse = (Game2G_EnterResponse)await scene.NetworkMessagingComponent.CallInnerRoute(
|
||||
gameRouteId, new G2Game_EnterRequest()
|
||||
{
|
||||
AccountId = accountID,
|
||||
GateRouteId = gateRuntimeId
|
||||
});
|
||||
|
||||
if (gameResponse.ErrorCode != 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return gameResponse.RoleRouteId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user