示例#1
0
        public void  clusterServerChanged(object sender, serverChangeEventArgs e)
        {
            //处理消息
            if (e.newValue.ToString() != localRunServer.Instance.ownCluster.clusterId)
            {
                return;
            }
            if (e.changeServerId != localRunServer.Instance.ownServer.id)
            {
                return;
            }
            enum_Actiondo ead = enum_Actiondo.unknown;

            if (e.changeType != serverChangeTypeEnum.zoneMasterChanged)
            {
                ead = enum_Actiondo.resetZoneServers;
            }
            else
            {
                ead = enum_Actiondo.resetZoneMasterServer;
            }
            actionMessage am = new actionMessage(ead, e.newValue.ToString(), this.regionName, "", "", "");

            localRunServer.Instance.addActions(am);
        }
示例#2
0
        public actionMessage(enum_Actiondo _action, string _fromId, string _fromRegion, string _destId = "", string _destRegion = "", string _message = "")
        {
            this.ID = System.DateTime.Now.ToString("yyyyMMddHHmmss") + "-" + Guid.NewGuid().ToString();

            this.fromServerId = _fromId;
            this.fromRegion   = _fromRegion;
            this.destRegion   = _destRegion;
            this.action       = _action;
            this.messageParam = _message;
            this.destServerId = _destId;
            createDt          = DateTime.Now;
        }