protected override void PrepareCmd(AnpMsg cmd) { cmd.Type = (uint)KAnp.KANP_CMD_PB_ACCEPT_CHAT; cmd.AddUInt64(RequestID); cmd.AddUInt32(UserID); cmd.AddUInt32(UserID); }
protected override void PrepareCmd(AnpMsg cmd) { cmd.Type = (uint)KAnp.KANP_CMD_KWS_INVITE_KWS; cmd.AddString(InvitationMsg); cmd.AddUInt32((UInt32)UserList.Count); foreach (User u in UserList) { cmd.AddString(u.UserName); cmd.AddString(u.EmailAddress); cmd.AddUInt64(u.KeyID); cmd.AddString(u.OrgName); cmd.AddString(u.Pwd); cmd.AddUInt32(Convert.ToUInt32(KcdSendEmailFlag)); } }
protected override void FormatSuccessReply(AnpMsg m) { m.Type = (uint)EAnpRes.CreateKws; m.AddUInt64(Kws.InternalID); }
/// <summary> /// Create an EAnp event having the parameters specified. /// </summary> private AnpMsg MakeEAnpEvent(EAnpEvt type, UInt64 date, UInt32 userID, UInt64 freshness) { AnpMsg m = new AnpMsg(); m.Minor = 1; m.Type = (UInt32)type; m.AddUInt64(InternalID); m.AddUInt64(date); m.AddUInt32(userID); m.AddUInt64(freshness); m.AddBin(Wm.MakeUuid()); return m; }
protected override void FormatSuccessReply(AnpMsg m) { m.Type = (uint)EAnpRes.LookupRecAddr; m.AddUInt32((uint)RecList.Count); foreach (Rec r in RecList) { m.AddString(r.Email); m.AddUInt64(r.KeyID); m.AddString(r.OrgName); } }
/// <summary> /// Fetch EAnp events. /// </summary> private void HandleFetchEvent(AnpMsg cmd, AnpMsg res) { int i = 0; UInt64 kwsID = cmd.Elements[i++].UInt64; UInt32 evtID = cmd.Elements[i++].UInt32; UInt32 limit = cmd.Elements[i++].UInt32; List<AnpMsg> l = Wm.LocalDbBroker.FetchEAnpEvents(kwsID, evtID, limit); res.Type = (uint)EAnpRes.FetchEvent; res.AddUInt64(Wm.Cd.UpdateFreshnessTime()); res.AddUInt32((uint)l.Count); foreach (AnpMsg evt in l) res.AddBin(evt.ToByteArray(true)); }