Example #1
0
        private bool DB_CreateMessage(CSCommon.Data.Message message)
        {
            string condition = "MessageId = " + message.MessageId;

            ServerFrame.DB.DBOperator dbOp = ServerFrame.DB.DBConnect.InsertData(condition, message, true);
            return(mDBConnect._ExecuteInsert(dbOp));
        }
Example #2
0
        private void DB_RoleEnteInitMessages(UserRole role)//只有登录的时候调用
        {
            string condition = "OwnerId=" + role.RoleData.RoleId;

            ServerFrame.DB.DBOperator dbOp = ServerFrame.DB.DBConnect.SelectData(condition, new CSCommon.Data.Message(), "");
            System.Data.DataTable     tab  = mDBConnect._ExecuteSelect(dbOp, "Message");
            if (tab != null)
            {
                foreach (System.Data.DataRow r in tab.Rows)
                {
                    CSCommon.Data.Message msg = new CSCommon.Data.Message();
                    if (false == ServerFrame.DB.DBConnect.FillObject(msg, r))
                    {
                        continue;
                    }
                    DB_DelMessage(msg);
                    //发送消息
                    RPC.PackageWriter pkg = new RPC.PackageWriter();
                    H_RPCRoot.smInstance.HGet_PlanesServer(pkg).RPC_SendPlayerMsg(pkg, role.RoleData.RoleId, msg);
                    pkg.DoCommand(role.PlanesConnect, RPC.CommandTargetType.DefaultType);
                }
            }
            else
            {
                System.Diagnostics.Debug.WriteLine("角色获取信息数据库执行失败:" + dbOp.SqlCode);
            }
        }
Example #3
0
        private void DB_DelMessage(CSCommon.Data.Message message)
        {
            string condition = "MessageId =" + message.MessageId;

            ServerFrame.DB.DBOperator dbOp = ServerFrame.DB.DBConnect.DestroyData(condition, message);
            mDBConnect._ExecuteDestroy(dbOp);
            return;
        }