private async void Player_NetUserDataChanged(Player obj) { if (_char != null) { return; } _char = await ServerDB.SelectCharacterAsync(_user.Char); if (_char == null) { _player.Error($"Error while retrieving pony"); } else { _player.SetBounds(); _player.SetVersion(); _object = new WO_Player(this); _save = new AutoSaveChar(this); _items = _object.GetComponent <ItemsMgr>(); _trade = _object.GetComponent <TradeMgr>(); _skills = _object.GetComponent <SkillsMgr>(); SetPet(); _user.Map = _server.Map.Id; _char.Map = _user.Map; _player.SynchNetData(); await CharsMgr.SaveCharacterAsync(_char); } }
public Task <bool> PrepareForMapSwitch() { _save.Destroy(); _char.Data.Position = _object.Position; _char.Data.Rotation = _object.Rotation; return(CharsMgr.SaveCharacterAsync(_char)); }
public Task <bool> SaveCharacter() { m_char.Data.Position = m_position; m_char.Data.Rotation = m_rotation; return(CharsMgr.SaveCharacterAsync(m_char)); }
public async override void OnFire() { _data.Data.Position = _data.Object.Position; _data.Data.Rotation = _data.Object.Rotation; await CharsMgr.SaveCharacterAsync(_data.Char); }