Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/module-cccam.c b/module-cccam.c
- index 7a2d860..6ac91f1 100644
- --- a/module-cccam.c
- +++ b/module-cccam.c
- @@ -3753,7 +3753,7 @@ int32_t cc_srv_connect(struct s_client *cl)
- { cs_log_dbg(D_CLIENT, "%s 2.1.x compatibility mode", getprefix()); }
- cs_log_dbg(D_TRACE, "ccc send cards %s", usr);
- - if(!cc_srv_report_cards(cl))
- + if(!cc_srv_report_cards(cl, 0))
- { return -1; }
- cs_ftime(&cc->ecm_time);
- diff --git a/module-cccshare.c b/module-cccshare.c
- index 1dd953e..106c5f9 100644
- --- a/module-cccshare.c
- +++ b/module-cccshare.c
- @@ -350,6 +350,36 @@ static int32_t send_card_to_client(struct cc_card *card, struct s_client *cl)
- return 1;
- }
- +static int32_t remove_card_to_client(struct cc_card *card, struct s_client *cl)
- +{
- + if(!card || !card->id)
- + { return 0; }
- +
- + uint8_t buf[4];
- + buf[0] = card->id >> 24;
- + buf[1] = card->id >> 16;
- + buf[2] = card->id >> 8;
- + buf[3] = card->id & 0xFF;
- +
- + struct s_clientmsg *clientmsg;
- + struct cc_data *cc = cl->cc;
- + if(cc && cl->typ == 'c' && !cl->kill && get_module(cl)->num == R_CCCAM) //CCCam-Client!
- + {
- + if(card_valid_for_client(cl, card))
- + {
- + if(cs_malloc(&clientmsg, sizeof(struct s_clientmsg)))
- + {
- + memcpy(clientmsg->msg, buf, sizeof(buf));
- + clientmsg->len = sizeof(buf);
- + clientmsg->cmd = MSG_CARD_REMOVED;
- + add_job(cl, ACTION_CLIENT_SEND_MSG, clientmsg, sizeof(struct s_clientmsg));
- + return 1;
- + }
- + }
- + }
- + return 0;
- +}
- +
- int32_t send_card_to_all_clients(struct cc_card *card)
- {
- int32_t count = 0;
- @@ -1483,7 +1513,7 @@ void update_card_list(void)
- card_added_count, card_removed_count, card_dup_count, card_count);
- }
- -int32_t cc_srv_report_cards(struct s_client *cl)
- +int32_t cc_srv_report_cards(struct s_client *cl, int8_t hide)
- {
- struct cc_card *card;
- @@ -1497,12 +1527,26 @@ int32_t cc_srv_report_cards(struct s_client *cl)
- it = ll_iter_create(reported_carddatas_list[i]);
- while(cl->cc && !cl->kill && (card = ll_iter_next(&it)))
- {
- - count += send_card_to_client(card, cl);
- + if(hide)
- + {
- + count += remove_card_to_client(card, cl);
- + }
- + else
- + {
- + count += send_card_to_client(card, cl);
- + }
- }
- }
- }
- cs_readunlock(__func__, &cc_shares_lock);
- - cs_log_dbg(D_TRACE, "reported %d cards for %s", count, username(cl));
- + if(hide)
- + {
- + cs_log_dbg(D_TRACE, "reported %d removed cards from %s", count, username(cl));
- + }
- + else
- + {
- + cs_log_dbg(D_TRACE, "reported %d cards for %s", count, username(cl));
- + }
- return cl->cc && !cl->kill;
- }
- diff --git a/module-cccshare.h b/module-cccshare.h
- index 0c2aa25..1925db4 100644
- --- a/module-cccshare.h
- +++ b/module-cccshare.h
- @@ -10,7 +10,7 @@
- // In this file put functions that are shared between module-cccam.c and module-cccshare.c
- int32_t chk_ident(FTAB *ftab, struct cc_card *card);
- -int32_t cc_srv_report_cards(struct s_client *cl);
- +int32_t cc_srv_report_cards(struct s_client *cl, int8_t hide);
- LLIST *get_cardlist(uint16_t caid, LLIST **list);
- void cc_free_card(struct cc_card *card);
- diff --git a/oscam-ecm.c b/oscam-ecm.c
- index d5fdab1..4d4e628 100644
- --- a/oscam-ecm.c
- +++ b/oscam-ecm.c
- @@ -660,6 +660,8 @@ void distribute_ea(struct s_ecm_answer *ea)
- }
- }
- +extern int32_t cc_srv_report_cards(struct s_client *cl, int8_t hide);
- +
- int32_t send_dcw(struct s_client *client, ECM_REQUEST *er)
- {
- if(!check_client(client) || client->typ != 'c')
- @@ -945,6 +947,7 @@ int32_t send_dcw(struct s_client *client, ECM_REQUEST *er)
- {
- client->account->acosc_penalty_active = 0;
- client->account->acosc_penalty_until = 0;
- + cc_srv_report_cards(client, 0);
- }
- if(client->account->acosc_penalty_active == 0 && max_active_sids > 0)
- @@ -1005,13 +1008,16 @@ int32_t send_dcw(struct s_client *client, ECM_REQUEST *er)
- { cs_log("[zaplist] ACoSC for Client: %s zap_limit reached: %i:%i(%s) penalty: 2(%s) BAN Client - Kill and set Client to failban list for %i sec.", username(client), client->account->acosc_user_zap_count, zap_limit, info5, info2, penalty_duration); }
- cs_add_violation_acosc(client, client->account->usr, penalty_duration);
- - add_job(client, ACTION_CLIENT_KILL, NULL, 0);
- + //add_job(client, ACTION_CLIENT_KILL, NULL, 0);
- +
- + cc_srv_report_cards(client, 1);
- +
- }
- else
- {
- cs_log("[zaplist] ACoSC for Client: %s %i:%i(%s) penalty: 2(%s) BAN Client - don't Ban dvbapi user only stop decoding", username(client), active_sid_count, max_active_sids, info1, info2);
- }
- - er->rc = E_DISABLED;
- + //er->rc = E_DISABLED;
- break;
- case 3: // delay
- if(client->account->acosc_penalty_active == 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement