Comments (10)
from obsidian.
me too my friend
from obsidian.
Hello @Mooshua! Thank you for taking interest in contributing.
You already got the gist of it, clearly. There are some important things to keep in mind (that are perhaps, not intuitive):
[Field(0), ActualType(byte)]
public MyEnum MyEnumValue { get; } // although it's an enum, it gets written as a byte
[Field(0), VarLength]
public int VarInt { get; } // gets written as varint
[Field(1), VarLength]
public long VarLong { get; } // gets written as varlong
[Field(0)]
public int[] Values { get; } // first Values.Length gets written as a varint, then the actual Values get written
[Field(1), CountType(typeof(short))]
public int[] Values { get; } // first Values.Length gets written as a short, then the actual Values get written
When there is X, Y and Z coordinates in the packet, you don't have to make them separate fields, you can use Vector
or VectorF
(for float/double) with [DataFormat(typeof(...))]
. So for example if a packet looked like:
Field | Type |
---|---|
X | float |
Y | float |
Z | float |
The packet would look like:
[Field(0), DataFormat(typeof(float))]
public VectorF Position { get; }
Sometimes, packet fields are only supposed to be written under some condition. You can use the [Condition]
attribute for that.
[Field(0)]
public int ValidChangesCount { get; }
[Field(1), Condition("ValidChangesCount > 0")]
public int[] Changes { get; }
// Generates something like:
// if (ValidChangesCount > 0)
// {
// WriteIntArray(Changes);
// }
You can view generated sserialization methods in Solution Explorer under Obsidian > Dependencies > Analyzers > Obsidian.SourceGenerators > Obsidian.SourceGenerators.Packets.Serialization.
Happy coding! ⛄
from obsidian.
нiхуя собi блять
from obsidian.
english?
from obsidian.
english?
"I'm very surprised at this number of packets" culturally speaking
from obsidian.
Welcome hacktoberfest people! A lot of packets are still unimplemented. Any help is very much welcome!
from obsidian.
UPDATE TO MATCH THE NEWEST PROTOCOL!
from obsidian.
Hi—what exactly is needed to implement a packet, from the perspective of a new contributor?
Currently my understanding is client bound packets simply need correct fields & ordering, and serverbound need “handler” functions for updating server state.
Are there any gotchas to contributing a packet that I’m missing?
Thanks.
from obsidian.
Added priority: blocking as this is very important. Help is very much welcome. Will update list with wiki.vg in a bit.
from obsidian.
Related Issues (20)
- Rename Obsidian.Utilities.Collection to plural
- Cancellable Events Can Be Uncancelled HOT 1
- [Proposal] Upgrade Event System HOT 1
- Feature Request: Implementing Bookmark Bar, Folder Bar, Tab Groups, and Web Mode in Obsidian HOT 3
- Editing view is no longer showing the table preview HOT 3
- Obsidian freezing and lagging when opening pdf files. HOT 1
- Hey, I want to contruibute and develop with you guys. Where should I start?
- We should add information about setting Obsidian.ConsoleApp as startup project
- Getting rid of GlobalUsings in the source code
- Fix compression
- Properly use logger
- Further implement the changed PlayerChatMessagePacket.cs
- Add internal method for broadcasting packet to players only in same world HOT 1
- Players shouldn't spawn in the void when switching worlds
- Packet priority HOT 6
- Not Found HOT 4
- Allow configuration through ENV variables HOT 5
- Server crash when closing HOT 1
- Clients should use JSON configured server render distance
- Server crashes when closing HOT 1
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 obsidian.