public void SendNewuser(string userid, string password, string email) { m_userPP.DoRequest <ReqNewUser, RespNewUser>("ReqNewUser", (sendObj) => { sendObj.SetParameter(new ReqNewUser() { userid = userid, password = password, email = email }); }, (recvObj) => { if (recvObj.header.code == Packet.Header.Code.OK) { Console.Out.WriteLine("user registration success"); } else if (recvObj.param.status == RespNewUser.Status.DuplicatedID) { Console.Out.WriteLine("duplicated id"); } else if (recvObj.param.status == RespNewUser.Status.AlreadyRegisteredEmail) { Console.Out.WriteLine("already registered email"); } }); }
public void SendPostNotice(string title, string desc) { m_notiPP.DoRequest <ReqPostNotice, EmptyParam>("ReqPostNotice", (send) => { send.SetParameter(new ReqPostNotice { title = title, desc = desc }); }, (recv) => { }); }
public void SendCheckAuth() { m_authPP.DoRequest <EmptyParam, EmptyParam>("ReqCheckAuth", (sendObj) => { }, (recvObj) => { if (recvObj.header.code == Packet.Header.Code.OK) { Console.Out.WriteLine("auth key valid"); } else { Console.Out.WriteLine("auth key invalid - need login"); } }); }
// public int SendNewPost(string title, string description, string sourceURL, bool isPrivate, IList <byte[]> dataList = null) { var postID = -1; m_postPP.DoRequest <ReqNewPosting, RespPostingModify>("ReqNewPosting", (send) => { send.SetParameter(new ReqNewPosting { title = title, desc = description, sourceURL = sourceURL, isPrivate = isPrivate, }); if (dataList != null) { foreach (var data in dataList) { send.AddBinaryData(data); } } }, (recv) => { postID = recv.param.postID; }); return(postID); }
public void SendFileReport_Posting(string shortdesc, string longdesc, int postid, ReqFileReport.PostReportReason reason) { m_reptPP.DoRequest <ReqFileReport, RespFileReport>("ReqFileReport", (send) => { send.SetParameter(new ReqFileReport { type = ReqFileReport.Type.Posting, shortdesc = shortdesc, longdesc = longdesc, reportingPostID = postid, postReportReason = reason, }); }, (recv) => { }); }
protected void DoRequest <SendParamT, RecvParamT>(string sendTypeStr, Action <BaseProcedurePool.ISend <SendParamT> > sendFunc, Action <BaseProcedurePool.IReceive <RecvParamT> > recvFunc) where SendParamT : class where RecvParamT : class { m_procPool.DoRequest <SendParamT, RecvParamT>(sendTypeStr, sendFunc, recvFunc); }