Mods / Login Protection
- Tags:
- Author:
- Xel
- Side:
- Server
- Created:
- Jun 3rd 2022 at 10:36 PM
- Last modified:
- May 28th at 12:21 AM
- Downloads:
- 3272
- Follow Unfollow 56
-
Latest release (for Vintage Story 1.22.2, potentially outdated):
loginprotection-1.4.1.zip 1-click install
Tired of dying when logging into a server?
Login Protection prevents the player from taking damage when they join a server because the server thinks the player is ready even though their client is still loading.
Once the player moves or does anything, they are considered "active" and no longer protected. Players standing in lava or on fire will also not be protected.
There is also a single config option ProtectionTimeSeconds. If this is set to a number then the player's protection will expire that many seconds after logging in (this may be before the player can actually see anything. Make sure you set the number high enough).
Exposes a single serverside method to check if a player is protected or not, as well as 3 events:
var loginProtection = Api.ModLoader.GetModSystem<LoginProtectionModSystem>();
loginProtection.OnLoginProtectionStart += player => doSomething(player);
loginProtection.OnLoginProtectionStop += player => doSomething(player);
loginProtection.OnShouldProtect += player => shouldProtect(player);
if (wouldDoSomething && loginProtection.IsPlayerProtected(player)) Dont();
internal class YourModSystem : ModSystem
{
private System.Func<IPlayer, bool> isPlayerProtected;
public void InjurePlayer (IPlayer player)
{
if (_api.IsServerSide())
{
if (isPlayerProtected == null)
{
var loginProtection = _api.ModLoader.GetModSystem("LoginProtection.LoginProtectionModSystem");
if (loginProtection != null)
{
var isPlayerProtectedMethod = loginProtection.GetType().GetMethod("IsPlayerProtected");
isPlayerProtected = isPlayerProtectedMethod.CreateDelegate(typeof(System.Func<IPlayer, bool>), loginProtection) as System.Func<IPlayer, bool>;
}
else
{
isPlayerProtected = (IPlayer p) => false;
}
}
if (!isPlayerProtected(player)))
{
ExplodePlayer(player);
}
}
}
}| Mod Version | Mod Identifier | For Game version | Downloads | Released | Changelog | Download | 1-click mod install* |
|---|---|---|---|---|---|---|---|
| 1.4.1 | loginprotection | 82 | May 28th at 12:21 AM | loginprotection-1.4.1.zip | 1-click install | ||
|
haha whoopsie
| |||||||
| 1.4.0 | loginprotection | 27 | May 27th at 1:28 AM | loginprotection-1.4.0.zip | 1-click install | ||
| |||||||
| 1.3.0-pre.1 | loginprotection | 84 | May 8th at 1:29 AM | loginprotection-1.3.0-pre.1.zip | 1-click install | ||
|
Recompile for net10. I didn't test it, pls test for me. Thanks | |||||||
| 1.2.0 | loginprotection | 1064 | Sep 4th 2023 at 3:35 PM | loginprotection-1.2.0.zip | 1-click install | ||
| |||||||
| 1.1.0 | loginprotection | 380 | Jul 26th 2023 at 2:11 AM | loginprotection-1.1.0.zip | 1-click install | ||
| |||||||
| 1.0.3 | loginprotection | 370 | Apr 8th 2023 at 12:01 PM | loginprotection-1.0.3.zip | 1-click install | ||
|
- recompile for 1.18 | |||||||
| 1.0.2 | loginprotection | 422 | Jun 7th 2022 at 12:54 PM | loginprotection-1.0.2.zip | 1-click install | ||
|
Add a new event | |||||||
| 1.0.1 | loginprotection | 377 | Jun 4th 2022 at 2:34 PM | loginprotection-1.0.1.zip | 1-click install | ||
| |||||||
| 1.0.0 | loginprotection | 466 | Jun 3rd 2022 at 10:39 PM | Empty | LoginProtection-1.0.0.dll | 1-click install | |
After loading latest version v1.4.0, players weer no longer able to damage entities. We reverted to v1.3.0-pre1.
I can confirm that. While this tecnically fixes the other issue mentioned earlier, it makes the game a forced pacifist run now. Makes a whole new challange hardcore survival mod out of this =D
Hey there! The mod works fine so far I can tell, but I think I found a small exploit:
Users on my server tend to disconnect and rejoin to make Drifters despawn.
... Ah yea, and a major exploit, which I think you should fix soon after me writing this:
Thank you for the update!!
1.3.0-pre.1 seems to work fine on my 1.22 server on a launch test.
Needs re-compiling to NET 10 for use on VS 1.22.
Any chance on an update soon?
tried on 1.21.6, it still works :)
Xel would this still work with 1.20.9?
Bit hesitant to load it on a live server currently but we do have a few people with weak connection, so it would help a lot.
Thanks in advance :)
Thalius just tested it and it is working as of 1.20.4
Is this working for 1.20.x?
Tested on multiplayer server version 1.19.3, everything works. You can install and enjoy!
Will the mod be updated to 1.19?
Could you add an 'PING' sound when the game connects or the game finished loading in single player (and pause the game)?
A lot of people like to abuse the login protection in order to be invulnerable and so as long they do not move, they can still hit stuff and maintain invulnerability. Please think seriously about adding a timer on rather how long the protection lasts or make it cancel invulnerability when an attack is performed by the player. Additionally, if you are in the invulnerability state, please make it freeze your present health and food unless you are moving/switching equipment/trying to bring your food/health back up or anything else aside from chatting to seek help in the chat window. Also, if you fell in the water and are technically not moving but your character is sinking, it should not cancel invulnerability unless the player themselves presses a button besides chatting keys. This should greatly reduce invulnerability abuse.
Any chance to make the protection "timed" and configurable?
(like: 30 seconds of protection, 60 seconds or so on)
Xel