Skip to forum content

You are not logged in. Please login or register.


forums.pvpgn.pro → [EN] The Source Code → My contribution.

Pages 1

You must login or register to post a reply

RSS topic feed

Posts: 5

1

Topic: My contribution.

Here is the code of the ladders, and I hope someone help me in the questions I asked. big_smile

Modify the files Channel.c y bnet_protocol.cpp


Channel.c line=1580

 /* well... unfortunatly channel_get_name never returns NULL but "" instead 
     so we first have to check if user is in a channel at all */
  if ((!conn_get_channel(c)) || (!(channel = channel_get_name(conn_get_channel(c)))))
    return -1;
  
  if ((conn_get_clienttag(c) == CLIENTTAG_WARCRAFT3_UINT) || 
   (conn_get_clienttag(c) == CLIENTTAG_WAR3XP_UINT))
      newflags = W3_ICON_SET;
  else if (account_get_auth_admin(acc,channel) == 1 || account_get_auth_admin(acc,NULL) == 1)
    newflags = MF_BLIZZARD;
  else if (account_get_auth_operator(acc,channel) == 1 || 
      account_get_auth_operator(acc,NULL) == 1)
    newflags = MF_BNET;
  else if (ladder_rank == 1)
     newflags = MF_1TH;
  else if( ladder_rank == 2)
     newflags = MF_2TH;
  else if(ladder_rat < 1000 && ladder_rat > 0)
     newflags = MF_SAPO;
  else if((ladder_rat > 999 && ladder_rat < 1035) || (ladder_rat == 0))
     newflags = MF_EME;
  else if(ladder_rat > 1034 && ladder_rat < 1070)
     newflags = MF_E;
  else if(ladder_rat > 1069 && ladder_rat < 1105)
     newflags = MF_EMA;
  else if(ladder_rat > 1104 && ladder_rat < 1140)
     newflags = MF_DME;
  else if(ladder_rat > 1139 && ladder_rat < 1175)
     newflags = MF_D;
  else if(ladder_rat > 1174 && ladder_rat < 1210)
     newflags = MF_DMA;
  else if(ladder_rat > 1209 && ladder_rat < 1245)
     newflags = MF_CME;
  else if(ladder_rat > 1244 && ladder_rat < 1280)
     newflags = MF_C;
  else if(ladder_rat > 1279 && ladder_rat < 1315)
     newflags = MF_CMA;
  else if(ladder_rat > 1314 && ladder_rat < 1350)
     newflags = MF_BME;
  else if(ladder_rat > 1349 && ladder_rat < 1385)
     newflags = MF_B;
  else if(ladder_rat > 1384 && ladder_rat < 1420)
     newflags = MF_BMA;
  else if(ladder_rat > 1419 && ladder_rat < 1455)
     newflags = MF_AME;
  else if(ladder_rat > 1454 && ladder_rat < 1499)
     newflags = MF_A;
  else newflags = MF_AMA;
  
  if (conn_get_flags(c) != newflags) {
    conn_set_flags(c, newflags);
    channel_update_userflags(c);
  }
  
  return 0;
}

banet_protocol.h line=

/*      Blizzard Entertainment employee */
#define MF_BLIZZARD 0x00000001 /* blue Blizzard logo */
/*      Channel operator */
#define MF_GAVEL    0x00000002 /* gavel */
/*      Speaker in moderated channel */
#define MF_VOICE    0x00000004 /* megaphone */
/*      System operator */
#define MF_BNET     0x00000008 /* (old: blue Blizzard, new: green b.net) or red BNETD logo */
/*      Chat bot or other user without UDP support */
#define MF_PLUG     0x00000010 /* tiny plug to right of icon, no UDP */
/*      Squelched/Ignored user */
#define MF_X        0x00000020 /* big red X */
/*      Special guest of Blizzard Entertainment */
#define MF_SHADES   0x00000040 /* sunglasses */
/* unused           0x00000080 */
/*      Use BEL character in error codes. Some bots use it as a flag. Battle.net */
/*      stopped supporting it recently. */
#define MF_BEEP     0x00000100 /* no change in icon */
/*      Registered Professional Gamers League player */
#define MF_PGLPLAY  0x00000200 /* PGL player logo */
/*      Registered Professional Gamers League official */
#define MF_PGLOFFL  0x00000400 /* PGL official logo */
/*      Registered KBK player */
#define MF_KBKPLAY  0x00000800 /* KBK player logo */
/*      Official KBK Referee */
#define MF_KBKREF   0x00001000 /* KBK referee logo */ /* FIXME: this number may be wrong */
/* unused... FIXME: how many bits work? 16 or 32? */

/*Ladder Categories*///****************
#define MF_SAPO 0x20000000 /*Sapo Category*/
#define MF_EME   0x40000000 /*E- Category*/
#define MF_E    0x02000000 /*E  Category*/
#define MF_EMA   0x04000000 /*E+ Category*/
#define MF_DME   0x00200000 /*D- Category*/
#define MF_D    0x00400000 /*D  Category*/
#define MF_DMA   0x00020000 /*D+ Category*/
#define MF_CME   0x00040000 /*C- Category*/
#define MF_C    0x00002000 /*C  Category*/
#define MF_CMA   0x00004000 /*C+ Category*/
#define MF_BME   0x00000200 /*B- Category*/
#define MF_B    0x00000400 /*B  Category*/
#define MF_BMA   0x00000020 /*B+ Category*/
#define MF_AME   0x00000040 /*A- Category*/
#define MF_A    0x00000004 /*A  Category*/
#define MF_AMA   0x00000002 /*A+ Category*/
#define MF_1TH  0x10000000 /*1th Place Category*/
#define MF_2TH  0x80000000 /*2th Place Category*/
/*Ladder Categories*///****************

/****** Channel Flags ******/
/* flag bits for MT_CHANNEL message */
#define CF_PUBLIC     0x00000001 /* public channel */
#define CF_MODERATED  0x00000002 /* moderated channel */
#define CF_RESTRICTED 0x00000004 /* ? restricted channel ? */
#define CF_THEVOID    0x00000008 /* "The Void" */
#define CF_SYSTEM     0x00000020 /* system channel */
#define CF_OFFICIAL   0x00001000 /* official channel */
/*
 * Examples:
 * 0x00001003 Blizzard Tech Support
 * 0x00001001 Open Tech Support
 * 0x00000021 Diablo II USA-1  or  War2BNE USA-1
 * 0x0000000D warez
 * 0x00000009 The Void
 * 0x00000001 War2 Ladder Challenges  or  Diablo II PvP
 * 0x00000000 clan randomchannel
 * 0x00000000 randomchannel
 */
/************************************

2

Re: My contribution.

Please wrap your code in [ code] tags.

  else if(ladder_rat > 1034 && ladder_rat < 1070)
     newflags = MF_E;
  else if(ladder_rat > 1069 && ladder_rat < 1105)
     newflags = MF_EMA;

If you know C more or less, you could put the data in a data structure.

3

Re: My contribution.

Dante, I don't see a question.

Do not ask for support in PM.

4

Re: My contribution.

HarpyWar wrote:

Dante, I don't see a question.

yap, he's right, what's your question anyway ?

5

Re: My contribution.

HarpyWar wrote:

Dante, I don't see the question.

my question is how to put the punctuation ladder 2 x 2?

Posts: 5

Pages 1

You must login or register to post a reply

Who now at forum

Currently view post: 1 guest, 0 registered users

forums.pvpgn.pro → [EN] The Source Code → My contribution.



Generated in 0.075 seconds (79% PHP - 21% DB) with 21 queries