Archived copy of war3source.com, the War3Source forum (2009–2020), rebuilt from the Internet Archive by wc3mods.net. This page was captured on 2012-10-25 (original capture). Forum · All archived topics · Wiki · Bug tracker · Blog
Chat

War3:Source
October 24, 2012, 10:54:08 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Download: http://war3source.com/index.php?board=9.0
What is War3Source?: http://war3source.com/index.php?topic=200.0
Sample Stats: http://war3source.com/war3stats
Steam Community Group: http://steamcommunity.com/groups/war3source
War3Source SVN Checkout: http://ownageclan.com/svn/war3source/
War3Source servers: http://www.game-monitor.com/search.php?vars=war3_version=
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Better method for Assigning races on spawn  (Read 304 times)
zero
Full Member
***
Posts: 191



View Profile WWW Email
« on: December 15, 2010, 10:56:06 PM »

I think the methods should be updated so that race can be auto assigned even if there is race limits enabled.

This can be done by modifying(in theory):
War3Source_Engine_DatabaseSaveXP
so that the method War3Source_LoadPlayerData()
checks to ensure that the race the user is assigned to has not reached its limit and if it has it can run DoForwardOnWar3PlayerAuthed(client); just like if the user had not selected a race yet.


As I do not know all the inner workings of this mod this is not really something I can edit and test myself very effectively otherwise I would and then just give you the code to add to the plugin. Hopefully this will help in allowing for this function to be added into future versions.
« Last Edit: December 16, 2010, 01:20:54 AM by Ownz » Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #1 on: December 22, 2010, 01:50:12 PM »

next version,

Code:
new raceFound=0; // worst case senario set player to race 0
if(GetConVarInt(hSetRaceOnJoinCvar)>0)
{
//Scan all the races
for(new x=1;x<=War3_GetRacesLoaded();x++)
{
new String:short[16];
War3_GetRaceShortname(x,short,sizeof(short));

//compare their short names to the one loaded
if(StrEqual(currentrace,short,false))
{
raceFound=x;
break;
}
}
new bool:doset=true;
if(GetConVarInt(W3GetVar(hRaceLimitEnabledCvar))>0){
if(GetRacesOnTeam(raceFound,GetClientTeam(client))>=W3GetRaceMaxLimitTeam(raceFound,GetClientTeam(client)))
{
doset=false;
War3_ChatMessage(client,"%T","Race limit for your team has been reached, please select a different race. (MAX {amount})",client,W3GetRaceMaxLimitTeam(racechosen,GetClientTeam(client)));
W3Log("race %d blocked on client %d due to restrictions limit %d (set race on join)",raceFound,client,W3GetRaceMaxLimitTeam(raceFound,GetClientTeam(client)));
//War3Source_ChangeRaceMenu(client);
///do not show menu cuz they DO NOT HAVE XP YET
}

}
if(doset){
W3SetPlayerProp(client,RaceSetByAdmin,false);
War3_SetRace(client,raceFound);
}
}
Logged

DarkEnergy
Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #2 on: December 22, 2010, 01:51:00 PM »

a person that just joined could squeeze someone out of their original race
Logged

DarkEnergy
zero
Full Member
***
Posts: 191



View Profile WWW Email
« Reply #3 on: January 01, 2011, 04:56:03 PM »

I think it is important that a player just joining can not kick another player off their race then everyone will just keep rejoining to get to use what ever race they want.
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #4 on: January 01, 2011, 07:06:05 PM »

a person that just joined could squeeze someone out of their original race
only during map change


other conflicts are resolved by time played on server, longer player gets priority
Logged

DarkEnergy
zero
Full Member
***
Posts: 191



View Profile WWW Email
« Reply #5 on: January 08, 2011, 06:12:58 PM »

As it is now, when someone joins the server and is a race that is limited per team for example Vagabond which is limited to 1 per team, it will force a player who is already on the server and using Vagabond to change into a different race.

Could it be changed so that the player who joins the server has to switch to a different race instead of the player already in the server?
Logged

Ownz
Developer
Administrator
Hero Member
*****
Posts: 2046



View Profile WWW Email
« Reply #6 on: January 08, 2011, 06:15:23 PM »

this is a bug, create a  topic under bugs pls
Logged

DarkEnergy
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!