public void TryGetClanIDOnlySupportsClanChatRooms(EAccountType type) { var id = new SteamID(4, ( uint )SteamID.ChatInstanceFlags.Clan, EUniverse.Public, type); Assert.False(id.TryGetClanID(out var groupID), groupID?.Render()); Assert.Null(groupID); }
public void InstancedSet(UInt32 unAccountID, UInt32 unInstance, EUniverse eUniverse, EAccountType eAccountType) { AccountID = unAccountID; AccountUniverse = eUniverse; AccountType = eAccountType; AccountInstance = unInstance; }
public void UnknownAccountTypesAreInvalid(EAccountType type) { SteamID sid = 76561198074261126; sid.AccountType = type; Assert.False(sid.IsValid); }
public void InstancedSet( UInt32 unAccountID, UInt32 unInstance, EUniverse eUniverse, EAccountType eAccountType ) { this.AccountID = unAccountID; this.AccountUniverse = eUniverse; this.AccountType = eAccountType; this.AccountInstance = unInstance; }
public PersonInfo AddNewPersonOrUpdate(string personName, string account, EAccountType accountType, EPersonNameTrust trust) { lock (_lockObj) { PersonInfo person = null; if (IsKnownAccount(account, accountType)) { person = GetPerson(account, accountType); Debug.Assert(person != null, String.Format("PersonInfo is null. The account {0} does not seem to be associated with a contact.", account)); person.SetName(personName, trust); } else { Debug.Assert(!String.IsNullOrEmpty(personName), String.Format("Invalid name for the contact with account {0}. Empty name is not valid.", account)); Debug.Assert(!String.IsNullOrEmpty(account), String.Format("Invalid account name for contact {0}. Empty account name is not valid.", personName)); Debug.Assert(!IsKnownAccount(account, accountType), "The account is already associated with a person."); //Trace.WriteLineIf(account.ToLower() != account, String.Format("!!! Warning: added account {0} was not in lower case. Did you forget to put it in lower case?", account)); person = new PersonInfo(MailData, personName, trust); _personIdToPerson[person.PersonId] = person; AssignAccount(account, accountType, person); } return person; } }
public void RegisterUser(string name, string email, string password, EAccountType role, ref IdentityResult result) { if (role == EAccountType.Volunteer) { Volunteer v = new Volunteer { Name = name, Email = email, UserName = email }; result = UserManager.Create(v, password); if (result.Succeeded) { UserManager.AddToRole(v.Id, role.ToString()); SignInManager.SignIn(v, isPersistent: false, rememberBrowser: false); } } else if (role == EAccountType.Ngo) { Ngo n = new Ngo() { Name = name, Email = email, UserName = email }; result = UserManager.Create(n, password); if (result.Succeeded) { UserManager.AddToRole(n.Id, role.ToString()); SignInManager.SignIn(n, isPersistent: false, rememberBrowser: false); } } }
public void KnownAccountTypesAreValid(EAccountType type) { SteamID sid = 76561198074261126; sid.AccountInstance = 0; // for Clan to pass sid.AccountType = type; Assert.True(sid.IsValid); }
public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) { SetAccountInstance(0); } else { SetAccountInstance(Constants.k_unSteamUserDefaultInstance); } }
// Token: 0x060000BA RID: 186 RVA: 0x00002767 File Offset: 0x00000967 public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) { SetAccountInstance(0u); return; } SetAccountInstance(1u); }
public void Set(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { this.SetAccountID(unAccountID); this.SetEUniverse(eUniverse); this.SetEAccountType(eAccountType); if (eAccountType == EAccountType.k_EAccountTypeClan || eAccountType == EAccountType.k_EAccountTypeGameServer) { this.SetAccountInstance(0u); } else { this.SetAccountInstance(1u); } }
public void Set( UInt32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) { this.AccountID = unAccountID; this.AccountUniverse = eUniverse; this.AccountType = eAccountType; if ( eAccountType == EAccountType.k_EAccountTypeClan ) { this.AccountInstance = 0; } else { this.AccountInstance = 1; } }
/// <summary> /// 判断“钱是花掉了还是赚了” (资金是用贷方流向借方) /// /// </summary> /// <param name="DebitAccountType">借方科目</param> /// <param name="CreditAccountType">贷方科目</param> /// <returns></returns> public EMoneyFlowState MoneyInOrOut(EAccountType DebitAccountType, EAccountType CreditAccountType) { EMoneyFlowState ret = EMoneyFlowState.WithinSystem; // 若资金从Income类科目流入至Asset类转化为资产,资金为流入 if (CreditAccountType == EAccountType.Income && DebitAccountType != EAccountType.Expense) { ret = EMoneyFlowState.FlowIn; } else if (CreditAccountType != EAccountType.Income && DebitAccountType == EAccountType.Expense) { ret = EMoneyFlowState.FlowOut; } return(ret); }
public void Set(UInt32 unAccountID, EUniverse eUniverse, EAccountType eAccountType) { this.AccountID = unAccountID; this.AccountUniverse = eUniverse; this.AccountType = eAccountType; if (eAccountType == EAccountType.k_EAccountTypeClan) { this.AccountInstance = 0; } else { this.AccountInstance = 1; } }
/// <summary> /// Sets the various components of this SteamID instance. /// </summary> /// <param name="unAccountID">The account ID.</param> /// <param name="eUniverse">The universe.</param> /// <param name="eAccountType">The account type.</param> public void Set(UInt32 unAccountID, EUniverse eUniverse, EAccountType eAccountType) { this.AccountID = unAccountID; this.AccountUniverse = eUniverse; this.AccountType = eAccountType; if (eAccountType == EAccountType.Clan || eAccountType == EAccountType.GameServer) { this.AccountInstance = 0; } else { this.AccountInstance = DesktopInstance; } }
public void Set(AccountId accountId, EUniverse eUniverse, EAccountType eAccountType) { SetAccountId(accountId); SetEUniverse(eUniverse); SetEAccountType(eAccountType); if (eAccountType == EAccountType.Clan || eAccountType == EAccountType.GameServer) { SetAccountInstance(0); } else { // by default we pick the desktop instance SetAccountInstance(Constants.SteamUserDesktopInstance); } }
/// <summary> /// <para> used by game servers, create a steam user that won't be shared with anyone else</para> /// <para> NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling</para> /// </summary> public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableClient(); return (HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(out phSteamPipe, eAccountType); }
/// <summary> /// Initializes a new instance of the <see cref="SteamID"/> class. /// </summary> /// <param name="unAccountID">The account ID.</param> /// <param name="eUniverse">The universe.</param> /// <param name="eAccountType">The account type.</param> public SteamID(UInt32 unAccountID, EUniverse eUniverse, EAccountType eAccountType) : this() { Set(unAccountID, eUniverse, eAccountType); }
/// <summary> /// Sets the various components of this SteamID instance. /// </summary> /// <param name="unAccountID">The account ID.</param> /// <param name="eUniverse">The universe.</param> /// <param name="eAccountType">The account type.</param> public void Set( UInt32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) { this.AccountID = unAccountID; this.AccountUniverse = eUniverse; this.AccountType = eAccountType; if ( eAccountType == EAccountType.Clan || eAccountType == EAccountType.GameServer ) { this.AccountInstance = 0; } else { this.AccountInstance = DesktopInstance; } }
///////////////////////////////////////////////////////////////////////////// public Account FindAccount(EAccountType eType, bool bCreate) { // Loop thru all the accounts for (int i = 0; i < m_Accounts.Count; i++) { Account account = m_Accounts[i]; // If we found a type match, return it if (account.AccountType == eType) return account; } // We didn't find the account and we won't create a new one, so get out if (!bCreate) return null; // Create a new account, by request Account accountNew = new Account(); accountNew.AccountType = eType; accountNew.Name = eType.ToString(); AddAccount(accountNew); return accountNew; }
public int GetAccountId(string account, EAccountType accountType) { try { if (String.IsNullOrEmpty(account)) return AccountInfo.InvalidAccountId; string accountKey = GetAccountKey(account, accountType); if (_accountToAccountId.ContainsKey(accountKey)) return _accountToAccountId[accountKey]; return AccountInfo.InvalidAccountId; } catch (Exception ex) { GenLib.Log.LogService.LogException("Exception in GetAccountId: ", ex); return AccountInfo.InvalidAccountId; } }
public static void HandleOpenAccount() { Console.WriteLine("**************************************************************"); Console.WriteLine("* 1. Open Checking Account *"); Console.WriteLine("* 2. Open Business Account *"); Console.WriteLine("* 3. Open Loan Account *"); Console.WriteLine("* 4. Open Term Deposit *"); Console.WriteLine("**************************************************************"); string accountType = Console.ReadLine(); try { EAccountType result = (EAccountType)Enum.Parse(typeof(EAccountType), accountType); // Convert string to Enum switch (result) { case EAccountType.CheckingAccount: checkingAccountInfo = new CheckingAccount() { Accountno = accountbl.GenerateAccountno(), Balance = accountbl.GetBalance(), CustomerId = customer.CustomerId, AccountStatus = accountbl.GetAccountStatus() }; checkingAccountInfo.AccountType = accountbl.GetAcountType(checkingAccountInfo); checkingAccountInfo.Interestrate = accountbl.GetIntrestrate(checkingAccountInfo); accountbl.OpenAccount(checkingAccountInfo); Console.WriteLine($"--->>>Generate random Account no: {checkingAccountInfo.Accountno}<<<---"); break; case EAccountType.BusinessAccount: businessAccountInfo = new BusinessAccount() { Accountno = accountbl.GenerateAccountno(), Balance = accountbl.GetBalance(), CustomerId = customer.CustomerId, AccountStatus = accountbl.GetAccountStatus() }; businessAccountInfo.AccountType = accountbl.GetAcountType(businessAccountInfo); businessAccountInfo.Interestrate = accountbl.GetIntrestrate(businessAccountInfo); accountbl.OpenAccount(businessAccountInfo); Console.WriteLine($"--->>>Generate random Account no: {businessAccountInfo.Accountno}<<<---"); break; case EAccountType.Loan: Console.WriteLine("Enter Amount"); decimal amount = Convert.ToDecimal(Console.ReadLine()); if (amount >= 0) { loanAccountInfo = new Loan(amount) { Accountno = accountbl.GenerateAccountno(), Balance = amount, CustomerId = customer.CustomerId, AccountStatus = accountbl.GetAccountStatus() }; loanAccountInfo.AccountType = accountbl.GetAcountType(loanAccountInfo); loanAccountInfo.Interestrate = accountbl.GetIntrestrate(loanAccountInfo); accountbl.OpenAccount(loanAccountInfo); Console.WriteLine($"--->>>Generate random Account no: {loanAccountInfo.Accountno}<<<---"); } else { Console.WriteLine("Failed!! Negative amount"); } break; case EAccountType.TermDeposit: Console.WriteLine("Enter Amount"); decimal termdepositamount = Convert.ToDecimal(Console.ReadLine()); if (termdepositamount >= 0) { termDepositAccountInfo = new TermDeposit(termdepositamount) { Accountno = accountbl.GenerateAccountno(), Balance = termdepositamount, CustomerId = customer.CustomerId, AccountStatus = accountbl.GetAccountStatus() }; termDepositAccountInfo.AccountType = accountbl.GetAcountType(termDepositAccountInfo); termDepositAccountInfo.Interestrate = accountbl.GetIntrestrate(termDepositAccountInfo); accountbl.OpenAccount(termDepositAccountInfo); Console.WriteLine($"--->>>Generate random Account no: {termDepositAccountInfo.Accountno}<<<---"); } else { Console.WriteLine("Failed!! Negative amount"); } break; default: break; } //end switch } //end try catch { Console.WriteLine("Invalid Option"); } }//end handleOpenAccount()
// This is a non standard/custom function not found in C++ Steamworks public void SetEAccountType(EAccountType other) { Id = (Id & ~(0xFul << 52)) | (((ulong)(other) & 0xFul) << 52); }
public void AssignAccount(string account, EAccountType accountType, PersonInfo person) { lock (_lockObj) { Debug.Assert(person != null); // create a new account Debug.Assert(!IsKnownAccount(account, accountType)); int accountId = SQLAddNewAccount(account, (int)accountType, person.PersonId, person.Name); string accountKey = GetAccountKey(account, accountType); _accountToAccountId[accountKey] = accountId; _accountIdToAccount[accountId] = accountKey; _accountIdToPersonName[accountId] = person.Name; person.AddAccount(accountId); _accountIdToPersonId[accountId] = person.PersonId; // use the same id as was set for the first email of the person SQLSetPersonId(accountId, person.PersonId); } }
public override void Reset() { steamPipeId = null; eAccountType = EAccountType.k_EAccountTypeAnonGameServer; }
public string GetPersonName(string account, EAccountType accountType) { PersonInfo info = GetPerson(account, accountType); if (info != null) return info.Name; return ""; }
///////////////////////////////////////////////////////////////////////////// public Transaction(string _sName, ETransactionType _eType, double _fValue, EAccountType _eAccountType, EAccountType _eAccountType2) : this(_sName, _eType, _fValue, _eAccountType, _eAccountType2, 0, 0) { }
///////////////////////////////////////////////////////////////////////////// public Transaction(string _sName, ETransactionType _eType, double _fValue, EAccountType _eAccountType, EAccountType _eAccountType2, JulianDay lStartDateLimit, JulianDay lEndDateLimit) { m_sName = _sName; m_lValue = (tMillicents)(_fValue * 1000.0); m_eType = _eType; }
public bool IsKnownAccount(string account, EAccountType accountType) { return GetAccountId(account, accountType) != AccountInfo.InvalidAccountId; }
public static string BuildRequestAccountData(string account, EAccountType accountType) { return BuildRequestData("PeopleData", "GetContactData", "account", account, "accountType", ((int)accountType).ToString()); }
public SteamId(AccountId accountId, EUniverse eUniverse, EAccountType eAccountType) { Id = 0; Set(accountId, eUniverse, eAccountType); }
// This is a non standard/custom function not found in C++ Steamworks public void SetEAccountType(EAccountType other) { m_SteamID = (m_SteamID & ~(0xFul << (ushort)52)) | (((ulong)(other) & 0xFul) << (ushort)52); }
public SteamId(AccountId accountId, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) { Id = 0; #if _SERVER && Assert Assert(!((EAccountType.Individual == eAccountType) && (unAccountInstance > SteamUserWebInstance))); // enforce that for individual accounts, instance is always 1 #endif // _SERVER InstancedSet(accountId, unAccountInstance, eUniverse, eAccountType); }
public string GetAccountKey(string account, EAccountType accountType) { return ((char)accountType).ToString() + account; }
public void InstancedSet(AccountID_t unAccountID, uint unInstance, EUniverse eUniverse, EAccountType eAccountType) { SetAccountID(unAccountID); SetEUniverse(eUniverse); SetEAccountType(eAccountType); SetAccountInstance(unInstance); }
//private string GetNodeInnerHtml(HtmlNode node, string xpath, string noneValue = null) //{ // var n = node.SelectSingleNode(xpath); // if (n != null) // return n.InnerHtml; // return noneValue; //} private string GetXmlForPerson(string author, string authorUri, string role = "from", EAccountType type = EAccountType.Custom, EPersonNameTrust trust = EPersonNameTrust.Low) { if (string.IsNullOrEmpty(author) || string.IsNullOrEmpty(authorUri)) { AddEvent(String.Format("Didn't find valid values for person. Name={0}, Uri={1}. Ignoring the person", author, authorUri)); return ""; } return Templates.BuildPerson(authorUri, author, role, type, trust); }
/// <summary> /// Initializes a new instance of the <see cref="SteamID"/> class. /// </summary> /// <param name="unAccountID">The account ID.</param> /// <param name="unInstance">The instance.</param> /// <param name="eUniverse">The universe.</param> /// <param name="eAccountType">The account type.</param> public SteamID( UInt32 unAccountID, UInt32 unInstance, EUniverse eUniverse, EAccountType eAccountType ) : this() { InstancedSet( unAccountID, unInstance, eUniverse, eAccountType ); }
public static extern int ISteamClient_CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType);
public static string BuildPerson(string account, string name, string role, EAccountType accountType, EPersonNameTrust nameTrust) { Debug.Assert(!string.IsNullOrEmpty(account)); Debug.Assert(name != null); return String.Format("<person account=\"{0}\" name=\"{1}\" role=\"{2}\" accountType=\"{3}\" nameTrust=\"{4}\" />", account.EncodeXMLString(), name.EncodeXMLString(), role, (int)accountType, (int)nameTrust); }
public static string BuildSetDataAddPerson(string personName, string account, EAccountType accountType, EPersonNameTrust nameTrust) { return String.Format("<data target=\"PeopleData\" content=\"AddPerson\" personName=\"{0}\" account=\"{1}\" accountType=\"{2}\" nameTrust=\"{3}\" />", personName.EncodeXMLString(), account.EncodeXMLString(), (int)accountType, (int)nameTrust); }
public CSteamID(AccountID_t unAccountID, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0uL; InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType); }
public Int32 CreateLocalUser(ref Int32 phSteamPipe, EAccountType eAccountType) { return(this.GetFunction <NativeCreateLocalUserIE>(this.Functions.CreateLocalUser4)(this.ObjectAddress, ref phSteamPipe, eAccountType)); }
public void ToChatIDOnlySupportsClans(EAccountType type) { var id = new SteamID(1, EUniverse.Public, type); Assert.Throws <InvalidOperationException>(() => id.ToChatID()); }
/// used by game servers, create a steam user that won't be shared with anyone else /// NOT THREADSAFE - ensure that no other threads are accessing Steamworks API when calling public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { phSteamPipe = (HSteamPipe)0; return((HSteamUser)0); }
public int GetPersonId(string account, EAccountType accountType) { int accountId = GetAccountId(account, accountType); return GetPersonId(accountId); }
/// <summary> /// Initializes a new instance of the <see cref="SteamID"/> class. /// </summary> /// <param name="unAccountID">The account ID.</param> /// <param name="unInstance">The instance.</param> /// <param name="eUniverse">The universe.</param> /// <param name="eAccountType">The account type.</param> public SteamID(UInt32 unAccountID, UInt32 unInstance, EUniverse eUniverse, EAccountType eAccountType) : this() { InstancedSet(unAccountID, unInstance, eUniverse, eAccountType); }
public PersonInfo GetPerson(string account, EAccountType accountType) { int id = GetPersonId(account, accountType); if (id == PersonInfo.InvalidPersonId) return null; return GetPerson(id); }
public CSteamID(AccountID_t unAccountID, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0; Set(unAccountID, eUniverse, eAccountType); }
public IEnumerable<int> GetAccountsByType(EAccountType type) { return (from accountId in _accountIdToAccount.Keys where (EAccountType)_accountIdToAccount[accountId][0] == type select accountId).ToList(); // return a copy of the list so that we don't get the "collection changed" exception }
public CSteamID(AccountID_t unAccountID, uint unAccountInstance, EUniverse eUniverse, EAccountType eAccountType) { m_SteamID = 0; #if _SERVER && Assert Assert(!((EAccountType.k_EAccountTypeIndividual == eAccountType) && (unAccountInstance > k_unSteamUserWebInstance))); // enforce that for individual accounts, instance is always 1 #endif // _SERVER InstancedSet(unAccountID, unAccountInstance, eUniverse, eAccountType); }
public bool TryGetPerson(string account, EAccountType accountType, out PersonInfo person) { person = GetPerson(account, accountType); return person != null; }
/// <summary> /// Initializes a new instance of the <see cref="SteamID"/> class. /// </summary> /// <param name="unAccountID">The account ID.</param> /// <param name="eUniverse">The universe.</param> /// <param name="eAccountType">The account type.</param> public SteamID( UInt32 unAccountID, EUniverse eUniverse, EAccountType eAccountType ) : this() { Set( unAccountID, eUniverse, eAccountType ); }
public void InstancedSet(AccountId accountId, uint unInstance, EUniverse eUniverse, EAccountType eAccountType) { SetAccountId(accountId); SetEUniverse(eUniverse); SetEAccountType(eAccountType); SetAccountInstance(unInstance); }
public static HSteamUser CreateLocalUser(out HSteamPipe phSteamPipe, EAccountType eAccountType) { InteropHelp.TestIfAvailableClient(); return((HSteamUser)NativeMethods.ISteamClient_CreateLocalUser(CSteamAPIContext.GetSteamClient(), out phSteamPipe, eAccountType)); }
public void SetEAccountType(EAccountType other) { m_SteamID = (ulong)(((long)m_SteamID & -67553994410557441L) | (((long)other & 15L) << 52)); }