Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bot #1113

Merged
merged 21 commits into from
Aug 20, 2024
Merged

Bot #1113

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 0 additions & 5 deletions bot/.gitignore

This file was deleted.

16 changes: 0 additions & 16 deletions bot/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions bot/drizzle.config.ts

This file was deleted.

20 changes: 0 additions & 20 deletions bot/migrate.ts

This file was deleted.

44 changes: 0 additions & 44 deletions bot/package.json

This file was deleted.

9 changes: 0 additions & 9 deletions bot/src/db/schema.ts

This file was deleted.

13 changes: 0 additions & 13 deletions bot/src/index.ts

This file was deleted.

43 changes: 0 additions & 43 deletions bot/src/routes/users.ts

This file was deleted.

15 changes: 0 additions & 15 deletions bot/src/types/index.ts

This file was deleted.

8 changes: 0 additions & 8 deletions bot/tsconfig.json

This file was deleted.

38 changes: 37 additions & 1 deletion contracts/src/models/event.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub struct EternumEvent {
#[key]
event_id: EventType,
timestamp: u64,
data: EventData,
// data: EventData,
}

#[derive(Introspect, Copy, Drop, Serde)]
Expand All @@ -32,10 +32,18 @@ pub enum EventData {
}

#[derive(Introspect, Copy, Drop, Serde)]
#[dojo::event]
#[dojo::model]
pub struct BattleStartData {
#[key]
id: ID,
#[key]
event_id: EventType,
battle_entity_id: ID,
attacker: ContractAddress,
attacker_name: felt252,
attacker_army_entity_id: ID,
defender_name: felt252,
defender: ContractAddress,
defender_army_entity_id: ID,
duration_left: u64,
Expand All @@ -45,9 +53,16 @@ pub struct BattleStartData {
}

#[derive(Introspect, Copy, Drop, Serde)]
#[dojo::event]
#[dojo::model]
pub struct BattleJoinData {
#[key]
id: ID,
#[key]
event_id: EventType,
battle_entity_id: ID,
joiner: ContractAddress,
joiner_name: felt252,
joiner_army_entity_id: ID,
joiner_side: BattleSide,
duration_left: u64,
Expand All @@ -56,9 +71,16 @@ pub struct BattleJoinData {
}

#[derive(Introspect, Copy, Drop, Serde)]
#[dojo::event]
#[dojo::model]
pub struct BattleLeaveData {
#[key]
id: ID,
#[key]
event_id: EventType,
battle_entity_id: ID,
leaver: ContractAddress,
leaver_name: felt252,
leaver_army_entity_id: ID,
leaver_side: BattleSide,
duration_left: u64,
Expand All @@ -67,9 +89,16 @@ pub struct BattleLeaveData {
}

#[derive(Introspect, Copy, Drop, Serde)]
#[dojo::event]
#[dojo::model]
pub struct BattleClaimData {
#[key]
id: ID,
#[key]
event_id: EventType,
structure_entity_id: ID,
claimer: ContractAddress,
claimer_name: felt252,
claimer_army_entity_id: ID,
previous_owner: ContractAddress,
x: u32,
Expand All @@ -78,8 +107,15 @@ pub struct BattleClaimData {
}

#[derive(Introspect, Copy, Drop, Serde)]
#[dojo::event]
#[dojo::model]
pub struct BattlePillageData {
#[key]
id: ID,
#[key]
event_id: EventType,
pillager: ContractAddress,
pillager_name: felt252,
pillager_army_entity_id: ID,
pillaged_structure_owner: ContractAddress,
pillaged_structure_entity_id: ID,
Expand Down
Loading
Loading