Beispiel #1
0
    public void Login(string name, string pwd)
    {
        Debug.Log("name = " + name + "; pwd = " + pwd);

        NetBitStream stream = new NetBitStream();

        stream.BeginWrite((ushort)Protocol.ID.LOGIN);

        LoginProto.Login login = new LoginProto.Login();
        login.name = name;
        login.pwd  = pwd;

        System.IO.MemoryStream mstream = new System.IO.MemoryStream();
        ProtoBuf.Serializer.Serialize <LoginProto.Login>(mstream, login);
        byte[] bs = mstream.ToArray();

        stream.WriteBodyBytes(bs);
        stream.EncodeHeader();

        _SvrMgr.Send(stream);
    }