| 654 | } |
| 655 | |
| 656 | CoreService::CoreService() : |
| 657 | suspend_depth{0}, |
| 658 | coreSuspender{nullptr} |
| 659 | { |
| 660 | |
| 661 | // These 2 methods must be first, so that they get id 0 and 1 |
| 662 | addMethod("BindMethod", &CoreService::BindMethod, SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 663 | addMethod("RunCommand", &CoreService::RunCommand, SF_DONT_SUSPEND); |
| 664 | |
| 665 | // Add others here: |
| 666 | addMethod("CoreSuspend", &CoreService::CoreSuspend, SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 667 | addMethod("CoreResume", &CoreService::CoreResume, SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 668 | |
| 669 | addMethod("RunLua", &CoreService::RunLua); |
| 670 | |
| 671 | // Functions: |
| 672 | addFunction("GetVersion", GetVersion, SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 673 | addFunction("GetDFVersion", GetDFVersion, SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 674 | |
| 675 | addFunction("GetWorldInfo", GetWorldInfo, SF_ALLOW_REMOTE); |
| 676 | |
| 677 | addFunction("ListEnums", ListEnums, SF_CALLED_ONCE | SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 678 | addFunction("ListJobSkills", ListJobSkills, SF_CALLED_ONCE | SF_DONT_SUSPEND | SF_ALLOW_REMOTE); |
| 679 | |
| 680 | addFunction("ListMaterials", ListMaterials, SF_CALLED_ONCE | SF_ALLOW_REMOTE); |
| 681 | addFunction("ListUnits", ListUnits, SF_ALLOW_REMOTE); |
| 682 | addFunction("ListSquads", ListSquads, SF_ALLOW_REMOTE); |
| 683 | |
| 684 | addFunction("SetUnitLabors", SetUnitLabors, SF_ALLOW_REMOTE); |
| 685 | } |
| 686 | |
| 687 | CoreService::~CoreService() |
| 688 | { |
nothing calls this directly
no test coverage detected