private void ProcMessageAll(ChatRoomInfo obj) { ChatRoomInfo msg = GetRoomInfo(true); msg.body.state = GetUserState(obj.msgUser); MsgCtrl.GetInst().sendMsg(obj.msgUser, msg); }
private void BroadcastRoomInfo(ChatRoomInfo msg) { foreach (var user in mUsers) { msg.body.state = GetUserState(user.Key); MsgCtrl.GetInst().sendMsg(user.Key, msg); } }
private void ProcDelUser(ChatRoomInfo obj) { foreach (string name in obj.body.users) { if (!mUsers.ContainsKey(name)) { continue; } UpdateTick(name); mUsers.Remove(name); ChatRoomInfo msg = new ChatRoomInfo(); msg.FillServerHeader(DEF.CMD_DelChatUsers, 0); msg.body.recordID = mRoomID; MsgCtrl.GetInst().sendMsg(name, msg); } DatabaseMgr.DelChatUsers(obj); BroadcastRoomInfo(GetRoomInfo()); }
private void btnServer_Click(object sender, EventArgs e) { DatabaseMgr.Open(); MsgCtrl.GetInst().StartService(); }