Ejemplo n.º 1
0
 private void timer_0_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (Interlocked.Exchange(ref int_0, 1) == 0)
     {
         try
         {
             if (bool_1)
             {
                 Send(new byte[14]
                 {
                     14,
                     0,
                     0,
                     0,
                     4,
                     30,
                     12,
                     0,
                     200,
                     0,
                     0,
                     0,
                     0,
                     0
                 });
             }
             else
             {
                 Send(ProtoPacket.pack(new PCS_APPing()));
             }
         }
         catch
         {
         }
         finally
         {
             Interlocked.Exchange(ref int_0, 0);
         }
     }
 }
Ejemplo n.º 2
0
 private void timer_2_Elapsed(object sender, ElapsedEventArgs e)
 {
     if (Interlocked.Exchange(ref int_4, 1) == 0)
     {
         try
         {
             if (uid != 0 && sidnew != 0)
             {
                 try
                 {
                     List <uint> list = new List <uint>();
                     list.Add(uid);
                     PQueryUserInfoReq obj = new PQueryUserInfoReq
                     {
                         uidlist = list,
                         topSid  = sidnew,
                         type    = 0
                     };
                     byte[] serverName = bytetool.String2Bytes("channelUserInfo");
                     byte[] bytes      = default(byte[]);
                     using (ByteArray byteArray = new ByteArray(ProtoPacket.pack(obj)))
                     {
                         PContextField1 pContextField = new PContextField1();
                         pContextField.f1 = sidnew;
                         ProtoPacket protoPacket = ProtoPacket.unpack(byteArray.Buffer);
                         PAPRouter   pAPRouter   = new PAPRouter();
                         pAPRouter.m_objAPHdr.m_pAppUID                  = new CAppUID();
                         pAPRouter.m_objAPHdr.m_pAppUID.m_uAppID         = 259u;
                         pAPRouter.m_objAPHdr.m_pAppUID.m_uUID.low       = uid;
                         pAPRouter.m_objAPHdr.m_pRoutingKey              = new CRoutingKey();
                         pAPRouter.m_objAPHdr.m_pRoutingKey.m_uRealUri   = protoPacket.getUri();
                         pAPRouter.m_objAPHdr.m_pCompressionInfo         = new CCompressionInfo();
                         pAPRouter.m_objAPHdr.m_pClientInfo              = new CClientInfo();
                         pAPRouter.m_objAPHdr.m_pClientInfo.m_serverName = serverName;
                         pAPRouter.m_objAPHdr.m_pExtentProp              = new CExtentProp();
                         MYHashMap mapExtentProp = pAPRouter.m_objAPHdr.m_pExtentProp.m_mapExtentProp;
                         uint      num           = 1u;
                         mapExtentProp.put(num.ToString(), ProtoPacket.packNoHeader(pContextField));
                         MYHashMap mapExtentProp2 = pAPRouter.m_objAPHdr.m_pExtentProp.m_mapExtentProp;
                         num = 3u;
                         mapExtentProp2.put(num.ToString(), null);
                         pAPRouter.m_strLoad = protoPacket.getBuffer().Buffer;
                         pAPRouter.m_ururi   = protoPacket.getUri();
                         bytes = ProtoPacket.pack(pAPRouter);
                         byteArray.Dispose();
                     }
                     Send(bytes);
                 }
                 catch
                 {
                 }
             }
         }
         catch
         {
         }
         finally
         {
             Interlocked.Exchange(ref int_4, 0);
         }
     }
 }