Ejemplo n.º 1
0
    //是否有其他的附加数据 0:否
    public void SendInteractCOMMON(SMsgInteractCOMMON_CS sMsgInteractCOMMON_CS)
    {
        Package pkg = new Package();

        pkg.Head = new PkgHead((byte)MasterMsgType.NET_ROOT_INTERACT, (short)InteractDefineManager.INTERACT_MSG_COMMON);
        pkg.Data = PackageHelper.StructToBytes <SMsgInteractCOMMON_CS>(sMsgInteractCOMMON_CS);
        this.Request(pkg);
    }
Ejemplo n.º 2
0
    public void SendInteractCOMMON(SMsgInteractCOMMON_CS sMsgInteractCOMMON_CS, SMsgInteractCOMMONContext_CS sMsgInteractCOMMONContext_CS)
    {
        Package pkg = new Package();

        pkg.Head = new PkgHead((byte)MasterMsgType.NET_ROOT_INTERACT, (short)InteractDefineManager.INTERACT_MSG_COMMON);
        pkg.Data = PackageHelper.StructToBytes <SMsgInteractCOMMON_CS>(sMsgInteractCOMMON_CS);

        if (1 == sMsgInteractCOMMON_CS.byIsContext)  //鏄惁鏈夊叾浠栫殑闄勫姞鏁版嵁 0:鍚?1:鏄?
        {
            byte[] dataPkg = new byte[pkg.Data.Length + Marshal.SizeOf(typeof(SMsgInteractCOMMONContext_CS))];
            pkg.Data.CopyTo(dataPkg, 0);
            sMsgInteractCOMMONContext_CS.szContext.CopyTo(dataPkg, pkg.Data.Length);
            pkg.Data = dataPkg;
        }

        this.Request(pkg);
    }