Esempio n. 1
0
        public IEnumerator QueryStatus(Coroutine coroutine, RankService _this, QueryStatusInMessage msg)
        {
            var rankServerControl = (RankServerControl)_this;

            var common = new ServerCommonStatus();

            common.Id = RankServer.Instance.Id;
            common.ByteReceivedPerSecond    = rankServerControl.ByteReceivedPerSecond;
            common.ByteSendPerSecond        = rankServerControl.ByteSendPerSecond;
            common.MessageReceivedPerSecond = rankServerControl.MessageReceivedPerSecond;
            common.MessageSendPerSecond     = rankServerControl.MessageSendPerSecond;
            common.ConnectionCount          = rankServerControl.ConnectionCount;

            msg.Response.CommonStatus = common;

            msg.Response.ConnectionInfo.AddRange(RankServer.Instance.Agents.Select(kv =>
            {
                var conn = new ConnectionStatus();
                var item = kv.Value;
                conn.ByteReceivedPerSecond    = item.ByteReceivedPerSecond;
                conn.ByteSendPerSecond        = item.ByteSendPerSecond;
                conn.MessageReceivedPerSecond = item.MessageReceivedPerSecond;
                conn.MessageSendPerSecond     = item.MessageSendPerSecond;
                conn.Target  = item.Id;
                conn.Latency = item.Latency;

                return(conn);
            }));

            msg.Reply();

            yield break;
        }
Esempio n. 2
0
 public IEnumerator PrepareDataForCommonUse(Coroutine coroutine,
                                            RankService _this,
                                            PrepareDataForCommonUseInMessage msg)
 {
     msg.Reply();
     return(null);
 }
Esempio n. 3
0
        public IEnumerator SSNotifyCharacterOnConnet(Coroutine coroutine,
                                                     RankService _this,
                                                     SSNotifyCharacterOnConnetInMessage msg)
        {
            var characterId = msg.Request.CharacterId;
            var clientId    = msg.Request.ClientId;
            var proxy       = new RankProxy(_this, characterId, clientId);

            _this.Proxys[characterId] = proxy;

            var ret = AsyncReturnValue <bool> .Create();

            var subCo = CoroutineFactory.NewSubroutine(OnConnected, coroutine, proxy, ret);

            if (subCo.MoveNext())
            {
                yield return(subCo);
            }
            var isOk = ret.Value;

            ret.Dispose();
            if (isOk)
            {
                msg.Reply((int)ErrorCodes.OK);
            }
            else
            {
                msg.Reply((int)ErrorCodes.ConnectFail);
            }
        }
Esempio n. 4
0
        public void Add()
        {
            if (!IsEdit)
            {
                string x = RankService.Add(Name, Description, Bonus, CanLead, MinExperience);
                if (x == null)
                {
                    TryClose();
                }
                else
                {
                    Error = x;
                }
            }
            else
            {
                toEdit.Name          = Name;
                toEdit.Description   = Description;
                toEdit.Bonus         = Bonus;
                toEdit.CanLead       = CanLead;
                toEdit.MinExperience = MinExperience;

                string x = RankService.Edit(toEdit);
                if (x == null)
                {
                    TryClose();
                }
                else
                {
                    Error = x;
                }
            }
        }
Esempio n. 5
0
        public AddPermissionViewModel(PermissionDTO permission)
        {
            Ranks       = RankService.GetAllBindableCollection();
            IsEdit      = true;
            ButtonLabel = "Edit";

            int i = 0;

            while (ActualRank == null)
            {
                if (Ranks[i].Id == permission.MinRankId)
                {
                    ActualRank = i;
                    break;
                }
                else
                {
                    i++;
                }
            }

            this.toEdit = permission;
            Name        = permission.Name;
            Description = permission.Description;
            NotifyOfPropertyChange(() => Name);
            NotifyOfPropertyChange(() => Description);
        }
