本文整理汇总了C#中IUser.GetUserId方法的典型用法代码示例。如果您正苦于以下问题:C# IUser.GetUserId方法的具体用法?C# IUser.GetUserId怎么用?C# IUser.GetUserId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IUser
的用法示例。
在下文中一共展示了IUser.GetUserId方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Notify
/// <summary>
///
/// </summary>
/// <param name="user"></param>
public void Notify(IUser 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);
}
}
}
示例2: Bind
/// <summary>
///
/// </summary>
/// <param name="user"></param>
public void Bind(IUser user)
{
int userId = user.GetUserId();
if (userId > 0)
{
//解除UserId与前一次的Session连接对象绑定
Guid sid;
if (_userHash.TryGetValue(userId, out sid) && sid != KeyCode)
{
var session = Get(sid);
if (session != null)
{
session.UnBind();
}
}
}
_userHash[userId] = KeyCode;
UserId = userId;
User = user;
}
示例3: Bind
/// <summary>
///
/// </summary>
/// <param name="user"></param>
public void Bind(IUser user) {
if (user == null) return;
int userId = user.GetUserId();
if (userId > 0) {
//解除UserId与前一次的Session连接对象绑定
Guid sid;
if (_userHash.TryGetValue(userId, out sid) && sid != KeyCode) {
var session = Get(sid);
if (session != null) {
//防止先后问题
if (session.IsReplaced || session.LastActivityTime < this.LastActivityTime) {
session.SetReplaced();
Save(session); //保留被踢的状态
session.Unbind();
}
}
}
}
_userHash[userId] = KeyCode;
User = user;
Save(this);
}
示例4: Bind
/// <summary>
///
/// </summary>
/// <param name="user"></param>
public void Bind(IUser user)
{
if (user == null) return;
int userId = user.GetUserId();
if (userId > 0)
{
//解除UserId与前一次的Session连接对象绑定
Guid sid;
if (_userHash.TryGetValue(userId, out sid) && sid != KeyCode)
{
var session = Get(sid);
if (session != null)
{
//防止先后问题
if (session.LastActivityTime < this.LastActivityTime)
{
session.UnBind();
Expire(session, 0);
}
}
}
}
_userHash[userId] = KeyCode;
User = user;
OnChangedSave(this);
}