protected override async Task OnStartAsync() { this.accountSave = new MappingReference <AccountData>(RPGServerPersistenceManager.TYPE_ACCOUNT_DATA, accountID, this); this.queryRoleSnap = new QueryMappingReference <RoleSnap>(RPGServerPersistenceManager.TYPE_ROLE_SNAP_DATA, this); this.accountRoleSnapSave = new MappingReference <AccountRoleSnap>(RPGServerPersistenceManager.TYPE_ACCOUNT_ROLE_SNAP_DATA, accountID, this); this.queryRoleDataStatusSnap = new QueryMappingReference <RoleDataStatusSnap>( RPGServerPersistenceManager.TYPE_ROLE_DATA_STATUS_SNAP_DATA, this); this.Provider.AutoDispose(accountSave); this.Provider.AutoDispose(queryRoleSnap); this.Provider.AutoDispose(accountRoleSnapSave); this.Provider.AutoDispose(queryRoleDataStatusSnap); this.heartbeat_timer = base.Provider.CreateTimer(CheckHeartbeat, this, TimeSpan.FromSeconds(TimerConfig.timer_sec_SessionKeepTimeout / 2), TimeSpan.FromSeconds(TimerConfig.timer_sec_SessionKeepTimeout / 2)); var data = await this.accountSave.LoadDataAsync(); var roleSnap = await this.accountRoleSnapSave.LoadDataAsync(); }
protected override Task OnStartAsync() { this.queryRoleSnap = RPGServerPersistenceManager.Instance.GetQueryReference <TLRoleSnap>(RPGServerPersistenceManager.TYPE_ROLE_SNAP_DATA, this); tlRoleDataWriter = new TLRoleAccountDataWriter(this); return(Execute(() => { try { this.http.Start(); } catch (Exception e) { log.Error(e); http = null; } })); }
protected override void OnDisposed() { this.accountSave.Dispose(); this.accountRoleSnapSave.Dispose(); this.queryRoleSnap.Dispose(); this.queryRoleDataStatusSnap.Dispose(); this.session = null; this.enter = null; this.remote_logic_service = null; this.remote_area_service = null; this.enter_game = null; this.heartbeat_timer = null; this.sessionToken = null; this.accountSave = null; this.queryRoleSnap = null; this.queryRoleDataStatusSnap = null; this.accountRoleSnapSave = null; }