Esempio n. 6
0
 //对比玩家与名次是否相符
 public IEnumerator CompareRank(Coroutine coroutine, RankService _this, CompareRankInMessage msg)
 {
     msg.Response = ServerRankManager.CompareRank(msg.Request.ServerId, P1vP1.P1vP1RankTypeId,
                                                  msg.Request.CharacterId, msg.Request.Rank);
     msg.Reply();
     yield break;
 }
Esempio n. 7
0
 public IEnumerator PrepareDataForLogout(Coroutine coroutine,
                                         RankService _this,
                                         PrepareDataForLogoutInMessage msg)
 {
     msg.Reply();
     yield break;
 }
Esempio n. 8
0
        public IEnumerator ServerGMCommand(Coroutine coroutine, RankService _this, ServerGMCommandInMessage msg)
        {
            var cmd   = msg.Request.Cmd;
            var param = msg.Request.Param;

            Logger.Info("Rank----------ServerGMCommand----------cmd={0}|param={1}", cmd, param);

            try
            {
                if ("ReloadTable" == cmd)
                {
                    Table.ReloadTable(param);
                }
                else if ("BackupRank" == cmd)
                {
                    ServerRankBackupManager.BackupAllRank(null, DateTime.Now);
                }
            }
            catch (Exception e)
            {
                Logger.Error("Rank----------ServerGMCommand----------error={0}", e.Message);
            }
            finally
            {
            }
            yield break;
        }
Esempio n. 9
0
 public IEnumerator PrepareDataForCreateCharacter(Coroutine coroutine,
                                                  RankService _this,
                                                  PrepareDataForCreateCharacterInMessage msg)
 {
     msg.Reply();
     Logger.Info("Reply PrepareDataForCreateCharacter Rank {0}", msg.CharacterId);
     return(null);
 }
Esempio n. 10
0
        public IEnumerator NodifyModifyPlayerName(Coroutine coroutine, RankService _this, NodifyModifyPlayerNameInMessage msg)
        {
            var name     = msg.Request.ModifyName;
            var ServerId = msg.Request.ServerId;

            ServerRankManager.ChangePlayerName(ServerId, name, msg.Request.Guid);
            yield break;
        }
Esempio n. 11
0
 public RankController(RankService rankService, UserService userService, LevelService levelService)
 {
     _rankService  = rankService;
     _userRank     = new List <User>();
     _userStatsDto = new List <UserStatsDto>();
     _userService  = userService;
     _levelService = levelService;
 }
 public UsersController(UserService userService, IOptions <AppSettings> appSettings, DailyChallengeService dailyChallengeService, EmailService emailService, RankService rankService)
 {
     _userService           = userService;
     _appSettings           = appSettings.Value;
     _dailyChallengeService = dailyChallengeService;
     _emailService          = emailService;
     _rankService           = rankService;
 }
        protected async override Task OnInitializedAsync()
        {
            // return base.OnInitializedAsync();

            _rankService = (RankService)ScopedServices.GetRequiredService(typeof(RankService));

            Items = await _rankService.GetAllActive().ToListAsync();
        }
Esempio n. 14
0
 //修改等级
 public IEnumerator CharacterChangeLevel(Coroutine coroutine,
                                         RankService _this,
                                         CharacterChangeLevelInMessage msg)
 {
     ServerRankManager.ResetLevel(msg.Request.ServerId, msg.Request.Name, msg.Request.Guid,
                                  msg.Request.Level * Constants.RankLevelFactor + msg.Request.Exp);
     yield break;
 }
Esempio n. 15
0
 public IEnumerator PrepareDataForEnterGame(Coroutine coroutine,
                                            RankService _this,
                                            PrepareDataForEnterGameInMessage msg)
 {
     msg.Reply();
     Logger.Info("Enter Game {0} - PrepareDataForEnterGame - 1 - {1}", msg.CharacterId,
                 TimeManager.Timer.ElapsedMilliseconds);
     return(null);
 }
