daily commit

This commit is contained in:
木鱼(iFish) 2015-07-08 20:49:11 +08:00
parent 8e2ef82565
commit 71aa8be4d5
4 changed files with 11 additions and 2 deletions

View File

@ -60,6 +60,7 @@
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />

View File

@ -20,6 +20,7 @@ namespace ChatRoomServer.Main
{
static ILog _log;
static readonly object _lockObject = new object();
internal static HashSet<string> PresetAdministrators = (System.Configuration.ConfigurationManager.AppSettings["chat:admin"] ?? "").Split(new[] {';'}, StringSplitOptions.RemoveEmptyEntries).ToHashSet(StringComparer.OrdinalIgnoreCase);
static ChatServer()
{

View File

@ -19,6 +19,7 @@ namespace ChatRoomServer.Main
DateTime _connecTime = DateTime.Now;
long _connectId;
bool _isAdmin;
/// <summary>
/// 路径分割
@ -55,6 +56,7 @@ namespace ChatRoomServer.Main
NickName = System.Net.WebUtility.UrlDecode(path[3]);
}
PathSegements = path;
_isAdmin = ChatServer.PresetAdministrators.Contains(UserName);
//更新统计
var db = new ChatDb();

View File

@ -17,8 +17,13 @@
};
sessMgr.on("sessionChanged", function () {
user = sessMgr.current;
checkPrivilege();
if (!sessMgr.current) {
session.exitRoom();
} else {
user = sessMgr.current;
checkPrivilege();
}
});
checkPrivilege();