еще 1 вопрос.
diff -urpEbB trunk-new/pvpgn/src/bnetd/account_wrap.cpp trunk/pvpgn/src/bnetd/account_wrap.cpp
--- trunk-new/pvpgn/src/bnetd/account_wrap.cpp 2009-07-08 21:32:29.000000000 +0200
+++ trunk/pvpgn/src/bnetd/account_wrap.cpp 2009-09-10 23:23:38.000000000 +0200
@@ -1202,6 +1202,19 @@ extern int account_get_ladder_rank(t_acc
return account_get_numattr(account,key);
}
+extern int account_get_ladder_rank2(t_account * account, t_clienttag clienttag, const char* id)
+{
+ char key[256];
+ char clienttag_str[5];
+
+ if (!clienttag)
+ {
+ eventlog(eventlog_level_error,__FUNCTION__,"got bad clienttag");
+ return 0;
+ }
+ std::sprintf(key,"Record\\%s\\%s\\rank",tag_uint_to_str(clienttag_str,clienttag),id);
+ return account_get_numattr(account,key);
+}
extern int account_set_ladder_rank(t_account * account, t_clienttag clienttag, t_ladder_id id, unsigned int rank)
{
@@ -2431,6 +2444,23 @@ extern unsigned int account_icon_to_prof
return char_icon_to_uint(result);
}
+extern int account_set_auth_icon(t_account * account, char const * icon_name, int val)
+{
+ char temp[256];
+
+ std::sprintf(temp,"BNET\\auth\\icon\\%.100s",icon_name);
+ return account_set_boolattr(account, temp, val);
+}
+
+
+extern int account_get_auth_icon(t_account * account, char const * icon_name)
+{
+ char temp[256];
+
+ std::sprintf(temp,"BNET\\auth\\icon\\%.100s",icon_name);
+ return account_get_boolattr(account, temp);
+}
+
extern int account_is_operator_or_admin(t_account * account, char const * channel)
{
if ((account_get_auth_operator(account,channel)==1) || (account_get_auth_operator(account,NULL)==1) ||
diff -urpEbB trunk-new/pvpgn/src/bnetd/account_wrap.h trunk/pvpgn/src/bnetd/account_wrap.h
--- trunk-new/pvpgn/src/bnetd/account_wrap.h 2009-07-08 21:32:29.000000000 +0200
+++ trunk/pvpgn/src/bnetd/account_wrap.h 2009-09-10 22:58:17.000000000 +0200
@@ -149,6 +149,7 @@ extern unsigned int account_get_ladder_r
extern int account_set_ladder_rating(t_account * account, t_clienttag clienttag, t_ladder_id id,unsigned rating);
extern int account_adjust_ladder_rating(t_account * account, t_clienttag clienttag, t_ladder_id id, int delta);
extern int account_get_ladder_rank(t_account * account, t_clienttag clienttag, t_ladder_id id);
+extern int account_get_ladder_rank2(t_account * account, t_clienttag clienttag, const char* id);
extern int account_set_ladder_rank(t_account * account, t_clienttag clienttag, t_ladder_id id, unsigned int rank);
extern unsigned int account_get_ladder_high_rating(t_account * account, t_clienttag clienttag, t_ladder_id id);
extern unsigned int account_get_ladder_high_rank(t_account * account, t_clienttag clienttag, t_ladder_id id);
@@ -227,6 +228,8 @@ extern int account_set_user_icon( t_acco
extern char const * account_get_user_icon( t_account * account, t_clienttag clienttag );
extern unsigned int account_icon_to_profile_icon(char const * icon,t_account * account, t_clienttag ctag);
extern char const * account_icon_default(t_account * account, t_clienttag clienttag);
+extern int account_set_auth_icon(t_account * account, char const * icon_name, int val);
+extern int account_get_auth_icon(t_account * account, char const * icon_name);
extern int account_is_operator_or_admin(t_account * account, char const * channel);
diff -urpEbB trunk-new/pvpgn/src/bnetd/command.cpp trunk/pvpgn/src/bnetd/command.cpp
--- trunk-new/pvpgn/src/bnetd/command.cpp 2009-07-08 21:32:29.000000000 +0200
+++ trunk/pvpgn/src/bnetd/command.cpp 2009-09-14 10:12:40.000000000 +0200
@@ -353,6 +353,8 @@ static int _handle_topic_command(t_conne
static int _handle_moderate_command(t_connection * c, char const * text);
static int _handle_clearstats_command(t_connection * c, char const * text);
static int _handle_tos_command(t_connection * c, char const * text);
+static int _handle_swapicon_command(t_connection * c, char const *text);
+static int _handle_seticon_command(t_connection * c, char const *text);
static const t_command_table_row standard_command_table[] =
{
@@ -453,6 +455,8 @@ static const t_command_table_row extende
{ "/unmuteacct" , _handle_unmuteacct_command },
{ "/flag" , _handle_flag_command },
{ "/tag" , _handle_tag_command },
+ { "/icon" , _handle_swapicon_command },
+ { "/seticon" , _handle_seticon_command },
{ "/help" , handle_help_command },
{ "/mail" , handle_mail_command },
{ "/ipban" , handle_ipban_command }, // in ipban.c
@@ -4461,6 +4465,330 @@ static int _handle_tag_command(t_connect
return 0;
}
+static int _handle_seticon_command(t_connection * c, char const *text)
+{
+ t_account * account;
+ char * command;
+ char * username;
+ char * icon;
+ char t[MAX_MESSAGE_LEN];
+ unsigned int i,j;
+ char arg1[256];
+ char arg2[256];
+ char arg3[256];
+
+ std::strncpy(t, text, MAX_MESSAGE_LEN - 1);
+ for (i=0; t[i]!=' ' && t[i]!='\0'; i++); /* skip command /groups */
+
+ for (; t[i]==' '; i++); /* skip spaces */
+ for (j=0; t[i]!=' ' && t[i]!='\0'; i++) /* get command */
+ if (j<sizeof(arg1)-1) arg1[j++] = t[i];
+ arg1[j] = '\0';
+
+ for (; t[i]==' '; i++); /* skip spaces */
+ for (j=0; t[i]!=' ' && t[i]!='\0'; i++) /* get username */
+ if (j<sizeof(arg2)-1) arg2[j++] = t[i];
+ arg2[j] = '\0';
+
+ for (; t[i]==' '; i++); /* skip spaces */
+ for (j=0; t[i]!='\0'; i++) /* get icon */
+ if (j<sizeof(arg3)-1) arg3[j++] = t[i];
+ arg3[j] = '\0';
+
+ command = arg1;
+ username = arg2;
+ icon = arg3;
+
+ for (i=0; i<std::strlen(icon); i++)
+ if (std::isupper((int)icon[i])) icon[i] = std::tolower((int)icon[i]);
+
+ if (arg1[0] =='\0') {
+ message_send_text(c,message_type_info,c,"usage: /seticon <command> <username> <icon code>");
+ return 0;
+ }
+
+ if (!std::strcmp(command,"help") || !std::strcmp(command,"h")) {
+ message_send_text(c,message_type_info,c,"Set icons (Setting custom icons for users).");
+ message_send_text(c,message_type_info,c,"Type: /seticon add <username> <icon code> - add an icon to user profile");
+ message_send_text(c,message_type_info,c,"Type: /seticon del <username> <icon code> - delete an icon from user profile");
+ message_send_text(c,message_type_info,c,"Type: /seticon list <username> - shows current icons user can use");
+ return 0;
+ }
+
+ if (arg2[0] =='\0') {
+ message_send_text(c,message_type_info,c,"usage: /seticon <command> <username> <icon code>");
+ return 0;
+ }
+
+ if (!(account = accountlist_find_account(username))) {
+ message_send_text(c,message_type_error,c,"Invalid user.");
+ return 0;
+ }
+
+ if (!std::strcmp(command,"list") || !std::strcmp(command,"l")) {
+
+ message_send_text(c,message_type_info,c,"Icon Name: Icon Code , Attribute");
+ message_send_text(c,message_type_info,c,"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
+ snprintf(msgtemp, sizeof(msgtemp), "Bomb: Bomb , %d",account_get_auth_icon(account,"bomb"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "SafeList1: SS1 , %d",account_get_auth_icon(account,"ss1"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "SafeList2: SS2 , %d",account_get_auth_icon(account,"ss2"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "SafeList3: SS3 , %d",account_get_auth_icon(account,"ss3"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "IronFist: Kift , %d",account_get_auth_icon(account,"kift"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Peasant: Peasant , %d",account_get_auth_icon(account,"peasant"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Footman: Foot , %d",account_get_auth_icon(account,"foot"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Knight: Knight , %d",account_get_auth_icon(account,"knight"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Archmage: Ezalor , %d",account_get_auth_icon(account,"ezalor"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Bloodmage: Invoker , %d",account_get_auth_icon(account,"invoker"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Medivh: Medivh , %d",account_get_auth_icon(account,"medivh"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Peon: Peon , %d",account_get_auth_icon(account,"peon"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Grunt: Grunt , %d",account_get_auth_icon(account,"grunt"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Tauren: Shaker , %d",account_get_auth_icon(account,"shaker"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Far Seer: Chen , %d",account_get_auth_icon(account,"chen"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Thrall: Thrall , %d",account_get_auth_icon(account,"thrall"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Wisp: Wisp , %d",account_get_auth_icon(account,"wisp"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Archer: Arch , %d",account_get_auth_icon(account,"arch"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Druid of the Claw: Syllabear , %d",account_get_auth_icon(account,"druid"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Priestess of the Moon: Mirana , %d",account_get_auth_icon(account,"mirana"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Warden: Mortred , %d",account_get_auth_icon(account,"mortred"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Furion Stormrage: Furion , %d",account_get_auth_icon(account,"furion"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Acolyte: Acolyte , %d",account_get_auth_icon(account,"acolyte"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Ghoul: Naix , %d",account_get_auth_icon(account,"naix"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Abomination: Pudge , %d",account_get_auth_icon(account,"pudge"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Lich: Lich , %d",account_get_auth_icon(account,"lich"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ snprintf(msgtemp, sizeof(msgtemp), "Tichondrius: Balanar , %d",account_get_auth_icon(account,"balanar"));
+ message_send_text(c,message_type_info,c,msgtemp);
+ message_send_text(c,message_type_info,c,"Note: Hammer and Ladder icons are not displayed on this list.");
+ return 0;
+ }
+
+ if (arg3[0] =='\0') {
+ message_send_text(c,message_type_info,c,"usage: /seticon <command> <username> <icon code>");
+ return 0;
+ }
+
+ if (!std::strcmp(icon,"bomb") || !std::strcmp(icon,"ss1") || !std::strcmp(icon,"ss2") || !std::strcmp(icon,"ss3")
+ || !std::strcmp(icon,"kift") || !std::strcmp(icon,"peasant") || !std::strcmp(icon,"foot") || !std::strcmp(icon,"knight")
+ || !std::strcmp(icon,"ezalor") || !std::strcmp(icon,"medivh")|| !std::strcmp(icon,"peon")|| !std::strcmp(icon,"grunt")
+ || !std::strcmp(icon,"shaker") || !std::strcmp(icon,"chen") || !std::strcmp(icon,"thrall") || !std::strcmp(icon,"wisp")
+ || !std::strcmp(icon,"arch") || !std::strcmp(icon,"syllabear") || !std::strcmp(icon,"mirana") || !std::strcmp(icon,"mortred")
+ || !std::strcmp(icon,"furion") || !std::strcmp(icon,"acolyte") || !std::strcmp(icon,"naix") || !std::strcmp(icon,"pudge")
+ || !std::strcmp(icon,"lich") || !std::strcmp(icon,"balanar") || !std::strcmp(icon,"invoker")) {
+ /*Do nothing.*/
+ }
+ else
+ {
+ eventlog(eventlog_level_warn,__FUNCTION__,"unknown icon: %x", text);
+ snprintf(msgtemp, sizeof(msgtemp), "No such icon, unable to set!");
+ message_send_text(c,message_type_error,c,msgtemp);
+ return 0;
+ }
+
+ if (!std::strcmp(command,"add") || !std::strcmp(command,"a")) {
+ account_set_auth_icon(account, icon, 1);
+ snprintf(msgtemp, sizeof(msgtemp) ,"%.128s is setted to the requested account.", icon);
+ message_send_text(c,message_type_info,c,msgtemp);
+ return 0;
+ }
+
+ if (!std::strcmp(command,"del") || !std::strcmp(command,"d")) {
+ account_set_auth_icon(account, icon, 0);
+ snprintf(msgtemp, sizeof(msgtemp) ,"%.128s is removed from the requested account.", icon);
+ message_send_text(c,message_type_info,c,msgtemp);
+ return 0;
+ }
+
+ snprintf(msgtemp, sizeof(msgtemp), "got unknown command: %.128s", command);
+ message_send_text(c,message_type_error,c,msgtemp);
+ return 0;
+
+}
+
+static int _handle_swapicon_command(t_connection * c, char const *text)
+{
+
+ t_account * account;
+ t_clienttag clienttag;
+ char const *user_icon;
+ unsigned int i,j;
+ char arg1[256];
+ char * icon;
+
+ account = conn_get_account(c);
+ clienttag = conn_get_clienttag(c);
+ user_icon = "XXXX";
+
+ for (i=0; text[i]!=' ' && text[i]!='\0'; i++);
+ for (; text[i]==' '; i++);
+
+ for (j=0; text[i]!=' ' && text[i]!='\0'; i++) /* get icon */
+ if (j<sizeof(arg1)-1) arg1[j++] = text[i];
+ arg1[j] = '\0';
+
+ icon = arg1;
+
+ if (arg1[0] =='\0') {
+ message_send_text(c,message_type_info,c,"usage: /icon <icon code>");
+ message_send_text(c,message_type_info,c,"Available icons:");
+
+ message_send_text(c,message_type_info,c,"Icon Code (Icon Name) ");
+ message_send_text(c,message_type_info,c,"=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=");
+ if (account_get_auth_icon(account,"bomb") == 1) message_send_text(c,message_type_info,c, "Bomb (Bomb)");
+ if (account_get_auth_icon(account,"ss1") == 1) message_send_text(c,message_type_info,c, "SS1 (SafeList1)");
+ if (account_get_auth_icon(account,"ss2") == 1) message_send_text(c,message_type_info,c, "SS2 (SafeList2)");
+ if (account_get_auth_icon(account,"ss3") == 1) message_send_text(c,message_type_info,c, "SS3 (SafeList3)");
+ if (account_get_auth_icon(account,"kift") == 1) message_send_text(c,message_type_info,c, "Kift (IronFist)");
+ if (account_get_auth_icon(account,"peasant") == 1) message_send_text(c,message_type_info,c, "Peasant (Peasant)");
+ if (account_get_auth_icon(account,"foot") == 1) message_send_text(c,message_type_info,c, "Foot (Footman)");
+ if (account_get_auth_icon(account,"knight") == 1) message_send_text(c,message_type_info,c, "Knight (Knight)");
+ if (account_get_auth_icon(account,"ezalor") == 1) message_send_text(c,message_type_info,c, "Ezalor (Archmage)");
+ if (account_get_auth_icon(account,"invoker") == 1) message_send_text(c,message_type_info,c, "Invoker (Bloodmage)");
+ if (account_get_auth_icon(account,"medivh") == 1) message_send_text(c,message_type_info,c, "Medivh (Medivh)");
+ if (account_get_auth_icon(account,"peon") == 1) message_send_text(c,message_type_info,c, "Peon (Peon)");
+ if (account_get_auth_icon(account,"grunt") == 1) message_send_text(c,message_type_info,c, "Grunt (Grunt)");
+ if (account_get_auth_icon(account,"shaker") == 1) message_send_text(c,message_type_info,c, "Shaker (Tauren)");
+ if (account_get_auth_icon(account,"chen") == 1) message_send_text(c,message_type_info,c, "Chen (Far Seer)");
+ if (account_get_auth_icon(account,"thrall") == 1) message_send_text(c,message_type_info,c, "Thrall (Thrall)");
+ if (account_get_auth_icon(account,"wisp") == 1) message_send_text(c,message_type_info,c, "Wisp (Wisp)");
+ if (account_get_auth_icon(account,"arch") == 1) message_send_text(c,message_type_info,c, "Arch (Archer)");
+ if (account_get_auth_icon(account,"syllabear") == 1) message_send_text(c,message_type_info,c, "Syllabear (Druid of the Claw)");
+ if (account_get_auth_icon(account,"mirana") == 1) message_send_text(c,message_type_info,c, "Mirana (Priestess of the Moon)");
+ if (account_get_auth_icon(account,"mortred") == 1) message_send_text(c,message_type_info,c, "Mortred (Warden)");
+ if (account_get_auth_icon(account,"furion") == 1) message_send_text(c,message_type_info,c, "Furion (Furion Stormrage)");
+ if (account_get_auth_icon(account,"acolyte") == 1) message_send_text(c,message_type_info,c, "Acolyte (Acolyte)");
+ if (account_get_auth_icon(account,"naix") == 1) message_send_text(c,message_type_info,c, "Naix (Ghoul)");
+ if (account_get_auth_icon(account,"pudge") == 1) message_send_text(c,message_type_info,c, "Pudge (Abomination)");
+ if (account_get_auth_icon(account,"lich") == 1) message_send_text(c,message_type_info,c, "Lich (Lich)");
+ if (account_get_auth_icon(account,"balanar") == 1) message_send_text(c,message_type_info,c, "Balanar (Tichondrius)");
+ if (account_get_command_groups(account) > 1) message_send_text(c,message_type_info,c, "Hammer (Hammer)");
+ message_send_text(c,message_type_info,c,"Ladder - In case you have reached the top 100 in Solo or Team");
+ return 0;
+ }
+
+ for (i=0; i<std::strlen(icon); i++)
+ if (std::isupper((int)icon[i])) icon[i] = std::tolower((int)icon[i]);
+
+ /*Checking if icon exist and applying his code to user_icon value.*/
+
+ if (!std::strcmp(icon,"bomb")) user_icon="BMOB";
+ if (!std::strcmp(icon,"ss1")) user_icon="DERF";
+ if (!std::strcmp(icon,"ss2")) user_icon="ULBF";
+ if (!std::strcmp(icon,"ss3")) user_icon="IHWF";
+ if (!std::strcmp(icon,"kift")) user_icon="LEYT";
+ if (!std::strcmp(icon,"peasant")) user_icon="MUH1";
+ if (!std::strcmp(icon,"foot")) user_icon="MUH2";
+ if (!std::strcmp(icon,"knight")) user_icon="MUH3";
+ if (!std::strcmp(icon,"ezalor")) user_icon="MUH4";
+ if (!std::strcmp(icon,"medivh")) user_icon="MUH5";
+ if (!std::strcmp(icon,"invoker")) user_icon="MUH6";
+ if (!std::strcmp(icon,"peon")) user_icon="CRO1";
+ if (!std::strcmp(icon,"grunt")) user_icon="CRO2";
+ if (!std::strcmp(icon,"shaker")) user_icon="CRO3";
+ if (!std::strcmp(icon,"chen")) user_icon="CRO4";
+ if (!std::strcmp(icon,"thrall")) user_icon="CRO5";
+ if (!std::strcmp(icon,"wisp")) user_icon="FLE1";
+ if (!std::strcmp(icon,"arch")) user_icon="FLE2";
+ if (!std::strcmp(icon,"syllabear")) user_icon="FLE3";
+ if (!std::strcmp(icon,"mirana")) user_icon="FLE4";
+ if (!std::strcmp(icon,"furion")) user_icon="FLE5";
+ if (!std::strcmp(icon,"mortred")) user_icon="FLE6";
+ if (!std::strcmp(icon,"acolyte")) user_icon="DNU1";
+ if (!std::strcmp(icon,"naix")) user_icon="DNU2";
+ if (!std::strcmp(icon,"pudge")) user_icon="DNU3";
+ if (!std::strcmp(icon,"lich")) user_icon="DNU4";
+ if (!std::strcmp(icon,"balanar")) user_icon="DNU5";
+
+ if (!std::strcmp(icon,"hammer"))
+ {
+ /* special hammer icon for all crew members */
+ if (account_get_command_groups(account) > 1)
+ {
+ user_icon="MMAH";
+ account_set_user_icon(account,clienttag,user_icon);
+ conn_update_w3_playerinfo(c);
+ channel_rejoin(c);
+ return 0;
+ }
+ else {
+ snprintf(msgtemp, sizeof(msgtemp), "You must be a EuroBattle.Net crew member to set this icon!");
+ message_send_text(c,message_type_error,c,msgtemp);
+ return 0;
+ }
+ }
+ if (!std::strcmp(icon,"ladder"))
+ {
+ /* all solo and team rank special icons */
+ if ((account_get_ladder_rank2(account, clienttag, "Solo") < 11) & (account_get_ladder_rank2(account, clienttag, "Solo") != 0))
+ user_icon="DERW";
+ else if ((account_get_ladder_rank2(account, clienttag, "Team") < 11) & (account_get_ladder_rank2(account, clienttag, "Team") != 0))
+ user_icon="NRGW";
+ else if ((account_get_ladder_rank2(account, clienttag, "Solo") < 31) & (account_get_ladder_rank2(account, clienttag, "Solo") != 0))
+ user_icon="DLGW";
+ else if ((account_get_ladder_rank2(account, clienttag, "Team") < 31) & (account_get_ladder_rank2(account, clienttag, "Team") != 0))
+ user_icon="2LGW";
+ else if ((account_get_ladder_rank2(account, clienttag, "Solo") < 101) & (account_get_ladder_rank2(account, clienttag, "Solo") != 0))
+ user_icon="RUPW";
+ else if ((account_get_ladder_rank2(account, clienttag, "Team") < 101) & (account_get_ladder_rank2(account, clienttag, "Team") != 0))
+ user_icon="DNIW";
+ else {
+ snprintf(msgtemp, sizeof(msgtemp), "You must reach the top 100 in Solo or Team ladder games for setting this icon!");
+ message_send_text(c,message_type_error,c,msgtemp);
+ return 0;
+ }
+
+ account_set_user_icon(account,clienttag,user_icon);
+ conn_update_w3_playerinfo(c);
+ channel_rejoin(c);
+ return 0;
+ }
+ if (!std::strcmp(user_icon,"XXXX"))
+ {
+ eventlog(eventlog_level_warn,__FUNCTION__,"unknown icon: %x", icon);
+ snprintf(msgtemp, sizeof(msgtemp), "No such icon. type /icon to see available icons.");
+ message_send_text(c,message_type_error,c,msgtemp);
+ return 0;
+ }
+
+ if (account_get_auth_icon(account,icon) == 1)
+ {
+ account_set_user_icon(account,clienttag,user_icon);
+ conn_update_w3_playerinfo(c);
+ channel_rejoin(c);
+ }
+ else
+ {
+ snprintf(msgtemp, sizeof(msgtemp), "The following icon is not available for your account.");
+ message_send_text(c,message_type_error,c,msgtemp);
+ }
+
+ return 0;
+}
+
static int _handle_set_command(t_connection * c, char const *text)
{
t_account * account;
мне его сохранять в текстовом документе далее менять расширение на .patch? например - addon.patch
и кидать в папку - patch ?
ps. для чего нужен этот патч?