public Character.AbstractBusinessObject Convert(Thrift.Protocol.TBase o)
        {
            if (null == o)
            {
                return null;
            }
            CharBagInfo info = o as CharBagInfo;
            CharBagData data = new CharBagData(info.CharId,info.ItemInfoList);

            data.Init = false;
            return data;
        }
 public AbstractBusinessObject Convert(Thrift.Protocol.TBase o)
 {
     CharBaseInfo info = o as CharBaseInfo;
     CharBaseData data = new CharBaseData();
     data.CharId = info.CharId;
     data.CharName = info.CharName;
     data.CharAge = info.Age;
     data.Fame = info.Fame;
     data.Level = info.Level;
     data.Gender = info.Gender;
     //leo
     data.CharTalentMap = info.CharTalentMap;
     data.CharRole = info.Role;
     data.CharDeatail = info.CharDeail;
     data.Init = false;
     return data;
 }
        public Character.AbstractBusinessObject Convert(Thrift.Protocol.TBase o)
        {
            if (null == o)
            {
                return null;
            }
            CharMissionInfo info = o as CharMissionInfo;
            CharMissionData data = new CharMissionData(info.CharId);
            var missionList = new List<MissionInfo>();

            if (info.CharMissionInfoList != null)
            {
                for (int i = 0; i < info.CharMissionInfoList.Count; ++i)
                {
                    missionList.Add(DeepCopy(info.CharMissionInfoList[i]));
                }
            }
            data.MissionList = missionList;
            data.Init = false;
            return data;
        }
 public Character.AbstractBusinessObject Convert(Thrift.Protocol.TBase o)
 {
     if (null == o)
     {
         return null;
     }
     CharCounterInfo info = o as CharCounterInfo;
     CharCounterData data = new CharCounterData(info.CharId);
     if (null != info.Bit8CounterList)
     {
         data.Bit8CounterList = new List<sbyte>(info.Bit8CounterList);
     }
     if (null != info.Bit32CounterList)
     {
         data.Bit32CounterList = new List<int>(info.Bit32CounterList);
     }
     if (null != info.FlagList)
     {
         data.FlagList = new List<bool>(info.FlagList);
     }
     data.Init = false;
     return data;
 }
 public void processContext(Object serverContext, Thrift.Transport.TTransport transport)
 {
     callCount++;
 }
 public void deleteContext(Object serverContext, Thrift.Protocol.TProtocol input, Thrift.Protocol.TProtocol output)
 {
     callCount++;
 }
 public Object createContext(Thrift.Protocol.TProtocol input, Thrift.Protocol.TProtocol output)
 {
     callCount++;
     return null;
 }
Esempio n. 8
0
 public void processContext(Object serverContext, Thrift.Transport.TTransport transport)
 {
   Console.WriteLine("Waiting for next client trade request");
 }
Esempio n. 9
0
 public void deleteContext(Object serverContext, Thrift.Protocol.TProtocol input, Thrift.Protocol.TProtocol output)
 {
   Console.WriteLine("Client disconnected");
   TradeEventGenerator.Unsubscribe();
 }
Esempio n. 10
0
 public Object createContext(Thrift.Protocol.TProtocol input, Thrift.Protocol.TProtocol output)
 {
   Console.WriteLine("Client connected");
   TradeEventGenerator.Subscribe(new ConcurrentQueue<PNWF.Trade>());
   return null;
 }
Esempio n. 11
0
    public void SendAsync(Thrift.Protocol.TBase data, Action<bool> completed)
    {
        MemoryStream stream = new MemoryStream();
        Thrift.Protocol.TProtocol tProtocol = new Thrift.Protocol.TBinaryProtocol(new Thrift.Transport.TStreamTransport(null, stream));

        data.Write(tProtocol);

        SendAsync(stream.ToArray(), completed);
    }