Clean up constants.

This commit is contained in:
Sean Bowe 2016-09-20 13:39:52 -06:00
parent 82b4aaa915
commit 46c9a5e436
No known key found for this signature in database
GPG Key ID: 95684257D8F8B031
3 changed files with 9 additions and 5 deletions

1
src/consts.rs Normal file
View File

@ -0,0 +1 @@
pub const NETWORK_MAGIC: [u8; 8] = [0xee, 0xee, 0x1f, 0xcc, 0x1c, 0xee, 0xcc, 0x19];

View File

@ -15,9 +15,12 @@ extern crate time;
extern crate ansi_term;
mod protocol;
use self::protocol::*;
mod consts;
use self::consts::*;
use snark::*;
use self::protocol::*;
use std::net::{TcpListener, TcpStream};
use std::io::{Read, Write};
use std::collections::HashMap;
@ -31,9 +34,8 @@ use bincode::rustc_serialize::{encode_into, decode_from};
use std::time::Duration;
const USE_DUMMY_CS: bool = true;
const LISTEN_ADDR: &'static str = "127.0.0.1:65530";
const NETWORK_MAGIC: [u8; 8] = [0xff, 0xff, 0x1f, 0xbb, 0x1c, 0xee, 0x00, 0x19];
const PLAYERS: usize = 2;
const LISTEN_ADDR: &'static str = "0.0.0.0:65530";
const PLAYERS: usize = 3;
pub const THREADS: usize = 8;
#[derive(Clone)]

View File

@ -11,6 +11,8 @@ extern crate bincode;
mod protocol;
use self::protocol::*;
mod consts;
use self::consts::*;
use rand::Rng;
use std::net::{TcpStream};
@ -22,7 +24,6 @@ use bincode::SizeLimit::Infinite;
use bincode::rustc_serialize::{encode_into, decode_from};
const COORDINATOR_ADDR: &'static str = "127.0.0.1:65530";
const NETWORK_MAGIC: [u8; 8] = [0xff, 0xff, 0x1f, 0xbb, 0x1c, 0xee, 0x00, 0x19];
pub const THREADS: usize = 8;
struct ConnectionHandler {