Skip to content

Added settings and changed namespaces.#3

Open
xiluisx wants to merge 1 commit intomasterfrom
xiluisx-fixed-branch
Open

Added settings and changed namespaces.#3
xiluisx wants to merge 1 commit intomasterfrom
xiluisx-fixed-branch

Conversation

@xiluisx
Copy link
Collaborator

@xiluisx xiluisx commented Oct 9, 2020

At the end i fixed my files so you can use this pr if you want.

@xiluisx xiluisx requested a review from Deaddiamond123 October 9, 2020 22:30
<HintPath>D:\SteamLibrary\steamapps\common\BROKE PROTOCOL\BrokeProtocol_Data\Managed\UnityEngine.PhysicsModule.dll</HintPath>
</Reference>
<Reference Include="NewtonSoft.Json">
<HintPath>D:\SteamLibrary\steamapps\common\BROKE PROTOCOL\BrokeProtocol_Data\Managed\NewtonSoft.Json.dll</HintPath>
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added reference for newtonsoft json

using System.Text;

namespace ClassLibrary8.Commands
namespace Chat_Log.Commands
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since you changed the project name, namespaces should be changed too.


private void LocalCommand(ShPlayer player, string Type)
private void LocalCommand(ShPlayer player, string type)
{
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "type" without caps in the parameters will make things better when reading the code.

Core.Instance.SaveSettings();
}
}
} No newline at end of file
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will save the settings file when the server saves in case you want to edit from the game it while it's running.

public void AddMessage(Message message)
{
if (messages.Count >= 300)
if (messages.Count >= Core.Instance.Settings.MaxLogMessages)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of using a hardcoded value it will now use the settings value which can be changed by the server owner

{
public int MaxLogMessages { get; set; } = 300;
}
} No newline at end of file
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the settings file, when creating settings the first time it will have 300 by default but after that it will use the value the server owner choose

@xiluisx xiluisx marked this pull request as ready for review October 9, 2020 22:36
@xiluisx xiluisx assigned xiluisx and unassigned xiluisx Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant