Giter VIP home page Giter VIP logo

dimensions's Introduction

The latest version is currently in testing at Dark Gaming pending approval. You can find this version (v6.0.0-beta.0) marked as pre-release.

README

Dimensions is: A routing service that can also load balance connections. For use with Terraria Servers.

Installation

Step 1: Install NodeJS

Follow the link and download either version. Later releases may offer better performance. https://nodejs.org/en/

Step 2: Install the Plugin

Download the plugin and put it in each Terraria Server for use with Dimensions

Step 3: Setting Up and Running

  • Download the latest release and extract it to its own folder
  • Open a cmd prompt/terminal at the folder and execute the command npm install --only=production (it may take a bit to finish)
  • Copy the file "config.js.example" and rename it to "config.js" and edit it to your specifications
  • OR follow the quickstart guide in the Config Wiki
  • To start Dimensions execute npm run start

Step 4 (Optional): Install Redis

If you do not need to have live reloading of modules / the configuration file then you do not need to do this step.

Redis is used to communicate with the dimensions process via the dimensions_cli.js file. It will allow you to reload the config and/or reload things like extensions or modules without the need to manually restart dimensions, reducing downtime.

Download and install Redis for your OS

  • Windows: https://github.com/MSOpenTech/redis/releases

  • Linux: https://redis.io/topics/quickstart

  • Set enabled to true in the config for the redis option

  • To reload changes to the cmd handlers, packet handlers, config or extensions, without restarting Dimensions

    • Run node dimensions_cli.js
      • Reload Config: reload
      • Reload Command Handlers: reloadcmds
      • Reload Packet Handlers: reloadhandlers
      • Reload Extensions: reloadplugins
    • The responses for each command currently are only output by each Dimensions instance rather than in the CLI

Development

  • Clone this repo
  • cd into the new directory
  • run npm install
  • There are a few scripts in the package.json
    • to build (and test) npm run build this will transpile the ts files to js, run the tests and put all output js files into a build directory
    • to build then run npm run bstart this will build and then run the index.js in the build directory
    • to start without building run npm run start

Dimensions uses the latest Typescript with strict checks enabled to help catch bugs. It is recommended that you modify the Typescript code instead of the transpiled javascript code. This will not only provide you with more safety regarding changes, but the original source is likely to be more understandable and you can merge changes from this repo using git.

Extensions

To build an extension:

Supporters

Thanks to all who have financially supported development:

dimensions's People

Contributors

actechex avatar arthri avatar dependabot[bot] avatar emreoyun avatar moneylover3246 avatar popstarfreas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dimensions's Issues

offset error

Since we are working on PE Terraria Servers; when PE Clients tries to connect, this error shows up:
Client Handle Send Data Error: RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 8. Received 9

How we can fix this in code?

Blacklist http services & Redis clarification

I'm not too familiar with using blacklist http services. Could you give an example of some of these? I was googling for a while, but the only one I could find that provided an API was Hetrix Tools.

Also, can you please give a bit more information on the purpose of Redis? You noted that is was for Pub/Sub for detached reloading, but what is that in the context of Dimensions.

