Junior Spellweaver
- Joined
- Apr 20, 2013
- Messages
- 103
- Reaction score
- 24
Hopefully you continue this long enough for it to get somewhere, people usually lose dedication before that happens.
Yeah, the major share of projects end up that way.
Though I think sharing the crypto I wrote is quite useful on its own
Anyhow, today wasted most of the day fixing crypto related bugs.
Currently it seems sending any data causes the client to disconnect, so I will work on that tomorrow
Update:
Encryption / Decryption works now
what IDE are you using?
This is very interesting. Any updates?tt:
You do know that Scala has complete interoperability with Java, right? There's no reason to make a non-specification-compliant version of pkgnx just to use Scala. This is especially relevant because what you wrote is not even idiomatic Scala as it's in Java-style (idiomatic Scala is functional!).
You're not editing it as Scala. You're writing Java. If that was an important freedom, why didn't you just do that at the outset?I ported it to Scala 1 on 1 for now so I have the possibility of changing it later.
I am fully aware Scala has interoperability with Java, but like I said, this way I would lose the freedom of directly editing it as Scala.
The tone in your post is set completely wrong
You could at least change the license if you're going to copy-paste the entire thing and call it your own. Previous experience with Scala does not have anything to do with what he's saying.so I would like to ask you to other be helpful or not reply at all.
As like I mentioned, I have no previous experience with Scala, so you are just behaving like a complete butt to somebody who is still learning.
You might have actually wanted to view the source before you start spouting baseless things
You must be registered to see links
I ported it to Scala 1 on 1 for now so I have the possibility of changing it later.
I am fully aware Scala has interoperability with Java, but like I said, this way I would lose the freedom of directly editing it as Scala.
Thank you, tone police.The tone in your post is set completely wrong, so I would like to ask you to other be helpful or not reply at all.
As like I mentioned, I have no previous experience with Scala, so you are just behaving like a complete butt to somebody who is still learning.
But if you happen to have any good tips or hints, please feel free to post those.
class NXLongNode(override val name: String,
override val file: NXFile,
override val childIndex: Int,
override val childCount: Int,
val reader: BufferedReader)
extends NXNode(name, file, childIndex, childCount) {
final val value = reader.getLong
override def get(): Long = value
}
sealed trait NXNode(name: String, file: NXFile, childIndex: Int, childCount: Int)
case class NXLongNode(name: String, file: NXFile, childIndex: Int, childCount: Int, value: Long) extends NXNode(name, file, childIndex, childCount)
...
class NXNullNode(override val name: String,
override val file: NXFile,
override val childIndex: Int,
override val childCount: Int,
val reader: BufferedReader)
extends NXNode(name, file, childIndex, childCount) {
reader.skip(8)
override def get(): Any = null
}
def resolve(path: Array[String]): NXNode = {
var cursor: NXNode = getRoot
for (piece <- path) {
if (cursor == null)
return null
cursor = cursor.getChild(piece)
}
cursor
}
for (node <- reader.resolve("MakeCharInfo.img/Info")) {
for (subNode <- node) {
// CharFemale | CharMale
for (valueNode <- subNode) {
val value = valueNode.asInstanceOf[NXLongNode].get()
if (value > 1e6)
allowedEquips += value
}
}
}
valueNode.asInstanceOf[NXLongNode].get()
class LazyNXFile(val buffer: ByteBuffer)
class LazyNXFile(buffer: ByteBuffer)
final class EmptyNodeIterator
extends Iterator[NXNode] {
override def hasNext: Boolean = false
override def next(): NXNode = null
}
Also, please remove attribution to me on this code that I did not write
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
Thank you, tone police.
using(getClass.getResourceAsStream("/XML/Etc.nx.gz"))(stream => {
bytes = GzipParser.readGzip(stream)
})
Actually according to the MIT license I should mention the original license on anything that would be a copy (Possibly this is just my misunderstanding of what a 'copy' could be considered to be)
Or you could just use the library to begin with and submit a PR if you want to make changes.Anyways, thank you for this reply, I will use as a reference to create my own reader.
The snark is real. The issue isn't that it's being re-used. The issue is that you're not actually using it. You "ported" it to Scala by taking the exact same code and rewriting it with Scala syntax.(as you apparently do not like the fact your public source is re-used)
You must be registered to see links
Really? You're loading compressed NX files?Code:using(getClass.getResourceAsStream("/XML/Etc.nx.gz"))(stream => { bytes = GzipParser.readGzip(stream) })
I find it hilarious how people are using the NX file format.
NX was designed first and foremost for me, for my C++/Rust, so that I can memory map the file and access the data directory with almost no loading and without using up significant amounts of memory.
Meanwhile here you are compressing your NX files so that not only do you have all the loaded NX data in memory, but you also have the decompressed file itself in memory.
The set of NX files for servers (so no bitmaps or sounds) was 451 MB back in GMS v141. Do you really want to throw that much memory away, plus the CPU time to decompress that, just for the sake of saving a bit of hard drive space?
I just find it incredulous that anyone would be willing to have their server take longer to startup just to save a bit of hard drive space.I did this because most files will be parsed (almost) completely and I will only save the information I need in the memory.
So the extra allocated memory for the files will be cleared right after I have collected all data.
As for the compression, I do not understand the problem of it taking a little more cpu time, as it will only be called when the server is started.