Commit Graph

484 Commits

Author SHA1 Message Date
Avi Weinstock
78014d7d3b Put material stats in their own manifest, and multiply a form's stats by the weighted average of the material multipliers. 2021-02-23 15:49:34 -05:00
Marcel Märtens
e3ef4422b6 cleanup ClientConnArgs 2021-02-22 21:07:20 +01:00
Marcel Märtens
3f5c64bec0 Client::new can now resolve DNS requests, better networking error messages 2021-02-22 17:35:19 +01:00
Marcel Märtens
514d5db038 Update Network Protocol
- now last digit version is compatible 0.6.0 will connect to 0.6.1
 - the TCP DATA Frames no longer contain START field, as it's not needed
 - the TCP OPENSTREAM Frames will now contain the BANDWIDTH field
 - MID is not Protocol internal

Update network
 - update API with Bandwidth

Update veloren
 - introduce better runtime and `async` things that are IO bound.
 - Remove `uvth` and instead use `tokio::runtime::Runtime::spawn_blocking`
 - remove futures_execute from client and server use tokio::runtime::Runtime instead
 - give threads a Name
2021-02-22 17:34:55 +01:00
Sam
d5ccc33abc Factored out duplicate code into closures, consolidated ability handling logic to a single function. 2021-02-19 18:45:48 -05:00
Marcel Märtens
03af9937cf Stabelize Network again:
- completly switch to Bytes, even in api. speed up TCP by fak 2
 - improve benchmarks
 - speed up mpsc metrics
 - gracefully handle shutdown by interpreting Ok(0) as tokio::tcpstream closed now.
 - fix hotloop in participants by adding `Some(n)` to fix endless handing.
 - fix closing bug by closing streams after `recv_mgr` is shutdown even if now shutdown is triggered locally.
 - fix prometheus
 - no longer throw when a `Stream` is dropped while participant still receives a msg for it.
 - fix the bandwith handling, TCP network send speed is up to 1.5GiB/s while recv is 150MiB/s
 - add documentation
 - tmp require rt-multi-threaded in client for tokio, to not fail cargo check

this is prob stable, i tested over 1 hour.
after that some optimisations in priomgr.
and impl. propper bandwith.
Speed is up to 2GB/s write and 150MB/s recv on a single core

sync add documentation
2021-02-17 19:37:48 +01:00
Marcel Märtens
ea8ab1ce7a Great improvements to the codebase:
- better logging in network
 - we now notify the send of what happened in recv in participant.
 - works with veloren master servers
 - works in singleplayer, using a actual mid.
 - add `mpsc` in whole stack incl tests
 - speed up internal read/write with `Bytes` crate
 - use `prometheus-hyper` for metrics
 - use a metrics cache
2021-02-17 16:15:00 +01:00
Marcel Märtens
9884019963 COMPLETE REDESIGN of network crate
- Implementing a async non-io protocol crate
    a) no tokio / no channels
    b) I/O is based on abstraction Sink/Drain
    c) different Protocols can have a different Drain Type
       This allow MPSC to send its content without splitting up messages at all!
       It allows UDP to have internal extra frames to care for security
       It allows better abstraction for tests
       Allows benchmarks on the mpsc variant
       Custom Handshakes to allow sth like Quic protocol easily
 - reduce the participant managers to 4: channel creations, send, recv and shutdown.
   keeping the `mut data` in one manager removes the need for all RwLocks.
   reducing complexity and parallel access problems
 - more strategic participant shutdown. first send. then wait for remote side to notice recv stop, then remote side will stop send, then local side can stop recv.
 - metrics are internally abstracted to fit protocol and network layer
 - in this commit network/protocol tests work and network tests work someway, veloren compiles but does not work
 - handshake compatible to async_std
2021-02-17 12:39:47 +01:00
Marcel Märtens
5aa1940ef8 get rid of async_std::channel
switch to `tokio` and `async_channel` crate.
I wanted to do tokio first, but it doesnt feature Sender::close(), thus i included async_channel
Got rid of `futures` and only need `futures_core` and `futures_util`.

Tokio does not support `Stream` and `StreamExt` so for now i need to use `tokio-stream`, i think this will go in `std` in the future

Created `b2b_close_stream_opened_sender_r` as the shutdown procedure does not need a copy of a Sender, it just need to stop it.

Various adjustments, e.g. for `select!` which now requieres a `&mut` for oneshots.

