Comments (22)
PE? Are you talking about mobile? Dimensions will try to read packets as though they are from a PC client. You would need to update it so that it uses the right format. At this time I don't know what the best approach is. You could simply go through the source and edit the packet handlers and some of the other places it writes packets.
from dimensions.
PE? Are you talking about mobile? Dimensions will try to read packets as though they are from a PC client. You would need to update it so that it uses the right format. At this time I don't know what the best approach is. You could simply go through the source and edit the packet handlers and some of the other places it writes packets.
Yes, version code updated but i don't find anything about this offset range. Can you explain how to change it's range?
from dimensions.
It's referring to reading from a buffer. It means that when it was reading a packet, it tried to read a byte at index 9 when the maximum index is 8. Likely because some packet (like player info) has more bytes on PC than mobile.
from dimensions.
It's referring to reading from a buffer. It means that when it was reading a packet, it tried to read a byte at index 9 when the maximum index is 8. Likely because some packet (like player info) has more bytes on PC than mobile.
So question is how i can manage(change or remove) maximum index value?
from dimensions.
That's not what it means. The maximum index value is based on how much data there is to read from the packet. What you need to do is update dimensions where it reads packets to read the mobile packets instead of pc.
from dimensions.
That's not what it means. The maximum index value is based on how much data there is to read from the packet. What you need to do is update dimensions where it reads packets to read the mobile packets instead of pc.
How i can do that? Since Mobile Version is hard-coded and we can't make changes on there.
Also searched PE TShock Code and only thing i found is buff time changed to Int16 format from Int32 format.
from dimensions.
To get the source of the error you can edit
https://github.com/popstarfreas/Dimensions/blob/dev/app/node_modules/dimensions/client.ts#L283
so that it prints out the stacktrace rather than just the message. Maybe just put console.log(e)
. That will tell you which packet it tried to read so you can see what needs to be changed.
from dimensions.
RangeError [ERR_OUT_OF_RANGE]: The value of "offset" is out of range. It must be >= 0 and <= 8. Received 9
at boundsError (internal/buffer.js:77:9)
at Buffer.readInt16LE (internal/buffer.js:405:5)
at PacketReader.readInt16 (C:\Users\minecraft\Desktop\Dimensions\build\node_modules\dimensions\packets\bufferreader.js:88:34)
at ClientPacketHandler.handlePlayerInventorySlot (C:\Users\minecraft\Desktop\Dimensions\build\node_modules\dimensions\clientpackethandler.js:198:32)
at ClientPacketHandler.handlePacket (C:\Users\minecraft\Desktop\Dimensions\build\node_modules\dimensions\clientpackethandler.js:60:32)
at C:\Users\minecraft\Desktop\Dimensions\build\node_modules\dimensions\client.js:137:57
at arrayEach (C:\Users\minecraft\Desktop\Dimensions\node_modules\lodash\lodash.js:516:11)
at Function.forEach (C:\Users\minecraft\Desktop\Dimensions\node_modules\lodash\lodash.js:9342:14)
at Client.handleDataSend (C:\Users\minecraft\Desktop\Dimensions\build\node_modules\dimensions\client.js:136:19)
at Socket. (C:\Users\minecraft\Desktop\Dimensions\build\node_modules\dimensions\listenserver.js:477:24) {
code: 'ERR_OUT_OF_RANGE'
}
What is internal/buffer.js
and how i can access that file? I searched on directory but no file found called buffer.js
.
from dimensions.
I don't know your level of expertise, so this may or may not be outside of your current knowledge but that stacktrace starts at the internal node code, which isn't Dimensions. You have to follow it down until you see dimensions, which is where it says PacketReader.readInt16
, that's fine so we know it's trying to read an int16 at bufferreader:88
. What callls that is handlePlayerInventorySlot
at line 198 in the js (the js is likely to have different line numbers than the original typescript code). So the guess here is that in 1.4 slots now use int16 instead of byte for the slot id. So to make it work with the mobile packet version https://github.com/popstarfreas/Dimensions/blob/dev/app/node_modules/dimensions/clientpackethandler.ts#L232 needs to be changed to readByte again.
from dimensions.
I don't know your level of expertise, so this may or may not be outside of your current knowledge but that stacktrace starts at the internal node code, which isn't Dimensions. You have to follow it down until you see dimensions, which is where it says
PacketReader.readInt16
, that's fine so we know it's trying to read an int16 atbufferreader:88
. What callls that ishandlePlayerInventorySlot
at line 198 in the js (the js is likely to have different line numbers than the original typescript code). So the guess here is that in 1.4 slots now use int16 instead of byte for the slot id. So to make it work with the mobile packet version https://github.com/popstarfreas/Dimensions/blob/dev/app/node_modules/dimensions/clientpackethandler.ts#L232 needs to be changed to readByte again.
@popstarfreas So after fixing this, i got many many errors but they are also fixed with your guidance. But there is less problems left now:
•IP redirection not works properly. Buffer keep sending buffers original IP(Example: Server runs in 0.0.0.1, Buffer runs in 0.0.0.2, while connecting to server, it shows connected from 0.0.0.2(buffers IP). Not causing problems on gameplay but will big issue on bans).
•Rest API not works well. Rest API keeps sending Invalid HTTP Response and how we can make Rest API actually count players in buffer(We need this because we are using counters to websites and status services).
•Server Switcher not works well. Typing /servername will sends command to server, not to buffer.
Also big thanks to helping to me. After everything works well, i can send pull request working PE Dimensions to your git.
from dimensions.
- The ip thing requires the dimensions plugin. Are you using that?
- I will have to look at REST API again, I made a change and I don't remember if I pushed it here yet
- Not sure about that one other than that the chat packet in mobile might be the old one where dimensions reads the new one
from dimensions.
- The ip thing requires the dimensions plugin. Are you using that?
- I will have to look at REST API again, I made a change and I don't remember if I pushed it here yet
- Not sure about that one other than that the chat packet in mobile might be the old one where dimensions reads the new one
- Yes with GeoIP enabled. But still IP Redirection not works.
- So how we can edit REST API with counter variables?
- How we can switch the old packets?
from dimensions.
- Well no one has reported issues in normal tshock, so this is a problem you need to resolve
- if I get time I will push the change I made locally
- You have to edit clientpackethandler to add the old chat packet handling
from dimensions.
- Well no one has reported issues in normal tshock, so this is a problem you need to resolve
- if I get time I will push the change I made locally
- You have to edit clientpackethandler to add the old chat packet handling
- Alright, i will try your old code to add IP Ban system onto Dimensions instead of using TShock's one.
- I will waiting you ;)
- I will work on it.
from dimensions.
Closed #61
from dimensions.
@popstarfreas Well there is no old packet handler in your code. How i can find old handler?
from dimensions.
you need to add a method that reads the old chat packet and calls the same method that line of code does.
from dimensions.
you need to add a method that reads the old chat packet and calls the same method that line of code does.
That didn't work. Thanks for helping anyway :)
from dimensions.
@popstarfreas After tracing the code, i verified this code will not work in Mobile.
https://github.com/popstarfreas/Dimensions/blob/dev/app/node_modules/dimensions/clientpackethandler.ts#L108
I changed it with ChatMessage packet but ChatMessage sends null.
Did you know what causes this problem(about sending null)?
from dimensions.
Reopened #61
from dimensions.
Nvm i solved this myelf
from dimensions.
Closed #61
from dimensions.
Related Issues (20)
- Some bugs in the Preview-releasessss! HOT 5
- 希望可以支持Proxy Protocol HOT 3
- 如何修改服务器聊天窗语言 HOT 8
- Stuck after transmission failure(传送失败后卡住)
- Invisible Players HOT 1
- 为什么跳转维度之后需要重新/login HOT 13
- Different version than the server. HOT 1
- 从大厅传送到另一个世界再传送回大厅地图部分方块会空白 HOT 2
- Player can't see each otcher HOT 4
- 测试版维度把光标放到玩家身上不会显示玩家名 HOT 16
- Terraria-Servers do not showing player count correctly HOT 1
- 如何获取玩家真实ip HOT 1
- Dimensions-5.9.1 NPCUpdate-Log报错 HOT 7
- Switch dimensions between servers cause inventory lag. HOT 5
- 泰拉瑞亚1.4.4.9版本更新后玩家传送之后装备栏会出现问题 HOT 2
- IP errors and connection to other dimensions HOT 21
- Errors present in the current Dimension HOT 4
- How to use Crossplay in Dimensions properly? HOT 4
- How to disable currentTerrariaVersion in config?It cause some problem when some plugins check player version. HOT 8
- Considering reading config file path from environment variable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dimensions.