/*----------------------------------------------- *本文件由代码生成器自动生成, *千万不要修改本文件的任何代码, *修改的的任何代码都会被覆盖掉! --------------------------------------------------*/ using System.IO; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Pomelo.DotNetClient; namespace pomelo.area { public class FriendHandler { private PomeloClient _socket; public FriendGetAllFriendsResponse lastFriendGetAllFriendsResponse { get { return _socket.GetLastResponse(); } } public FriendApplyResponse lastFriendApplyResponse { get { return _socket.GetLastResponse(); } } public FriendAllApplyResponse lastFriendAllApplyResponse { get { return _socket.GetLastResponse(); } } public FriendAgreeApplyResponse lastFriendAgreeApplyResponse { get { return _socket.GetLastResponse(); } } public FriendAllAgreeApplyResponse lastFriendAllAgreeApplyResponse { get { return _socket.GetLastResponse(); } } public FriendRefuceApplyResponse lastFriendRefuceApplyResponse { get { return _socket.GetLastResponse(); } } public FriendAllRefuceApplyResponse lastFriendAllRefuceApplyResponse { get { return _socket.GetLastResponse(); } } public FriendDeleteResponse lastFriendDeleteResponse { get { return _socket.GetLastResponse(); } } public FriendDeleteChouRenResponse lastFriendDeleteChouRenResponse { get { return _socket.GetLastResponse(); } } public FriendAllDeleteChouRenResponse lastFriendAllDeleteChouRenResponse { get { return _socket.GetLastResponse(); } } public FriendAddChouRenResponse lastFriendAddChouRenResponse { get { return _socket.GetLastResponse(); } } public AddFriendInfoResponse lastAddFriendInfoResponse { get { return _socket.GetLastResponse(); } } public QueryPlayerNameResponse lastQueryPlayerNameResponse { get { return _socket.GetLastResponse(); } } public ConcernFriendResponse lastConcernFriendResponse { get { return _socket.GetLastResponse(); } } public ConcernAllFriendResponse lastConcernAllFriendResponse { get { return _socket.GetLastResponse(); } } public FriendMessageListResponse lastFriendMessageListResponse { get { return _socket.GetLastResponse(); } } public DeleteAllFriendMessageResponse lastDeleteAllFriendMessageResponse { get { return _socket.GetLastResponse(); } } public DeleteBlackListResponse lastDeleteBlackListResponse { get { return _socket.GetLastResponse(); } } public DeleteAllBlackListResponse lastDeleteAllBlackListResponse { get { return _socket.GetLastResponse(); } } public AddBlackListResponse lastAddBlackListResponse { get { return _socket.GetLastResponse(); } } public GetSocialInfoResponse lastGetSocialInfoResponse { get { return _socket.GetLastResponse(); } } public GetShopItemListResponse lastGetShopItemListResponse { get { return _socket.GetLastResponse(); } } public ExchangeFriendShopItemResponse lastExchangeFriendShopItemResponse { get { return _socket.GetLastResponse(); } } public GetRecentChatListResponse lastGetRecentChatListResponse { get { return _socket.GetLastResponse(); } } public GetChatMsgResponse lastGetChatMsgResponse { get { return _socket.GetLastResponse(); } } public RmChatMsgResponse lastRmChatMsgResponse { get { return _socket.GetLastResponse(); } } public GivePresentsResponse lastGivePresentsResponse { get { return _socket.GetLastResponse(); } } public ReadVoiceMsgResponse lastReadVoiceMsgResponse { get { return _socket.GetLastResponse(); } } static FriendHandler() { EventTypes.RegistPushType("area.friendPush.sendItemPush", typeof(SendItemPush)); EventTypes.RegistPushType("area.friendPush.favorabilityOrAdoreUpdatePush", typeof(FavorabilityOrAdoreUpdatePush)); EventTypes.RegistPushType("area.friendPush.friendOnlineOrOfflinePush", typeof(FriendOnlineOrOfflinePush)); EventTypes.RegistRequestType("area.friendHandler.friendGetAllFriendsRequest", typeof(FriendGetAllFriendsRequest), typeof(FriendGetAllFriendsResponse)); EventTypes.RegistRequestType("area.friendHandler.friendApplyRequest", typeof(FriendApplyRequest), typeof(FriendApplyResponse)); EventTypes.RegistRequestType("area.friendHandler.friendAllApplyRequest", typeof(FriendAllApplyRequest), typeof(FriendAllApplyResponse)); EventTypes.RegistRequestType("area.friendHandler.friendAgreeApplyRequest", typeof(FriendAgreeApplyRequest), typeof(FriendAgreeApplyResponse)); EventTypes.RegistRequestType("area.friendHandler.friendAllAgreeApplyRequest", typeof(FriendAllAgreeApplyRequest), typeof(FriendAllAgreeApplyResponse)); EventTypes.RegistRequestType("area.friendHandler.friendRefuceApplyRequest", typeof(FriendRefuceApplyRequest), typeof(FriendRefuceApplyResponse)); EventTypes.RegistRequestType("area.friendHandler.friendAllRefuceApplyRequest", typeof(FriendAllRefuceApplyRequest), typeof(FriendAllRefuceApplyResponse)); EventTypes.RegistRequestType("area.friendHandler.friendDeleteRequest", typeof(FriendDeleteRequest), typeof(FriendDeleteResponse)); EventTypes.RegistRequestType("area.friendHandler.friendDeleteChouRenRequest", typeof(FriendDeleteChouRenRequest), typeof(FriendDeleteChouRenResponse)); EventTypes.RegistRequestType("area.friendHandler.friendAllDeleteChouRenRequest", typeof(FriendAllDeleteChouRenRequest), typeof(FriendAllDeleteChouRenResponse)); EventTypes.RegistRequestType("area.friendHandler.friendAddChouRenRequest", typeof(FriendAddChouRenRequest), typeof(FriendAddChouRenResponse)); EventTypes.RegistRequestType("area.friendHandler.addFriendInfoRequest", typeof(AddFriendInfoRequest), typeof(AddFriendInfoResponse)); EventTypes.RegistRequestType("area.friendHandler.queryPlayerNameRequest", typeof(QueryPlayerNameRequest), typeof(QueryPlayerNameResponse)); EventTypes.RegistRequestType("area.friendHandler.concernFriendRequest", typeof(ConcernFriendRequest), typeof(ConcernFriendResponse)); EventTypes.RegistRequestType("area.friendHandler.concernAllFriendRequest", typeof(ConcernAllFriendRequest), typeof(ConcernAllFriendResponse)); EventTypes.RegistRequestType("area.friendHandler.friendMessageListRequest", typeof(FriendMessageListRequest), typeof(FriendMessageListResponse)); EventTypes.RegistRequestType("area.friendHandler.deleteAllFriendMessageRequest", typeof(DeleteAllFriendMessageRequest), typeof(DeleteAllFriendMessageResponse)); EventTypes.RegistRequestType("area.friendHandler.deleteBlackListRequest", typeof(DeleteBlackListRequest), typeof(DeleteBlackListResponse)); EventTypes.RegistRequestType("area.friendHandler.deleteAllBlackListRequest", typeof(DeleteAllBlackListRequest), typeof(DeleteAllBlackListResponse)); EventTypes.RegistRequestType("area.friendHandler.addBlackListRequest", typeof(AddBlackListRequest), typeof(AddBlackListResponse)); EventTypes.RegistRequestType("area.friendHandler.getSocialInfoRequest", typeof(GetSocialInfoRequest), typeof(GetSocialInfoResponse)); EventTypes.RegistRequestType("area.friendHandler.getShopItemListRequest", typeof(GetShopItemListRequest), typeof(GetShopItemListResponse)); EventTypes.RegistRequestType("area.friendHandler.exchangeFriendShopItemRequest", typeof(ExchangeFriendShopItemRequest), typeof(ExchangeFriendShopItemResponse)); EventTypes.RegistRequestType("area.friendHandler.getRecentChatListRequest", typeof(GetRecentChatListRequest), typeof(GetRecentChatListResponse)); EventTypes.RegistRequestType("area.friendHandler.getChatMsgRequest", typeof(GetChatMsgRequest), typeof(GetChatMsgResponse)); EventTypes.RegistRequestType("area.friendHandler.rmChatMsgRequest", typeof(RmChatMsgRequest), typeof(RmChatMsgResponse)); EventTypes.RegistRequestType("area.friendHandler.givePresentsRequest", typeof(GivePresentsRequest), typeof(GivePresentsResponse)); EventTypes.RegistRequestType("area.friendHandler.readVoiceMsgRequest", typeof(ReadVoiceMsgRequest), typeof(ReadVoiceMsgResponse)); } public FriendHandler(PomeloClient socket) { this._socket = socket; } public void friendGetAllFriendsRequest(string c2s_friendId,int c2s_type,Action cb,object option = null) { var request = new FriendGetAllFriendsRequest(); request.c2s_friendId= c2s_friendId; request.c2s_type= c2s_type; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendGetAllFriendsResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendApplyRequest(string c2s_toPlayerId,Action cb,object option = null) { var request = new FriendApplyRequest(); request.c2s_toPlayerId= c2s_toPlayerId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendApplyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendAllApplyRequest(List c2s_toPlayerIds,Action cb,object option = null) { var request = new FriendAllApplyRequest(); request.c2s_toPlayerIds.AddRange(c2s_toPlayerIds); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendAllApplyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendAgreeApplyRequest(string c2s_requestId,Action cb,object option = null) { var request = new FriendAgreeApplyRequest(); request.c2s_requestId= c2s_requestId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendAgreeApplyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendAllAgreeApplyRequest(List c2s_requestIds,Action cb,object option = null) { var request = new FriendAllAgreeApplyRequest(); request.c2s_requestIds.AddRange(c2s_requestIds); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendAllAgreeApplyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendRefuceApplyRequest(string c2s_requestId,Action cb,object option = null) { var request = new FriendRefuceApplyRequest(); request.c2s_requestId= c2s_requestId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendRefuceApplyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendAllRefuceApplyRequest(List c2s_requestIds,Action cb,object option = null) { var request = new FriendAllRefuceApplyRequest(); request.c2s_requestIds.AddRange(c2s_requestIds); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendAllRefuceApplyResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendDeleteRequest(string c2s_friendId,Action cb,object option = null) { var request = new FriendDeleteRequest(); request.c2s_friendId= c2s_friendId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendDeleteResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendDeleteChouRenRequest(string c2s_chouRenId,Action cb,object option = null) { var request = new FriendDeleteChouRenRequest(); request.c2s_chouRenId= c2s_chouRenId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendDeleteChouRenResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendAllDeleteChouRenRequest(List c2s_chouRenIds,Action cb,object option = null) { var request = new FriendAllDeleteChouRenRequest(); request.c2s_chouRenIds.AddRange(c2s_chouRenIds); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendAllDeleteChouRenResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendAddChouRenRequest(string c2s_chouRenId,Action cb,object option = null) { var request = new FriendAddChouRenRequest(); request.c2s_chouRenId= c2s_chouRenId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendAddChouRenResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void addFriendInfoRequest(Action cb,object option = null) { var request = new AddFriendInfoRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as AddFriendInfoResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void queryPlayerNameRequest(string c2s_strName,Action cb,object option = null) { var request = new QueryPlayerNameRequest(); request.c2s_strName= c2s_strName; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as QueryPlayerNameResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void concernFriendRequest(string c2s_friendId,Action cb,object option = null) { var request = new ConcernFriendRequest(); request.c2s_friendId= c2s_friendId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ConcernFriendResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void concernAllFriendRequest(List c2s_friendIds,Action cb,object option = null) { var request = new ConcernAllFriendRequest(); request.c2s_friendIds.AddRange(c2s_friendIds); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ConcernAllFriendResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void friendMessageListRequest(Action cb,object option = null) { var request = new FriendMessageListRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as FriendMessageListResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void deleteAllFriendMessageRequest(Action cb,object option = null) { var request = new DeleteAllFriendMessageRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as DeleteAllFriendMessageResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void deleteBlackListRequest(string c2s_blackListId,Action cb,object option = null) { var request = new DeleteBlackListRequest(); request.c2s_blackListId= c2s_blackListId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as DeleteBlackListResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void deleteAllBlackListRequest(Action cb,object option = null) { var request = new DeleteAllBlackListRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as DeleteAllBlackListResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void addBlackListRequest(string c2s_blackListId,Action cb,object option = null) { var request = new AddBlackListRequest(); request.c2s_blackListId= c2s_blackListId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as AddBlackListResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getSocialInfoRequest(Action cb,object option = null) { var request = new GetSocialInfoRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetSocialInfoResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getShopItemListRequest(Action cb,object option = null) { var request = new GetShopItemListRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetShopItemListResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void exchangeFriendShopItemRequest(int c2s_itemId,int c2s_num,Action cb,object option = null) { var request = new ExchangeFriendShopItemRequest(); request.c2s_itemId= c2s_itemId; request.c2s_num= c2s_num; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ExchangeFriendShopItemResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getRecentChatListRequest(Action cb,object option = null) { var request = new GetRecentChatListRequest(); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetRecentChatListResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void getChatMsgRequest(string c2s_friendId,Action cb,object option = null) { var request = new GetChatMsgRequest(); request.c2s_friendId= c2s_friendId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GetChatMsgResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void rmChatMsgRequest(string c2s_friendId,Action cb,object option = null) { var request = new RmChatMsgRequest(); request.c2s_friendId= c2s_friendId; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as RmChatMsgResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void givePresentsRequest(string c2s_friendId,int c2s_giveType,List c2s_item,Action cb,object option = null) { var request = new GivePresentsRequest(); request.c2s_friendId= c2s_friendId; request.c2s_giveType= c2s_giveType; request.c2s_item.AddRange(c2s_item); _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as GivePresentsResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void readVoiceMsgRequest(string c2s_friendId,string c2s_msgTime,Action cb,object option = null) { var request = new ReadVoiceMsgRequest(); request.c2s_friendId= c2s_friendId; request.c2s_msgTime= c2s_msgTime; _socket.request(request, (object msg, out int s2c_code, out string s2c_msg) => { var rsp = msg as ReadVoiceMsgResponse; s2c_code = rsp.s2c_code; s2c_msg = rsp.s2c_msg; return s2c_code == 200; }, cb, option); } public void onSendItemPush(Action cb) { _socket.listen_once(cb); } public void onFavorabilityOrAdoreUpdatePush(Action cb) { _socket.listen_once(cb); } public void onFriendOnlineOrOfflinePush(Action cb) { _socket.listen_once(cb); } } }