private byte[] buildMessage(string message) { FlatBufferBuilder builder = new FlatBufferBuilder(0x400); StringOffset nameOffset = builder.CreateString("[SYSTEM]"); StringOffset messageOffset = builder.CreateString(message); ChatMessage.StartChatMessage(builder); ChatMessage.AddName(builder, nameOffset); ChatMessage.AddMessage(builder, messageOffset); Offset <ChatMessage> offset3 = ChatMessage.EndChatMessage(builder); builder.Finish(offset3.Value); return(builder.SizedByteArray()); }
private byte[] buildMessage(string message) { FlatBufferBuilder builder = new FlatBufferBuilder(1024); StringOffset nameOffset = builder.CreateString($"[{this.chatName}]: "); StringOffset messageOffset = builder.CreateString(message); StringOffset interestIDOffset = builder.CreateString(this.RoomId); StringOffset regionIDOffset = builder.CreateString(this.RegionId); Offset <Header> mHeaderOffset = Header.CreateHeader(builder, interestIDOffset, regionIDOffset, MessageType.Chat); ChatMessage.StartChatMessage(builder); ChatMessage.AddMHeader(builder, mHeaderOffset); ChatMessage.AddName(builder, nameOffset); ChatMessage.AddMessage(builder, messageOffset); var msg = ChatMessage.EndChatMessage(builder); builder.Finish(msg.Value); return(builder.SizedByteArray()); }