forked from ParadiseSS13/Paradise
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5ad2291
commit dcaad1f
Showing
26 changed files
with
1,197 additions
and
316 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
*.dm text eol=lf | ||
*.md text eol=lf | ||
*LICENSE text eol=lf |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
# DMAPI Internals | ||
|
||
This folder should be placed on it's own inside a codebase that wishes to use the TGS DMAPI. Warranty void if modified. | ||
This folder should be placed on its own inside a codebase that wishes to use the TGS DMAPI. Warranty void if modified. | ||
|
||
- [includes.dm](./includes.dm) is the file that should be included by DM code, it handles including the rest. | ||
- The [core](./core) folder includes all code not directly part of any API version. | ||
- The other versioned folders contain code for the different DMAPI versions. | ||
- [v3210](./v3210) contains the final TGS3 API. | ||
- [v4](./v4) is the legacy DMAPI 4 (Used in TGS 4.0.X versions). | ||
- [v5](./v5) is the current DMAPI version used by TGS4 >=4.1. | ||
- [v5](./v5) is the current DMAPI version used by TGS >=4.1. | ||
- [LICENSE](./LICENSE) is the MIT license for the DMAPI. | ||
|
||
APIs communicate with TGS in two ways. All versions implement TGS -> DM communication using /world/Topic. DM -> TGS communication, called the bridge method, is different for each version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,10 @@ | ||
#if DM_VERSION < 510 | ||
#error The TGS DMAPI does not support BYOND versions < 510! | ||
#endif | ||
|
||
#define TGS_UNIMPLEMENTED "___unimplemented" | ||
#define TGS_VERSION_PARAMETER "server_service_version" | ||
|
||
#ifndef TGS_DEBUG_LOG | ||
#define TGS_DEBUG_LOG(message) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/datum/tgs_http_handler/byond_world_export | ||
|
||
/datum/tgs_http_handler/byond_world_export/PerformGet(url) | ||
// This is an infinite sleep until we get a response | ||
var/export_response = world.Export(url) | ||
TGS_DEBUG_LOG("byond_world_export: Export complete") | ||
|
||
if(!export_response) | ||
TGS_ERROR_LOG("byond_world_export: Failed request: [url]") | ||
return new /datum/tgs_http_result(null, FALSE) | ||
|
||
var/content = export_response["CONTENT"] | ||
if(!content) | ||
TGS_ERROR_LOG("byond_world_export: Failed request, missing content!") | ||
return new /datum/tgs_http_result(null, FALSE) | ||
|
||
var/response_json = TGS_FILE2TEXT_NATIVE(content) | ||
if(!response_json) | ||
TGS_ERROR_LOG("byond_world_export: Failed request, failed to load content!") | ||
return new /datum/tgs_http_result(null, FALSE) | ||
|
||
return new /datum/tgs_http_result(response_json, TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.