コード例 #1
0
ファイル: Party.cs プロジェクト: Osuryn/ClockworkConflicts
 public Party(Account user, int partyId)
 {
     userList = new List<Account>();
     this.userList.Add(user);
     partyLeader = user.accountId;
     this.partyId = partyId;
     domainController = DomainController.getInstance();
 }
コード例 #2
0
        private void FormatPartyMembers(string data)
        {
            string[] array;
            array = data.Split('|');

            myParty.userList.Clear();

            foreach (string account in array)
            {
                string[] array2;
                array2 = account.Split('|');
                Account toAdd = new Account(Convert.ToInt32(array2[0]), Convert.ToByte(array2[1]), array2[2], Convert.ToInt32(array2[3]));
                FullyKnownAccounts.Add(toAdd);
                myParty.adduser(toAdd.accountId);
            }
        }
コード例 #3
0
        private void FillFriendList(string data)
        {
            string[] array = data.Split('|');

            foreach (string friend in array)
            {
                try
                {
                    string[] subarray = friend.Split(',');
                    int id = Convert.ToInt32(subarray[0]);
                    byte flags = Convert.ToByte(subarray[1]);
                    string name = subarray[2];
                    int guildId = Convert.ToInt32(subarray[3]);
                    Account acc = new Account(id, flags, name, guildId, IsOnlineFriend(id));
                    FullyKnownAccounts.Add(acc);
                    friendList.Add(acc);
                }
                catch (Exception e)
                {
                    guiController.UnityLog("something went wrong adding friend: " + friend + " = " + e.ToString());
                }
            }
        }
コード例 #4
0
        public void ReceiveAccountInfo(string accountInfo, bool myAccount)
        {
            int userId;
            byte flags;
            int index = -1;
            string screenName;
            int guildId = -1;

            index = accountInfo.IndexOf("@");
            string ipData = accountInfo.Substring(index);
            string outputbackup = accountInfo.Substring(0, index);

            index = outputbackup.IndexOf(",");
            userId = Convert.ToInt32(outputbackup.Substring(0, index));

            outputbackup = outputbackup.Substring(index + 1);
            index = -1;
            index = outputbackup.IndexOf(",");
            flags = Convert.ToByte(Convert.ToInt32(outputbackup.Substring(0, index)));

            outputbackup = outputbackup.Substring(index + 1);
            index = -1;
            index = outputbackup.IndexOf(",");
            screenName = outputbackup.Substring(0, index);

            guildId = Convert.ToInt32(outputbackup.Substring(index + 1));

            Account account = new Account(userId, flags, screenName, guildId);

            if (myAccount)
            {
                this.myAccount = account;
                setServerIpAdresses(ipData);
            }
            else
            {
                FullyKnownAccounts.Add(account);
            }
        }