accessories tab

Former-commit-id: 542362e98e908c9ec7c563d7fdcd43c4b8f922fd
This commit is contained in:
Pfauenauge90 2019-03-28 18:25:00 +01:00 committed by Imbris
parent 330053c778
commit f8dc8976c1
43 changed files with 836 additions and 229 deletions

View File

@ -1,13 +1,3 @@
# Fresh
An experiment
## Compile
```
git clone https://gitlab.com/veloren/fresh.git
cd fresh
git submodule update --init --recursive
rustup default nightly
cargo build
```
An experiment

78
common/src/net/test.rs Normal file
View File

@ -0,0 +1,78 @@
use std::{
io::Write,
str::FromStr,
net::SocketAddr,
thread,
time::Duration,
};
use mio::{net::TcpStream, Events, Poll, PollOpt, Ready, Token};
use super::{error::PostError, PostBox, PostOffice};
fn new_local_addr(n: u16) -> SocketAddr {
SocketAddr::from(([127, 0, 0, 1], 12345 + n))
}
#[test]
fn basic_run() {
let srv_addr = new_local_addr(0);
let mut server: PostOffice<String, String> = PostOffice::new(srv_addr).unwrap();
let mut client: PostBox<String, String> = PostBox::to_server(srv_addr).unwrap();
std::thread::sleep(std::time::Duration::from_millis(10));
let mut scon = server.new_connections().next().unwrap();
std::thread::sleep(std::time::Duration::from_millis(10));
scon.send(String::from("foo")).unwrap();
client.send(String::from("bar")).unwrap();
std::thread::sleep(std::time::Duration::from_millis(10));
assert_eq!("foo", client.new_messages().next().unwrap());
assert_eq!("bar", scon.new_messages().next().unwrap());
}
#[test]
fn huge_size_header() {
let srv_addr = new_local_addr(1);
let mut server: PostOffice<String, String> = PostOffice::new(srv_addr).unwrap();
let mut client = TcpStream::connect(&srv_addr).unwrap();
std::thread::sleep(std::time::Duration::from_millis(10));
let mut scon = server.new_connections().next().unwrap();
std::thread::sleep(std::time::Duration::from_millis(10));
client.write(&[0xffu8; 64]).unwrap();
std::thread::sleep(std::time::Duration::from_millis(10));
assert_eq!(scon.new_messages().next(), None);
}
#[test]
fn disconnect() {
let srv_addr = new_local_addr(2);
let mut server = PostOffice::<_, String>::new(srv_addr)
.unwrap();
// Create then close client
{
PostBox::<String, String>::to_server(srv_addr).unwrap();
}
std::thread::sleep(std::time::Duration::from_millis(10));
let mut to_client = server
.new_connections()
.next()
.unwrap();
to_client.send(String::from("foo")).unwrap();
thread::sleep(Duration::from_millis(10));
match to_client.new_messages().next() {
None => {},
_ => panic!("Unexpected message!"),
}
match to_client.status() {
Some(PostError::Disconnected) => {},
s => panic!("Did not expect {:?}", s),
}
}

View File

@ -73,7 +73,7 @@ impl Chat {
.restrict_to_height(false)
.font_size(14)
.font_id(font)
.bottom_left_with_margins_on(ui_widgets.window, 10.0, 30.0);
.bottom_left_with_margins_on(ui_widgets.window, 10.0, 10.0);
let dims = match (
text_edit.get_x_dimension(ui_widgets),
text_edit.get_y_dimension(ui_widgets),

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -0,0 +1,5 @@
[.ShellClassInfo]
InfoTip=Dieser Ordner wird online freigegeben.
IconFile=C:\Program Files\Google\Drive\googledrivesync.exe
IconIndex=16

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

View File

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

View File

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

View File

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 390 B

View File

@ -0,0 +1 @@
*.png filter=lfs diff=lfs merge=lfs -text

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 976 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 873 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1014 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 948 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 944 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 990 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 824 B