mirror of
https://github.com/sebastian-heinz/Arrowgene.DragonsDogmaOnline
synced 2026-08-03 11:12:41 -04:00
- Refactored code so implementation can be shared between Server and DdonGameServer. - Moved settings into settings module and implemented an example using a less structured scripting module interface. - Created new ScriptableSettings class to assist with interacting with non-structured settings module. - Created README.md files for suggestions and guidelines for module implementation.
25 lines
647 B
C#
25 lines
647 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace Arrowgene.Ddon.GameServer.Scripting
|
|
{
|
|
public class ScriptUtils
|
|
{
|
|
public static ScriptModule FindModule(string path, Dictionary<string, ScriptModule> modules)
|
|
{
|
|
string[] directories = Path.GetDirectoryName(path).Split(Path.DirectorySeparatorChar);
|
|
|
|
foreach (var directory in directories.Reverse())
|
|
{
|
|
if (modules.ContainsKey(directory))
|
|
{
|
|
return modules[directory];
|
|
}
|
|
}
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|