예제 #1
0
 private void SendAllAccountSyncDataToClient(ClientState client, AccountSyncType type)
 {
     foreach (KeyValuePair <string, Account> account in AccountHandler.AccountsOnline)
     {
         SendAccountSyncDataToClient(client, account.Value, type);
     }
 }
예제 #2
0
        private string GetAccountSyncCommand(Account account, AccountSyncType syncType)
        {
            //protocol#|syncfacct#|syncType#|username#|rating#|wins#|losses<#>
            string cmd = string.Format("{0}{1}{2}{1}{3}{1}{4}{1}{5}{1}{6}{1}{7}{1}{8}",
                                       (int)ReadProtocol.GetVersion(),
                                       m_SegmentTerminator,
                                       NetworkCommand.GetCommand(NetworkCommandType.SyncForeignAccount),
                                       (int)syncType,
                                       account.Username,
                                       account.Rating,
                                       account.Wins,
                                       account.Losses,
                                       account.AccountId);

            return(cmd);
        }
예제 #3
0
 private void SendAccountSyncDataToAllClients(Account account, ClientState client, AccountSyncType type)
 {
     ClientManager.SendMessageToAllClients(GetAccountSyncCommand(account, type), client);
 }
예제 #4
0
 private void SendAccountSyncDataToClient(ClientState client, Account account, AccountSyncType type)
 {
     client.SendData(GetAccountSyncCommand(account, type));
 }