修改 在线离线的判断逻辑
This commit is contained in:
@@ -21,6 +21,8 @@ namespace Common
|
||||
public static CSRedisClient redis4;
|
||||
public static CSRedisClient redis5;
|
||||
public static CSRedisClient redis6;
|
||||
public static CSRedisClient redis7;
|
||||
public static CSRedisClient redis8;
|
||||
public static CSRedisClient redis_webchat;
|
||||
//private static readonly string[] redisHosts = null;
|
||||
private static int SessionExpireMinutes = int.Parse(ConfigurationManager.AppSettings["session_expire_minutes"]);
|
||||
@@ -59,6 +61,8 @@ namespace Common
|
||||
redis4 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=4");
|
||||
redis5 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=5");
|
||||
redis6 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=6");
|
||||
redis7 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=7");
|
||||
redis8 = new CSRedisClient(redisHostStr + ",password=,defaultDatabase=8");
|
||||
redis_webchat = new CSRedisClient(string.Format(webchat_redisstr + ",password={0},defaultDatabase=0",webchat_redis_pwd));
|
||||
|
||||
//Native subscribe
|
||||
@@ -205,6 +209,14 @@ namespace Common
|
||||
{
|
||||
client = redis6;
|
||||
}
|
||||
else if (SliceNo == 7)
|
||||
{
|
||||
client = redis7;
|
||||
}
|
||||
else if (SliceNo == 8)
|
||||
{
|
||||
client = redis8;
|
||||
}
|
||||
else
|
||||
{
|
||||
client = redis;
|
||||
|
||||
@@ -772,6 +772,12 @@ namespace Common
|
||||
long current_timestamp = Convert.ToInt64(ts.TotalSeconds);
|
||||
return current_timestamp;
|
||||
}
|
||||
public static long GetCurrentTimeStamp_MS(DateTime dt)
|
||||
{
|
||||
TimeSpan ts = dt - new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local);
|
||||
long current_timestamp = Convert.ToInt64(ts.TotalMilliseconds);
|
||||
return current_timestamp;
|
||||
}
|
||||
public static DateTime GetCurrentDateTime(long timestampMilliseconds)
|
||||
{
|
||||
DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local);
|
||||
|
||||
Reference in New Issue
Block a user