get_xp_from_file()

This is the place to make suggestions for Warcraft3 XP.

Moderator: Forum Moderator

User avatar
juKay
WC3Mods Donor
WC3Mods Donor
Posts: 14
Joined: Thu Aug 11, 2005 2:36 am
Location: Härnösand / Sweden
Contact:

get_xp_from_file()

Postby juKay » Fri Aug 12, 2005 4:05 pm

You should change the SELECT * FROM table, into actually telling what fields you want. It will lift a bit of load of the SQL-server.

Code: Select all

#if MYSQL_ENABLED
  if (returnrace)
  {
    if (get_cvar_num("mp_savebyname")==1)
      format(mquery, 1023, "SELECT xp, race FROM `%s` WHERE playername='%s'",mysqltablename,playername)
    else
      format(mquery, 1023, "SELECT xp, race FROM `%s` WHERE playerid='%s'",mysqltablename,playerid)


and also these so they reflect the change above

Code: Select all

dbi_field(res,1,xp,7)
dbi_field(res,2,race,1)


same thing later in that code

Code: Select all

if (get_cvar_num("mp_savebyname")==1)
  format(mquery, 1023, "SELECT xp, skill1, skill2, skill3, skill4 FROM `%s` WHERE playername='%s' AND race='%d'",mysqltablename,playername,p_skills[id][0])
else
  format(mquery, 1023, "SELECT xp, skill1, skill2, skill3, skill4 FROM `%s` WHERE playerid='%s' AND race='%d'",mysqltablename,playerid,p_skills[id][0])


and also changing the dbi_field() so it reflects the changes made

User avatar
Lazarus Long
Lead PITA SOB
Posts: 618
Joined: Tue Jul 05, 2005 9:24 pm

Postby Lazarus Long » Sun Sep 11, 2005 5:32 pm

done - it will be part of 2.6.2
Lazarus


Return to “WC3XP - Suggestions / Ideas”

Who is online

Users browsing this forum: No registered users and 1 guest