Esempio n. 16
0
 public AddEmployeeViewModel()
 {
     IsEdit           = false;
     ButtonLabel      = "Add";
     Ranks            = RankService.GetAllBindableCollection();
     Specializations  = SpecializationService.GetAllBindableCollection();
     DateOfEmployment = DateTime.Now;
     NotifyOfPropertyChange(() => DateOfEmployment);
 }
Esempio n. 17
0
        public IEnumerator OnServerStop(Coroutine coroutine, RankService _this)
        {
            var co = CoroutineFactory.NewSubroutine(ServerRankManager.RefreshAll, coroutine);

            if (co.MoveNext())
            {
                yield return(co);
            }
            RankServer.Instance.DB.Dispose();
        }
Esempio n. 18
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request["type"] != null)
            {
                if (Request["type"] == "1")
                {
                    if (!RankService.IsModuleRank(1001))
                    {
                        Response.Write("<div style='width:100%;margin-top:200px;text-align:center;color:red;'>您没有本模块的操作权限! 请与管理员联系!</div>");
                        Response.End();
                    }
                }
                if (Request["type"] == "2")
                {
                    if (!RankService.IsModuleRank(1002))
                    {
                        Response.Write("<div style='width:100%;margin-top:200px;text-align:center;color:red;'>您没有本模块的操作权限! 请与管理员联系!</div>");
                        Response.End();
                    }
                }
            }
            else
            {
                if (!RankService.IsModuleRank(1001))
                {
                    Response.Write("<div style='width:100%;margin-top:200px;text-align:center;color:red;'>您没有本模块的操作权限! 请与管理员联系!</div>");
                    Response.End();
                }
            }
            if (!IsPostBack)
            {
                this.ddltype.DataSource     = FeedBackTypeService.GetAllFeedBackType();
                this.ddltype.DataTextField  = "typename";
                this.ddltype.DataValueField = "id";
                this.ddltype.DataBind();
                this.ddltype.Items.Insert(0, new ListItem("全部", "all"));

                this.rtNews.DataSource = pds();
                this.rtNews.DataBind();
                if (Request["flag"] != null)
                {
                    FeedBackService.SetFlag(Request["flag"].ToString() == "1"?true:false, int.Parse(Request["id"]));


                    Response.Redirect("feedback.aspx?page=" + Request["page"] + getcanshu());
                }
                else if (Request["del"] != null)
                {
                    string[] page = Request["page"].Split(',');
                    FeedBackService.DeleteFeedBack(int.Parse(Request["del"]));

                    Response.Redirect(Request["reUrl"].Replace("|", "&"));
                }
            }
        }
Esempio n. 19
0
        public IEnumerator GetRankValue(Coroutine coroutine, RankService _this, GetRankValueInMessage msg)
        {
            var request  = msg.Request;
            var serverId = request.ServerId;
            var rankType = request.RankType;
            var idx      = request.Idx;

            msg.Response = ServerRankManager.GetRankData(serverId, rankType, idx);
            msg.Reply();
            yield break;
        }
Esempio n. 20
0
        public RankPage()
        {
            InitializeComponent();


            navigationHelper            = new NavigationHelper(this);
            navigationHelper.LoadState += NavigationHelper_LoadState;
            navigationHelper.SaveState += NavigationHelper_SaveState;
            _rankService = new RankService();
            getDataFromService();
        }
Esempio n. 21
0
 public ServicesManager(DataManager dataManager)
 {
     _dataManager          = dataManager;
     _depatrmentService    = new DepatrmentService(_dataManager);
     _firedService         = new FiredService(_dataManager);
     _positionService      = new PositionService(_dataManager);
     _rankService          = new RankService(_dataManager);
     _staffService         = new StaffService(_dataManager);
     _subDepartmentService = new SubDepartmentService(_dataManager);
     _decreeService        = new DecreeService(_dataManager);
 }
