mirror of https://github.com/deavminet/libdnet.git
ProtocolBuffer generated code works
Made umports public Added stub createChannel method and Channel class
This commit is contained in:
parent
59d64a50df
commit
aeec429991
Binary file not shown.
Binary file not shown.
15
README.md
15
README.md
|
@ -8,3 +8,18 @@ DNET client library. This library also contains some data structures used by the
|
||||||
There are two _"sets"_, persay, of data structures in the library, there are those generated by ProtocolBuffers and then which are used by the library internally. There are then the OOP data structures used by the user through the API.
|
There are two _"sets"_, persay, of data structures in the library, there are those generated by ProtocolBuffers and then which are used by the library internally. There are then the OOP data structures used by the user through the API.
|
||||||
|
|
||||||
The former are located in `source/libdnet/protobuf/` and the latter in `source/libdnet/api/types/`
|
The former are located in `source/libdnet/protobuf/` and the latter in `source/libdnet/api/types/`
|
||||||
|
|
||||||
|
## Todo
|
||||||
|
|
||||||
|
Below is a todo list of what needs to be done. There is a lot of work ahead and many projects that are being used to make this piece of art come to life.
|
||||||
|
|
||||||
|
- [ ] ProtocolBuffer definitions
|
||||||
|
- [ ] Server-side encoding
|
||||||
|
- [ ] Server-to-client
|
||||||
|
- [ ] Server-to-server (not urgent)
|
||||||
|
- [ ] Client-side encoding
|
||||||
|
- [ ] Encoder/Decoder functions (for the above)
|
||||||
|
- [ ] Setup eventing system
|
||||||
|
- [ ] `tristanable` dequeue loop with hooking system into `eventy`
|
||||||
|
- [ ] Task queuing and completion with `eventy`
|
||||||
|
- [ ] Asynchronous notifications support via `eventy`
|
BIN
bin/liblibdnet.a
BIN
bin/liblibdnet.a
Binary file not shown.
|
@ -4,7 +4,7 @@
|
||||||
protoCodeFile=source/libdnet/protobuf/dnet.d
|
protoCodeFile=source/libdnet/protobuf/dnet.d
|
||||||
|
|
||||||
# Fix up
|
# Fix up
|
||||||
cat $protoCodeFile | sed -e "s/source.libdnet.protobuf./ /" > tmpFile
|
cat $protoCodeFile | sed -e "s/import source.libdnet.protobuf./public import /" > tmpFile
|
||||||
|
|
||||||
# Fix up module header
|
# Fix up module header
|
||||||
cat tmpFile | sed -e "s/dnet/libdnet.protobuf.dnet/" > tmpFile2
|
cat tmpFile | sed -e "s/dnet/libdnet.protobuf.dnet/" > tmpFile2
|
||||||
|
|
|
@ -17,6 +17,21 @@ import libdnet.protobuf.dnet;
|
||||||
* is mirrored into the library)
|
* is mirrored into the library)
|
||||||
*/
|
*/
|
||||||
public final class Client
|
public final class Client
|
||||||
|
{
|
||||||
|
public Channel createChannel(string name)
|
||||||
|
{
|
||||||
|
Channel newChannel;
|
||||||
|
|
||||||
|
/* TODO: Check if the channel exists firstly */
|
||||||
|
ChannelMessage d = new ChannelMessage();
|
||||||
|
d.name = name;
|
||||||
|
d.type = ChannelMessage.MessageType.CREATE;
|
||||||
|
|
||||||
|
return newChannel;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public final class Channel
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
|
@ -11,7 +11,8 @@ class ChannelMessage
|
||||||
{
|
{
|
||||||
@Proto(1) MessageType type = protoDefaultValue!MessageType;
|
@Proto(1) MessageType type = protoDefaultValue!MessageType;
|
||||||
@Proto(2) string name = protoDefaultValue!string;
|
@Proto(2) string name = protoDefaultValue!string;
|
||||||
@Proto(3) bytes additionalData = protoDefaultValue!bytes;
|
@Proto(3) string statusCode = protoDefaultValue!string;
|
||||||
|
@Proto(4) bytes additionalData = protoDefaultValue!bytes;
|
||||||
|
|
||||||
enum MessageType
|
enum MessageType
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,9 @@ message ChannelMessage
|
||||||
// The channel to which the command applies
|
// The channel to which the command applies
|
||||||
string name = 2;
|
string name = 2;
|
||||||
|
|
||||||
|
// (Only for returns)
|
||||||
|
string statusCode = 3;
|
||||||
|
|
||||||
// Additional data (dependent on command)
|
// Additional data (dependent on command)
|
||||||
bytes additionalData = 3;
|
bytes additionalData = 4;
|
||||||
}
|
}
|
|
@ -1,13 +1,13 @@
|
||||||
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
// Generated by the protocol buffer compiler. DO NOT EDIT!
|
||||||
// source: libdnet.protobuf.dnet.proto
|
// source: source/liblibdnet.protobuf.dnet/protobuf/dnet.proto
|
||||||
|
|
||||||
module libdnet.protobuf.dnet;
|
module libdnet.protobuf.dnet;
|
||||||
|
|
||||||
import google.protobuf;
|
import google.protobuf;
|
||||||
import account;
|
public import account;
|
||||||
import channel;
|
public import channel;
|
||||||
import server;
|
public import server;
|
||||||
import property;
|
public import property;
|
||||||
|
|
||||||
enum protocVersion = 3014000;
|
enum protocVersion = 3014000;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue