Companionship

by kizrak

Have friends and family? Tired of them playing without you? Get Companionship! This mod makes playing on your map/server a pain if you do it alone! When just a single player is on the map/server, the game slows down to painfully slow speed until more people join. Once a second player joins the map/server, the game returns to normal speed! Also allows players to select their desired game speed (once there are enough companions). The game will then go at the speed of the slowest desired player. Players can change their desired speed at any time.

Utilities
2 years ago
0.17 - 1.1
147

b `/speed x` with invalid input crashes game

2 years ago

A player accidentally passed in a bit of unicode to the /speed function when trying to type a number (foreign keyboard) and crashed the game for everyone. The input should probably be sanitized to return an error message if the input isn't a valid number. :-)

Love this mod! Simple but so useful!

2 years ago
(updated 2 years ago)

Wow -- nice catch and that is a really good idea -- thank you! 🧡

I've added this to my todo issue list.

10 months ago

Looks like it still crashes, just happened by a player on my current server, lol:

1089.611 Error MainLoop.cpp:1382: Exception at tick 55347: Error while running command "speed": __companionship__/companionship.lua:109: bad argument #3 of 3 to '__index' (string expected, got nil)
stack traceback:
        [C]: in function '__index'
        __companionship__/companionship.lua:109: in function <__companionship__/companionship.lua:108>
1089.611 Error ServerMultiplayerManager.cpp:92: MultiplayerManager failed: "Error while running command "speed": __companionship__/companionship.lua:109: bad argument #3 of 3 to '__index' (string expected, got nil)
stack traceback:
        [C]: in function '__index'
        __companionship__/companionship.lua:109: in function <__companionship__/companionship.lua:108>"

This time they typed just /speed by itself via rcon bot and it crashed, they were trying to figure out the speed the server was running at.

New response