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()); }
public static IPlayerCoPrx read(Ice.InputStream istr) { Ice.ObjectPrx proxy = istr.readProxy(); if (proxy != null) { IPlayerCoPrxHelper result = new IPlayerCoPrxHelper(); result.iceCopyFrom(proxy); return(result); } return(null); }
public static IPlayerCoPrx uncheckedCast(Ice.ObjectPrx b, string f) { if (b == null) { return(null); } Ice.ObjectPrx bb = b.ice_facet(f); IPlayerCoPrxHelper h = new IPlayerCoPrxHelper(); h.iceCopyFrom(bb); return(h); }
public static IPlayerCoPrx uncheckedCast(Ice.ObjectPrx b) { if (b == null) { return(null); } IPlayerCoPrx r = b as IPlayerCoPrx; if (r == null) { IPlayerCoPrxHelper h = new IPlayerCoPrxHelper(); h.iceCopyFrom(b); r = h; } return(r); }
public static IPlayerCoPrx checkedCast(Ice.ObjectPrx b, _System.Collections.Generic.Dictionary <string, string> ctx) { if (b == null) { return(null); } IPlayerCoPrx r = b as IPlayerCoPrx; if ((r == null) && b.ice_isA(ice_staticId(), ctx)) { IPlayerCoPrxHelper h = new IPlayerCoPrxHelper(); h.iceCopyFrom(b); r = h; } return(r); }
public static IPlayerCoPrx checkedCast(Ice.ObjectPrx b, string f, _System.Collections.Generic.Dictionary <string, string> ctx) { if (b == null) { return(null); } Ice.ObjectPrx bb = b.ice_facet(f); try { if (bb.ice_isA(ice_staticId(), ctx)) { IPlayerCoPrxHelper h = new IPlayerCoPrxHelper(); h.iceCopyFrom(bb); return(h); } } catch (Ice.FacetNotExistException) { } return(null); }
public static IPlayerCoPrx checkedCast(Ice.ObjectPrx b, string f) { if (b == null) { return(null); } Ice.ObjectPrx bb = b.ice_facet(f); try { if (bb.ice_isA(ice_staticId())) { IPlayerCoPrxHelper h = new IPlayerCoPrxHelper(); h.iceCopyFrom(bb); return(h); } } catch (Ice.FacetNotExistException) { } return(null); }
public async void LoginAccountSelectMenu() { var playerprx = www.session.UncheckedCast(IPlayerCoPrxHelper.uncheckedCast, IPlayerCoPrxHelper.ice_staticId()); var ret = await playerprx.RegOrLoginReqAsync("test", "456789"); }
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(); } }