fucked up perms, players db without cryps

This commit is contained in:
ntr 2018-11-29 23:46:24 +11:00
parent 38af55aacd
commit e29842ffc1
12 changed files with 13 additions and 51 deletions

View File

@ -22,14 +22,6 @@ exports.up = async knex => {
.onDelete('CASCADE'); .onDelete('CASCADE');
table.index('game'); table.index('game');
// cryp in a game
table.uuid('cryp').notNullable()
table.foreign('cryp')
.references('id')
.inTable('cryps')
.onDelete('CASCADE');
table.index('cryp');
// account in a game // account in a game
table.uuid('account').notNullable() table.uuid('account').notNullable()
table.foreign('account') table.foreign('account')

0
server/.env Executable file → Normal file
View File

0
server/Cargo.toml Executable file → Normal file
View File

0
server/README.md Executable file → Normal file
View File

24
server/WORKLOG.md Executable file → Normal file
View File

@ -1,18 +1,3 @@
Pve needs to be good, not many players early on
Randomly generated PVE graph to traverse with scattered rewards
Two types of XP -> Skill xp and Cryp XP
Skill XP allocates points in skill tree
Cryp XP allocates points in Cryp passive tree
Skills can be customised via skill tree
Cryp obiendience a deteoriating bar (placeholder name)
Cryps gain obedience when playing with you in PVE, PVP or using items
Obedience drains over time
Obedience drains faster when training / missions
Having obedience is desirable for getting good rewards
# Principles # Principles
* Experience something * Experience something
* Express something * Express something
@ -62,14 +47,6 @@ skill order defined by cryp/skill speed
counter -> dmg <-> heal counter -> dmg <-> heal
immune to status effects
physical, magic, pure dmg?
elemental?
items give skills
gem td style attr combinations gem td style attr combinations
stoney + spikey = jagged stoney + spikey = jagged
@ -90,7 +67,6 @@ gem td style attr combinations
ghostly ghostly
* 1: Fighting against human nature is a losing game * 1: Fighting against human nature is a losing game
* 2: Aesthetics matter * 2: Aesthetics matter
* 3: Resonance is important * 3: Resonance is important

0
server/src/account.rs Executable file → Normal file
View File

0
server/src/cryp.rs Executable file → Normal file
View File

20
server/src/game.rs Executable file → Normal file
View File

@ -592,27 +592,22 @@ pub fn game_get(tx: &mut Transaction, id: Uuid) -> Result<Game, Error> {
return Ok(game); return Ok(game);
} }
/// write a row for every cryp in a team when added to a battle pub fn players_write(account: &Account, game_id: Uuid, tx: &mut Transaction) -> Result<(), Error> {
pub fn players_write(team: &Team, game_id: Uuid, tx: &mut Transaction) -> Result<(), Error> {
// pve // pve
if !team.id.is_nil() {
for cryp in &team.cryps {
let id = Uuid::new_v4(); let id = Uuid::new_v4();
let query = " let query = "
INSERT INTO players (id, game, cryp, account) INSERT INTO players (id, game, account)
VALUES ($1, $2, $3, $4) VALUES ($1, $2, $3)
RETURNING id, account; RETURNING id, account;
"; ";
let result = tx let result = tx
.query(query, &[&id, &game_id, &cryp.id, &team.id])?; .query(query, &[&id, &game_id, &account.id])?;
let _returned = result.iter().next().expect("no row written"); let _returned = result.iter().next().expect("no row written");
println!("wrote player entry game:{:?} cryp:{:?} account:{:?}", game_id, cryp.id, team.id); println!("wrote player {:?} joined game: {:?}", account.name, game_id);
}
}
return Ok(()); return Ok(());
} }
@ -695,7 +690,6 @@ pub fn game_pve(params: GamePveParams, tx: &mut Transaction, account: &Account)
// persist // persist
game_new(&game, tx)?; game_new(&game, tx)?;
// players_write(&game.team_by_id(account.id), game_id, tx)?;
Ok(game) Ok(game)
} }
@ -723,7 +717,7 @@ pub fn game_pvp(params: GamePvpParams, tx: &mut Transaction, account: &Account)
// persist // persist
game_new(&game, tx)?; game_new(&game, tx)?;
players_write(&game.team_by_id(account.id), game_id, tx)?; players_write(account, game_id, tx)?;
Ok(game) Ok(game)
} }
@ -757,7 +751,7 @@ pub fn game_join(params: GameJoinParams, tx: &mut Transaction, account: &Account
} }
game_update(&game, tx)?; game_update(&game, tx)?;
players_write(&game.team_by_id(account.id), game_id, tx)?; players_write(account, game_id, tx)?;
Ok(game) Ok(game)
} }

0
server/src/main.rs Executable file → Normal file
View File

0
server/src/net.rs Executable file → Normal file
View File

0
server/src/rpc.rs Executable file → Normal file
View File

0
server/src/skill.rs Executable file → Normal file
View File