mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added client localhost connection
Former-commit-id: d4dec70ef3ecad8f40196b87b0f5c8b55c51c44a
This commit is contained in:
parent
dbbcc1e80e
commit
2fffe21bc7
@ -46,7 +46,7 @@ impl PlayState for TitleState {
|
||||
Event::Close => return PlayStateResult::Shutdown,
|
||||
// When space is pressed, start a session
|
||||
Event::Char(' ') => return PlayStateResult::Push(
|
||||
Box::new(SessionState::new(global_state.window.renderer_mut())),
|
||||
Box::new(SessionState::new(global_state.window.renderer_mut()).unwrap()), // TODO: Handle this error
|
||||
),
|
||||
// Ignore all other events
|
||||
_ => {},
|
||||
|
@ -11,15 +11,12 @@ use gfx::{
|
||||
};
|
||||
|
||||
// Local
|
||||
use super::{
|
||||
Globals,
|
||||
super::{
|
||||
Pipeline,
|
||||
TgtColorFmt,
|
||||
TgtDepthFmt,
|
||||
Mesh,
|
||||
Quad,
|
||||
},
|
||||
use super::super::{
|
||||
Pipeline,
|
||||
TgtColorFmt,
|
||||
TgtDepthFmt,
|
||||
Mesh,
|
||||
Quad,
|
||||
};
|
||||
|
||||
gfx_defines! {
|
||||
|
@ -4,7 +4,7 @@ use std::marker::PhantomData;
|
||||
// Library
|
||||
use gfx::{
|
||||
self,
|
||||
traits::{Factory, FactoryExt},
|
||||
traits::Factory,
|
||||
};
|
||||
use image::{
|
||||
DynamicImage,
|
||||
@ -14,7 +14,6 @@ use image::{
|
||||
// Local
|
||||
use super::{
|
||||
RenderError,
|
||||
mesh::Mesh,
|
||||
Pipeline,
|
||||
gfx_backend,
|
||||
};
|
||||
|
@ -34,14 +34,14 @@ pub struct SessionState {
|
||||
/// Represents an active game session (i.e: one that is being played)
|
||||
impl SessionState {
|
||||
/// Create a new `SessionState`
|
||||
pub fn new(renderer: &mut Renderer) -> Self {
|
||||
let client = Client::new().with_test_state(); // <--- TODO: Remove this
|
||||
Self {
|
||||
pub fn new(renderer: &mut Renderer) -> Result<Self, Error> {
|
||||
let client = Client::new(([127, 0, 0, 1], 59003))?.with_test_state(); // <--- TODO: Remove this
|
||||
Ok(Self {
|
||||
// Create a scene for this session. The scene handles visible elements of the game world
|
||||
scene: Scene::new(renderer, &client),
|
||||
client,
|
||||
key_state: KeyState::new(),
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,5 @@
|
||||
// Standard
|
||||
use std::{
|
||||
rc::Rc,
|
||||
cell::RefCell,
|
||||
};
|
||||
use std::rc::Rc;
|
||||
|
||||
// Library
|
||||
use image::DynamicImage;
|
||||
|
Loading…
Reference in New Issue
Block a user