Beispiel #1
0
 /// <summary>
 /// 获取Action处理的输出字节流
 /// </summary>
 /// <returns></returns>
 public static byte[] GetActionResponse(int actionId, BaseUser baseUser, string parameters, out HttpGet httpGet)
 {
     string serverHost = string.Format("{0}:{1}", ActionConfig.Current.IpAddress, ActionConfig.Current.Port);
     string param = string.Format("MsgId={0}&St={1}&Sid={2}&Uid={3}&ActionID={4}{5}",
         0,
         "st",
         baseUser.GetSessionId(),
         baseUser.GetUserId(),
         actionId,
         parameters);
     httpGet = new HttpGet(param, baseUser.SocketSid, baseUser.RemoteAddress);
     BaseStruct baseStruct = FindRoute(ActionConfig.Current.TypeName, httpGet, actionId);
     SocketGameResponse response = new SocketGameResponse();
     baseStruct.UserFactory = uid => { return baseUser; };
     baseStruct.SetPush();
     baseStruct.DoInit();
     using (baseStruct.RequestLock())
     {
         if (!baseStruct.GetError() &&
             baseStruct.ReadUrlElement() &&
             baseStruct.DoAction() &&
             !baseStruct.GetError())
         {
             baseStruct.BuildPacket();
             baseStruct.WriteAction(response);
         }
         else
         {
             baseStruct.WriteErrorAction(response);
         }
     }
     return response.ReadByte();
 }
Beispiel #2
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="user"></param>
 public void Notify(BaseUser user)
 {
     int gameId = GameEnvironment.ProductCode;
     int serverId = GameEnvironment.ProductServerId;
     int userId = user.GetUserId();
     string pid = user.GetPassportId();
     OrderInfo[] orderList = PayManager.getPayment(gameId, serverId, pid);
     foreach (var orderInfo in orderList)
     {
         if (DoNotify(userId, orderInfo))
         {
             PayManager.Abnormal(orderInfo.OrderNO);
             TraceLog.ReleaseWriteFatal("Payment order:{0},Pid:{1} notify success", orderInfo.OrderNO, pid);
         }
         else
         {
             TraceLog.ReleaseWriteFatal("Payment order:{0},Pid:{1} notify faild", orderInfo.OrderNO, pid);
         }
     }
 }
Beispiel #3
0
 /// <summary>
 /// 
 /// </summary>
 /// <param name="roleUser"></param>
 public SessionUser(BaseUser roleUser)
     : this()
 {
     PassportId = roleUser.GetPassportId();
     UserId = roleUser.GetUserId();
 }