Exemplo n.º 1
0
        public static byte[] MakeConnectBuffer(long userId, string matchId, string matchToken)
        {
            var builder = new MessageBuilder();

            var matchIdOffset    = builder.CreateString(matchId);
            var matchTokenOffset = builder.CreateString(matchToken);

            Connect.StartConnect(builder);

            Connect.AddOpcode(builder, (sbyte)Opcode.Connect);
            Connect.AddUserId(builder, userId);
            Connect.AddMatchId(builder, matchIdOffset);
            Connect.AddExternalToken(builder, matchTokenOffset);

            var connectPacketOffset = Connect.EndConnect(builder);

            builder.Finish(connectPacketOffset.Value);

            return(builder.SizedByteArray());
        }
Exemplo n.º 2
0
 public static Offset <Connect> CreateConnect(FlatBufferBuilder builder,
                                              short opcode = 1,
                                              long userId  = 0,
                                              StringOffset matchIdOffset       = default(StringOffset),
                                              StringOffset externalTokenOffset = default(StringOffset),
                                              StringOffset clientVersionOffset = default(StringOffset),
                                              short clientCode     = 0,
                                              short clientPlatform = 0,
                                              bool reconnecting    = false)
 {
     builder.StartTable(8);
     Connect.AddUserId(builder, userId);
     Connect.AddClientVersion(builder, clientVersionOffset);
     Connect.AddExternalToken(builder, externalTokenOffset);
     Connect.AddMatchId(builder, matchIdOffset);
     Connect.AddClientPlatform(builder, clientPlatform);
     Connect.AddClientCode(builder, clientCode);
     Connect.AddOpcode(builder, opcode);
     Connect.AddReconnecting(builder, reconnecting);
     return(Connect.EndConnect(builder));
 }