//[MethodImpl(MethodImplOptions.Synchronized)] private Task <T> Request <T>(DBRequestType type, DBResponseType responseType, uint?parameter, object complexParameter) { lock (Sync) { var id = NextMessageId(); var taskSource = new TaskCompletionSource <T>(); var pending = new PendingRequest(); pending.Callback = x => { taskSource.SetResult((T)x); }; pending.RequestType = type; pending.ResponseType = responseType; PendingRequests.Add(id, pending); this.CityClient.Write(new DBRequestWrapperPDU() { Sender = new Sender { AriesID = "0", MasterAccountID = "0", }, SendingAvatarID = id, Body = new cTSONetMessageStandard() { DatabaseType = type.GetRequestID(), Parameter = parameter, ComplexParameter = complexParameter } }); return((Task <T>)taskSource.Task); } }
public DatabaseResponse(DBResponseType type) { Type = type; }
public static uint GetResponseID(this DBResponseType type) { switch (type) { case DBResponseType.GetHouseThumbByID: return(0x9BF19573); case DBResponseType.GetLotAndObjects: return(0x8C6B0A49); case DBResponseType.GetLotList: return(0xDBEECD65); case DBResponseType.GetMaxPlayerPerLot: return(0xDF0A0528); case DBResponseType.GetNeighborhoods: return(0x6AE0FD6E); case DBResponseType.GetShardVersion: return(0x9E2095BE); case DBResponseType.GetTopList: return(0xA928455B); case DBResponseType.GetTopResultSetByID: return(0xFCD03A1B); case DBResponseType.InsertBookmarks: return(0x69CBE384); case DBResponseType.InsertGenericTask: return(0xA98B6783); case DBResponseType.InsertNeighborhoods: return(0x4AE12821); case DBResponseType.InsertNewAvatar: return(0x0A3C127F); case DBResponseType.InsertNewFriendshipComment: return(0xEAE8E26F); case DBResponseType.InsertPendingRoomateInv: return(0xBCE989F6); case DBResponseType.InsertSpotlightTextByLotID: return(0x0B8AE5E6); case DBResponseType.MoveOutByAvatarID: return(0x8CEEB761); case DBResponseType.LoadAvatarByID: return(0x2ADF8FF5); case DBResponseType.MoveLotByID: return(0xAB4266CE); case DBResponseType.PrtControlToggleByAvatarID: return(0x6A53F3F6); case DBResponseType.ReleaseAvatarLease: return(0xAB9EB010); case DBResponseType.RenewAvatarLease: return(0x2B9EB082); case DBResponseType.SaveAvatarByID: return(0x2ADDE27E); case DBResponseType.SaveLotAndObjectBlobByID: return(0xCBFD899C); case DBResponseType.Search: return(0xC94837CC); case DBResponseType.SearchExactMatch: return(0x89527401); case DBResponseType.SellObject: return(0x8BFD895F); case DBResponseType.SetFriendshipComment: return(0xAAE0AE66); case DBResponseType.SetLotDesc: return(0x4A70B913); case DBResponseType.SetLotName: return(0xAA70B969); case DBResponseType.SetMoneyFields: return(0xFCF14801); case DBResponseType.StockDress: return(0x4B4510D5); case DBResponseType.UpdateBadgeByID: return(0xCAFB31A4); case DBResponseType.UpdateCharDescByID: return(0x6A3FED66); case DBResponseType.UpdateDataServiceLotAdmitInfo_AddAdmittedID: return(0xAA270399); case DBResponseType.UpdateDataServiceLotAdmitInfo_AddBannedID: return(0xCA2703AF); case DBResponseType.UpdateDataServiceLotAdmitInfo_RemoveAdmittedID: return(0xCA2703C0); case DBResponseType.UpdateDataServiceLotAdmitInfo_RemoveBannedID: return(0xEA2703DD); case DBResponseType.UpdateDataServiceLotAdmitInfo_SetAdmitMode: return(0x0A2703F4); case DBResponseType.GetSpotlightLotList: return(0xCBD4DD94); case DBResponseType.GetFinancialDetail: return(0x4C23D6C1); case DBResponseType.GetOnlineJobLot: return(0x2C3BC494); case DBResponseType.OnlineJobLotDesactivate: return(0x8C509438); case DBResponseType.OnlineJobLotRequestDesactivation: return(0x4C9D236B); case DBResponseType.OnlineJobOccupantDesactivate: return(0xEC96E1E7); case DBResponseType.UpdatePrivacyModeByID: return(0x20C61C89); case DBResponseType.GetDataUpdateEventsLastSeqID: return(0x0BB12839); case DBResponseType.GetDataUpdateEvents: return(0x0B5E202B); case DBResponseType.GetNeighborhoodInfo: return(0x0B7ADA36); case DBResponseType.CallCreateFriends: return(0x61586EB4); case DBResponseType.CallDecayRelationships: return(0xA1586F52); case DBResponseType.UpdateRelationshipLastContact: return(0xCD33BF75); case DBResponseType.RenameAvatar: return(0xB061033E); case DBResponseType.AcceptPendingRoomateInv: return(0xDCE98A01); case DBResponseType.AcquireAvatarLease: return(0x4B9D77CA); case DBResponseType.BuyDress: return(0xCB44F065); case DBResponseType.BuyLotByAvatarID: return(0xBD8DDB9B); case DBResponseType.BuyObject: return(0x4BFD8A12); case DBResponseType.DeleteAttributeByAvatarID: return(0xCB393006); case DBResponseType.DeleteAvatarByID: return(0x4A52E0E6); case DBResponseType.DeleteBookmarks: return(0x69CBE292); case DBResponseType.DeleteObject: return(0x2B219B40); case DBResponseType.DeleteSpotlightTextByLotID: return(0x2B8D6F0B); case DBResponseType.GetAvatarIDByName: return(0xE95BB42F); case DBResponseType.GetAvatarInventoryByID: return(0x2BFD89F5); case DBResponseType.GetBookmarks: return(0x3D8F9003); case DBResponseType.GetCharByID: return(0x1BAE532A); case DBResponseType.GetCityType: return(0x4A3929BB); case DBResponseType.GetDataServiceBuildableMapInfoByXY: return(0x6A3D7A09); case DBResponseType.GetDataServiceLotAdmitInfo: return(0xEA245646); case DBResponseType.GetDataServiceLotInfoByXY: return(0xE9C81D0A); case DBResponseType.GetDebitCreditTask: return(0x898A168C); case DBResponseType.GetGenericFlash: return(0x3FE8B5A4); case DBResponseType.GetHouseLeaderByLotID: return(0xBD90911F); case DBResponseType.GetObjectTuningVariables: return(0xD6327954); case DBResponseType.GetObjectsAndCatalog: return(0x6E8EAC4E); case DBResponseType.CreateObject: return(0xABCD897C); case DBResponseType.GetSelector: return(0x2C371266); case DBResponseType.GetGameConstants: return(0xE1299B7A); case DBResponseType.RecordFeedEvent: return(0x41C22C14); case DBResponseType.DebitCredit: return(0x3C24F6BC); case DBResponseType.GetAllRelationshipsByID: return(0xCB4A60AC); case DBResponseType.GetDataServiceAvatarBudgetByID: return(0x4AA84819); case DBResponseType.GetDataServiceAvatarSkillsByID: return(0x8AA81196); case DBResponseType.GetFriendshipWebCommentByID: return(0x0AE9F8F1); case DBResponseType.InsertGenericFlash: return(0x3FF83299); case DBResponseType.SecureTrade: return(0xABFD897C); case DBResponseType.SetDataServiceAvatarVarSkillLockByID: return(0xAB9DE815); case DBResponseType.SetLotCategory: return(0xCAD4C4F8); case DBResponseType.SetLotNeighborhoodID: return(0x0AF53C18); case DBResponseType.SetNeighborhoodCenterGridXY: return(0xAB0848EF); case DBResponseType.InventoryTransfer: return(0x4BFDC6DB); case DBResponseType.GetSelectorApproval: return(0xA46A18AD); case DBResponseType.DebitCreditSharedAccount: return(0xBCD04D22); case DBResponseType.ExternalBankTransaction: return(0xF898CE34); } return(0); }