Example #1
0
 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());
 }
Example #2
0
 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);
 }
Example #3
0
            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);
            }
Example #4
0
            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);
            }
Example #5
0
            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);
            }
Example #6
0
 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);
 }
Example #7
0
 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);
 }
Example #8
0
 public async void LoginAccountSelectMenu()
 {
     var playerprx = www.session.UncheckedCast(IPlayerCoPrxHelper.uncheckedCast, IPlayerCoPrxHelper.ice_staticId());
     var ret       = await playerprx.RegOrLoginReqAsync("test", "456789");
 }
Example #9
0
        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();
            }
        }