Esempio n. 22
0
        public void Delete(RankDTO rank)
        {
            IWindowManager manager             = new WindowManager();
            DeleteConfirmationViewModel modify = new DeleteConfirmationViewModel();
            bool?showDialogResult = manager.ShowDialog(modify, null, null);

            if (showDialogResult != null && showDialogResult == true)
            {
                RankService.Delete(rank);
            }
            Reload();
        }
Esempio n. 23
0
        public AddEmployeeViewModel(EmployeeDTO employee)
        {
            IsEdit          = true;
            ButtonLabel     = "Edit";
            Ranks           = RankService.GetAllBindableCollection();
            Specializations = SpecializationService.GetAllBindableCollection();
            int i = 0;

            if (employee.RankId != null)
            {
                while (ActualRank == null)
                {
                    if (Ranks[i].Id == employee.RankId)
                    {
                        ActualRank = i;
                        break;
                    }
                    else
                    {
                        i++;
                    }
                }
            }

            if (employee.SpecializationId != null)
            {
                int j = 0;
                while (ActualSpecialization == null)
                {
                    if (Specializations[j].Id == employee.SpecializationId)
                    {
                        ActualSpecialization = j;
                        break;
                    }
                    else
                    {
                        j++;
                    }
                }
            }

            this.toEdit      = employee;
            NationalId       = employee.NationalId;
            FirstName        = employee.FirstName;
            LastName         = employee.LastName;
            Salary           = employee.Salary;
            DateOfEmployment = employee.DateOfEmployment;
            NotifyOfPropertyChange(() => NationalId);
            NotifyOfPropertyChange(() => FirstName);
            NotifyOfPropertyChange(() => LastName);
            NotifyOfPropertyChange(() => Salary);
            NotifyOfPropertyChange(() => DateOfEmployment);
        }
Esempio n. 24
0
        public void getdata()
        {
            this.lbmodule1.Text  = ModuleService.GetName(1);
            this.lbmodule2.Text  = ModuleService.GetName(2);
            this.lbmodule3.Text  = ModuleService.GetName(3);
            this.lbmodule4.Text  = ModuleService.GetName(4);
            this.lbmodule5.Text  = ModuleService.GetName(5);
            this.lbmodule6.Text  = ModuleService.GetName(6);
            this.lbmodule7.Text  = ModuleService.GetName(7);
            this.lbmodule8.Text  = ModuleService.GetName(8);
            this.lbmodule9.Text  = ModuleService.GetName(9);
            this.lbmodule10.Text = ModuleService.GetName(10);
            this.lbmodule11.Text = ModuleService.GetName(11);


            cbldata(cblmodule11, 11);
            cbldata(cblmodule10, 10);
            cbldata(cblmodule9, 9);


            cbldata(cblmodule8, 8);
            cbldata(cblmodule7, 7);
            cbldata(cblmodule6, 6);
            cbldata(cblmodule5, 5);
            cbldata(cblmodule4, 4);
            cbldata(cblmodule3, 3);
            cbldata(cblmodule2, 2);
            cbldata(cblmodule1, 1);

            if (Request["roleid"] != null)
            {
                this.lbrolename.Text = RoleService.GetRoleById(int.Parse(Request["roleid"])).rolename;
                this.hdback.Value    = Request.UrlReferrer.ToString();
                var dt = RankService.GetRank(int.Parse(Request["roleid"]));
                for (int i = 0; i < dt.Count; i++)
                {
                    string moduleId = dt[i].moduleid.ToString();

                    getcheck(cblmodule11, moduleId);
                    getcheck(cblmodule10, moduleId);
                    getcheck(cblmodule9, moduleId);

                    getcheck(cblmodule8, moduleId);
                    getcheck(cblmodule7, moduleId);
                    getcheck(cblmodule6, moduleId);
                    getcheck(cblmodule5, moduleId);
                    getcheck(cblmodule4, moduleId);
                    getcheck(cblmodule3, moduleId);
                    getcheck(cblmodule2, moduleId);
                    getcheck(cblmodule1, moduleId);
                }
            }
        }
