private void SendAllAccountSyncDataToClient(ClientState client, AccountSyncType type) { foreach (KeyValuePair <string, Account> account in AccountHandler.AccountsOnline) { SendAccountSyncDataToClient(client, account.Value, type); } }
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); }
private void SendAccountSyncDataToAllClients(Account account, ClientState client, AccountSyncType type) { ClientManager.SendMessageToAllClients(GetAccountSyncCommand(account, type), client); }
private void SendAccountSyncDataToClient(ClientState client, Account account, AccountSyncType type) { client.SendData(GetAccountSyncCommand(account, type)); }