How to disable currentTerrariaVersion in config?It cause some problem when some plugins check player version.

 ```

The currentTerrariaVersion in config makes some plugins check player version wrongly.
Plugins check the player version normally when player join the fisrst Server.But when play use command to enter anther server,all plugins's player version check result is currentTerrariaVersion(230).It cause PC player's client version is changed into 1.4.0.5(230),but the server version is 1.4.3.2.It causes many bugs.
Last week,I turn to a lot of people who understand TShock programming in China.Almost everyone thinks that it is currentTerrariaVersion
in config.js problem, not @Moneylover3246‘s Crossplay.But they have not time to further research Dimensions.So I ask help for you.
Chinese players just use 1.4.0.5 and 1.4.3.2.So we must use CrossPlay to allows for cross-platform play.
Dimensions is the most stable multi world I've ever seen, so I'm not like giving up using it.Could you share a solution or help me modify the code?

Connecting to offline server

is there any way to keep player in current dimension when they trying to shift to an offline dimension (server that not started yet or crashed server)?

Prefix's being wiped/replaced when switching worlds.

Every 5 or 6 times a player switches dimensions their inventory prefix's will be replaced with their single player varients.

For example, on my SSC character I had a godly xeno popper and accessories with defence/dmg prefix's. On my non ssc character(Which I don't use) it has only the starter items with a tiny copper shortsword. After a few dimension changes, my SSC character has a tiny xeno popper and no prefix's on anything else.

Currently using version 4.12 but this issue also happened on 4.11

Cannot re-enter Dimension when disconnected

If for some reason the client gets disconnected from the current Dimension, they are unable to go back in due to being "already in that Dimension". When this happens the current Dimension should be unassigned so that they may re-enter.

Maximum 2 players per dimension?

No more than 2 players can be present at the same time. Anyone else will just stuck at found server or Dimemsion Crashed error.

Using the latest beta.

Fri Jul 27 2018 20:30:25 GMT-0700 (Pacific Daylight Time): [3324] Server on 6666 started.
Fri Jul 27 2018 20:30:25 GMT-0700 (Pacific Daylight Time): [3324] Server on 9999 started.
Fri Jul 27 2018 20:30:47 GMT-0700 (Pacific Daylight Time): [3324 Client: 24.80.159.19 connected [main: 1]
Fri Jul 27 2018 20:32:11 GMT-0700 (Pacific Daylight Time): [3324 Client: 113.172.26.14 connected [main: 2]
Fri Jul 27 2018 20:32:27 GMT-0700 (Pacific Daylight Time): [3324 Client: 171.252.146.40 connected [main: 3]
Fri Jul 27 2018 20:32:27 GMT-0700 (Pacific Daylight Time): TerrariaServer Socket Error: read ECONNRESET
Fri Jul 27 2018 20:32:27 GMT-0700 (Pacific Daylight Time): TerrariaServer socket closed. [main]
Fri Jul 27 2018 20:32:42 GMT-0700 (Pacific Daylight Time): [3324] Client: 171.252.146.40 disconnected main: 1]
Fri Jul 27 2018 20:32:42 GMT-0700 (Pacific Daylight Time): Socket Timeout:  2

SSC

When I join an SSC server via dimensions, then leave said server, my inventory gets purged. Is there a fix for this?

If you ban someone it bans 127.0.0.1?

I'm not sure where to post this, but I think it should be posted here, but whenever someone registered on my dimensions server, It doesn't show their real IP, I can only see a localhost (127.0.0.1) as their IP, Which makes banning players even harder as banning someone will ban the Localhost, banning every player in the process.

World Size Overlaps

World Sizes overlap upon switching Dimensions (ex. switching from a small world to a large world will keep the small world canvas, and vice versa.)

Update currentTerrariaVersion for 1.4.0.5?

currentTerrariaVersion in the config.js is currently 226, but does not allow for switching dimensions, giving a "...was booted: You are not using the same version as this server." error.

Some bugs in the Preview-releasessss!

Just yesterday, I received a QQ message from wujiawai131108. He told me that Dimensions updated and disabled the currentTerrariaVersion。 This means that crossplay can be used normally, I was surprised, so I tried to use the latest preview version of Dimensions and encountered the following bug:

  1. When entering other Dimensions from the main Dimensions, there will be bugs that items cannot be moved or obtained, and the blocks cannot be changed. At the same time, there is the bug of infinite loss of items.
  2. Sometimes when you enter other latitudes from the main dimension, you are the only one (from the Dimensions) display in MOTD and can't receive or send chat.

Because there are too many bugs, I just want to fix the version bugs. but I can't fix them.Can you tell me how to fix them or can you fix them in the next version?please
I'm just a Chinese junior high school student,and My English test is not ideal.so The above text is gross translated by Baidu fanyi.There may be many errors in various senses in this issue(

Critical Crash issue, Dividing by Zero (Djinn's Curse).

This has been properly tested before hand, is that whenever a person joins (and/or leaves) the Server with the Djinn's Curse equipped (Only on non-SSC Servers) will cause a bunch of random players to Crash (Client crash) due to trying to divide by Zero.

This doesn't happen when using the default port (for example, my main port for the non-SSC Server is 6556) and when joining with a Djinn's curse through there no crash will occur.

Player can't see each otcher

Player can't see each otcher when a player enter a server.If a player is dead or uses /tp,the other will see the player.

Sends dimension message on disconnect first time

This happens when the client first connects. It's not something that will show up in the normal client as it receives the Disconnect packet first, however Dimensions will send the "Specify a dimension to travel to" chat packet after the client is actually disconnected. Doesn't cause any issues, but it should be avoided.

[OTAPI] SSC Inventories overwriting Singleplayer (NSSC) Inventories.

As noted in the title above, whenever a user moves from an SSC Server to an NSSC Server throughout the use of the dimension switch command, the singleplayer inventory will be overwritten by the SSC one. This is not the case when leaving the SSC Server through the Exit option and joining again.

This does not happen vice-versa.

Dimensions not working

When I type /dimensions I see names of the servers that I added to config.js
But when I type / and one of the names, I get the standard "Invalid command" message
I can connect to each of the servers individually just fine (using the listenPort port from the config, so I guess the routing is working)

[OTAPI] Health not properly moving over from SSC to NSSC.

As noted in the title above, when switching from a SSC Server to NSSC Server, the current health will be overwritten in the current session, though this isn't a big issue unless the server contains of health modifications which could be abused.

(Not tested with a character containing 100 health > joining SSC and obtaining 500 health & leaving and check if the user still has 500 health in the Menu).

Only connectable through 127.0.0.1

When I try to get others to play in my server. I can't join through my regular IP, I have to use 127.0.0.1. When I give others my domain, they can't join either

Different version than the server.

I'm running two fresh installs of the latest tShock version 4.5.17 and Dimensions 5.9.1 whenever I try to use /.build to switch servers, it says I'm not on the same version as the server.

I don't know if this is a bug, but I can't seem to figure it out.

Disable load-balance feature?

Just like the title, I want to disable it. I just want a convenient command for players to move between map, I don't need load-balance.

Stuck after transmission failure(传送失败后卡住)

If the server to be delivered is not online or is not connected due to other problems or network problems, then Stuck (disconnect all servers) like this: video download link
Can you return to the previous server when the transfer fails, or add an option to specify the server to be transferred after the transfer fails (doge)
/doge/doge/doge


如果要传送的服务器 不在线 或者因为 其他问题 或者 网络问题 没连上,那么好像就会 卡住(断开所有服务器的连接)就像这样:视频下载链接

可不可以做到传送失败时回到上一个服务器, 或者添加一个选项用于指定传送失败后要传送到的服务器()
/doge/doge/doge

Space before Dimensions List

this line causes a small space to be prepended to the dimensions list. I assume it was in case the dimensions list was in one message, though the command prints it in two

(Image from DG)
image

Invisible Players

Upon joining the server or when teleporting between servers, there is a high chance you or another player is invisible.
You can still see invisible players edit blocks, drop items, kill mobs, etc.

There is also the possibility that held items are displayed weirdly on the characters, or characters look like the default unedited character. (Standard hair and clothes and such.)

This also goes combined with sometimes being stuck on 'Found Server' or 'Receiving Tiles'.
Forcing you to cancel and try to connect to the server multiple times before finally being let in.
Servers also sometimes get stuck when you leave, then you have to press enter in the server console to unstuck them.

(Other things like dying when someone else dies, or being teleported to spawn when another player joins the world are also happening.)

How to replicate:
Run two tshock servers and dimensions, the bug occurs 9/10 times upon server join/world teleport.
Have multiple players join the server and teleport between worlds.
With some players you can always see them and the bug doesn't happen.
Rejoining the server or teleporting between worlds multiple times has a 4/10 chance to get rid of the bug.

More symptoms:

  1. Teleporting to another world, player may spawn with a companion that isn't theirs. Like a stardust dragon. (Just the head and it does attack monsters.)
  2. Inventory may glitch, not allowing you to pick up, break or craft items.
  3. If another player joins the world for the first time, other players are teleported to spawn.
  4. A swinging Zenith may pop up for a moment when you join a world, even if you have no Zenith in your inventory.
  5. Your terraria client may crash upon world teleports.

Items lost their prefix upon Dimension shifting

Many players on my server has reported that sometime all their items lost its prefix when they move from one Dimension to another.
This glitch/bug seems to happen randomly and not every users has it.

Password Protected Dimensions

Right now it is not possible to switch to a Dimension that has a password set (through the tShock config). A feature should be added that allows a password to be specified to allow connecting to those with a password.

About ip ban will ban 127.0.0.1

if banned a person when ip ban is enable, it will ban 127.0.0.1. It causes all players banned. Disable it will be inconvenient. Is it possible to record real ip of players?

[OTAPI] Prefixes being overwritten when moving from SSC to SSC.

As noted in the title, whenever you log onto a SSC Server and switch to another SSC server, the prefix you currently have on the item you are holding will transfer over to the other SSC Server. Allowing the user to obtain prefixes on items normally not possible.

Though TShock should automatically get rid of wrong prefixes, this isn't always the case.

BigInt support

Since Node v12 has BigInt support in the Buffer API it might be worth making use of this in the bufferwriter/bufferreader to ensure they are handled correctly (since they're currently put into JS's normal number type).

Considering reading config file path from environment variable

During dockerize this load balancer,I found that if this application can provide an implement to read config path from environmental variable,with redis reload method,its config reading can be much flexible

I wanna add few codes in ‘configloader.js’ to fulfil this feature like bellow
image

Is it a proper way to implement it like this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.