Skip to content

Commit

Permalink
Merge pull request #54
Browse files Browse the repository at this point in the history
Dynamic Dimensions / Extension improvements
  • Loading branch information
popstarfreas authored Sep 7, 2019
2 parents a4621e5 + febca7c commit 211cda9
Show file tree
Hide file tree
Showing 18 changed files with 229 additions and 2,891 deletions.
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
language: node_js
node_js:
- "12"
before_script:
- npm install grunt-cli -g
script: grunt
script: npm run test
install: npm install
31 changes: 31 additions & 0 deletions UpdateTypes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Dimension Packet Update Types
If you use packet 67 with Dimensions, make sure the first data is an Int16 with a message type not already used to avoid it being misread as one of the below. If you publish a plugin or tool which uses this packet and that is used with Dimensions, add the type and information to this file.

## [0] Real IP Address
Dimensions sends this to a Terraria Server to update the client's IP address from the IP of the machine Dimensions is running on to the real IP of the client.
| Info | Size | Datatype |
| ----------- | ---- | -------- |
| Type | 2 | Int16 |
| IP | ? | String |

## [1] Gamemodes Join Mode
Gamemodes uses this to specify what mode the user has joined for.
| Info | Size | Datatype |
| ----------- | ---- | -------- |
| Type | 2 | Int16 |
| Join Mode | ? | String |

## [2] Switch Server
Terraria Servers use this to tell Dimensions to switch the clients Dimension
| Info | Size | Datatype |
| -------------- | ---- | -------- |
| Type | 2 | Int16 |
| Dimension Name | ? | String |

## [3] Switch Server Manual
| Info | Size | Datatype |
| -------------- | ---- | -------- |
| Type | 2 | Int16 |
| Server IP | ? | String |
| Server Port | ? | UInt16 |
Terraria Servers use this to tell Dimension to switch the client to a specific ip/port that is not in the Dimensions config.
1 change: 1 addition & 0 deletions app/.baseDir.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// grunt-ts creates this file to help TypeScript find the compilation root of your project. If you wish to get to stop creating it, specify a `rootDir` setting in the Gruntfile ts `options`. See https://github.com/TypeStrong/grunt-ts#rootdir for details. Note that `rootDir` goes under `options`, and is case-sensitive. This message was revised in grunt-ts v6. Note that `rootDir` requires TypeScript 1.5 or higher.
8 changes: 6 additions & 2 deletions app/node_modules/dimensions/clearutils.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions app/node_modules/dimensions/client.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/node_modules/dimensions/clientcommandhandler.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions app/node_modules/dimensions/listenserver.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/node_modules/dimensions/packets/bufferwriter.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/node_modules/dimensions/packets/dumbpacketwriter.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions app/node_modules/dimensions/packets/packetwriter.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/node_modules/dimensions/terrariaserver.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 19 additions & 4 deletions app/node_modules/dimensions/terrariaserverpackethandler.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions app/spec/dimensions/clientcommandhandlerspec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ describe("ClientCommandHandler", () => {
});

it("should send the user a user count", (done: DoneFn) => {
clientSocketDataHandlers.push((data: string) => {
const handler = (data: string) => {
expect(data).toContain("There are 0 players across all Dimensions");
done();
});
client.globalHandlers.command.parseCommand("/who");
}
clientSocketDataHandlers.push(handler);
let command = client.globalHandlers.command.parseCommand("/who");
client.globalHandlers.command.handle(command, client);
});
});

Expand Down
33 changes: 0 additions & 33 deletions gruntfile.js

This file was deleted.

11 changes: 11 additions & 0 deletions jasmine.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"spec_dir": "build/spec",
"spec_files": [
"**/*[sS]pec.js"
],
"helpers": [
"helpers/**/*.js"
],
"stopSpecOnExpectationFailure": false,
"random": true
}
Loading

0 comments on commit 211cda9

Please sign in to comment.