Future things to do:
 - Use some better signalling than oneshot<()> in some cases.
 - Use a Watch for the Prio propergation (impl. it ofc)
 - Use Bounded Channels in order to improve performance
 - adjust tests coding

bring tests to work
2021-02-17 12:38:53 +01:00
Marcel Märtens
1b77b6dc41 Initial switch to tokio for network, minimum working example. 2021-02-17 12:37:59 +01:00
Caelan
dda4931f46 Clean and update dependencies
* Remove tweak feature
 * Remove const-tweaker
 * Update tiny_http
 * Update bitvec to 0.21.0
 * Downgrade euc to avoid conflict with vek 0.12.0
 * Require exactly vek 0.12.0
 * Update all other dependencies automatically based on these changes
 * Update gilrs to latest at the request of Ada Lovegirls
 * Update meshing benchmarks to new criterion API
2021-02-17 01:27:06 -08:00
TheThirdSpartan
f10f88081d Small chat message formatting changes and fixed missing player alias during admin entity possession 2021-02-17 02:15:45 +00:00
Avi Weinstock
c984035976 MR 1775 review fixes.
- Separate `invite` machinery from `group_manip` into it's own thing (includes renaming `group_invite` to `invite` where applicable).
- Move some invite/trade machinery to `ControlEvent`.
- Make `TradePhase` a proper enum instead of a bunch of bools.
- Make `TradeId` a proper newtype.
- Remove trades from `Trades` on accept (previously was only on decline).
- Typo fixes/misc cleanup.
- Add bullet point for trading to the changelog.
2021-02-14 11:13:56 -05:00
Avi Weinstock
232ddb0860 Polish trading implementation and address review comments.
- Fix item swapping edge case
- Document more assumptions/edge cases
- fmt and clippy
- s/ServerGeneral::GroupInvite/ServerGeneral::Invite/
- Use `Client::current` in `Client::is_dead`
2021-02-14 11:11:35 -05:00
Avi Weinstock
f6db8bb7c4 Implement actual inventory-manipulation part of trading server side. 2021-02-12 18:43:10 -05:00
Avi Weinstock
abb5684883 Trade implementation progress.
- Accept/decline buttons that submit the proper messages
- A phase2 screen that renders the (item, quantity) pairs as text
- More checks in the trade state machine server-side.
2021-02-12 18:43:10 -05:00
Avi Weinstock
e2b55e0706 Implement enough of a trade UI that dragging & dropping items into it round-trips between clients. 2021-02-12 18:43:09 -05:00
Avi Weinstock
aeb2398fc6 Trade implementation progress.
- Server messages now bring up the trade window.
- When a trade is declined, it closes the window on both clients.
2021-02-12 18:43:09 -05:00
Avi Weinstock
ae528124fc Trade implementation progress.
- State machine for modifying trades.
- ServerGeneral/ClientGeneral messages.
2021-02-12 18:43:09 -05:00
Avi Weinstock
e9b811b62b Plumb trade requests through the group invite UI, such that they can be accepted/declined without impacting the counterparty's movement. 2021-02-12 18:43:09 -05:00
Quellus
63952875d9 Rebase !1447 Chat input color and icon reflect channel message is sent to. 2021-02-10 19:42:59 +00:00
Sam
e033fe6bee Inventory manipulations are now only for input from the client, and are no longer directly sent as a server event. Slot manipulations do that instead. 2021-02-08 13:55:50 -05:00
Sam
1c83c5ee6f Loadout manipulations now emit a separate event from client instead of hackily intercepting inventory manipulations in common. 2021-02-08 12:31:17 -05:00
Sam
6a1e583d45 Eradicated clones 2021-02-08 12:01:48 -05:00
Sam
8eebcdfcd2 Inventory changes that modify the loadout now go through a control action instead of a control event. 2021-02-08 12:01:47 -05:00
James Melkonian
23b1df3cdd Add basic NPC interaction and fix NPC chat spamming 2021-01-31 20:29:50 +00:00
DaforLynx
c6e262c4ce Small audio fixes; addresses #939 and #940 2021-01-29 11:37:10 +00:00
Marcel Märtens
ff10373cbe add unittests for api compatibility for client::Client and common::Clock
this tests the broad api of veloren and FAILS in case the interface is changed. It contains a not that those functions are commonly used by 3rd parties
and thus they need to be notified
2021-01-23 21:06:47 +01:00
Monty Marz
de5c5702b3 stats display
Addressed comments.

