442 Commits

Author SHA1 Message Date
Joshua Yanovski
e7cd5fedf4 Bring vek up to date so we can bump rustc (hopefully). 2021-03-04 05:46:59 +01:00
Marcel Märtens
0f591dfcdd Change the way Network is dropped.
Instead of keeping Runtime and manually spawn a task on `drop` this task is spawned at start and will wait to be triggered.
The `drop` methods then wait for completion, UNLESS they are in a async context, then they MUST NOT BLOCK (deadlock potential), so they defer it to the Runtime and HOPE for the runtime to exist long enough.
This get rid of the weird `block_in_place` which is only accessable with `rt-multi-threaded` and has some disadvantages.
We also wont requiere the runtime to be active all the time. Though its needed for a clean shutdown
2021-03-03 11:28:40 +01:00
ccgauche
2bb54137a0 Merge branch 'master' into 'ccgauche/plugin-player-join-event'
# Conflicts:
#   CHANGELOG.md
2021-03-02 09:45:15 +00:00
Sam
06ecf398db Item use is now goes through a control action rather than a control event. 2021-03-01 20:51:08 -05:00
Jesus Bracho
6b1ba22d1f Implement stacking and splitting 2021-03-02 00:08:46 +00:00
ccgauche
cc06cbce83 Fixed comments 2021-03-01 21:29:18 +01:00
ccgauche
927b2868ec Lots of improvement in pointer management (switched from i32 to u64) + New event implemented 2021-03-01 19:00:44 +01:00
Sam
fbba22ac2f Made changes to fix torvus 2021-02-27 22:42:11 -05:00
Avi Weinstock
fa891ff74a 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
7ce91665f8 cleanup ClientConnArgs 2021-02-22 21:07:20 +01:00
Marcel Märtens
b473bb9cbd Client::new can now resolve DNS requests, better networking error messages 2021-02-22 17:35:19 +01:00
Marcel Märtens
def5db54de 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
517abc79ab 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
048fcf88f8 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
00386b6955 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
33085f1645 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
13276a6d00 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
88620c804a Initial switch to tokio for network, minimum working example. 2021-02-17 12:37:59 +01:00
Caelan
86d1b00735 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
6b236cbc30 Small chat message formatting changes and fixed missing player alias during admin entity possession 2021-02-17 02:15:45 +00:00
Avi Weinstock
f86f22f0e8 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
a1176284d2 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
7a37538f06 Implement actual inventory-manipulation part of trading server side. 2021-02-12 18:43:10 -05:00
Avi Weinstock
e0f4bb3dc6 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
2b9129d290 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
231c104355 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
b259acaa59 Trade implementation progress.
- State machine for modifying trades.
- ServerGeneral/ClientGeneral messages.
2021-02-12 18:43:09 -05:00
Avi Weinstock
94ef4a6917 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
22501ccf64 Rebase !1447 Chat input color and icon reflect channel message is sent to. 2021-02-10 19:42:59 +00:00
Sam
7e3ec94207 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
d6ffb1cea5 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
45be7dd64d Eradicated clones 2021-02-08 12:01:48 -05:00
Sam
b7496b438f 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
8951e427e4 Add basic NPC interaction and fix NPC chat spamming 2021-01-31 20:29:50 +00:00
DaforLynx
1d6676fb98 Small audio fixes; addresses #939 and #940 2021-01-29 11:37:10 +00:00
Marcel Märtens
515e86fe02 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
5e55984595 stats display
Addressed comments.

Addressed comments.
2021-01-19 08:08:11 -05:00
Sam
c100657219 Purged stats, including level and experience 2021-01-19 08:07:23 -05:00
Sam
ddbdea96c1 General combat skill tree.
UI for general skill tree
2021-01-19 08:07:20 -05:00
Sam
b2d52b8001 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
1a57ec4afc 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
5903578e1a Sceptre skill tree. 2021-01-19 08:07:03 -05:00
Sam
ed107dbe61 Staff skill tree. 2021-01-19 08:07:03 -05:00
Sam
97f89383b8 Implemented bow skill tree. 2021-01-19 08:07:02 -05:00
Sam
8d9d4fc62f Hammer skill tree complete. 2021-01-19 08:07:02 -05:00
Sam
4c61b59856 Axe skill tree functional. 2021-01-19 08:07:01 -05:00
Sam
ba263cf444 Added sword skill tree 2021-01-19 08:06:59 -05:00
Sam
266bea8298 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
80f2a20c35 Skills can now have prerequisite skills. Skills can now cost different amounts of skill points. 2021-01-19 08:06:57 -05:00
Sam
1a15625f12 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