private async Task RunSession(FSSession session, ushort index, int count, bool needNetty) { var account = "account" + index; var password = "******"; var playerName = "player" + index; try { session.SetDestroyedHandler((sender, e) => { NLogger.Info($"session:{session.GetId()} destroyed!"); }); //注册账号 var playerprx = session.UncheckedCast(IPlayerCoPrxHelper.uncheckedCast, IPlayerCoPrxHelper.ice_staticId()); var ret = await playerprx.RegOrLoginReqAsync(account, password); NLogger.Debug("RegOrLoginReqAsync ok:" + account + ", result=" + ret); var zoneprx = session.UncheckedCast(IZoneCoPrxHelper.uncheckedCast, IZoneCoPrxHelper.ice_staticId()); await zoneprx.TestApiReqAsync(); NLogger.Debug("TestApiReqAsync ok:" + account); for (int i = 0; i < 20; ++i) { var str = Console.In.ReadLine(); switch (str) { case "1": await zoneprx.TestApiReq2Async(); break; case "13": await zoneprx.TestApiReq3Async(); break; } } NLogger.Info($"{account} playerPrx end!"); } catch (Ice.Exception ex) { NLogger.Error(account + ":" + ex.Message); } catch (System.Exception e) { NLogger.Error(account + ":" + e.ToString()); } finally { //session.Destory(); } }
private static void InitIceOptions(IceOptions iceOptions) { iceOptions.ConfigFile = "Ice.config"; iceOptions.AddFacetType(typeof(PlayerPocol), IPlayerCoPrxHelper.ice_staticId()); //iceOptions.FacetTypes.Add(typeof(WorldI)); //iceOptions.FacetTypes.Add(typeof(PlayerI)); //iceOptions.FacetTypes.Add(typeof(RoleMasterI)); iceOptions.AddFacetType(typeof(ZonePocol), IZoneCoPrxHelper.ice_staticId()); }