Esempio n. 25
0
        //玩家的排行榜数据修改
        public IEnumerator SSCharacterChangeDataList(Coroutine coroutine,
                                                     RankService _this,
                                                     SSCharacterChangeDataListInMessage msg)
        {
            var name     = msg.Request.Changes.Name;
            var ServerId = msg.Request.Changes.ServerId;

            foreach (var change in msg.Request.Changes.Changes)
            {
                switch (change.RankType)
                {
                case (int)RankType.FightValue:      //战斗力
                    ServerRankManager.ResetFightPoint(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.Level:      //等级
                    ServerRankManager.ResetLevel(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.Money:      //钱
                    ServerRankManager.ResetMoney(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.CityLevel:      //家园等级
                    ServerRankManager.ResetCityLevel(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.WingsFight:      //翅膀战力
                    ServerRankManager.ResetWingsFight(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.PetFight:      //精灵战力
                    ServerRankManager.ResetPetFight(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.RechargeTotal:                         //总充值
                    ServerRankManager.ResetTotalRecharge(ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.DailyGift:
                case (int)RankType.WeeklyGift:
                case (int)RankType.TotalGift:
                    ServerRankManager.ResetGiftRank(change.RankType, ServerId, name, msg.CharacterId, change.Value);
                    break;

                case (int)RankType.Mount:      // 坐骑
                    ServerRankManager.ResetMountRank(ServerId, name, msg.CharacterId, change.Value);
                    break;
                }
            }
            yield break;
        }
Esempio n. 26
0
        protected override async Task <RangeVisitEntity> OnFindInDbAsync(int identity)
        {
            var tructks = await RankService.RangeVisitEntityAsync(0, identity);

            var size = await RankService.SizeVisitAsync();

            return(new RangeVisitEntity
            {
                CreateTime = DateTime.Now,
                Size = size,
                EntityTrucks = tructks,
                HitCount = 0
            });
        }
 private async Task <bool> RefreshAsync()
 {
     Items = null;
     OnNew();
     try
     {
         Items = await RankService.GetStudentRankListAsync();
     }
     catch (Exception e)
     {
         return(false);
     }
     return(true);
 }
Esempio n. 28
0
        public IEnumerator BSNotifyCharacterOnLost(Coroutine coroutine,
                                                   RankService _this,
                                                   BSNotifyCharacterOnLostInMessage msg)
        {
            var characterId = msg.Request.CharacterId;
            RankCharacterProxy charProxy;

            if (!_this.Proxys.TryGetValue(characterId, out charProxy))
            {
                yield break;
            }
            var proxy = (RankProxy)charProxy;

            proxy.Connected = false;
        }
Esempio n. 29
0
        public IEnumerator ReadyToEnter(Coroutine coroutine, RankService _this, ReadyToEnterInMessage msg)
        {
            if (RankServer.Instance.IsReadyToEnter && RankServer.Instance.AllAgentConnected())
            {
                msg.Response = 1;
            }
            else
            {
                msg.Response = 0;
            }

            msg.Reply();

            return(null);
        }
Esempio n. 30
0
        /// <summary>
        /// 设置权限表
        /// </summary>
        /// <param name="cbl"></param>
        /// <param name="roleid"></param>
        public void checkRank(CheckBoxList cbl, int roleid)
        {
            for (int i = 0; i < cbl.Items.Count; i++)
            {
                int v = int.Parse(cbl.Items[i].Value);

                if (cbl.Items[i].Selected)
                {
                    RankService.AddRank(v, int.Parse(Request["roleid"]));
                }
                else
                {
                    RankService.DeleteRank(v, roleid);
                }
            }
        }