add silly name generation
This commit is contained in:
parent
35b5acc769
commit
35a5349a82
4 changed files with 3776 additions and 4 deletions
894
data/first.txt
Normal file
894
data/first.txt
Normal file
|
@ -0,0 +1,894 @@
|
|||
1080p
|
||||
24/365
|
||||
24/7
|
||||
Abandoned
|
||||
Absolute
|
||||
Acclaimed
|
||||
Accomplished
|
||||
Adaptive
|
||||
Admirable
|
||||
Adolescent
|
||||
Adorable
|
||||
Adored
|
||||
Advanced
|
||||
Aged
|
||||
Aggravating
|
||||
Aggressive
|
||||
Agitated
|
||||
Alarmed
|
||||
Alarming
|
||||
Alienated
|
||||
Alive
|
||||
Amazing
|
||||
Ameliorated
|
||||
Amused
|
||||
Amusing
|
||||
Ancient
|
||||
Angelic
|
||||
Anguished
|
||||
Annual
|
||||
Another
|
||||
Antique
|
||||
Arctic
|
||||
Arid
|
||||
Aromatic
|
||||
Assimilated
|
||||
Assured
|
||||
Athletic
|
||||
Attentive
|
||||
Attractive
|
||||
Austere
|
||||
Authorized
|
||||
Automated
|
||||
Automatic
|
||||
Auxiliary
|
||||
Average
|
||||
Aware
|
||||
Awesome
|
||||
Awful
|
||||
Awkward
|
||||
Back-end
|
||||
Backing Up
|
||||
Bad
|
||||
Balanced
|
||||
Basic
|
||||
Beloved
|
||||
Bespoke
|
||||
Best
|
||||
Best-of-breed
|
||||
Better
|
||||
Big
|
||||
Bite-sized
|
||||
Bitter
|
||||
Black
|
||||
Bleeding-edge
|
||||
Blissful
|
||||
Blond
|
||||
Blue
|
||||
Bluetooth
|
||||
Blushing
|
||||
Bogus
|
||||
Boiling
|
||||
Boring
|
||||
Breakable
|
||||
Bricks-and-clicks
|
||||
Brief
|
||||
Bright
|
||||
Broken
|
||||
Bronze
|
||||
Brown
|
||||
Bubbly
|
||||
Bumpy
|
||||
Burly
|
||||
Business-focused
|
||||
Busy
|
||||
Buttery
|
||||
Bypassing
|
||||
Calculating
|
||||
Calm
|
||||
Candid
|
||||
Canine
|
||||
Capital
|
||||
Carefree
|
||||
Careful
|
||||
Cautious
|
||||
Cavernous
|
||||
Centralized
|
||||
Charming
|
||||
Chief
|
||||
Circular
|
||||
Classic
|
||||
Clean
|
||||
Clear-cut
|
||||
Clicks-and-mortar
|
||||
Cloned
|
||||
Close
|
||||
Closed
|
||||
Cloudy
|
||||
Clumsy
|
||||
Cold
|
||||
Collaborative
|
||||
Colorless
|
||||
Common
|
||||
Compassionate
|
||||
Compatible
|
||||
Compelling
|
||||
Competent
|
||||
Complete
|
||||
Complicated
|
||||
Compressing
|
||||
Configurable
|
||||
Confused
|
||||
Connecting
|
||||
Conscious
|
||||
Considerate
|
||||
Content
|
||||
Conventional
|
||||
Cooked
|
||||
Copying
|
||||
Corny
|
||||
Costly
|
||||
Courteous
|
||||
Crafty
|
||||
Crazy
|
||||
Creamy
|
||||
Creative
|
||||
Creepy
|
||||
Crooked
|
||||
Cross-group
|
||||
Cross-media
|
||||
Cross-platform
|
||||
Crowded
|
||||
Cultured
|
||||
Curly
|
||||
Curvy
|
||||
Customer-focused
|
||||
Customizable
|
||||
Customized
|
||||
Cutting-edge
|
||||
Dangerous
|
||||
Dapper
|
||||
Daring
|
||||
Dark
|
||||
Darling
|
||||
Dazzling
|
||||
De-energized
|
||||
De-engineered
|
||||
Dead
|
||||
Deadly
|
||||
Dearest
|
||||
Decent
|
||||
Decentralized
|
||||
Deep
|
||||
Defensive
|
||||
Defiant
|
||||
Deficient
|
||||
Delectable
|
||||
Delightful
|
||||
Dense
|
||||
Dependent
|
||||
Descriptive
|
||||
Devolved
|
||||
Difficult
|
||||
Digital
|
||||
Digitized
|
||||
Diligent
|
||||
Direct
|
||||
Disastrous
|
||||
Discrete
|
||||
Disguised
|
||||
Dishonest
|
||||
Disloyal
|
||||
Dismal
|
||||
Distant
|
||||
Distinct
|
||||
Distorted
|
||||
Distributed
|
||||
Diverse
|
||||
Dizzy
|
||||
Dot-com
|
||||
Doting
|
||||
Double
|
||||
Down-sized
|
||||
Downright
|
||||
Drab
|
||||
Drafty
|
||||
Dramatic
|
||||
Droopy
|
||||
Dull
|
||||
Dutiful
|
||||
Dynamic
|
||||
E-business
|
||||
Early
|
||||
Earnest
|
||||
Easy
|
||||
Easy-going
|
||||
Edible
|
||||
Efficient
|
||||
Elaborate
|
||||
Elderly
|
||||
Electric
|
||||
Electronic
|
||||
Elegant
|
||||
Elementary
|
||||
Elliptical
|
||||
Embarrassed
|
||||
Empty
|
||||
End-to-end
|
||||
Enhanced
|
||||
Enormous
|
||||
Enraged
|
||||
Enterprise
|
||||
Enterprise-wide
|
||||
Entire
|
||||
Envious
|
||||
Equal
|
||||
Equatorial
|
||||
Ergonomic
|
||||
Esteemed
|
||||
Euphoric
|
||||
Even
|
||||
Everlasting
|
||||
Excellent
|
||||
Excited
|
||||
Exciting
|
||||
Exclusive
|
||||
Exhausted
|
||||
Exotic
|
||||
Expanded
|
||||
Expensive
|
||||
Experienced
|
||||
Extended
|
||||
Extensible
|
||||
Extraneous
|
||||
Face To Face
|
||||
Faint
|
||||
False
|
||||
Famous
|
||||
Fancy
|
||||
Fantastic
|
||||
Far-off
|
||||
Faraway
|
||||
Fast
|
||||
Fat
|
||||
Fatal
|
||||
Favorable
|
||||
Favorite
|
||||
Fearful
|
||||
Fearless
|
||||
Feminine
|
||||
Fickle
|
||||
Finished
|
||||
Firm
|
||||
First
|
||||
Firsthand
|
||||
Fitting
|
||||
Flaky
|
||||
Flamboyant
|
||||
Flashy
|
||||
Flat
|
||||
Flawless
|
||||
Flickering
|
||||
Flippant
|
||||
Flustered
|
||||
Focused
|
||||
Forceful
|
||||
Forked
|
||||
Formal
|
||||
Fortunate
|
||||
Fragrant
|
||||
Frayed
|
||||
Free
|
||||
Frequent
|
||||
Fresh
|
||||
Frictionless
|
||||
Frightened
|
||||
Frigid
|
||||
Frivolous
|
||||
Front-end
|
||||
Front-line
|
||||
Frozen
|
||||
Fruitful
|
||||
Full-time
|
||||
Fully-configurable
|
||||
Fumbling
|
||||
Function-based
|
||||
Functional
|
||||
Fundamental
|
||||
Funny
|
||||
Future-proofed
|
||||
General
|
||||
Generating
|
||||
Generic
|
||||
Genuine
|
||||
Giving
|
||||
Glaring
|
||||
Gleaming
|
||||
Gleeful
|
||||
Glittering
|
||||
Global
|
||||
Glossy
|
||||
Glum
|
||||
Good
|
||||
Good-natured
|
||||
Gorgeous
|
||||
Graceful
|
||||
Gracious
|
||||
Grandiose
|
||||
Granular
|
||||
Grass-roots
|
||||
Grateful
|
||||
Gray
|
||||
Great
|
||||
Greedy
|
||||
Gregarious
|
||||
Grim
|
||||
Grimy
|
||||
Gripping
|
||||
Grizzled
|
||||
Grotesque
|
||||
Grouchy
|
||||
Growling
|
||||
Gruesome
|
||||
Grumpy
|
||||
Gullible
|
||||
Gummy
|
||||
Hacking
|
||||
Handcrafted
|
||||
Handmade
|
||||
Happy
|
||||
Happy-go-lucky
|
||||
Haptic
|
||||
Hard
|
||||
Hard-to-find
|
||||
Harmful
|
||||
Harmless
|
||||
Hasty
|
||||
Hateful
|
||||
Heartfelt
|
||||
Hearty
|
||||
Heavenly
|
||||
Heavy
|
||||
Hefty
|
||||
Helpful
|
||||
Hidden
|
||||
Hideous
|
||||
High
|
||||
Hoarse
|
||||
Holistic
|
||||
Hollow
|
||||
Homely
|
||||
Honorable
|
||||
Horizontal
|
||||
Hospitable
|
||||
Humble
|
||||
Hungry
|
||||
Icky
|
||||
Icy
|
||||
Idealistic
|
||||
Idolized
|
||||
Ignorant
|
||||
Illiterate
|
||||
Illustrious
|
||||
Imaginative
|
||||
Immaculate
|
||||
Immense
|
||||
Impactful
|
||||
Impassioned
|
||||
Impeccable
|
||||
Imperfect
|
||||
Impish
|
||||
Implemented
|
||||
Important
|
||||
Impractical
|
||||
Impressive
|
||||
Improbable
|
||||
Impure
|
||||
Inborn
|
||||
Incomparable
|
||||
Incompatible
|
||||
Incomplete
|
||||
Inconsequential
|
||||
Incredible
|
||||
Indelible
|
||||
Indexing
|
||||
Inexperienced
|
||||
Infamous
|
||||
Infantile
|
||||
Infinite
|
||||
Innovative
|
||||
Insecure
|
||||
Insidious
|
||||
Insignificant
|
||||
Instructive
|
||||
Insubstantial
|
||||
Integrated
|
||||
Intelligent
|
||||
Interactive
|
||||
International
|
||||
Intrepid
|
||||
Intuitive
|
||||
Inverse
|
||||
Ironclad
|
||||
Irritating
|
||||
Itchy
|
||||
Jaded
|
||||
Jagged
|
||||
Jam-packed
|
||||
Jaunty
|
||||
Jealous
|
||||
Jittery
|
||||
Joint
|
||||
Jovial
|
||||
Joyous
|
||||
Juicy
|
||||
Jumbo
|
||||
Juvenile
|
||||
Keen
|
||||
Key
|
||||
Killer
|
||||
Kind
|
||||
Kindly
|
||||
Klutzy
|
||||
Knobby
|
||||
Knotty
|
||||
Known
|
||||
Kooky
|
||||
Large
|
||||
Lawful
|
||||
Lazy
|
||||
Leading-edge
|
||||
Lean
|
||||
Left
|
||||
Licensed
|
||||
Light
|
||||
Lighthearted
|
||||
Likable
|
||||
Likely
|
||||
Limited
|
||||
Little
|
||||
Lively
|
||||
Loathsome
|
||||
Lone
|
||||
Lonely
|
||||
Long
|
||||
Long-term
|
||||
Lost
|
||||
Lovely
|
||||
Lucky
|
||||
Lustrous
|
||||
Luxurious
|
||||
Made-up
|
||||
Magnetic
|
||||
Majestic
|
||||
Major
|
||||
Male
|
||||
Managed
|
||||
Mandatory
|
||||
Marvelous
|
||||
Massive
|
||||
Mature
|
||||
Meager
|
||||
Mealy
|
||||
Mean
|
||||
Mediocre
|
||||
Medium
|
||||
Meek
|
||||
Mellow
|
||||
Melodic
|
||||
Menacing
|
||||
Merry
|
||||
Mindless
|
||||
Miniature
|
||||
Minty
|
||||
Miserable
|
||||
Miserly
|
||||
Mission-critical
|
||||
Misty
|
||||
Mobile
|
||||
Modern
|
||||
Modest
|
||||
Moist
|
||||
Monitored
|
||||
Moral
|
||||
Mortified
|
||||
Motionless
|
||||
Mountainous
|
||||
Muddy
|
||||
Multi-byte
|
||||
Multi-channelled
|
||||
Multi-cultural
|
||||
Multi-lateral
|
||||
Multi-layered
|
||||
Multi-tiered
|
||||
Multicolored
|
||||
Murky
|
||||
Mushy
|
||||
Natural
|
||||
Naughty
|
||||
Nautical
|
||||
Navigating
|
||||
Needy
|
||||
Neglected
|
||||
Negligible
|
||||
Nervous
|
||||
Networked
|
||||
Neural
|
||||
Next
|
||||
Next-generation
|
||||
Nifty
|
||||
Nocturnal
|
||||
Nonstop
|
||||
Normal
|
||||
Notable
|
||||
Noted
|
||||
Numb
|
||||
Nutty
|
||||
Obedient
|
||||
Object-based
|
||||
Obvious
|
||||
Oddball
|
||||
Offensive
|
||||
Official
|
||||
Old
|
||||
One-to-one
|
||||
Online
|
||||
Open-architected
|
||||
Open-source
|
||||
Operative
|
||||
Optical
|
||||
Optimistic
|
||||
Optimized
|
||||
Optional
|
||||
Opulent
|
||||
Orange
|
||||
Ordinary
|
||||
Organic
|
||||
Organized
|
||||
Oriental
|
||||
Ornate
|
||||
Ornery
|
||||
Out-of-the-box
|
||||
Outgoing
|
||||
Outlandish
|
||||
Outrageous
|
||||
Oval
|
||||
Overjoyed
|
||||
Overlooked
|
||||
Overriding
|
||||
Paltry
|
||||
Parched
|
||||
Parsing
|
||||
Part-time
|
||||
Partial
|
||||
Passionate
|
||||
Peaceful
|
||||
Peppery
|
||||
Periodic
|
||||
Persevering
|
||||
Persistent
|
||||
Personal
|
||||
Pertinent
|
||||
Pessimistic
|
||||
Petty
|
||||
Phased
|
||||
Phony
|
||||
Pink
|
||||
Pitiful
|
||||
Plain
|
||||
Plaintive
|
||||
Pleased
|
||||
Pleasing
|
||||
Plug-and-play
|
||||
Plump
|
||||
Polarised
|
||||
Polished
|
||||
Poor
|
||||
Portly
|
||||
Posh
|
||||
Practical
|
||||
Pre-emptive
|
||||
Precious
|
||||
Pretty
|
||||
Previous
|
||||
Pricey
|
||||
Primary
|
||||
Prime
|
||||
Pristine
|
||||
Private
|
||||
Prize
|
||||
Proactive
|
||||
Probable
|
||||
Profit-focused
|
||||
Profitable
|
||||
Profound
|
||||
Programmable
|
||||
Programming
|
||||
Progressive
|
||||
Proud
|
||||
Prudent
|
||||
Public-key
|
||||
Pungent
|
||||
Puny
|
||||
Pushy
|
||||
Putrid
|
||||
Puzzled
|
||||
Puzzling
|
||||
Quaint
|
||||
Qualified
|
||||
Quality-focused
|
||||
Quantifying
|
||||
Quarrelsome
|
||||
Quarterly
|
||||
Queasy
|
||||
Questionable
|
||||
Quick-witted
|
||||
Quiet
|
||||
Quintessential
|
||||
Quirky
|
||||
Quixotic
|
||||
Ragged
|
||||
Rapid
|
||||
Re-contextualized
|
||||
Re-engineered
|
||||
Reactive
|
||||
Ready
|
||||
Real-time
|
||||
Realigned
|
||||
Reckless
|
||||
Rectangular
|
||||
Recycled
|
||||
Red
|
||||
Reduced
|
||||
Redundant
|
||||
Refined
|
||||
Regal
|
||||
Remarkable
|
||||
Remote
|
||||
Repulsive
|
||||
Required
|
||||
Responsible
|
||||
Reverse-engineered
|
||||
Revolutionary
|
||||
Revolving
|
||||
Rich
|
||||
Right
|
||||
Right-sized
|
||||
Rigid
|
||||
Ripe
|
||||
Roasted
|
||||
Robust
|
||||
Rotten
|
||||
Rough
|
||||
Rowdy
|
||||
Royal
|
||||
Ruddy
|
||||
Rural
|
||||
Rustic
|
||||
Rusty
|
||||
Sarcastic
|
||||
Scalable
|
||||
Scared
|
||||
Scary
|
||||
Scented
|
||||
Scheming
|
||||
Scornful
|
||||
Scratchy
|
||||
Scrawny
|
||||
Seamless
|
||||
Second
|
||||
Secret
|
||||
Secured
|
||||
Self-enabling
|
||||
Self-reliant
|
||||
Selfish
|
||||
Sentimental
|
||||
Separate
|
||||
Serpentine
|
||||
Sexy
|
||||
Shadowy
|
||||
Shady
|
||||
Shallow
|
||||
Sharable
|
||||
Shimmering
|
||||
Shiny
|
||||
Shocking
|
||||
Showy
|
||||
Shrill
|
||||
Similar
|
||||
Sizzling
|
||||
Sleek
|
||||
Sleepy
|
||||
Slim
|
||||
Slimy
|
||||
Slow
|
||||
Slushy
|
||||
Small
|
||||
Smart
|
||||
Smoggy
|
||||
Smooth
|
||||
Smug
|
||||
Snappy
|
||||
Sniveling
|
||||
Snoopy
|
||||
Soft
|
||||
Solid State
|
||||
Some
|
||||
Sophisticated
|
||||
Sorrowful
|
||||
Soulful
|
||||
Soupy
|
||||
Speedy
|
||||
Spiffy
|
||||
Splendid
|
||||
Spotless
|
||||
Spry
|
||||
Square
|
||||
Squeaky
|
||||
Stable
|
||||
Stand-alone
|
||||
Standard
|
||||
Starchy
|
||||
Stark
|
||||
Steep
|
||||
Sticky
|
||||
Stiff
|
||||
Strategic
|
||||
Streamlined
|
||||
Strident
|
||||
Striking
|
||||
Striped
|
||||
Stupendous
|
||||
Subdued
|
||||
Submissive
|
||||
Suburban
|
||||
Sudden
|
||||
Sugary
|
||||
Sunny
|
||||
Super
|
||||
Superior
|
||||
Suspicious
|
||||
Sweaty
|
||||
Sweet
|
||||
Sweltering
|
||||
Swift
|
||||
Switchable
|
||||
Synchronised
|
||||
Synergistic
|
||||
Synergized
|
||||
Synthesized
|
||||
Synthesizing
|
||||
Tall
|
||||
Tan
|
||||
Tangible
|
||||
Tart
|
||||
Tasty
|
||||
Taut
|
||||
Team-oriented
|
||||
Tedious
|
||||
Teeming
|
||||
Tender
|
||||
Terrible
|
||||
Testy
|
||||
Thankful
|
||||
Thin
|
||||
Third
|
||||
Thorny
|
||||
Threadbare
|
||||
Tiny
|
||||
Tired
|
||||
Total
|
||||
Tough
|
||||
Trained
|
||||
Transmitting
|
||||
Transparent
|
||||
Treasured
|
||||
Tremendous
|
||||
Triangular
|
||||
Trifling
|
||||
Triple-buffered
|
||||
Trivial
|
||||
Trustworthy
|
||||
Trusty
|
||||
Truthful
|
||||
Turn-key
|
||||
Twin
|
||||
Ubiquitous
|
||||
Unacceptable
|
||||
Unaware
|
||||
Unbranded
|
||||
Uncomfortable
|
||||
Uncommon
|
||||
Unconscious
|
||||
Understated
|
||||
Uneven
|
||||
Uniform
|
||||
Unique
|
||||
United
|
||||
Universal
|
||||
Unknown
|
||||
Unlawful
|
||||
Unlined
|
||||
Unlucky
|
||||
Unrealistic
|
||||
Unruly
|
||||
Unselfish
|
||||
Unsteady
|
||||
Untimely
|
||||
Untried
|
||||
Untrue
|
||||
Unusual
|
||||
Unwieldy
|
||||
Unwilling
|
||||
Up-sized
|
||||
Upgradable
|
||||
Upright
|
||||
Upset
|
||||
Useful
|
||||
User-centric
|
||||
User-friendly
|
||||
Utter
|
||||
Valid
|
||||
Valuable
|
||||
Value-added
|
||||
Variable
|
||||
Vast
|
||||
Venerated
|
||||
Vengeful
|
||||
Versatile
|
||||
Vertical
|
||||
Victorious
|
||||
Vigorous
|
||||
Viral
|
||||
Virtual
|
||||
Vision-oriented
|
||||
Visionary
|
||||
Vivacious
|
||||
Vivid
|
||||
Voluminous
|
||||
Wan
|
||||
Warm
|
||||
Warmhearted
|
||||
Wasteful
|
||||
Watchful
|
||||
Waterlogged
|
||||
Wavy
|
||||
Weak
|
||||
Wealthy
|
||||
Web-enabled
|
||||
Webbed
|
||||
Wee
|
||||
Weekends-only
|
||||
Weekly
|
||||
Weird
|
||||
Welcome
|
||||
Well-documented
|
||||
Well-groomed
|
||||
Well-lit
|
||||
Well-made
|
||||
Whimsical
|
||||
Whole
|
||||
Wide
|
||||
Wiggly
|
||||
Wild
|
||||
Willing
|
||||
Wilted
|
||||
Winged
|
||||
Wireless
|
||||
Wiry
|
||||
Witty
|
||||
Wobbly
|
||||
Woeful
|
||||
Woozy
|
||||
World-class
|
||||
Worried
|
||||
Worthless
|
||||
Wrathful
|
||||
Wretched
|
||||
Wrong
|
||||
Wry
|
||||
Young
|
||||
Youthful
|
||||
Zany
|
||||
Zealous
|
||||
Zesty
|
2854
data/last.txt
Normal file
2854
data/last.txt
Normal file
File diff suppressed because it is too large
Load diff
|
@ -8,6 +8,7 @@ use axum::{
|
|||
};
|
||||
use futures::{SinkExt, StreamExt};
|
||||
use lib::models::*;
|
||||
use rand::seq::SliceRandom;
|
||||
use serde_json::to_string;
|
||||
use std::{net::SocketAddr, sync::Arc};
|
||||
|
||||
|
@ -30,7 +31,11 @@ fn server_sum_update(state: &Arc<AppState>) -> ServerStateSummary {
|
|||
pub async fn on_websocket_connection(stream: WebSocket, state: Arc<AppState>, addr: SocketAddr) {
|
||||
// Add User to users
|
||||
let new_user = User {
|
||||
name: "Anonymous".to_string(),
|
||||
name: format!(
|
||||
"{} {}",
|
||||
state.first_names.choose(&mut rand::thread_rng()).unwrap(),
|
||||
state.last_names.choose(&mut rand::thread_rng()).unwrap(),
|
||||
),
|
||||
};
|
||||
|
||||
// By splitting, we can send and receive at the same time.
|
||||
|
@ -58,7 +63,6 @@ pub async fn on_websocket_connection(stream: WebSocket, state: Arc<AppState>, ad
|
|||
))
|
||||
.await;
|
||||
|
||||
|
||||
// ANNOUNCE THY PRESENCE
|
||||
let msg = ChatMessage {
|
||||
text: format!(
|
||||
|
|
|
@ -4,7 +4,8 @@ use axum_extra::response::Css;
|
|||
use lib::models::*;
|
||||
use std::{
|
||||
collections::HashMap,
|
||||
fs,
|
||||
fs::{read_to_string, File},
|
||||
io::{BufRead, BufReader},
|
||||
net::SocketAddr,
|
||||
sync::{Arc, Mutex},
|
||||
};
|
||||
|
@ -17,13 +18,26 @@ use crate::api::*;
|
|||
/// Parse json for card data
|
||||
fn load_json(path: &str) -> Result<Vec<CardSet>> {
|
||||
let data: String =
|
||||
fs::read_to_string(path).with_context(|| format!("Invalid JSON path: \"{}\"", path))?;
|
||||
read_to_string(path).with_context(|| format!("Invalid JSON path: \"{}\"", path))?;
|
||||
let jayson: Vec<CardSet> =
|
||||
serde_json::from_str(&data).with_context(|| format!("\"{path}\" is invalid json"))?;
|
||||
|
||||
Ok(jayson)
|
||||
}
|
||||
|
||||
fn load_names(path: &str) -> Vec<String> {
|
||||
let f = File::open(path).unwrap();
|
||||
let f = BufReader::new(f);
|
||||
|
||||
let mut buf = vec![];
|
||||
|
||||
for line in f.lines() {
|
||||
buf.push(line.unwrap())
|
||||
}
|
||||
|
||||
return buf;
|
||||
}
|
||||
|
||||
// this is still around just for reference
|
||||
#[allow(dead_code)]
|
||||
fn test() -> Result<()> {
|
||||
|
@ -86,6 +100,8 @@ pub struct AppState {
|
|||
// all_cards: Mutex<Vec<CardSet>>,
|
||||
// Games list
|
||||
games: Mutex<Vec<Game>>,
|
||||
first_names: Vec<String>,
|
||||
last_names: Vec<String>,
|
||||
}
|
||||
|
||||
// Include utf-8 files at **compile** time.
|
||||
|
@ -120,11 +136,15 @@ async fn main() -> Result<()> {
|
|||
let users = Mutex::new(HashMap::<SocketAddr, User>::new());
|
||||
// let all_cards = Mutex::new(load_json(cards_input_path)?);
|
||||
let games = Mutex::new(vec![]);
|
||||
let first_names = load_names("data/first.txt");
|
||||
let last_names = load_names("data/last.txt");
|
||||
let app_state = Arc::new(AppState {
|
||||
users,
|
||||
tx,
|
||||
// all_cards,
|
||||
games,
|
||||
first_names,
|
||||
last_names,
|
||||
});
|
||||
|
||||
// set routes and apply state
|
||||
|
|
Loading…
Add table
Reference in a new issue