Addressed comments.
2021-01-19 08:08:11 -05:00
Sam
c0c45a1996 Purged stats, including level and experience 2021-01-19 08:07:23 -05:00
Sam
48c98b11cf General combat skill tree.
UI for general skill tree
2021-01-19 08:07:20 -05:00
Sam
bde2bc1f77 UI for sword skill tree
Axe skill tree UI

Hammer skill tree UI

Bow skill tree UI

moar renders

Staff skill tree UI

Sceptre skill tree UI
2021-01-19 08:07:12 -05:00
Monty Marz
3f436079e8 Skill-Tree UI
switchable tabs
rework icons, fix cursor toggle
auto slot placing

Bow leap skill changed to bow glide skill.
2021-01-19 08:07:06 -05:00
Sam
0ccbdc3b8c Sceptre skill tree. 2021-01-19 08:07:03 -05:00
Sam
5c7705f874 Staff skill tree. 2021-01-19 08:07:03 -05:00
Sam
662a08defc Implemented bow skill tree. 2021-01-19 08:07:02 -05:00
Sam
4dfe14c103 Hammer skill tree complete. 2021-01-19 08:07:02 -05:00
Sam
72604e8a4e Axe skill tree functional. 2021-01-19 08:07:01 -05:00
Sam
cc60ca58be Added sword skill tree 2021-01-19 08:06:59 -05:00
Sam
fa073bceff Skills can now optionally have levels. Max level prevents adding skill of higher level. Support for skills having a prerequisite of a particular level. 2021-01-19 08:06:57 -05:00
Sam
5d474974b9 Skills can now have prerequisite skills. Skills can now cost different amounts of skill points. 2021-01-19 08:06:57 -05:00
Sam
cbfe064e4f You now gain skill points after a threshold of xp within a particular skill group.
Skills can now unlock skill groups. Temp method of using chat to unlock skills.
2021-01-19 08:06:52 -05:00
Sam
63eb71ed5b Exp is now awarded to specific skill groups. It's automatically split between a general pool and weapon pools based on if you have the weapon in your loadout and if you've unlocked the weapon pools. 2021-01-18 17:54:03 -05:00
Jesus Bracho
ec79890335 Provide buff information on killed entities 2021-01-18 05:46:53 +00:00
Ben Wallis
aef2637288 Refactored loadout to have public functions for each slot instead of requiring callers to use the _INDEX consts 2021-01-08 19:12:09 +00:00
Ben Wallis
5636083e27 * Fixed character load errors not being handled in Voxygen.
* Improved server error message for character load errors.
* Added server logging for item asset load errors during character load.
* Fixed character select error message dialog not supporting long messages.
2020-12-30 19:29:22 +00:00
Acrimon
e76474463a
update authc 2020-12-28 16:42:40 +01:00
Marcel Märtens
e8003a44dd update specs 2020-12-16 14:31:16 +01:00
Marcel Märtens
e3307344ab get rid of some insecure dependencies 2020-12-16 10:42:36 +01:00
Marcel Märtens
107fd432f5 update further crates 2020-12-16 08:56:21 +01:00
Joshua Barretto
494436be01 Hid plugins behind a feature flag to resolve Windows CI issue 2020-12-15 11:14:26 +00:00
Joshua Barretto
023888f560 Updated changelog, fmt and clippy fixes 2020-12-13 17:40:15 +00:00
Joshua Barretto
f8c8e342e6 Moved common networking code to common/net, clippy fixes 2020-12-13 17:23:45 +00:00
Joshua Barretto
027842f832 Resolved plugin dependency cycle, allowing more interesting plugin API 2020-12-13 17:15:33 +00:00
Marcel Märtens
eba3532386 move tools and chat-cli in src/bin and examples 2020-12-12 02:12:00 +01:00
Marcel Märtens
ccb01e1898 adjust fmt and clippy after toolchain upgrade 2020-12-10 14:53:01 +01:00
Joshua Barretto
52f2bccf2f Fixed incorrect grid check 2020-12-05 18:30:07 +00:00
Joshua Barretto
77a39d74d4 Removed public fields from Client, turned a character error into a frontend event 2020-12-05 11:20:25 +00:00
Joshua Barretto
e5ebbd31fa Began using Grid<T> for LoD data 2020-12-05 11:20:25 +00:00
Marcel Märtens
e398cca53c move common_state into common_sys 2020-12-01 13:46:28 +01:00
Marcel Märtens
add7922653 Move Systems out of common into common_sys
This requires to move `State` into a own crate called `common_state` which depends on `common` and `common_sys`
2020-12-01 13:44:07 +01:00
Marcel Märtens
ca1601a980 Change the version number to 0.8 2020-11-28 11:25:58 +01:00
Joshua Barretto
28b0a00b44 Removed per-level dungeon waypoints 2020-11-23 10:57:14 +00:00
Joshua Barretto
d4d4f17d3c Added world map size icons 2020-11-23 10:45:01 +00:00
Imbris
1355c1e8f5 Move tracy frame markers to proper locations, add a few spans 2020-11-22 14:22:39 -05:00
jiminycrick
3b47add55a Fully move sfx away from ECS event bus 2020-11-18 13:31:13 -08:00
jiminycrick
9c87345135 Moved functions to client out of audio and generalized non-positional ambient sfx 2020-11-18 13:31:12 -08:00
jiminycrick
a9711eea01 Beginning to address comments 2020-11-18 13:31:12 -08:00
jiminycrick
a684bc90fd Quadraped footsteps and songs in biomes 2020-11-18 13:31:12 -08:00
jiminycrick
c8d79b0b0e Dungeon and cave specific music 2020-11-18 13:31:12 -08:00
Imbris
891e81cf58 Merge branch 'imbris/save-selected-char' into 'master'
Save the selected character, deselect character when deleting, auto select newly created character

