|
@@ -1,7 +1,6 @@
|
|
|
using Ice;
|
|
|
using System;
|
|
|
using System.Threading;
|
|
|
-using System.Threading.Tasks;
|
|
|
using BattleIce;
|
|
|
|
|
|
namespace ET.Server
|
|
@@ -50,26 +49,31 @@ namespace ET.Server
|
|
|
|
|
|
BattleIceAgentComponent.Instance.IceZoneManager = ZoneIce;
|
|
|
Log.Debug("got zoneManager.Proxy");
|
|
|
- ZoneIce.ice_invocationTimeout(15);
|
|
|
+ ZoneIce.ice_invocationTimeout(15000);
|
|
|
|
|
|
ObjectAdapter adapter = communicator().createObjectAdapter("");
|
|
|
ObjectPrx prx = adapter.add(new ZoneManagerCallback(), communicator().stringToIdentity("bs-" + ConstGame.GameServerId));
|
|
|
ZoneIce.ice_getCachedConnection().setAdapter(adapter);
|
|
|
- int ret = ZoneIce.setCallback(prx.ice_getIdentity(), ConstGame.GameServerId.ToString());
|
|
|
- if (ret < 0)
|
|
|
+ //-3: 未知异常
|
|
|
+ //-2: 异常参数;
|
|
|
+ //-1: 已有在线的,拒绝;
|
|
|
+ //0 : 加入成功
|
|
|
+ //1 : 加入成功,重连
|
|
|
+ int code = ZoneIce.setCallback(prx.ice_getIdentity(), ConstGame.GameServerUUID);
|
|
|
+ if (code < 0)
|
|
|
{
|
|
|
- Log.Error($"ice connect error: {ret}");
|
|
|
+ Log.Error($"战斗服连接异常: {code}");
|
|
|
return 2;
|
|
|
}
|
|
|
|
|
|
//向战斗服注册本GameServer
|
|
|
- string res = ZoneIce.registerGameServer(ConstGame.GameServerId, 0);
|
|
|
+ string res = ZoneIce.registerGameServer(ConstGame.GameServerId, ConstGame.GameServerId);
|
|
|
BattleIceAgentComponent.Instance.StrBattleServerVersion = res;
|
|
|
Log.Info($"Battle Server version: {res}");
|
|
|
}
|
|
|
catch (Ice.Exception e)
|
|
|
{
|
|
|
- Log.Error(e.Message);
|
|
|
+ Log.Error($"BattleIceAgentComponent ZoneManagerPrx Exception.{e.Message}");
|
|
|
return 3;
|
|
|
}
|
|
|
|
|
@@ -84,11 +88,11 @@ namespace ET.Server
|
|
|
|
|
|
Log.Debug("got XmdsManager.Proxy");
|
|
|
BattleIceAgentComponent.Instance.IceXmdsManager = XmdsIce;
|
|
|
- XmdsIce.ice_invocationTimeout(15);
|
|
|
+ XmdsIce.ice_invocationTimeout(15000);
|
|
|
}
|
|
|
catch (Ice.Exception e)
|
|
|
{
|
|
|
- Log.Error(e.Message);
|
|
|
+ Log.Error($"BattleIceAgentComponent XmdsManagerPrx Exception.{e.Message}");
|
|
|
return 5;
|
|
|
}
|
|
|
|
|
@@ -110,18 +114,25 @@ namespace ET.Server
|
|
|
Log.Debug($"battleServer zone notify: type({eventType}), msg({msg})");
|
|
|
Log.Debug("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
|
|
|
|
- //TODO:GWorld.java @ battleServerEvent
|
|
|
- if (eventType == "areaEvent" || eventType == "zoneEvent")
|
|
|
- {
|
|
|
- }
|
|
|
- else if (eventType == "playerEvent")
|
|
|
- {
|
|
|
- }
|
|
|
- else if (eventType == "mapNotify")
|
|
|
- {
|
|
|
- }
|
|
|
- else if (eventType == "taskEvent")
|
|
|
+ switch (eventType)
|
|
|
{
|
|
|
+ case "areaEvent":
|
|
|
+ case "zoneEvent":
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ case "playerEvent":
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ case "taskEvent":
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ case "mapNotify":
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|