mirror of
https://github.com/tgstation/tgstation-server.git
synced 2026-08-24 21:46:52 +01:00
Makes it work
This commit is contained in:
@@ -252,16 +252,17 @@ namespace TGServerService
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public string InteropMessage(string command)
|
||||
public bool InteropMessage(string command)
|
||||
{
|
||||
try
|
||||
{
|
||||
HandleCommand(command);
|
||||
return null;
|
||||
return true;
|
||||
}
|
||||
catch(Exception e)
|
||||
{
|
||||
return "Error: " + e.Message;
|
||||
TGServerService.WriteWarning(String.Format("Handle command for \"{0}\" failed: {1}", command, e.ToString()), TGServerService.EventID.InteropCallException);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,6 +75,7 @@ namespace TGServerService
|
||||
ServerUpdateApplied = 6300,
|
||||
ChatBroadcastFail = 6400,
|
||||
IRCLogModes = 6500,
|
||||
InteropCallException = 6600,
|
||||
}
|
||||
|
||||
static TGServerService ActiveService; //So everyone else can write to our eventlog
|
||||
|
||||
@@ -132,9 +132,9 @@ namespace TGServiceInterface
|
||||
/// Called from /world/ExportService(command)
|
||||
/// </summary>
|
||||
/// <param name="command">The command to run</param>
|
||||
/// <returns>null on success, error message on failure</returns>
|
||||
/// <returns>true on success, false on failure</returns>
|
||||
[OperationContract]
|
||||
string InteropMessage(string command);
|
||||
bool InteropMessage(string command);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -146,17 +146,17 @@ namespace TGServiceInterface
|
||||
/// The proc that DD calls to access <see cref="ITGServiceBridge"/>
|
||||
/// </summary>
|
||||
/// <param name="args">The arguments passed</param>
|
||||
/// <returns>null on success, error message on failure</returns>
|
||||
/// <returns>0 success, -1 on a WCF, error, 1 on an operation error</returns>
|
||||
[DllExport("DDEntryPoint", CallingConvention = CallingConvention.Cdecl)]
|
||||
public static string DDEntryPoint(string[] args)
|
||||
public static int DDEntryPoint(int argc, [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 0)]string[] args)
|
||||
{
|
||||
try
|
||||
{
|
||||
return Server.GetComponent<ITGServiceBridge>().InteropMessage(String.Join(" ", args));
|
||||
return Server.GetComponent<ITGServiceBridge>().InteropMessage(String.Join(" ", args)) ? 0 : 1;
|
||||
}
|
||||
catch (Exception e)
|
||||
catch
|
||||
{
|
||||
return "Service Error: " + e.Message;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user