mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
accessories tab
Former-commit-id: 542362e98e908c9ec7c563d7fdcd43c4b8f922fd
This commit is contained in:
parent
93897f904a
commit
60df735e3b
12
README.md
12
README.md
@ -1,13 +1,3 @@
|
|||||||
# Fresh
|
# Fresh
|
||||||
|
|
||||||
An experiment
|
An experiment
|
||||||
|
|
||||||
## Compile
|
|
||||||
|
|
||||||
```
|
|
||||||
git clone https://gitlab.com/veloren/fresh.git
|
|
||||||
cd fresh
|
|
||||||
git submodule update --init --recursive
|
|
||||||
rustup default nightly
|
|
||||||
cargo build
|
|
||||||
```
|
|
78
common/src/net/test.rs
Normal file
78
common/src/net/test.rs
Normal 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),
|
||||||
|
}
|
||||||
|
}
|
@ -73,7 +73,7 @@ impl Chat {
|
|||||||
.restrict_to_height(false)
|
.restrict_to_height(false)
|
||||||
.font_size(14)
|
.font_size(14)
|
||||||
.font_id(font)
|
.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 (
|
let dims = match (
|
||||||
text_edit.get_x_dimension(ui_widgets),
|
text_edit.get_x_dimension(ui_widgets),
|
||||||
text_edit.get_y_dimension(ui_widgets),
|
text_edit.get_y_dimension(ui_widgets),
|
||||||
|
File diff suppressed because it is too large
Load Diff
BIN
voxygen/test_assets/font/Whitney-Book.ttf
Normal file
BIN
voxygen/test_assets/font/Whitney-Book.ttf
Normal file
Binary file not shown.
@ -0,0 +1,5 @@
|
|||||||
|
[.ShellClassInfo]
|
||||||
|
InfoTip=Dieser Ordner wird online freigegeben.
|
||||||
|
IconFile=C:\Program Files\Google\Drive\googledrivesync.exe
|
||||||
|
IconIndex=16
|
||||||
|
|
BIN
voxygen/test_assets/ui/char_selection/gender_bg.png
Normal file
BIN
voxygen/test_assets/ui/char_selection/gender_bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 274 B |
BIN
voxygen/test_assets/ui/char_selection/races_bg.png
Normal file
BIN
voxygen/test_assets/ui/char_selection/races_bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 362 B |
1
voxygen/test_assets/ui/char_selection/text/.gitattributes
vendored
Normal file
1
voxygen/test_assets/ui/char_selection/text/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
1
voxygen/test_assets/ui/char_selection/text/White/.gitattributes
vendored
Normal file
1
voxygen/test_assets/ui/char_selection/text/White/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
BIN
voxygen/test_assets/ui/char_selection/text/White/login.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/White/login.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/White/quit.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/White/quit.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/White/server_address.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/White/server_address.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/White/servers.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/White/servers.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/White/settings.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/White/settings.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/White/username.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/White/username.png
(Stored with Git LFS)
Normal file
Binary file not shown.
1
voxygen/test_assets/ui/char_selection/text/Yellow/.gitattributes
vendored
Normal file
1
voxygen/test_assets/ui/char_selection/text/Yellow/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/a01.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/a01.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/login.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/login.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/quit.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/quit.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/server_address.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/server_address.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/servers.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/servers.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/settings.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/settings.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/username.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/Yellow/username.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/a01.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/a01.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/login.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/login.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/quit.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/quit.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/server_address.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/server_address.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/servers.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/servers.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/settings.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/settings.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/singleplayer.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/singleplayer.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/text/username.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/char_selection/text/username.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/char_selection/weapons_bg.png
Normal file
BIN
voxygen/test_assets/ui/char_selection/weapons_bg.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 390 B |
1
voxygen/test_assets/ui/hud/buttons/.gitattributes
vendored
Normal file
1
voxygen/test_assets/ui/hud/buttons/.gitattributes
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_down.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_down.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_down_mo.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_down_mo.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_down_press.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_down_press.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_tobot.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_tobot.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_tobot_mo.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_tobot_mo.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_tobot_press.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_tobot_press.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_up.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_up.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_up_mo.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_up_mo.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_up_press.png
(Stored with Git LFS)
Normal file
BIN
voxygen/test_assets/ui/hud/buttons/chat_arrow_up_press.png
(Stored with Git LFS)
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user