empty equip
This commit is contained in:
parent
2c532aa7d1
commit
246489c342
@ -26,6 +26,7 @@
|
||||
|
||||
.opponent {
|
||||
grid-area: opponent;
|
||||
transform: perspective(23rem);
|
||||
}
|
||||
|
||||
.opponent .combat-text {
|
||||
@ -294,8 +295,18 @@ CRYP DAMAGE
|
||||
position: relative;
|
||||
height: 100%;
|
||||
min-width: 200px;
|
||||
/*animation: rotate 1s infinite ease-in-out alternate;*/
|
||||
}
|
||||
|
||||
/*@keyframes rotate {
|
||||
0% {
|
||||
transform: rotateY(0deg);
|
||||
}
|
||||
100% {
|
||||
transform: rotateY(50deg);
|
||||
}
|
||||
}
|
||||
*/
|
||||
.resolving .skills button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -108,6 +108,9 @@ function Equipment(props) {
|
||||
} return false;
|
||||
});
|
||||
|
||||
if (skills.every(s => !s)) skills.push(<button disabled={true}> </button>);
|
||||
if (specs.every(s => !s)) specs.push(<figure key={0}> </figure>);
|
||||
|
||||
return (
|
||||
<div className="equip" >
|
||||
<div className={skillClass} onClick={e => unequipClick(e)} onMouseOver={e => hoverInfo(e, 'equipSkills')} >
|
||||
|
||||
@ -9,8 +9,6 @@ use serde_cbor::{to_vec};
|
||||
use std::env;
|
||||
use std::thread::{spawn, sleep};
|
||||
use std::time::{Instant, Duration};
|
||||
use std::any::Any;
|
||||
use std::panic;
|
||||
|
||||
use r2d2::{Pool};
|
||||
use r2d2::{PooledConnection};
|
||||
@ -35,8 +33,8 @@ struct RpcErrorResponse {
|
||||
err: String
|
||||
}
|
||||
|
||||
fn receive(db: Db, rpc: &Rpc, msg: Message, client: &mut WebSocket<TcpStream>) -> Result<String, Error> {
|
||||
match rpc.receive(msg, &db, client) {
|
||||
fn receive(db: Db, begin: Instant, rpc: &Rpc, msg: Message, client: &mut WebSocket<TcpStream>) -> Result<String, Error> {
|
||||
match rpc.receive(msg, begin, &db, client) {
|
||||
Ok(reply) => {
|
||||
let response = to_vec(&reply)
|
||||
.expect("failed to serialize response");
|
||||
@ -62,18 +60,18 @@ pub fn db_connection(url: String) -> Pool<PostgresConnectionManager> {
|
||||
.expect("Failed to create pool.")
|
||||
}
|
||||
|
||||
fn print_panic_payload(ctx: &str, payload: &(Any + Send + 'static)) {
|
||||
let d = format!("{:?}", payload);
|
||||
let s = if let Some(s) = payload.downcast_ref::<String>() {
|
||||
&s
|
||||
} else if let Some(s) = payload.downcast_ref::<&str>() {
|
||||
s
|
||||
} else {
|
||||
// "PAYLOAD IS NOT A STRING"
|
||||
d.as_str()
|
||||
};
|
||||
info!("{}: PANIC OCCURRED: {}", ctx, s);
|
||||
}
|
||||
// fn print_panic_payload(ctx: &str, payload: &(Any + Send + 'static)) {
|
||||
// let d = format!("{:?}", payload);
|
||||
// let s = if let Some(s) = payload.downcast_ref::<String>() {
|
||||
// &s
|
||||
// } else if let Some(s) = payload.downcast_ref::<&str>() {
|
||||
// s
|
||||
// } else {
|
||||
// // "PAYLOAD IS NOT A STRING"
|
||||
// d.as_str()
|
||||
// };
|
||||
// info!("{}: PANIC OCCURRED: {}", ctx, s);
|
||||
// }
|
||||
|
||||
pub fn start() {
|
||||
// panic::set_hook(Box::new(|panic_info| {
|
||||
@ -120,13 +118,8 @@ pub fn start() {
|
||||
Ok(msg) => {
|
||||
let begin = Instant::now();
|
||||
let db_connection = db.get().expect("unable to get db connection");
|
||||
match receive(db_connection, &rpc, msg, &mut websocket) {
|
||||
Ok(method) => {
|
||||
match method.as_ref() {
|
||||
"pong" => (),
|
||||
_ => info!("response sent. total duration: {:?}", begin.elapsed()),
|
||||
}
|
||||
},
|
||||
match receive(db_connection, begin, &rpc, msg, &mut websocket) {
|
||||
Ok(_) => (),
|
||||
Err(e) => warn!("{:?}", e),
|
||||
}
|
||||
},
|
||||
|
||||
@ -6,6 +6,7 @@ use std::net::{TcpStream};
|
||||
|
||||
// demo
|
||||
use std::iter;
|
||||
use std::time::Instant;
|
||||
use rand::{thread_rng, Rng};
|
||||
use rand::distributions::{Alphanumeric};
|
||||
|
||||
@ -28,7 +29,7 @@ use item::{Item, ItemInfoCtr, item_info};
|
||||
pub struct Rpc;
|
||||
|
||||
impl Rpc {
|
||||
pub fn receive(&self, msg: Message, db: &Db, client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
pub fn receive(&self, msg: Message, begin: Instant, db: &Db, client: &mut WebSocket<TcpStream>) -> Result<RpcResponse, Error> {
|
||||
// consume the ws data into bytes
|
||||
let data = msg.into_data();
|
||||
|
||||
@ -51,8 +52,6 @@ impl Rpc {
|
||||
None => "none".to_string(),
|
||||
};
|
||||
|
||||
info!("method={:?} account={:?}", v.method, account_name);
|
||||
|
||||
// check the method
|
||||
// if no auth required
|
||||
match v.method.as_ref() {
|
||||
@ -104,6 +103,8 @@ impl Rpc {
|
||||
|
||||
tx.commit()?;
|
||||
|
||||
info!("method={:?} account={:?} duration={:?}", v.method, account_name, begin.elapsed());
|
||||
|
||||
return response;
|
||||
},
|
||||
Err(e) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user