-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add C# scripting support #667
base: develop
Are you sure you want to change the base?
feat: Add C# scripting support #667
Conversation
81551e3
to
5740041
Compare
- Added Roslyn to the project. - Added an example of parsing game logic settings from a .csx file. - Made GameLogicSettings.csx hotloadable. - Adjusted exp point modifier settings for enemies and quests to be hotload friendly. - Implemented a ScriptModule interface for GameServer scripts. - Converted extended NPC facilities into scripting .csx files for each NPC and made directory hotloadable. New NPC options can be added after the server starts without a restart.
5740041
to
ee1a11f
Compare
<None Update="Files\Assets\scripts\GameLogicSettings.csx"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
<None Update="Files\Assets\scripts\HellWorld.csx"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete these two scripts that don't exist.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since GameLogicSetting no longer come from the json file maybe we shouldnt have it be part of this class.
Im aware this implies an annoying refactor but i feel its confusing if kept here
/// </summary> | ||
/// <param name="path">Path to a text based file to read</param> | ||
/// <returns>Returns the contents of the file read as a string</returns> | ||
public static string ReadAllText(string path) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we use this function in the AssetRepository deserializers too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, we should. This fixes that issue where the file can't be accessed, which is why we have that retry logic. We should be able to remove that and just use this function instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you add it to the pr?
im not sure why this function fixes the issue but oh well as long as it works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found this article on SF which I tried an no longer get the error.
Replaced File.ReadAllText with Util.ReadAllText.
hotload friendly.
Checklist:
develop
branch