See merge request veloren/veloren!1516
2020-11-15 01:40:44 +00:00
Imbris
4f2512f126 Save the selected character, deselect character when deleting, auto select newly created character 2020-11-14 19:17:42 -05:00
Imbris
2072929a5a Send ability map from the server to the client on connection instead of loading from the assets 2020-11-14 16:07:07 -05:00
Marcel Märtens
40f5afc2b0 ci cleanup, dependency update 2020-11-06 14:34:42 +01:00
Sam
a0af315930 Addressed comments. 2020-11-04 19:22:08 -06:00
Sam
c48c022f7e Separated out health from stats component. 2020-11-04 19:22:04 -06:00
Marcel Märtens
00456c8373 extract a Presence Component, which is server only and has state of Player and Client. Presence is only valid for Clients that are in game 2020-11-03 08:56:02 +01:00
Marcel Märtens
6bb74c9c6f Fix clients are disconnecting GRACEFULLY by removing the Disconnect Request from a client, a client now sends a TERMINATE message directly 2020-11-03 08:55:54 +01:00
Samuel Keiffer
19e210672a Merge branch 'BottledByte/buff_system' into 'master'
The Buff system

Closes #413

See merge request veloren/veloren!1285
2020-10-27 17:11:02 +00:00
Brad
57d09be6b9 Added client-side is_dead check to inventory pickup 2020-10-26 23:23:29 -04:00
Sam
337cf6e137 Cleaned up UI code. Removed stuff added for testing. Added 10% for melee attacks to inflict a bleeding debuff. Renamed BuffId to BuffKind. Fixed memory leak. Set event emission to false when timer is decremented. 2020-10-26 19:30:10 -05:00
Monty Marz
8fa398954d Initial implementation of buffs UI
player buffs animation

more testing debuffs

sorting and display limit fix

overhead buffs

fix

WIP buff removal function

fmt

Update buffs.rs

Now with compiling: WIP group UI buffs

positioning

Update group.rs

Update group.rs

Small optimizations.

Fixed positioning of buffs in group panel. Broke buff tooltips in group panel.

buff frame visuals

added setting for displaying buffs at minimap
2020-10-26 19:28:24 -05:00
Sam
1a1ceb54bc Server event used to deal damage/heal with buffs. Buff kills now award xp. 2020-10-26 19:28:20 -05:00
Marcel Märtens
153c6c3b13 Fixing Tarpaulin isn't easy.
So first off all we had to update the toolchain, i think everything in september is okay, but we got with this current version.
Then we had to update several dependencies, which broke:
 - need a specific fix of winit, i think we want to get rid of this with iced, hopefully, because its buggy as hell. update wayland client to 0.27
 - use a updated version of glutin which has wayland-client 0.27 and no longer the broke version 0.23
 - update conrod to use modern copypasta 0.7
 - use `packed_simd_2` instead of `packed_simd` as the owner of the create abandoned the project.
 - adjust all the coding to work with the newer glutin and winit version. that also includes fixing a macro in one of the dependencies that did some crazy conversion from 1 event type to another event type.
   It was called `convert_event`
 - make a `simd` feature which is default and introduce conditional compiling.
   AS I HAVE NO IDEA OF SIMD AND THE CODE. AND I DIDN'T INTRODUCE THE ERROR IN THE FIRST PLACE, WE PANIC FOR NON SIMD CASE FOR NOW. BUT IT WORKS FOR TESTS.
 - tarpaulin doesnt support no-default-features. so we have to `sed` them away. semms fair.
2020-10-26 17:04:20 +01:00
Marcel Märtens
2a7378b4ae pack together InGame, CharacterScreen and General variant in a single enum, as requested by zesterer.
His reason to reqeust that is, that there might not be a perfect disctinction in the future.
Now we need to send ServerGeneral over streams and do additional checking at various places to verify that not the wrong variant is send.
2020-10-12 11:27:21 +02:00
Marcel Märtens
55b59fbe07 various small fixes according to the MR 2020-10-12 11:25:20 +02:00
Marcel Märtens
ff374eab59 create a ServerMsg and ClientMsg enum and verify the state when in debug mode to benefit from the transition 2020-10-11 22:59:53 +02:00
Marcel Märtens
e8452fafc6 fix naming, replace NotInGame with CharacterScreen 2020-10-11 22:55:38 +02:00
Marcel Märtens
8b40f81ee2 No longer block the main thread for client connections, new clients will be handled by server without waiting.
- Instread we have a dedicated thread that will async wait for new participants to connect and then notify the main thread
- registry no longer sends a view distance with it.
- remove ClientMsg::Command again as it's unused
2020-10-11 22:55:02 +02:00
Marcel Märtens
017e004309 Rename enums to allow a super enum in the future, but i am not yet sure if we want to introduce this yet
```
//This is a helper structure, containing all possible data send over
pub enum ClientMsg {
    Initial(ClientType),
    General(ClientGeneralMsg),
    InGame(ClientInGameMsg),
    NotInGame(ClientNotInGameMsg),
    Register(ClientRegisterMsg),
    Ping(PingMsg)
}
```
2020-10-11 22:49:25 +02:00
Marcel Märtens
d7a74c0cf1 fix voxygen state system. before we had a timing error that we did the next voxygen step before client set in_game which lead us to a disconnect.
now assume in_game is correct in client unless told by server in its answer
2020-10-11 22:49:19 +02:00
Marcel Märtens
b1db5ef488 Redo Network Frontend.
Rather than having a single Stream to handle ALL data, seperate into multiple streams:
 - Ping Stream, for seperate PINGS
 - Register Stream, only used till the client is registered, then no longer used!
 - General Stream, used for msg that can occur always
 - NotInGame Stream, used for everything NOT ingame, e.g. Character Screen
 - InGame Stream, used for all GAME data, players, terrain, entities, etc...

This version does compile, and gets the client registered (with auth too) but doesnt get to the char screen yet.

This fixes also the ignoring messages problem we had, as we are not sending data to the register stream!
This fixes also the problem that the server had to sleep for the Stream Creation, as the Server is now creating the streams and client has to sleep.
2020-10-11 22:49:14 +02:00
Monty Marz
2b800a2b63 make clippy happy
Delete glider.ron
2020-10-07 02:23:20 +00:00
Sam
de45784596 Addressed round of testing feedback. 2020-09-29 19:48:09 -05:00
Ben Wallis
b3dd8e8a02 Added #![deny(clippy::clone_on_ref_ptr)] to all crates and fixed resulting lint errors 2020-09-27 17:25:33 +01:00
Sam
45fef87f32 Addressed comments 2020-09-19 14:40:21 -05:00
Sam
6327dd18b6 Moved knockback to a server event so that it would actually be applied to the player. 2020-09-19 14:40:17 -05:00
Monty Marz
5fe79e1c6a new loading screen bgs (part 1)
Add a basic random feature to char creation

loading screen bg (part 2)

loading screen changes, random button graphics
Random appearance also pick a random npc name
2020-09-18 23:17:47 +00:00
Ben Wallis
712f2e9c97 * Moved migrations to beginning of server initialisation
* Added migrations for entity ID changes to existing tables
2020-09-17 23:02:14 +00:00
Joshua Yanovski
19485b6a00 Add a DisconnectReason enum. 2020-09-14 08:16:09 +02:00