mirror of
https://github.com/Ragora/TribesReplay.git
synced 2026-02-25 17:23:36 +00:00
v22649 (04/28/01):
- Fixed buddy filter. You can now use the Filter option on the JOIN screen to find games that have players in them that are listed on your buddy list. (Use the Email or Warrior Browser functions to add/remove people from your buddy list.) - You can now add a player to your server admin lists (so that server admins can auto-admin players when they join a server, if desired). How this is done: If you are a SuperAdmin (owner of the server), you can go into the lobby and right-click on a player's name. You will then have the ability to add them to your Admin or SuperAdmin lists. - "Vote Spamming" has been prevented in-game. - Added "quickbuy" keyboard shortcuts to use at vehicle station. (Default keys are the 1-6 number keys. 1 is Wildcat, 6 is Havoc). (NOTE: These key bindings are not currently editable. However, since you are on the vehicle purchase pad when they are in effect, they cannot interfere with any custom keys you've created, so you should have no problems.) - Moved some of the CD check from script into code, where it should be. - Missile reticle is improved aesthetically. This is part 1 of 2 of the missile reticle changes. The second part will be in the next patch. - Team Damage ON/OFF can be changed by Admins/SuperAdmins as well as being voted on by players. If you are an Admin or SuperAdmin, then just go to Lobby and look up where the "Vote" options are listed. There are options there to toggle the Team Damage flag. Regular players can also Vote to Enable/Disable Team Damage in the same spot. - Default server prefs have been changed so that the default time limit is now 30 minutes (instead of 20) and Team Damage is OFF. - The "sticking" mouse button problem is now fixed. - Deployables are now easier to place on walls and other surfaces. There were some inconsistencies on which surfaces could be placed upon and those are now resolved. - (gameplay change) Flag captures are now worth 100 points, instead of 1 point. Additionally, each time someone grabs the flag *from the enemy flag stand* they will gain 1 point, regardless of whether they actually capture it or not. You will ONLY get this single point if the flag was actually on the flagstand. You will NOT get the point by touching the flag anywhere else on the field. This change will help prevent tie situations and will reward aggressive offensive play. NOTE: The "touch" point can only be gained once every 20 seconds...so a "scrum" around the flag base will not result in a large group of points being gained. - (gameplay change) Deployable inventory stations can no longer be deployed directly next to each other. They must be at least 20 meters apart in order to be deployed properly. - (gameplay change) Many team damage fixes occurred. When Team Damage is OFF the following are now true: Friendly teammates are no longer prevented from destroying deployables. The ELF will no longer drain energy from friendly players. If a friendly player blinds another friendly player with Whiteout grenades, then a message is displayed in the Chat HUD so that the blinded person knows who did it. (There are more Team Damage changes coming in the next patch.) - (gameplay change) Medium now has a standard loadout of 12 grenades in the grenade launcher instead of 10. Light: 10; Medium: 12; Heavy: 15. - (gameplay change) Deployable pulse sensors now have a range of 150m instead of 120m to make them a more attractive option to deploy. - (gameplay change) Ejection speed increased slightly to more easily accomodate jumping out of moving vehicles. - (gameplay change) Siege: Alcatraz. The generators have been moved around a bit. There are two entrances to that base. One is the "front door" and the other is the "back door". (The back door is the one that has a team-pass-only force field blocking enemies from the switch room.) There is now an upper generator down the chute from the "front door" that powers the "back door" force field. Additionally, there is a solar panel outside that powers the base turrets and sentry turrets. None of these generators have to be destroyed to get to the switch, but their destruction makes it MUCH easier to do so. There are four generators total on this map (all are waypointed now), and the destruction of all four is necessary before the base power will go down. - (gameplay change) Siege: Caldera. The generator has been moved out of the switch room and into the very big main room that has the inventory stations in it. It is no longer necessary to destroy the generators in a particular sequence. Destroying the two main generators (Primary and Secondary) will drop the force field that protects the switch. Both gens must be down in order for the switch force field to drop.
This commit is contained in:
parent
116be1648d
commit
a7153c654d
49 changed files with 3968 additions and 2625 deletions
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
//--- GAME RULES BEGIN ---
|
||||
//Prevent enemy from capturing your flag
|
||||
//Capture enemy flag and bring it to your team's flag stand
|
||||
//Score a point each time enemy flag is "capped"
|
||||
//To score, your flag must be at its stand when the enemy flag arrives
|
||||
//Score one point for grabbing the enemy's flag
|
||||
//To capture, your flag must be at its stand
|
||||
//Score 100 points each time enemy flag is captured
|
||||
//--- GAME RULES END ---
|
||||
|
||||
//exec the AI scripts
|
||||
|
|
@ -84,7 +84,8 @@ function CTFGame::initGameVars(%game)
|
|||
|
||||
%game.SCORE_PER_KILL = 1;
|
||||
%game.SCORE_PER_PLYR_FLAG_CAP = 3;
|
||||
%game.SCORE_PER_TEAM_FLAG_CAP = 1;
|
||||
%game.SCORE_PER_TEAM_FLAG_CAP = 100;
|
||||
%game.SCORE_PER_TEAM_FLAG_TOUCH = 1;
|
||||
%game.SCORE_PER_GEN_DESTROY = 2;
|
||||
%game.SCORE_PER_ESCORT_ASSIST = 1;
|
||||
|
||||
|
|
@ -101,10 +102,13 @@ function CTFGame::initGameVars(%game)
|
|||
%game.RADIUS_GEN_DEFENSE = 20; //meters
|
||||
%game.RADIUS_FLAG_DEFENSE = 20; //meters
|
||||
|
||||
%game.TOUCH_DELAY_MS = 20000; //20 secs
|
||||
|
||||
%game.fadeTimeMS = 2000;
|
||||
|
||||
%game.notifyMineDist = 7.5;
|
||||
|
||||
|
||||
%game.stalemate = false;
|
||||
%game.stalemateObjsVisible = false;
|
||||
%game.stalemateTimeMS = 60000;
|
||||
|
|
@ -194,6 +198,9 @@ function CTFGame::playerTouchEnemyFlag(%game, %player, %flag)
|
|||
//if this flag was "at home", see if both flags have now been taken
|
||||
if (%flag.isHome)
|
||||
{
|
||||
// tiebreaker score
|
||||
game.awardScoreFlagTouch( %client, %flag );
|
||||
|
||||
%startStalemate = false;
|
||||
if ($TeamFlag[1] == %flag)
|
||||
%startStalemate = !$TeamFlag[2].isHome;
|
||||
|
|
@ -660,12 +667,34 @@ function CTFGame::awardScoreFlagCap(%game, %cl, %flag)
|
|||
%game.checkScoreLimit(%cl.team);
|
||||
}
|
||||
|
||||
|
||||
function CTFGame::awardScoreFlagTouch(%game, %cl, %flag)
|
||||
{
|
||||
%team = %cl.team;
|
||||
if( $DontScoreTimer[%team] )
|
||||
return;
|
||||
|
||||
$dontScoreTimer[%team] = true;
|
||||
schedule(%game.TOUCH_DELAY_MS, 0, eval, "$dontScoreTimer["@%team@"] = false;");
|
||||
$TeamScore[%team] += %game.SCORE_PER_TEAM_FLAG_TOUCH;
|
||||
messageAll('MsgTeamScoreIs', "", %team, $TeamScore[%team]);
|
||||
|
||||
if (%game.SCORE_PER_TEAM_FLAG_TOUCH > 0)
|
||||
{
|
||||
%plural = (%game.SCORE_PER_TEAM_FLAG_TOUCH != 1 ? 's' : "");
|
||||
messageTeam(%team, 'msgCTFFriendFlagTouch', '\c0Your team receives %1 point%2 for grabbing the enemy flag!', %game.SCORE_PER_TEAM_FLAG_TOUCH, %plural);
|
||||
messageTeam(%flag.team, 'msgCTFEnemyFlagTouch', '\c0Enemy team %1 receives %2 point%3 for grabbing your flag!', %cl.name, %game.SCORE_PER_TEAM_FLAG_TOUCH, %plural);
|
||||
}
|
||||
%game.recalcScore(%cl);
|
||||
%game.checkScoreLimit(%team);
|
||||
}
|
||||
|
||||
function CTFGame::checkScoreLimit(%game, %team)
|
||||
{
|
||||
%scoreLimit = MissionGroup.CTF_scoreLimit;
|
||||
%scoreLimit = MissionGroup.CTF_scoreLimit * %game.SCORE_PER_TEAM_FLAG_CAP;
|
||||
// default of 5 if scoreLimit not defined
|
||||
if(%scoreLimit $= "")
|
||||
%scoreLimit = 5;
|
||||
%scoreLimit = 5 * %game.SCORE_PER_TEAM_FLAG_CAP;
|
||||
if($TeamScore[%team] >= %scoreLimit)
|
||||
%game.scoreLimitReached();
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -348,7 +348,19 @@ function GMJ_Browser::onDatabaseRow( %this, %row, %isLastRow, %key )
|
|||
if ( %isLastRow )
|
||||
{
|
||||
GMJ_StatusText.setValue( "Querying the master server..." );
|
||||
queryMasterServer( $JoinGamePort, 0, "Any", "Any", 0, 255, 16, 0xFFFFFFFF, 0, 0, %this.buddyList );
|
||||
queryMasterServer(
|
||||
$JoinGamePort, // Port
|
||||
0, // Flags
|
||||
"Any", // Rules Set
|
||||
"Any", // Mission Type
|
||||
0, // Min Players
|
||||
255, // Max Players
|
||||
16, // Max Bots
|
||||
0xFFFFFFFF, // Region Mask
|
||||
0, // Max Ping
|
||||
0, // Min CPU Speed
|
||||
0, // Filter flags
|
||||
%this.buddyList );
|
||||
GMJ_StopBtn.setActive( true );
|
||||
%this.buddyList = "";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -508,7 +508,7 @@ function HuntersYardSaleTimeOut(%waypoint)
|
|||
%waypoint.delete();
|
||||
}
|
||||
|
||||
function HuntersGame::updateFlagHoarder(%game)
|
||||
function HuntersGame::updateFlagHoarder(%game, %eventClient)
|
||||
{
|
||||
%hoarder = -1;
|
||||
%maxFlags = -1;
|
||||
|
|
@ -526,30 +526,36 @@ function HuntersGame::updateFlagHoarder(%game)
|
|||
//if we found our hoarder, set the waypoint, otherwise, delete it
|
||||
if (%hoarder > 0)
|
||||
{
|
||||
if (!isObject(%game.hoarderWaypoint))
|
||||
//only update if the event (capping, picking up flag, etc...) was the actual hoarder
|
||||
if (!isObject(%game.flagHoarder) || %game.flagHoarder == %eventClient)
|
||||
{
|
||||
//create a waypoint at player's location...
|
||||
%game.hoarderWaypoint = new WayPoint()
|
||||
if (!isObject(%game.hoarderWaypoint))
|
||||
{
|
||||
position = %hoarder.player.position;
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
name = "Flag Hoarder Was Here";
|
||||
dataBlock = "WayPointMarker";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
team = 0;
|
||||
};
|
||||
//create a waypoint at player's location...
|
||||
%game.hoarderWaypoint = new WayPoint()
|
||||
{
|
||||
position = %hoarder.player.position;
|
||||
rotation = "1 0 0 0";
|
||||
scale = "1 1 1";
|
||||
name = "Flag Hoarder Was Here";
|
||||
dataBlock = "WayPointMarker";
|
||||
lockCount = "0";
|
||||
homingCount = "0";
|
||||
team = 0;
|
||||
};
|
||||
|
||||
//add the waypoint to the cleanup group
|
||||
MissionCleanup.add(%game.hoarderWaypoint);
|
||||
//add the waypoint to the cleanup group
|
||||
MissionCleanup.add(%game.hoarderWaypoint);
|
||||
}
|
||||
|
||||
//set the position
|
||||
%game.flagHoarder = %hoarder;
|
||||
%game.hoarderWaypoint.setTransform(%hoarder.player.getWorldBoxCenter() SPC "0 0 1 0");
|
||||
}
|
||||
|
||||
//set the position
|
||||
%game.hoarderWaypoint.setTransform(%hoarder.player.getWorldBoxCenter() SPC "0 0 1 0");
|
||||
}
|
||||
else if (isObject(%game.hoarderWaypoint))
|
||||
{
|
||||
%game.flaghoarder = "";
|
||||
%game.hoarderWaypoint.delete();
|
||||
}
|
||||
}
|
||||
|
|
@ -634,7 +640,7 @@ function HuntersGame::playerTouchFlag(%game, %player, %flag)
|
|||
}
|
||||
|
||||
//new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags
|
||||
%game.updateFlagHoarder();
|
||||
%game.updateFlagHoarder(%client);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -875,7 +881,7 @@ function Nexus::onCollision(%data, %obj, %colObj)
|
|||
messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned 1 flag for 1 point.~wfx/misc/nexus_cap.wav', %client.name, 1);
|
||||
|
||||
//new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags
|
||||
Game.updateFlagHoarder();
|
||||
Game.updateFlagHoarder(%client);
|
||||
}
|
||||
|
||||
//add the nexus effect
|
||||
|
|
@ -892,7 +898,7 @@ function Nexus::onCollision(%data, %obj, %colObj)
|
|||
messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags for %3 points.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore);
|
||||
|
||||
//new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags
|
||||
Game.updateFlagHoarder();
|
||||
Game.updateFlagHoarder(%client);
|
||||
}
|
||||
|
||||
//add the nexus effect
|
||||
|
|
@ -909,7 +915,7 @@ function Nexus::onCollision(%data, %obj, %colObj)
|
|||
messageAllExcept(%client, -1, 'MsgHuntPlayerScored', '\c2%1 returned %2 flags for %3 points.~wfx/misc/nexus_cap.wav', %client.name, %numToScore, %totalScore);
|
||||
|
||||
//new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags
|
||||
Game.updateFlagHoarder();
|
||||
Game.updateFlagHoarder(%client);
|
||||
}
|
||||
|
||||
//add the nexus effect
|
||||
|
|
@ -1391,7 +1397,7 @@ function HuntersGame::throwFlags(%game, %player)
|
|||
messageClient(%client, 'MsgHuntYouHaveFlags', "", 0);
|
||||
|
||||
//new tracking - *everyone* automatically tracks the "flag hoarder" if they have at least 15 flags
|
||||
%game.updateFlagHoarder();
|
||||
%game.updateFlagHoarder(%client);
|
||||
}
|
||||
|
||||
function HuntersGame::dropFlag(%game, %player)
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ function LaunchToolbarMenu::onSelect(%this, %id, %text)
|
|||
//case 8: // Play Recording
|
||||
// Canvas.pushDialog(RecordingsDlg);
|
||||
case 9: // Quit
|
||||
IRCClient::quit();
|
||||
LaunchTabView.closeAllTabs();
|
||||
quit();
|
||||
//case 10: // Log Off
|
||||
|
|
|
|||
|
|
@ -280,7 +280,7 @@ function LobbyPlayerPopup::onSelect( %this, %id, %text )
|
|||
|
||||
case 4: // Ban
|
||||
MessageBoxYesNo( "CONFIRM", "Are you sure you want to ban " @ %this.player.name @ "?",
|
||||
"lobbyPlayerVote( VoteBanPlayer, \"BAN player\", " @ %this.player.clientId @ " );" );
|
||||
"lobbyPlayerVote( BanPlayer, \"BAN player\", " @ %this.player.clientId @ " );" );
|
||||
|
||||
case 5: // force observer
|
||||
forceToObserver(%this.player.clientId);
|
||||
|
|
@ -466,7 +466,7 @@ function handleSuperAdminPlayerMessage( %msgType, %msgString, %client )
|
|||
%player.isSuperAdmin = true;
|
||||
%player.isAdmin = true;
|
||||
}
|
||||
alxPlay(VotePassSound, 0, 0, 0);
|
||||
alxPlay(AdminForceSound, 0, 0, 0);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -537,7 +537,7 @@ function lobbyVote()
|
|||
return;
|
||||
|
||||
case "VoteMatchStart":
|
||||
startNewVote( "VoteMatchStart", "Started the Match" );
|
||||
startNewVote( "VoteMatchStart" );
|
||||
schedule( 100, 0, lobbyReturnToGame );
|
||||
return;
|
||||
|
||||
|
|
@ -572,7 +572,6 @@ function lobbyVote()
|
|||
if( !LobbyVoteMenu.tourneyChoose )
|
||||
{
|
||||
startNewVote( "VoteChangeMission",
|
||||
"change the mission to",
|
||||
%text, // Mission display name
|
||||
LobbyVoteMenu.typeName, // Mission type display name
|
||||
$clVoteCmd[%id], // Mission id
|
||||
|
|
@ -581,7 +580,6 @@ function lobbyVote()
|
|||
else
|
||||
{
|
||||
startNewVote( "VoteTournamentMode",
|
||||
"change the server to",
|
||||
%text, // Mission display name
|
||||
LobbyVoteMenu.typeName, // Mission type display name
|
||||
$clVoteCmd[%id], // Mission id
|
||||
|
|
@ -592,7 +590,7 @@ function lobbyVote()
|
|||
return;
|
||||
|
||||
case "timeLimit":
|
||||
startNewVote( "VoteChangeTimeLimit", "change the time limit to", $clVoteCmd[%id] );
|
||||
startNewVote( "VoteChangeTimeLimit", $clVoteCmd[%id] );
|
||||
LobbyVoteMenu.reset();
|
||||
return;
|
||||
}
|
||||
|
|
@ -613,6 +611,6 @@ function LobbyVoteMenu::reset( %this )
|
|||
//------------------------------------------------------------------------------
|
||||
function lobbyPlayerVote(%voteType, %actionMsg, %playerId)
|
||||
{
|
||||
startNewVote(%voteType, %actionMsg, %playerId, 0, 0, 0, true);
|
||||
startNewVote(%voteType, %playerId, 0, 0, 0, true);
|
||||
fillLobbyVoteMenu();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2205,6 +2205,7 @@ function JoystickConfigDlg::setPane( %this, %pane )
|
|||
else
|
||||
DeadZoneSlider.setValue( abs( firstWord( %deadZone ) ) / %scale );
|
||||
InvertJoyAxisTgl.setValue( moveMap.isInverted( "joystick", %axisType ) );
|
||||
JoyAxisRelativeTgl.setValue( moveMap.isRelativeAxis( "joystick", %axisType ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -2213,6 +2214,7 @@ function JoystickConfigDlg::setPane( %this, %pane )
|
|||
JoyAxisSlider.setValue( 0.5 );
|
||||
DeadZoneSlider.setValue( 0.0 );
|
||||
InvertJoyAxisTgl.setValue( false );
|
||||
JoyAxisRelativeTgl.setValue( %axisType $= "slider" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2225,6 +2227,7 @@ function JoyAxisActionMenu::onSelect( %this, %id, %text )
|
|||
DeadZoneSlider.setActive( %on );
|
||||
DeadZoneText.setVisible( %on );
|
||||
InvertJoyAxisTgl.setActive( %on );
|
||||
JoyAxisRelativeTgl.setActive( %on );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
@ -2259,21 +2262,18 @@ function bindJoystickAxis( %axisIndex, %cmdIndex )
|
|||
|
||||
%sens = JoyAxisSlider.getValue() * 100;
|
||||
%delta = DeadZoneSlider.getValue() * %sens;
|
||||
%flags = "S";
|
||||
if ( InvertJoyAxisTgl.getValue() )
|
||||
%flags = %flags @ "I";
|
||||
if ( JoyAxisRelativeTgl.getValue() )
|
||||
%flags = %flags @ "L";
|
||||
if ( %delta > 0 )
|
||||
{
|
||||
%deadZone = "-" @ %delta SPC %delta;
|
||||
if ( InvertJoyAxisTgl.getValue() )
|
||||
moveMap.bind( "joystick", %axis, "SDI", %deadZone, %sens, %cmd );
|
||||
else
|
||||
moveMap.bind( "joystick", %axis, "SD", %deadZone, %sens, %cmd );
|
||||
moveMap.bind( "joystick", %axis, %flags @ "D", %deadZone, %sens, %cmd );
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( InvertJoyAxisTgl.getValue() )
|
||||
moveMap.bind( "joystick", %axis, "SI", %sens, %cmd );
|
||||
else
|
||||
moveMap.bind( "joystick", %axis, "S", %sens, %cmd );
|
||||
}
|
||||
moveMap.bind( "joystick", %axis, %flags, %sens, %cmd );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -1,5 +1,57 @@
|
|||
function serverCmdStartNewVote(%client, %typeName, %actionMsg, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
// These have been secured against all those wanna-be-hackers.
|
||||
$VoteMessage["VoteAdminPlayer"] = "Admin Player";
|
||||
$VoteMessage["VoteKickPlayer"] = "Kick Player";
|
||||
$VoteMessage["BanPlayer"] = "Ban Player";
|
||||
$VoteMessage["VoteChangeMission"] = "change the mission to";
|
||||
$VoteMessage["VoteTeamDamage", 0] = "enable team damage";
|
||||
$VoteMessage["VoteTeamDamage", 1] = "disable team damage";
|
||||
$VoteMessage["VoteTournamentMode"] = "change the server to";
|
||||
$VoteMessage["VoteChangeTimeLimit"] = "change the time limit to";
|
||||
$VoteMessage["VoteMatchStart"] = "start the match";
|
||||
$VoteMessage["VoteGreedMode", 0] = "enable Hoard Mode";
|
||||
$VoteMessage["VoteGreedMode", 1] = "disable Hoard Mode";
|
||||
$VoteMessage["VoteHoardMode", 0] = "enable Greed Mode";
|
||||
$VoteMessage["VoteHoardMode", 1] = "disable Greed Mode";
|
||||
|
||||
function serverCmdStartNewVote(%client, %typeName, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
{
|
||||
// haha - who gets the last laugh... No admin for you!
|
||||
if( %typeName $= "VoteAdminPlayer" && !$Host::allowAdminPlayerVotes )
|
||||
return;
|
||||
|
||||
%typePass = true;
|
||||
|
||||
// if not a valid vote, turn back.
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteTeamDamage" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteHoardMode" )
|
||||
if( $VoteMessage[ %typeName ] $= "" && %typeName !$= "VoteGreedMode" )
|
||||
%typePass = false;
|
||||
|
||||
if(( $VoteMessage[ %typeName, $TeamDamage ] $= "" && %typeName $= "VoteTeamDamage" ))
|
||||
%typePass = false;
|
||||
|
||||
if( !%typePass )
|
||||
return; // -> bye ;)
|
||||
|
||||
if( %typeName $= "BanPlayer" )
|
||||
if( !%client.isSuperAdmin )
|
||||
return; // -> bye ;)
|
||||
|
||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||
|
||||
// keep these under the server's control. I win.
|
||||
if( !%playerVote )
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
else if( %typeName $= "VoteTeamDamage" || %typeName $= "VoteGreedMode" || %typeName $= "VoteHoardMode" )
|
||||
%actionMsg = $VoteMessage[ %typeName, $TeamDamage ];
|
||||
else
|
||||
%actionMsg = $VoteMessage[ %typeName ];
|
||||
|
||||
if( !%client.canVote && !%isAdmin )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( !%client.isAdmin || ( ( %arg1.isAdmin && ( %client != %arg1 ) ) ) )
|
||||
{
|
||||
%teamSpecific = false;
|
||||
|
|
@ -9,9 +61,9 @@ function serverCmdStartNewVote(%client, %typeName, %actionMsg, %arg1, %arg2, %ar
|
|||
%clientsVoting = 0;
|
||||
|
||||
//send a message to everyone about the vote...
|
||||
if (%playerVote)
|
||||
if ( %playerVote )
|
||||
{
|
||||
%teamSpecific = Game.numTeams > 1;
|
||||
%teamSpecific = ( %typeName $= "VoteKickPlayer" );
|
||||
%kickerIsObs = %client.team == 0;
|
||||
%kickeeIsObs = %arg1.team == 0;
|
||||
%sameTeam = %client.team == %arg1.team;
|
||||
|
|
@ -27,9 +79,9 @@ function serverCmdStartNewVote(%client, %typeName, %actionMsg, %arg1, %arg2, %ar
|
|||
messageClient(%client, '', "\c2Player votes must be team based.");
|
||||
return;
|
||||
}
|
||||
|
||||
// kicking and banning are team specific
|
||||
if(%typeName $= "VoteKickPlayer" || %typeName $= "VoteBanPlayer")
|
||||
|
||||
// kicking is team specific
|
||||
if( %typeName $= "VoteKickPlayer" )
|
||||
{
|
||||
if(%arg1.isSuperAdmin)
|
||||
{
|
||||
|
|
@ -38,6 +90,8 @@ function serverCmdStartNewVote(%client, %typeName, %actionMsg, %arg1, %arg2, %ar
|
|||
}
|
||||
|
||||
Game.kickClient = %arg1;
|
||||
Game.kickGuid = %arg1.guid;
|
||||
Game.kickTeam = %arg1.team;
|
||||
if(%teamSpecific)
|
||||
{
|
||||
for ( %idx = 0; %idx < ClientGroup.getCount(); %idx++ )
|
||||
|
|
@ -204,19 +258,29 @@ function serverCmdStartNewVote(%client, %typeName, %actionMsg, %arg1, %arg2, %ar
|
|||
messageClient(%client, '', '\c2You can not %1 %2, %3 is a Super Admin!', %actionMsg, %arg1.name, %gender);
|
||||
}
|
||||
}
|
||||
|
||||
%client.canVote = false;
|
||||
%client.rescheduleVote = schedule( ($Host::voteSpread * 1000) + ($Host::voteTime * 1000) , 0, "resetVotePrivs", %client );
|
||||
}
|
||||
|
||||
function resetVotePrivs( %client )
|
||||
{
|
||||
//messageClient( %client, '', 'You may now start a new vote.');
|
||||
%client.canVote = true;
|
||||
%client.rescheduleVote = "";
|
||||
}
|
||||
|
||||
function serverCmdSetPlayerVote(%client, %vote)
|
||||
{
|
||||
// players can only vote once
|
||||
if(%client.vote $= "")
|
||||
if( %client.vote $= "" )
|
||||
{
|
||||
%client.vote = %vote;
|
||||
if(%client.vote == 1)
|
||||
messageAll('addYesVote', "");
|
||||
else
|
||||
messageAll('addNoVote', "");
|
||||
|
||||
|
||||
commandToClient(%client, 'voteSubmitted', %vote);
|
||||
}
|
||||
}
|
||||
|
|
@ -254,6 +318,7 @@ function calcVotes(%typeName, %arg1, %arg2, %arg3, %arg4)
|
|||
eval( "Game." @ %typeName @ "(false,\"" @ %arg1 @ "\",\"" @ %arg2 @ "\",\"" @ %arg3 @ "\",\"" @ %arg4 @ "\");" );
|
||||
Game.scheduleVote = "";
|
||||
Game.kickClient = "";
|
||||
clearVotes();
|
||||
}
|
||||
|
||||
function clearVotes()
|
||||
|
|
@ -282,7 +347,6 @@ function setModeFFA( %mission, %missionType )
|
|||
{
|
||||
if( $Host::TournamentMode )
|
||||
{
|
||||
$TeamDamage = 1;
|
||||
$Host::TournamentMode = false;
|
||||
|
||||
if( isObject( Game ) )
|
||||
|
|
@ -298,7 +362,6 @@ function setModeTournament( %mission, %missionType )
|
|||
{
|
||||
if( !$Host::TournamentMode )
|
||||
{
|
||||
$TeamDamage = 1;
|
||||
$Host::TournamentMode = true;
|
||||
|
||||
if( isObject( Game ) )
|
||||
|
|
|
|||
|
|
@ -269,7 +269,7 @@ $BotProfile[9, skill] = 0.99;
|
|||
$BotProfile[9, offense] = false;
|
||||
$BotProfile[9, voicePitch] = 1.12;
|
||||
$BotProfile[10, name] = "HexaBOTic";
|
||||
$BotProfile[10, skill] = 1.99;
|
||||
$BotProfile[10, skill] = 0.99;
|
||||
$BotProfile[10, offense] = true;
|
||||
$BotProfile[10, voicePitch] = 0.895;
|
||||
$BotProfile[11, name] = "Sne/\kBOT";
|
||||
|
|
|
|||
|
|
@ -204,6 +204,7 @@ function createAIDebugDlg()
|
|||
visible = "True";
|
||||
setFirstResponder = "True";
|
||||
helpTag = "0";
|
||||
bypassHideCursor = "1";
|
||||
|
||||
new DebugView(aiDebug)
|
||||
{
|
||||
|
|
@ -235,6 +236,13 @@ function ToggleAIDebug(%make)
|
|||
createAIDebugDlg();
|
||||
Canvas.pushDialog(aiDebugDlg, 70);
|
||||
$AIDebugActive = true;
|
||||
|
||||
//make sure we're debuging the correct client
|
||||
if (LocalClientConnection.getControlObject() == LocalClientConnection.camera)
|
||||
{
|
||||
if (isObject(LocalClientConnection.observeClient))
|
||||
aidebug(LocalClientConnection.observeClient);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ $AIWeightPatrolling = 2000;
|
|||
|
||||
//Hunters weights...
|
||||
$AIHuntersWeightMustCap = 4690;
|
||||
$AIHuntersWeightNeedHealth = 4625;
|
||||
$AIHuntersWeightShouldCap = 4425;
|
||||
$AIHuntersWeightMustEngage = 4450;
|
||||
$AIHuntersWeightShouldEngage = 4325;
|
||||
|
|
|
|||
|
|
@ -53,6 +53,7 @@ function AIHuntersTask::assume(%task, %client)
|
|||
%task.setMonitorFreq(10);
|
||||
%task.pickupFlag = -1;
|
||||
%task.engageTarget = -1;
|
||||
%task.getHealth = -1;
|
||||
%task.capFlags = false;
|
||||
}
|
||||
|
||||
|
|
@ -60,6 +61,7 @@ function AIHuntersTask::retire(%task, %client)
|
|||
{
|
||||
%task.pickupFlag = -1;
|
||||
%task.engageTarget = -1;
|
||||
%task.getHealth = -1;
|
||||
%task.capFlags = false;
|
||||
}
|
||||
|
||||
|
|
@ -88,30 +90,66 @@ function AIHuntersTask::weight(%task, %client)
|
|||
if (%nexusDist < 0)
|
||||
%nexusDist = 32767;
|
||||
|
||||
//validate the health item
|
||||
if (isObject(%task.getHealth))
|
||||
{
|
||||
if (%task.getHealth.isHidden())
|
||||
%task.getHealth = -1;
|
||||
else if ((%task.getHealth.getDataBlock().getName() $= "DeployedStationInventory") ||
|
||||
(%task.getHealth.getDataBlock().getName() $= "StationInventory"))
|
||||
{
|
||||
if (%task.getHealth.isDisabled() && !%task.getHealth.isPowered())
|
||||
%task.getHealth = -1;
|
||||
}
|
||||
}
|
||||
|
||||
//find the dist to the closest health
|
||||
%healthDist = 32767;
|
||||
%damage = %client.player.getDamagePercent();
|
||||
if (%damage > 0.7)
|
||||
if (%client.flagCount < 5)
|
||||
%damageTolerance = 0.7;
|
||||
else
|
||||
%damageTolerance = 0.25 + ((%client.getSkillLevel() * %client.getSkillLevel()) * 0.35);
|
||||
if (%damage > %damageTolerance)
|
||||
{
|
||||
//search for a health kit
|
||||
%closestHealth = AIFindSafeItem(%client, "Health");
|
||||
if (%closestHealth > 0)
|
||||
{
|
||||
%healthDist = %client.getPathDistance(%closestHealth);
|
||||
if (%healthDist < 0)
|
||||
%healthDist = 32767;
|
||||
}
|
||||
if (!isObject(%task.getHealth))
|
||||
{
|
||||
//search for a health kit
|
||||
%closestHealth = AIFindSafeItem(%client, "Health");
|
||||
if (isObject(%closestHealth))
|
||||
{
|
||||
%healthDist = %client.getPathDistance(%closestHealth.getWorldBoxCenter());
|
||||
if (%healthDist < 0)
|
||||
%healthDist = 32767;
|
||||
else
|
||||
%healthItem = %closestHealth;
|
||||
}
|
||||
|
||||
//else search for an inventory station
|
||||
else
|
||||
{
|
||||
%result = AIFindClosestInventory(%client, false);
|
||||
%closestInv = getWord(%result, 0);
|
||||
%closestDist = getWord(%result, 1);
|
||||
if (%closestInv > 0)
|
||||
%healthDist = %closestDist;
|
||||
}
|
||||
}
|
||||
//else search for an inventory station
|
||||
else
|
||||
{
|
||||
%result = AIFindClosestInventory(%client, false);
|
||||
%closestInv = getWord(%result, 0);
|
||||
%closestDist = getWord(%result, 1);
|
||||
if (isObject(%closestInv))
|
||||
{
|
||||
%healthDist = %closestDist;
|
||||
%healthItem = %closestInv;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
%healthDist = %client.getPathDistance(%task.getHealth.getWorldBoxCenter());
|
||||
if (%healthDist < 0)
|
||||
{
|
||||
%healthDist = 32767;
|
||||
%task.getHealth = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
%task.getHealth = -1;
|
||||
|
||||
//see if we need to cap - make sure we're actually able first
|
||||
%mustCap = false;
|
||||
|
|
@ -199,16 +237,15 @@ function AIHuntersTask::weight(%task, %client)
|
|||
|
||||
//If there's a tough or equal enemy nearby, or no flags, think about capping
|
||||
//ie. never cap if there are flags nearby and no enemies...
|
||||
if ((AIClientIsAlive(%closestEnemy) && AIEngageWhoWillWin(%closestEnemy, %client) != %client) ||
|
||||
if ((AICheckEnemyDanger(%client, 35) >= 3 && %damage > %damageTolerance) ||
|
||||
(!isObject(%closestFlag) || %closestFlagDist > $AIHuntersCloseFlagDist))
|
||||
{
|
||||
//if we've got enough to take the lead, and there are no flags in the vicinity
|
||||
if ((!%clientIsInLead && %needFlagsForLead == 0) || %highestScore == 0)
|
||||
%mustCap = true;
|
||||
|
||||
//else if we're about to get our butt kicked and we're much closer to the nexus than to health...
|
||||
else if ((AIClientIsAlive(%closestEnemy) && AIEngageWhoWillWin(%closestEnemy, %client) == %closestEnemy) &&
|
||||
(%healthDist - %nexusDist > 100))
|
||||
//else if we're about to get our butt kicked...
|
||||
else if (AIClientIsAlive(%closestEnemy) && AIEngageWhoWillWin(%closestEnemy, %client) == %closestEnemy)
|
||||
{
|
||||
%mustCap = true;
|
||||
}
|
||||
|
|
@ -238,7 +275,9 @@ function AIHuntersTask::weight(%task, %client)
|
|||
if (%needFlagsForLead == 0 || %numEnemyFlags < %needFlagsForLead || Game.teamMode)
|
||||
{
|
||||
if (%numToScore >= $AIHuntersMinFlagsToCap + (%client.getSkillLevel() * %client.getSkillLevel() * 15))
|
||||
{
|
||||
%shouldCap = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -257,15 +296,19 @@ function AIHuntersTask::weight(%task, %client)
|
|||
}
|
||||
}
|
||||
|
||||
//if we've made it this far, we either can't cap, or there's no need to cap...
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
// if we've made it this far, we either can't cap, or there's no need to cap... //
|
||||
////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
//if we're engaging someone that's going to kill us, return 0 and let the patrol take over...
|
||||
%currentTarget = %client.getEngageTarget();
|
||||
if ((AIClientIsAlive(%currentTarget) && AIEngageWhoWillWin(%currentTarget, %client) == %currentTarget) && %healthDist < 300)
|
||||
{
|
||||
%task.setWeight(0);
|
||||
return;
|
||||
}
|
||||
//see if we need health
|
||||
if (%damage > %damageTolerance && (isObject(%healthItem) || isObject(%task.getHealth)))
|
||||
{
|
||||
if (!isObject(%task.getHealth))
|
||||
%task.getHealth = %healthItem;
|
||||
|
||||
%task.setWeight($AIHuntersWeightNeedHealth);
|
||||
return;
|
||||
}
|
||||
|
||||
//find the closest player with the most flags (that we have los to)
|
||||
%losTimeout = $AIClientMinLOSTime + ($AIClientLOSTimeout * %client.getSkillLevel());
|
||||
|
|
@ -348,6 +391,15 @@ function AIHuntersTask::monitor(%task, %client)
|
|||
%client.setEngageTarget(%task.engageTarget);
|
||||
}
|
||||
|
||||
//see if we've should go for health...
|
||||
else if (isObject(%task.getHealth))
|
||||
{
|
||||
%client.stepMove(%task.getHealth.getWorldBoxCenter(), 1);
|
||||
|
||||
if (AIClientIsAlive(%task.engageTarget))
|
||||
%client.setEngageTarget(%task.engageTarget);
|
||||
}
|
||||
|
||||
//else see if there's just someone to engage
|
||||
else if (AIClientIsAlive(%task.engageTarget))
|
||||
%client.stepEngage(%task.engageTarget);
|
||||
|
|
@ -361,6 +413,31 @@ function AIHuntersTask::monitor(%task, %client)
|
|||
// AIHunters utility functions
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
//this function checks to make sure a bot isn't in a mosh pit of enemies
|
||||
//notice it cheats by not using LOS... )
|
||||
function AICheckEnemyDanger(%client, %radius)
|
||||
{
|
||||
%numEnemies = 0;
|
||||
for (%i = 0; %i < ClientGroup.getCount(); %i++)
|
||||
{
|
||||
%cl = ClientGroup.getObject(%i);
|
||||
if (AIClientIsAlive(%cl) && %cl.team != %client.team)
|
||||
{
|
||||
%dist = %client.getPathDistance(%cl.player.position);
|
||||
if (%dist < %radius)
|
||||
{
|
||||
%winner = AIEngageWhoWillWin(%cl, %client);
|
||||
if (%winner == %cl)
|
||||
%numEnemies += 3;
|
||||
else if (%winner != %client)
|
||||
%numEnemies++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return %numEnemies;
|
||||
}
|
||||
|
||||
function AIFindClosestFlag(%client, %radius)
|
||||
{
|
||||
%closestFlag = -1;
|
||||
|
|
@ -436,7 +513,6 @@ function aih()
|
|||
|
||||
function aiHlist()
|
||||
{
|
||||
$timescale = 0.01;
|
||||
%count = ClientGroup.getCount();
|
||||
for (%i = 0; %i < %count; %i++)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ function AIBuyInventory(%client, %requiredEquipment, %equipmentSets, %buyInvTime
|
|||
%client.invBuyList = %inventorySet; //the list/set of items we're going to buy...
|
||||
%client.buyingSet = %buyingSet; //whether it's a list or a set...
|
||||
%client.isSeekingInv = false;
|
||||
%client.seekingInv = "";
|
||||
|
||||
//now process the state machine
|
||||
return AIProcessBuyInventory(%client);
|
||||
|
|
|
|||
|
|
@ -318,7 +318,7 @@ function onConnectionToServerLost( %msg )
|
|||
}
|
||||
|
||||
// Client voting functions:
|
||||
function startNewVote(%name, %actionMsg, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
function startNewVote(%name, %arg1, %arg2, %arg3, %arg4, %playerVote)
|
||||
{
|
||||
if ( %arg1 $= "" )
|
||||
%arg1 = 0;
|
||||
|
|
@ -331,7 +331,7 @@ function startNewVote(%name, %actionMsg, %arg1, %arg2, %arg3, %arg4, %playerVote
|
|||
if ( %playerVote $= "" )
|
||||
%playerVote = 0;
|
||||
|
||||
commandToServer('startNewVote', %name, %actionMsg, %arg1, %arg2, %arg3, %arg4, %playerVote);
|
||||
commandToServer('startNewVote', %name, %arg1, %arg2, %arg3, %arg4, %playerVote);
|
||||
}
|
||||
|
||||
function setPlayerVote(%vote)
|
||||
|
|
|
|||
|
|
@ -378,7 +378,7 @@ function throwGrenade( %val )
|
|||
commandToServer( 'startThrowCount' );
|
||||
else
|
||||
commandToServer( 'endThrowCount' );
|
||||
$mvTriggerCount4++;
|
||||
$mvTriggerCount4 += $mvTriggerCount4 & 1 == %val ? 2 : 1;
|
||||
}
|
||||
|
||||
function placeMine( %val )
|
||||
|
|
@ -387,7 +387,7 @@ function placeMine( %val )
|
|||
commandToServer( 'startThrowCount' );
|
||||
else
|
||||
commandToServer( 'endThrowCount' );
|
||||
$mvTriggerCount5++;
|
||||
$mvTriggerCount5 += $mvTriggerCount5 & 1 == %val ? 2 : 1;
|
||||
}
|
||||
|
||||
function placeBeacon( %val )
|
||||
|
|
@ -842,7 +842,8 @@ function togglePlayerArmor(%val)
|
|||
|
||||
function jump(%val)
|
||||
{
|
||||
$mvTriggerCount2++;
|
||||
//$mvTriggerCount2++;
|
||||
$mvTriggerCount2 += $mvTriggerCount2 & 1 == %val ? 2 : 1;
|
||||
}
|
||||
|
||||
// moveMap.bind(keyboard, "alt c", playCel);
|
||||
|
|
@ -863,17 +864,17 @@ function jump(%val)
|
|||
|
||||
function mouseFire(%val)
|
||||
{
|
||||
$mvTriggerCount0++;
|
||||
$mvTriggerCount0 += $mvTriggerCount0 & 1 == %val ? 2 : 1;
|
||||
}
|
||||
|
||||
function mouseJet(%val)
|
||||
{
|
||||
$mvTriggerCount3++; // Fire
|
||||
$mvTriggerCount3 += $mvTriggerCount3 & 1 == %val ? 2 : 1;
|
||||
}
|
||||
|
||||
function altTrigger(%val)
|
||||
{
|
||||
$mvTriggerCount1++; // Alt Trigger
|
||||
$mvTriggerCount1 += $mvTriggerCount1 & 1 == %val ? 2 : 1;
|
||||
}
|
||||
|
||||
function testLOSTarget()
|
||||
|
|
|
|||
|
|
@ -2338,7 +2338,11 @@ function DefaultGame::onAIKilledClient(%game, %clVictim, %clAttacker, %damageTyp
|
|||
//------------------------------------------------------------------------------
|
||||
function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %key )
|
||||
{
|
||||
if( !%targetClient.matchStartReady )
|
||||
return;
|
||||
|
||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||
|
||||
%isTargetSelf = ( %client == %targetClient );
|
||||
%isTargetAdmin = ( %targetClient.isAdmin || %targetClient.isSuperAdmin );
|
||||
%isTargetBot = %targetClient.isAIControlled();
|
||||
|
|
@ -2349,10 +2353,7 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
|
|||
else if ( %client.isAdmin )
|
||||
%outrankTarget = !%targetClient.isAdmin;
|
||||
|
||||
if( ! %targetClient.matchStartReady )
|
||||
return;
|
||||
|
||||
if( %client.isSuperAdmin )
|
||||
if( %client.isSuperAdmin && %targetClient.guid != 0 )
|
||||
{
|
||||
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "addAdmin", "", 'Add to Server Admin List', 10);
|
||||
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "addSuperAdmin", "", 'Add to Server SuperAdmin List', 11);
|
||||
|
|
@ -2366,7 +2367,6 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
|
|||
else
|
||||
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "MutePlayer", "", 'Mute', 1);
|
||||
|
||||
//if ( !%isTargetBot )
|
||||
if ( !%isTargetBot && %client.canListenTo( %targetClient ) )
|
||||
{
|
||||
if ( %client.getListenState( %targetClient ) )
|
||||
|
|
@ -2375,6 +2375,9 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
|
|||
messageClient( %client, 'MsgPlayerPopupItem', "", %key, "ListenPlayer", "", 'Enable Voice Com', 9 );
|
||||
}
|
||||
}
|
||||
|
||||
if( !%client.canVote && !%isAdmin )
|
||||
return;
|
||||
|
||||
// regular vote options on players
|
||||
if ( %game.scheduleVote $= "" && !%isAdmin && !%isTargetAdmin )
|
||||
|
|
@ -2442,6 +2445,7 @@ function DefaultGame::sendGamePlayerPopupMenu( %game, %client, %targetClient, %k
|
|||
//------------------------------------------------------------------------------
|
||||
function DefaultGame::sendGameVoteMenu( %game, %client, %key )
|
||||
{
|
||||
%isAdmin = ( %client.isAdmin || %client.isSuperAdmin );
|
||||
%multipleTeams = %game.numTeams > 1;
|
||||
|
||||
// no one is going anywhere until this thing starts
|
||||
|
|
@ -2465,6 +2469,9 @@ function DefaultGame::sendGameVoteMenu( %game, %client, %key )
|
|||
// if( $HostGameBotCount > 0 && %totalSlots > 0 && %client.isAdmin)
|
||||
//messageClient( %client, 'MsgVoteItem', "", %key, 'Addbot', "", 'Add a Bot' );
|
||||
}
|
||||
|
||||
if( !%client.canVote && !%isAdmin )
|
||||
return;
|
||||
|
||||
if ( %game.scheduleVote $= "" )
|
||||
{
|
||||
|
|
@ -2604,16 +2611,16 @@ function DefaultGame::voteTeamDamage(%game, %admin)
|
|||
%cause = "";
|
||||
if(%admin)
|
||||
{
|
||||
if($teamDamage)
|
||||
if($teamDamage)
|
||||
{
|
||||
messageAll('MsgAdminForce', '\c2The Admin has disabled team damage.');
|
||||
$teamDamage = 0;
|
||||
messageAll('MsgAdminForce', '\c2The Admin has disabled team damage.');
|
||||
$Host::TeamDamageOn = $TeamDamage = 0;
|
||||
%setto = "disabled";
|
||||
}
|
||||
else
|
||||
{
|
||||
messageAll('MsgAdminForce', '\c2The Admin has enabled team damage.');
|
||||
$teamDamage = 1;
|
||||
$Host::TeamDamageOn = $TeamDamage = 1;
|
||||
%setto = "enabled";
|
||||
}
|
||||
%cause = "(admin)";
|
||||
|
|
@ -2626,13 +2633,13 @@ function DefaultGame::voteTeamDamage(%game, %admin)
|
|||
if($teamDamage)
|
||||
{
|
||||
messageAll('MsgVotePassed', '\c2Team damage was disabled by vote.');
|
||||
$teamDamage = 0;
|
||||
$Host::TeamDamageOn = $TeamDamage = 0;
|
||||
%setto = "disabled";
|
||||
}
|
||||
else
|
||||
{
|
||||
messageAll('MsgVotePassed', '\c2Team damage was enabled by vote.');
|
||||
$teamDamage = 1;
|
||||
$Host::TeamDamageOn = $TeamDamage = 1;
|
||||
%setto = "enabled";
|
||||
}
|
||||
%cause = "(vote)";
|
||||
|
|
@ -2698,12 +2705,12 @@ function DefaultGame::voteMatchStart( %game, %admin)
|
|||
{
|
||||
if(!%ready)
|
||||
{
|
||||
messageClient( %client, 'msgClient', "\c2No players are ready yet.");
|
||||
messageClient( %client, 'msgClient', '\c2No players are ready yet.');
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
messageAll('msgMissionStart', 'The admin has forced the match to start.');
|
||||
messageAll('msgMissionStart', '\c2The admin has forced the match to start.');
|
||||
%cause = "(admin)";
|
||||
startTourneyCountdown();
|
||||
}
|
||||
|
|
@ -2712,7 +2719,7 @@ function DefaultGame::voteMatchStart( %game, %admin)
|
|||
{
|
||||
if(!%ready)
|
||||
{
|
||||
messageAll( 'msgClient', "\c2Vote passed to start Match, but no players are ready yet.");
|
||||
messageAll( 'msgClient', '\c2Vote passed to start match, but no players are ready yet.');
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
|
@ -2740,7 +2747,7 @@ function DefaultGame::voteFFAMode( %game, %admin, %client )
|
|||
|
||||
if (%admin)
|
||||
{
|
||||
messageAll('MsgAdminForce', "\c2The Admin has switched the server to Free For All mode.", %client);
|
||||
messageAll('MsgAdminForce', '\c2The Admin has switched the server to Free For All mode.', %client);
|
||||
setModeFFA($CurrentMission, $CurrentMissionType);
|
||||
%cause = "(admin)";
|
||||
}
|
||||
|
|
@ -2749,7 +2756,7 @@ function DefaultGame::voteFFAMode( %game, %admin, %client )
|
|||
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
|
||||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
messageAll('MsgVotePassed', "\c2Server switched to Free For All mode by vote.", %client);
|
||||
messageAll('MsgVotePassed', '\c2Server switched to Free For All mode by vote.', %client);
|
||||
setModeFFA($CurrentMission, $CurrentMissionType);
|
||||
%cause = "(vote)";
|
||||
}
|
||||
|
|
@ -2834,49 +2841,43 @@ function DefaultGame::voteKickPlayer(%game, %admin, %client)
|
|||
{
|
||||
%cause = "";
|
||||
%name = %client.nameBase;
|
||||
|
||||
if(%admin)
|
||||
{
|
||||
kick(%client, %admin);
|
||||
kick(%client, %admin, %client.guid );
|
||||
%cause = "(admin)";
|
||||
}
|
||||
else
|
||||
{
|
||||
%team = %client.team;
|
||||
%totalVotes = %game.votesFor[%team] + %game.votesAgainst[%team];
|
||||
if(%totalVotes > 0 && (%game.votesFor[%team] / %totalVotes) > ($Host::VotePasspercent / 100))
|
||||
//%team = %client.team;
|
||||
%totalVotes = %game.votesFor[%game.kickTeam] + %game.votesAgainst[%game.kickTeam];
|
||||
if(%totalVotes > 0 && (%game.votesFor[%game.kickTeam] / %totalVotes) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
kick(%client, %admin);
|
||||
kick(%client, %admin, Game.kickGuid);
|
||||
%cause = "(vote)";
|
||||
}
|
||||
else
|
||||
messageAll('MsgVoteFailed', '\c2Kick player vote did not pass');
|
||||
}
|
||||
|
||||
%game.kickTeam = "";
|
||||
%game.kickGuid = "";
|
||||
|
||||
if(%cause !$= "")
|
||||
logEcho(%name@" (cl "@%client@") kicked "@%cause);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function DefaultGame::voteBanPlayer(%game, %admin, %client)
|
||||
function DefaultGame::banPlayer(%game, %admin, %client)
|
||||
{
|
||||
%cause = "";
|
||||
%name = %client.nameBase;
|
||||
if(%admin)
|
||||
if( %admin )
|
||||
{
|
||||
ban(%client, %admin);
|
||||
ban( %client, %admin );
|
||||
%cause = "(admin)";
|
||||
}
|
||||
else
|
||||
{
|
||||
%team = %client.team;
|
||||
%totalVotes = %game.votesFor[%team] + %game.votesAgainst[%team];
|
||||
if((%totalVotes > 0) && (%game.votesFor[%team] / %totalVotes) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
ban(%client, %admin);
|
||||
%cause = "(vote)";
|
||||
}
|
||||
else
|
||||
messageAll('MsgVoteFailed', '\c2Ban player vote did not pass.');
|
||||
}
|
||||
|
||||
if(%cause !$= "")
|
||||
logEcho(%name@" (cl "@%client@") banned "@%cause);
|
||||
}
|
||||
|
|
@ -2885,11 +2886,10 @@ function DefaultGame::voteBanPlayer(%game, %admin, %client)
|
|||
function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
||||
{
|
||||
%cause = "";
|
||||
%name = getTaggedString(%client.name);
|
||||
|
||||
if (%admin)
|
||||
{
|
||||
messageAll('MsgAdminAdminPlayer', "\c2The Admin made " @ %name @ " an admin.", %client);
|
||||
messageAll('MsgAdminAdminPlayer', '\c2The Admin made %2 an admin.', %client, %client.name);
|
||||
%client.isAdmin = 1;
|
||||
%cause = "(admin)";
|
||||
}
|
||||
|
|
@ -2898,12 +2898,12 @@ function DefaultGame::voteAdminPlayer(%game, %admin, %client)
|
|||
%totalVotes = %game.totalVotesFor + %game.totalVotesAgainst;
|
||||
if(%totalVotes > 0 && (%game.totalVotesFor / (ClientGroup.getCount() - $HostGameBotCount)) > ($Host::VotePasspercent / 100))
|
||||
{
|
||||
messageAll('MsgAdminPlayer', "\c2" @ %name @ " was made an admin by vote.");
|
||||
messageAll('MsgAdminPlayer', '\c2%2 was made an admin by vote.', %client, %client.name);
|
||||
%client.isAdmin = 1;
|
||||
%cause = "(vote)";
|
||||
}
|
||||
else
|
||||
messageAll('MsgVoteFailed', '\c2Admin vote did not pass.');
|
||||
messageAll('MsgVoteFailed', '\c2Vote to make %1 an admin did not pass.', %client.name);
|
||||
}
|
||||
if(%cause !$= "")
|
||||
logEcho(%client.nameBase@" (cl "@%client@") made admin "@%cause);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
// Note: cameras are treated as grenades, not "regular" deployables
|
||||
|
||||
$TurretIndoorSpaceRadius = 20; // deployed turrets must be this many meters apart
|
||||
$InventorySpaceRadius = 20; // deployed inventory must be this many meters apart
|
||||
$TurretIndoorSphereRadius = 50; // radius for turret frequency check
|
||||
$TurretIndoorMaxPerSphere = 4; // # of turrets allowed in above radius
|
||||
|
||||
|
|
@ -32,6 +33,7 @@ $NotDeployableReason::NoInteriorFound = 7;
|
|||
$NotDeployableReason::TurretTooClose = 8;
|
||||
$NotDeployableReason::TurretSaturation = 9;
|
||||
$NotDeployableReason::SurfaceTooNarrow = 10;
|
||||
$NotDeployableReason::InventoryTooClose = 11;
|
||||
|
||||
$MinDeployableDistance = 0.5;
|
||||
$MaxDeployableDistance = 4.0; //meters from body
|
||||
|
|
@ -269,7 +271,7 @@ datablock SensorData(DeployPulseSensorObj)
|
|||
detectsPassiveJammed = false;
|
||||
detectsCloaked = false;
|
||||
detectionPings = true;
|
||||
detectRadius = 120;
|
||||
detectRadius = 150;
|
||||
};
|
||||
|
||||
datablock StaticShapeData(DeployedPulseSensor) : StaticShapeDamageProfile
|
||||
|
|
@ -583,11 +585,16 @@ function ShapeBaseImageData::testHavePurchase(%item, %xform)
|
|||
//don't check this for non-Clasping turret deployables
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
function TurretIndoorDeployableImage::testTurretTooClose(%item, %plyr)
|
||||
function ShapeBaseImageData::testInventoryTooClose(%item, %plyr)
|
||||
{
|
||||
InitContainerRadiusSearch(%item.surfacePt, $TurretIndoorSpaceRadius, $TypeMasks::StaticShapeObjectType);
|
||||
return false;
|
||||
}
|
||||
|
||||
function InventoryDeployableImage::testInventoryTooClose(%item, %plyr)
|
||||
{
|
||||
InitContainerRadiusSearch(%item.surfacePt, $InventorySpaceRadius, $TypeMasks::StaticShapeObjectType);
|
||||
|
||||
// old function was only checking whether the first object found was a turret -- also wasn't checking
|
||||
// which team the object was on
|
||||
|
|
@ -595,7 +602,7 @@ function TurretIndoorDeployableImage::testTurretTooClose(%item, %plyr)
|
|||
while((%found = containerSearchNext()) != 0)
|
||||
{
|
||||
%foundName = %found.getDataBlock().getName();
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor))
|
||||
if( (%foundName $= DeployedStationInventory) )
|
||||
if (%found.team == %plyr.team)
|
||||
{
|
||||
%turretInRange = true;
|
||||
|
|
@ -615,7 +622,27 @@ function TurretOutdoorDeployableImage::testTurretTooClose(%item, %plyr)
|
|||
while((%found = containerSearchNext()) != 0)
|
||||
{
|
||||
%foundName = %found.getDataBlock().getName();
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor))
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) || (%foundName $= DeployedStationInventory))
|
||||
if (%found.team == %plyr.team)
|
||||
{
|
||||
%turretInRange = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return %turretInRange;
|
||||
}
|
||||
|
||||
function TurretOutdoorDeployableImage::testTurretTooClose(%item, %plyr)
|
||||
{
|
||||
InitContainerRadiusSearch(%item.surfacePt, $TurretOutdoorSpaceRadius, $TypeMasks::StaticShapeObjectType);
|
||||
|
||||
// old function was only checking whether the first object found was a turret -- also wasn't checking
|
||||
// which team the object was on
|
||||
%turretInRange = false;
|
||||
while((%found = containerSearchNext()) != 0)
|
||||
{
|
||||
%foundName = %found.getDataBlock().getName();
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) || (%foundName $= DeployedStationInventory))
|
||||
if (%found.team == %plyr.team)
|
||||
{
|
||||
%turretInRange = true;
|
||||
|
|
@ -639,7 +666,7 @@ function TurretIndoorDeployableImage::testTurretSaturation(%item)
|
|||
while(%found)
|
||||
{
|
||||
%foundName = %found.getDataBlock().getName();
|
||||
if ((%foundName $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor))
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) || (%foundName $= DeployedStationInventory))
|
||||
{
|
||||
//found one
|
||||
%numTurretsNearby++;
|
||||
|
|
@ -664,7 +691,7 @@ function TurretOutdoorDeployableImage::testTurretSaturation(%item)
|
|||
while(%found)
|
||||
{
|
||||
%foundName = %found.getDataBlock().getName();
|
||||
if ((%foundName $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor))
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) || (%foundName $= DeployedStationInventory))
|
||||
{
|
||||
//found one
|
||||
%numTurretsNearby++;
|
||||
|
|
@ -697,7 +724,7 @@ function testNearbyDensity(%item, %radius)
|
|||
while(%found)
|
||||
{
|
||||
%foundName = %found.getDataBlock().getName();
|
||||
if ((%foundName $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor))
|
||||
if((%foundname $= TurretDeployedFloorIndoor) || (%foundName $= TurretDeployedWallIndoor) || (%foundName $= TurretDeployedCeilingIndoor) || (%foundName $= TurretDeployedOutdoor) || (%foundName $= DeployedStationInventory))
|
||||
%turretCount++;
|
||||
%found = containerSearchNext();
|
||||
}
|
||||
|
|
@ -762,9 +789,15 @@ function ShapeBaseImageData::testInvalidDeployConditions(%item, %plyr, %slot)
|
|||
else if (%item.testSelfTooClose(%plyr, %surfacePt))
|
||||
%disqualified = $NotDeployableReason::SelfTooClose;
|
||||
else if (%item.testObjectTooClose(%surfacePt))
|
||||
{
|
||||
%disqualified = $NotDeployableReason::ObjectTooClose;
|
||||
}
|
||||
else if (%item.testTurretTooClose(%plyr))
|
||||
%disqualified = $NotDeployableReason::TurretTooClose;
|
||||
else if (%item.testInventoryTooClose(%plyr))
|
||||
{
|
||||
%disqualified = $NotDeployableReason::InventoryTooClose;
|
||||
}
|
||||
else if (%item.testTurretSaturation())
|
||||
%disqualified = $NotDeployableReason::TurretSaturation;
|
||||
else if (%disqualified == $NotDeployableReason::None)
|
||||
|
|
@ -787,7 +820,7 @@ function ShapeBaseImageData::testInvalidDeployConditions(%item, %plyr, %slot)
|
|||
%disqualified = $NotDeployableReason::SurfaceTooNarrow;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (%plyr.getMountedImage($BackpackSlot) == %item) //player still have the item?
|
||||
{
|
||||
if (%disqualified)
|
||||
|
|
@ -879,6 +912,9 @@ function Deployables::displayErrorMsg(%item, %plyr, %slot, %error)
|
|||
case $NotDeployableReason::SurfaceTooNarrow:
|
||||
%msg = '\c2There is not adequate surface to clamp to here.%1';
|
||||
|
||||
case $NotDeployableReason::InventoryTooClose:
|
||||
%msg = '\c2Interference from a nearby inventory prevents placement here.%1';
|
||||
|
||||
default:
|
||||
%msg = '\c2Deploy failed.';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -304,7 +304,10 @@ function ShapeBase::setInventory(%this,%data,%value,%force)
|
|||
|
||||
function ShapeBase::getInventory(%this,%data)
|
||||
{
|
||||
return %this.inv[%data.getName()];
|
||||
if ( isObject( %data ) )
|
||||
return( %this.inv[%data.getName()] );
|
||||
else
|
||||
return( 0 );
|
||||
}
|
||||
|
||||
function ShapeBase::hasAmmo( %this, %weapon )
|
||||
|
|
|
|||
|
|
@ -946,7 +946,8 @@ datablock SplashData(PlayerSplash)
|
|||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
// Jet data
|
||||
//----------------------------------------------------------------------------
|
||||
datablock ParticleData(HumanArmorJetParticle)
|
||||
{
|
||||
dragCoefficient = 0.0;
|
||||
|
|
@ -977,6 +978,62 @@ datablock ParticleEmitterData(HumanArmorJetEmitter)
|
|||
particles = "HumanArmorJetParticle";
|
||||
};
|
||||
|
||||
datablock JetEffectData(HumanArmorJetEffect)
|
||||
{
|
||||
texture = "special/jetExhaust02";
|
||||
coolColor = "0.0 0.0 1.0 1.0";
|
||||
hotColor = "0.2 0.4 0.7 1.0";
|
||||
activateTime = 0.2;
|
||||
deactivateTime = 0.05;
|
||||
length = 0.75;
|
||||
width = 0.2;
|
||||
speed = -15;
|
||||
stretch = 2.0;
|
||||
yOffset = 0.2;
|
||||
};
|
||||
|
||||
datablock JetEffectData(HumanMediumArmorJetEffect)
|
||||
{
|
||||
texture = "special/jetExhaust02";
|
||||
coolColor = "0.0 0.0 1.0 1.0";
|
||||
hotColor = "0.2 0.4 0.7 1.0";
|
||||
activateTime = 0.2;
|
||||
deactivateTime = 0.05;
|
||||
length = 0.75;
|
||||
width = 0.2;
|
||||
speed = -15;
|
||||
stretch = 2.0;
|
||||
yOffset = 0.4;
|
||||
};
|
||||
|
||||
datablock JetEffectData(HumanLightFemaleArmorJetEffect)
|
||||
{
|
||||
texture = "special/jetExhaust02";
|
||||
coolColor = "0.0 0.0 1.0 1.0";
|
||||
hotColor = "0.2 0.4 0.7 1.0";
|
||||
activateTime = 0.2;
|
||||
deactivateTime = 0.05;
|
||||
length = 0.75;
|
||||
width = 0.2;
|
||||
speed = -15;
|
||||
stretch = 2.0;
|
||||
yOffset = 0.2;
|
||||
};
|
||||
|
||||
datablock JetEffectData(BiodermArmorJetEffect)
|
||||
{
|
||||
texture = "special/jetExhaust02";
|
||||
coolColor = "0.0 0.0 1.0 1.0";
|
||||
hotColor = "0.8 0.6 0.2 1.0";
|
||||
activateTime = 0.2;
|
||||
deactivateTime = 0.05;
|
||||
length = 0.75;
|
||||
width = 0.2;
|
||||
speed = -15;
|
||||
stretch = 2.0;
|
||||
yOffset = 0.0;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// Foot puffs
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
@ -1194,7 +1251,8 @@ datablock PlayerData(LightMaleHumanArmor) : LightPlayerDamageProfile
|
|||
jetSound = ArmorJetSound;
|
||||
wetJetSound = ArmorJetSound;
|
||||
jetEmitter = HumanArmorJetEmitter;
|
||||
|
||||
jetEffect = HumanArmorJetEffect;
|
||||
|
||||
boundingBox = "1.2 1.2 2.3";
|
||||
pickupRadius = 0.75;
|
||||
|
||||
|
|
@ -1468,6 +1526,7 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
|||
wetJetSound = ArmorWetJetSound;
|
||||
|
||||
jetEmitter = HumanArmorJetEmitter;
|
||||
jetEffect = HumanMediumArmorJetEffect;
|
||||
|
||||
boundingBox = "1.45 1.45 2.4";
|
||||
pickupRadius = 0.75;
|
||||
|
|
@ -1561,7 +1620,7 @@ datablock PlayerData(MediumMaleHumanArmor) : MediumPlayerDamageProfile
|
|||
max[DiscAmmo] = 15;
|
||||
max[SniperRifle] = 0;
|
||||
max[GrenadeLauncher] = 1;
|
||||
max[GrenadeLauncherAmmo]= 10;
|
||||
max[GrenadeLauncherAmmo]= 12;
|
||||
max[Mortar] = 0;
|
||||
max[MortarAmmo] = 0;
|
||||
max[MissileLauncher] = 1;
|
||||
|
|
@ -1863,6 +1922,7 @@ datablock PlayerData(LightFemaleHumanArmor) : LightMaleHumanArmor
|
|||
{
|
||||
shapeFile = "light_female.dts";
|
||||
waterBreathSound = WaterBreathFemaleSound;
|
||||
jetEffect = HumanMediumArmorJetEffect;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
@ -1870,6 +1930,7 @@ datablock PlayerData(MediumFemaleHumanArmor) : MediumMaleHumanArmor
|
|||
{
|
||||
shapeFile = "medium_female.dts";
|
||||
waterBreathSound = WaterBreathFemaleSound;
|
||||
jetEffect = HumanArmorJetEffect;
|
||||
};
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
@ -1891,9 +1952,11 @@ datablock PlayerData(LightMaleBiodermArmor) : LightMaleHumanArmor
|
|||
{
|
||||
shapeFile = "bioderm_light.dts";
|
||||
jetEmitter = BiodermArmorJetEmitter;
|
||||
jetEffect = BiodermArmorJetEffect;
|
||||
|
||||
|
||||
debrisShapeName = "bio_player_debris.dts";
|
||||
|
||||
|
||||
//Foot Prints
|
||||
decalData = LightBiodermFootprint;
|
||||
decalOffset = 0.3;
|
||||
|
|
@ -1913,6 +1976,7 @@ datablock PlayerData(MediumMaleBiodermArmor) : MediumMaleHumanArmor
|
|||
{
|
||||
shapeFile = "bioderm_medium.dts";
|
||||
jetEmitter = BiodermArmorJetEmitter;
|
||||
jetEffect = BiodermArmorJetEffect;
|
||||
|
||||
debrisShapeName = "bio_player_debris.dts";
|
||||
|
||||
|
|
@ -2423,7 +2487,7 @@ function Armor::doDismount(%this, %obj, %forced)
|
|||
// Position above dismount point
|
||||
%obj.setTransform(%pos);
|
||||
%obj.playAudio(0, UnmountVehicleSound);
|
||||
%obj.applyImpulse(%pos, VectorScale(%impulseVec, %obj.getDataBlock().mass));
|
||||
%obj.applyImpulse(%pos, VectorScale(%impulseVec, %obj.getDataBlock().mass * 3));
|
||||
%obj.setPilot(false);
|
||||
%obj.vehicleTurret = "";
|
||||
}
|
||||
|
|
@ -2440,6 +2504,7 @@ function Player::scriptKill(%player, %damageType)
|
|||
|
||||
function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %amount, %damageType, %momVec)
|
||||
{
|
||||
//error("Armor::damageObject( "@%data@", "@%targetObject@", "@%sourceObject@", "@%position@", "@%amount@", "@%damageType@", "@%momVec@" )");
|
||||
if(%targetObject.invincible || %targetObject.getState() $= "Dead")
|
||||
return;
|
||||
|
||||
|
|
@ -2476,12 +2541,16 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
|||
|
||||
//if the source object is a player object, player's don't have sensor groups
|
||||
// if it's a turret, get the sensor group of the target
|
||||
// if its a vehicle (of any type) use the sensor group
|
||||
if (%sourceClient)
|
||||
%sourceTeam = %sourceClient.getSensorGroup();
|
||||
else if(%damageType == $DamageType::Suicide)
|
||||
%sourceTeam = 0;
|
||||
else if(isObject(%sourceObject) && %sourceObject.getClassName() $= "Turret")
|
||||
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
|
||||
else if( isObject(%sourceObject) &&
|
||||
( %sourceObject.getClassName() $= "FlyingVehicle" || %sourceObject.getClassName() $= "WheeledVehicle" ) || %sourceObject.getClassName() $= "HoverVehicle")
|
||||
%sourceTeam = getTargetSensorGroup(%sourceObject.getTarget());
|
||||
else
|
||||
{
|
||||
if (%sourceObject && %sourceObject.getTarget() >= 0 )
|
||||
|
|
@ -2534,7 +2603,8 @@ function Armor::damageObject(%data, %targetObject, %sourceObject, %position, %am
|
|||
%damageType == $DamageType::Mortar ||
|
||||
%damageType == $DamageType::MortarTurret ||
|
||||
%damageType == $DamageType::BomberBombs ||
|
||||
%damageType == $DamageType::SatchelCharge )
|
||||
%damageType == $DamageType::SatchelCharge ||
|
||||
%damageType == $DamageType::Missile )
|
||||
{
|
||||
if( %previousDamage >= 0.35 ) // only if <= 35 percent damage remaining
|
||||
{
|
||||
|
|
|
|||
|
|
@ -387,23 +387,32 @@ $ELFFireSound = 3;
|
|||
|
||||
function ELFProjectileData::zapTarget(%data, %projectile, %target, %targeter)
|
||||
{
|
||||
%oldERate = %target.getRechargeRate();
|
||||
%target.setRechargeRate(%oldERate - %data.drainEnergy);
|
||||
%projectile.checkELFStatus(%data, %target, %targeter);
|
||||
%oldERate = %target.getRechargeRate();
|
||||
%target.teamDamageStateOnZap = $teamDamage;
|
||||
|
||||
if(!%target.teamDamageStateOnZap && %target.team == %targeter.team)
|
||||
%target.setRechargeRate(%oldERate);
|
||||
else
|
||||
%target.setRechargeRate(%oldERate - %data.drainEnergy);
|
||||
%projectile.checkELFStatus(%data, %target, %targeter);
|
||||
}
|
||||
|
||||
function ELFProjectileData::unzapTarget(%data, %projectile, %target, %targeter)
|
||||
{
|
||||
cancel(%projectile.ELFrecur);
|
||||
cancel(%projectile.ELFrecur);
|
||||
%target.stopAudio($ELFZapSound);
|
||||
%targeter.stopAudio($ELFFireSound);
|
||||
%targeter.stopAudio($ELFFireSound);
|
||||
%target.zapSound = false;
|
||||
%targeter.zappingSound = false;
|
||||
if(!%target.isDisabled())
|
||||
{
|
||||
%oldERate = %target.getRechargeRate();
|
||||
%target.setRechargeRate(%oldERate + %data.drainEnergy);
|
||||
}
|
||||
|
||||
if(!%target.isDisabled())
|
||||
{
|
||||
%oldERate = %target.getRechargeRate();
|
||||
if(!%target.teamDamageStateOnZap && %target.team == %targeter.team)
|
||||
%target.setRechargeRate(%oldERate);
|
||||
else
|
||||
%target.setRechargeRate(%oldERate + %data.drainEnergy);
|
||||
}
|
||||
}
|
||||
|
||||
function ELFProjectileData::targetDestroyedCancel(%data, %projectile, %target, %targeter)
|
||||
|
|
@ -549,7 +558,14 @@ function RadiusExplosion(%explosionSource, %position, %radius, %damage, %impulse
|
|||
if(%amount > 0)
|
||||
%data.damageObject(%targetObject, %sourceObject, %position, %amount, %damageType, %momVec);
|
||||
else if( %explosionSource.getDataBlock().getName() $= "ConcussionGrenadeThrown" && %data.getClassName() $= "PlayerData" )
|
||||
%data.applyConcussion( %dist, %radius, %sourceObject, %targetObject );
|
||||
{
|
||||
%data.applyConcussion( %dist, %radius, %sourceObject, %targetObject );
|
||||
|
||||
if(!$teamDamage && %sourceObject != %targetObject && %sourceObject.client.team == %targetObject.client.team)
|
||||
{
|
||||
messageClient(%targetObject.client, 'msgTeamConcussionGrenade', '\c1You were hit by %1\'s concussion grenade.', getTaggedString(%sourceObject.client.name));
|
||||
}
|
||||
}
|
||||
|
||||
if( %doImpulse )
|
||||
%targetObject.applyImpulse(%position, %impulseVec);
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
if($Host::TimeLimit $= "")
|
||||
$Host::TimeLimit = 20;
|
||||
|
||||
$teamDamage = 1;
|
||||
$SB::WODec = 0.004; // whiteout
|
||||
$SB::DFDec = 0.02; // damageFlash
|
||||
|
||||
|
|
@ -35,7 +34,7 @@ function CreateServer(%mission, %missionType)
|
|||
exec("scripts/turret.cs");
|
||||
exec("scripts/weapTurretCode.cs");
|
||||
exec("scripts/pack.cs");
|
||||
exec("scripts/vehicles/vehicle_spec_fx.cs"); // Must exist before other vehicle files or CRASH BOOM
|
||||
exec("scripts/vehicles/vehicle_spec_fx.cs"); // Must exist before other vehicle files or CRASH BOOM
|
||||
exec("scripts/vehicles/serverVehicleHud.cs");
|
||||
exec("scripts/vehicles/vehicle_shrike.cs");
|
||||
exec("scripts/vehicles/vehicle_bomber.cs");
|
||||
|
|
@ -43,7 +42,7 @@ function CreateServer(%mission, %missionType)
|
|||
exec("scripts/vehicles/vehicle_wildcat.cs");
|
||||
exec("scripts/vehicles/vehicle_tank.cs");
|
||||
exec("scripts/vehicles/vehicle_mpb.cs");
|
||||
exec("scripts/vehicles/vehicle.cs"); // Must be added after all other vehicle files or EVIL BAD THINGS
|
||||
exec("scripts/vehicles/vehicle.cs"); // Must be added after all other vehicle files or EVIL BAD THINGS
|
||||
exec("scripts/ai.cs");
|
||||
exec("scripts/item.cs");
|
||||
exec("scripts/station.cs");
|
||||
|
|
@ -69,7 +68,7 @@ function CreateServer(%mission, %missionType)
|
|||
for(%file = findFirstFile(%search); %file !$= ""; %file = findNextFile(%search))
|
||||
{
|
||||
%type = fileBase(%file); // get the name of the script
|
||||
exec("scripts/" @ %type @ ".cs");
|
||||
exec("scripts/" @ %type @ ".cs");
|
||||
}
|
||||
|
||||
$missionSequence = 0;
|
||||
|
|
@ -88,8 +87,19 @@ function CreateServer(%mission, %missionType)
|
|||
schedule(0,0,startHeartbeat);
|
||||
|
||||
// setup the bots for this server
|
||||
if( $Host::BotsEnabled )
|
||||
initGameBots( %mission, %missionType );
|
||||
|
||||
// load the mission...
|
||||
loadMission(%mission, %missionType, true);
|
||||
}
|
||||
|
||||
function initGameBots( %mission, %mType )
|
||||
{
|
||||
echo( "adding bots..." );
|
||||
|
||||
AISystemEnabled( false );
|
||||
if ( $HostGameBotCount > 0 && %missionType !$= "SinglePlayer" )
|
||||
if ( $Host::BotCount > 0 && %mType !$= "SinglePlayer" )
|
||||
{
|
||||
// Make sure this mission is bot enabled:
|
||||
for ( %idx = 0; %idx < $HostMissionCount; %idx++ )
|
||||
|
|
@ -100,20 +110,23 @@ function CreateServer(%mission, %missionType)
|
|||
|
||||
if ( $BotEnabled[%idx] )
|
||||
{
|
||||
if ( $HostGameBotCount > 16 )
|
||||
if ( $Host::BotCount > 16 )
|
||||
$HostGameBotCount = 16;
|
||||
if ( $HostGameBotCount > $Host::MaxPlayers - 1 )
|
||||
else
|
||||
$HostGameBotCount = $Host::BotCount;
|
||||
|
||||
if ( $Host::BotCount > $Host::MaxPlayers - 1 )
|
||||
$HostGameBotCount = $Host::MaxPlayers - 1;
|
||||
|
||||
//set the objective reassessment timeslice var
|
||||
$AITimeSliceReassess = 0;
|
||||
//set the objective reassessment timeslice var
|
||||
$AITimeSliceReassess = 0;
|
||||
aiConnectMultiple( $HostGameBotCount, $Host::MinBotDifficulty, $Host::MaxBotDifficulty, -1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
$HostGameBotCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
loadMission(%mission, %missionType, true);
|
||||
}
|
||||
|
||||
function findNextCycleMission()
|
||||
|
|
@ -165,27 +178,25 @@ function DestroyServer()
|
|||
$missionRunning = false;
|
||||
allowConnections(false);
|
||||
stopHeartbeat();
|
||||
MissionGroup.delete();
|
||||
MissionCleanup.delete();
|
||||
if(isObject(game))
|
||||
{
|
||||
game.deactivatePackages();
|
||||
game.delete();
|
||||
}
|
||||
MissionGroup.delete();
|
||||
MissionCleanup.delete();
|
||||
if(isObject(game))
|
||||
{
|
||||
game.deactivatePackages();
|
||||
game.delete();
|
||||
}
|
||||
if(isObject($ServerGroup))
|
||||
$ServerGroup.delete();
|
||||
|
||||
// delete all the connections:
|
||||
while(ClientGroup.getCount())
|
||||
{
|
||||
%client = ClientGroup.getObject(0);
|
||||
if (%client.isAIControlled())
|
||||
%client.drop();
|
||||
else
|
||||
%client.delete();
|
||||
}
|
||||
|
||||
%HostGuidList = "";
|
||||
{
|
||||
%client = ClientGroup.getObject(0);
|
||||
if (%client.isAIControlled())
|
||||
%client.drop();
|
||||
else
|
||||
%client.delete();
|
||||
}
|
||||
|
||||
// delete all the data blocks...
|
||||
// this will cause problems if there are any connections
|
||||
|
|
@ -209,7 +220,7 @@ function Disconnect()
|
|||
|
||||
function DisconnectedCleanup()
|
||||
{
|
||||
// clear the chat hud message vector
|
||||
// clear the chat hud message vector
|
||||
HudMessageVector.clear();
|
||||
if ( isObject( PlayerListGroup ) )
|
||||
PlayerListGroup.delete();
|
||||
|
|
@ -225,9 +236,9 @@ function DisconnectedCleanup()
|
|||
clientCmdclearBottomPrint();
|
||||
clientCmdClearCenterPrint();
|
||||
|
||||
// clear the inventory and weapons hud
|
||||
weaponsHud.clearAll();
|
||||
inventoryHud.clearAll();
|
||||
// clear the inventory and weapons hud
|
||||
weaponsHud.clearAll();
|
||||
inventoryHud.clearAll();
|
||||
|
||||
// back to the launch screen
|
||||
Canvas.setContent(LaunchGui);
|
||||
|
|
@ -240,10 +251,11 @@ function DisconnectedCleanup()
|
|||
if ( !EmailGui.checkingEmail && EmailGui.checkSchedule $= "" )
|
||||
CheckEmail( true );
|
||||
|
||||
IRCClient::onLeaveGame();
|
||||
IRCClient::onLeaveGame();
|
||||
}
|
||||
|
||||
function kick(%client, %admin)
|
||||
// we pass the guid as well, in case this guy leaves the server.
|
||||
function kick( %client, %admin, %guid )
|
||||
{
|
||||
if(%admin)
|
||||
messageAll( 'MsgAdminForce', '\c2The Admin has kicked %1.', %client.name );
|
||||
|
|
@ -252,21 +264,30 @@ function kick(%client, %admin)
|
|||
|
||||
messageClient(%client, 'onClientKicked', "");
|
||||
messageAllExcept( %client, -1, 'MsgClientDrop', "", %client.name, %client );
|
||||
|
||||
if (%client.isAIControlled())
|
||||
|
||||
if( %client.isAIControlled() )
|
||||
{
|
||||
$HostGameBotCount--;
|
||||
%client.drop();
|
||||
}
|
||||
else
|
||||
{
|
||||
// kill and delete this client
|
||||
if( isObject(%client.player) )
|
||||
%client.player.scriptKill(0);
|
||||
|
||||
%client.schedule(700, "delete");
|
||||
|
||||
BanList::add( %client.guid, %client.getAddress(), $Host::KickBanTime );
|
||||
%count = ClientGroup.getCount();
|
||||
for( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%cl = ClientGroup.getObject( %i );
|
||||
if( %cl.guid == %guid )
|
||||
{
|
||||
// kill and delete this client
|
||||
if( isObject( %cl.player ) )
|
||||
%cl.player.scriptKill(0);
|
||||
|
||||
%cl.schedule(700, "delete");
|
||||
|
||||
BanList::add( %guid, "0", $Host::KickBanTime );
|
||||
Game.kickGuid = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -342,18 +363,18 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
}
|
||||
|
||||
// Sex/Race defaults
|
||||
switch$ ( %raceGender )
|
||||
{
|
||||
case "Human Male":
|
||||
%client.sex = "Male";
|
||||
%client.race = "Human";
|
||||
case "Human Female":
|
||||
%client.sex = "Female";
|
||||
%client.race = "Human";
|
||||
case "Bioderm":
|
||||
%client.sex = "Male";
|
||||
%client.race = "Bioderm";
|
||||
}
|
||||
switch$ ( %raceGender )
|
||||
{
|
||||
case "Human Male":
|
||||
%client.sex = "Male";
|
||||
%client.race = "Human";
|
||||
case "Human Female":
|
||||
%client.sex = "Female";
|
||||
%client.race = "Human";
|
||||
case "Bioderm":
|
||||
%client.sex = "Male";
|
||||
%client.race = "Bioderm";
|
||||
}
|
||||
%client.armor = "Light";
|
||||
|
||||
// Override the connect name if this server does not allow smurfs:
|
||||
|
|
@ -373,7 +394,6 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
else
|
||||
%name = "\cp\c7" @ %tag @ "\c6" @ %name @ "\co";
|
||||
|
||||
addToServerGuidList( %client.guid );
|
||||
%client.sendGuid = %client.guid;
|
||||
}
|
||||
else
|
||||
|
|
@ -426,16 +446,16 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
%name = %nameTry;
|
||||
}
|
||||
|
||||
%smurfName = %name;
|
||||
%smurfName = %name;
|
||||
// Tag the name with the "smurf" color:
|
||||
%name = "\cp\c8" @ %name @ "\co";
|
||||
}
|
||||
|
||||
%client.name = addTaggedString(%name);
|
||||
if(%client.isSmurf)
|
||||
%client.nameBase = %smurfName;
|
||||
else
|
||||
%client.nameBase = %realName;
|
||||
if(%client.isSmurf)
|
||||
%client.nameBase = %smurfName;
|
||||
else
|
||||
%client.nameBase = %realName;
|
||||
%client.justConnected = true;
|
||||
%client.isReady = false;
|
||||
|
||||
|
|
@ -449,8 +469,8 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
// full reset of client target manager
|
||||
clientResetTargets(%client, false);
|
||||
|
||||
%client.voice = %voice;
|
||||
%client.voiceTag = addtaggedString(%voice);
|
||||
%client.voice = %voice;
|
||||
%client.voiceTag = addtaggedString(%voice);
|
||||
|
||||
//set the voice pitch based on a lookup table from their chosen voice
|
||||
%client.voicePitch = getValidVoicePitch(%voice, %voicePitch);
|
||||
|
|
@ -468,18 +488,18 @@ function GameConnection::onConnect( %client, %name, %raceGender, %skin, %voice,
|
|||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%recipient = ClientGroup.getObject(%cl);
|
||||
if((%recipient != %client))
|
||||
if((%recipient != %client))
|
||||
{
|
||||
// These should be "silent" versions of these messages...
|
||||
messageClient(%client, 'MsgClientJoin', "",
|
||||
%recipient.name,
|
||||
%recipient,
|
||||
%recipient.target,
|
||||
%recipient.isAIControlled(),
|
||||
%recipient.isAdmin,
|
||||
%recipient.isSuperAdmin,
|
||||
%recipient.isSmurf,
|
||||
%recipient.sendGuid);
|
||||
messageClient(%client, 'MsgClientJoin', "",
|
||||
%recipient.name,
|
||||
%recipient,
|
||||
%recipient.target,
|
||||
%recipient.isAIControlled(),
|
||||
%recipient.isAdmin,
|
||||
%recipient.isSuperAdmin,
|
||||
%recipient.isSmurf,
|
||||
%recipient.sendGuid);
|
||||
|
||||
messageClient(%client, 'MsgClientJoinTeam', "", %recipient.name, $teamName[%recipient.team], %recipient, %recipient.team );
|
||||
}
|
||||
|
|
@ -535,8 +555,6 @@ function GameConnection::onDrop(%client, %reason)
|
|||
if(isObject(Game))
|
||||
Game.onClientLeaveGame(%client);
|
||||
|
||||
if ( !%client.isSmurf )
|
||||
removeFromServerGuidList( %client.guid );
|
||||
if ( $CurrentMissionType $= "SinglePlayer" )
|
||||
messageAllExcept(%client, -1, 'MsgClientDrop', "", %client.name, %client);
|
||||
else
|
||||
|
|
@ -551,27 +569,28 @@ function GameConnection::onDrop(%client, %reason)
|
|||
$HostGamePlayerCount--;
|
||||
|
||||
// reset the server if everyone has left the game
|
||||
if( $HostGamePlayerCount == 0 && $Host::Dedicated)
|
||||
if( $HostGamePlayerCount - $HostGameBotCount == 0 && $Host::Dedicated)
|
||||
schedule(0, 0, "resetServerDefaults");
|
||||
}
|
||||
|
||||
function dismountPlayers()
|
||||
{
|
||||
// make sure all palyers are dismounted from vehicles and have normal huds
|
||||
// make sure all palyers are dismounted from vehicles and have normal huds
|
||||
%count = ClientGroup.getCount();
|
||||
for(%cl = 0; %cl < %count; %cl++)
|
||||
{
|
||||
%client = ClientGroup.getObject(%cl);
|
||||
%player = %client.player;
|
||||
if(%player.isMounted()) {
|
||||
%player.unmount();
|
||||
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
|
||||
}
|
||||
%player = %client.player;
|
||||
if(%player.isMounted()) {
|
||||
%player.unmount();
|
||||
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function loadMission( %missionName, %missionType, %firstMission )
|
||||
{
|
||||
cls();
|
||||
buildLoadInfo( %missionName, %missionType );
|
||||
|
||||
// reset all of these
|
||||
|
|
@ -624,7 +643,7 @@ function loadMissionStage1(%missionName, %missionType, %firstMission)
|
|||
|
||||
$CurrentMission = %missionName;
|
||||
$CurrentMissionType = %missionType;
|
||||
|
||||
|
||||
createInvBanCount();
|
||||
echo("LOADING MISSION: " @ %missionName);
|
||||
|
||||
|
|
@ -708,6 +727,12 @@ function loadMissionStage2()
|
|||
$CountdownStarted = false;
|
||||
AISystemEnabled( false );
|
||||
|
||||
// Set the team damage here so that the game type can override it:
|
||||
if ( $Host::TournamentMode )
|
||||
$TeamDamage = 1;
|
||||
else
|
||||
$TeamDamage = $Host::TeamDamageOn;
|
||||
|
||||
Game.missionLoadDone();
|
||||
|
||||
// start all the clients in the mission
|
||||
|
|
@ -807,11 +832,12 @@ function GameConnection::dataBlocksDone( %client, %missionSequence )
|
|||
return;
|
||||
%client.currentPhase = 2;
|
||||
|
||||
// targets require ShapeBase datablocks (only needed on first connection)
|
||||
if(!%client.receivedTargets)
|
||||
// only want to set this once... (targets will not be updated/sent until a
|
||||
// client has this flag set)
|
||||
if(!%client.getReceivedDataBlocks())
|
||||
{
|
||||
%client.setReceivedDataBlocks(true);
|
||||
sendTargetsToClient(%client);
|
||||
%client.receivedTargets = true;
|
||||
}
|
||||
|
||||
commandToClient(%client, 'MissionStartPhase2', $missionSequence);
|
||||
|
|
@ -863,6 +889,11 @@ function serverSetClientTeamState( %client )
|
|||
{
|
||||
dataBlock = Observer;
|
||||
};
|
||||
|
||||
if( isObject( %client.rescheduleVote ) )
|
||||
Cancel( %client.rescheduleVote );
|
||||
%client.canVote = true;
|
||||
%client.rescheduleVote = "";
|
||||
|
||||
MissionCleanup.add( %client.camera ); // we get automatic cleanup this way.
|
||||
|
||||
|
|
@ -954,16 +985,16 @@ function serverSetClientTeamState( %client )
|
|||
function HideHudHACK(%visible)
|
||||
{
|
||||
//compassHud.setVisible(%visible);
|
||||
//enerDamgHud.setVisible(%visible);
|
||||
//enerDamgHud.setVisible(%visible);
|
||||
retCenterHud.setVisible(%visible);
|
||||
reticleFrameHud.setVisible(%visible);
|
||||
//invPackHud.setVisible(%visible);
|
||||
weaponsHud.setVisible(%visible);
|
||||
outerChatHud.setVisible(%visible);
|
||||
objectiveHud.setVisible(%visible);
|
||||
outerChatHud.setVisible(%visible);
|
||||
objectiveHud.setVisible(%visible);
|
||||
chatHud.setVisible(%visible);
|
||||
navHud.setVisible(%visible);
|
||||
//watermarkHud.setVisible(%visible);
|
||||
//watermarkHud.setVisible(%visible);
|
||||
hudClusterBack.setVisible(%visible);
|
||||
inventoryHud.setVisible(%visible);
|
||||
clockHUD.setVisible(%visible);
|
||||
|
|
@ -985,10 +1016,10 @@ function ServerPlay3D(%profile,%transform)
|
|||
function clientCmdSetFirstPerson(%value)
|
||||
{
|
||||
$firstPerson = %value;
|
||||
if(%value)
|
||||
ammoHud.setVisible(true);
|
||||
else
|
||||
ammoHud.setVisible(false);
|
||||
if(%value)
|
||||
ammoHud.setVisible(true);
|
||||
else
|
||||
ammoHud.setVisible(false);
|
||||
}
|
||||
|
||||
function clientCmdVehicleMount()
|
||||
|
|
@ -1013,7 +1044,7 @@ function serverCmdSAD( %client, %password )
|
|||
%client.isAdmin = true;
|
||||
%client.isSuperAdmin = true;
|
||||
%name = getTaggedString( %client.name );
|
||||
MessageAll( 'MsgAdminForce', "\c2" @ %name @ " has become Admin by force.", %client );
|
||||
MessageAll( 'MsgSuperAdminPlayer', '\c2%2 has become a Super Admin by force.', %client, %client.name );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1284,7 +1315,7 @@ function serverCmdChangePlayersTeam( %clientRequesting, %client, %team)
|
|||
}
|
||||
}
|
||||
else
|
||||
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
|
||||
commandToClient(%client, 'setHudMode', 'Standard', "", 0);
|
||||
|
||||
%multiTeam = (Game.numTeams > 1);
|
||||
if(%multiTeam)
|
||||
|
|
@ -1310,16 +1341,16 @@ function serverCmdForcePlayerToObserver( %clientRequesting, %client )
|
|||
|
||||
function serverCmdTogglePlayerMute(%client, %who)
|
||||
{
|
||||
if (%client.muted[%who])
|
||||
{
|
||||
%client.muted[%who] = false;
|
||||
messageClient(%client, 'MsgPlayerUnmuted', '%1 has been unmuted.', %who.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
%client.muted[%who] = true;
|
||||
messageClient(%client, 'MsgPlayerMuted', '%1 has been muted.', %who.name);
|
||||
}
|
||||
if (%client.muted[%who])
|
||||
{
|
||||
%client.muted[%who] = false;
|
||||
messageClient(%client, 'MsgPlayerUnmuted', '%1 has been unmuted.', %who.name);
|
||||
}
|
||||
else
|
||||
{
|
||||
%client.muted[%who] = true;
|
||||
messageClient(%client, 'MsgPlayerMuted', '%1 has been muted.', %who.name);
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
|
|
@ -1400,7 +1431,7 @@ function serverCmdClientPickedTeam( %client, %option )
|
|||
%client.observerMode = "pregame";
|
||||
%client.notReady = true;
|
||||
%client.camera.getDataBlock().setMode( %client.camera, "pre-game", %client.player );
|
||||
commandToClient(%client, 'setHudMode', 'Observer');
|
||||
commandToClient(%client, 'setHudMode', 'Observer');
|
||||
|
||||
|
||||
%client.setControlObject( %client.camera );
|
||||
|
|
@ -1448,7 +1479,7 @@ function dumpGameString()
|
|||
|
||||
function isOnAdminList(%client)
|
||||
{
|
||||
if( !%totalRecords = getRecordCount( $Host::AdminList ) )
|
||||
if( !%totalRecords = getFieldCount( $Host::AdminList ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1456,7 +1487,6 @@ function isOnAdminList(%client)
|
|||
for(%i = 0; %i < %totalRecords; %i++)
|
||||
{
|
||||
%record = getField( getRecord( $Host::AdminList, 0 ), %i);
|
||||
echo( "record: " @ %record @ "guid: " @ %client.guid );
|
||||
if(%record == %client.guid)
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1466,7 +1496,7 @@ function isOnAdminList(%client)
|
|||
|
||||
function isOnSuperAdminList(%client)
|
||||
{
|
||||
if( !%totalRecords = getRecordCount( $Host::superAdminList ) )
|
||||
if( !%totalRecords = getFieldCount( $Host::superAdminList ) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
@ -1474,7 +1504,6 @@ function isOnSuperAdminList(%client)
|
|||
for(%i = 0; %i < %totalRecords; %i++)
|
||||
{
|
||||
%record = getField( getRecord( $Host::superAdminList, 0 ), %i);
|
||||
echo( "record: " @ %record @ "guid: " @ %client.guid );
|
||||
if(%record == %client.guid)
|
||||
return true;
|
||||
}
|
||||
|
|
@ -1487,13 +1516,15 @@ function ServerCmdAddToAdminList( %admin, %client )
|
|||
if( !%admin.isSuperAdmin )
|
||||
return;
|
||||
|
||||
%count = getRecordCount( $Host::AdminList );
|
||||
%count = getFieldCount( $Host::AdminList );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%id = getRecord( $Host::AdminList, %i );
|
||||
%id = getField( $Host::AdminList, %i );
|
||||
if ( %id == %client.guid )
|
||||
{
|
||||
return; // They're already there!
|
||||
}
|
||||
}
|
||||
|
||||
if( %count == 0 )
|
||||
|
|
@ -1507,11 +1538,11 @@ function ServerCmdAddToSuperAdminList( %admin, %client )
|
|||
if( !%admin.isSuperAdmin )
|
||||
return;
|
||||
|
||||
%count = getRecordCount( $Host::SuperAdminList );
|
||||
%count = getFieldCount( $Host::SuperAdminList );
|
||||
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
%id = getRecord( $Host::SuperAdminList, %i );
|
||||
%id = getField( $Host::SuperAdminList, %i );
|
||||
if ( %id == %client.guid )
|
||||
return; // They're already there!
|
||||
}
|
||||
|
|
@ -1699,8 +1730,8 @@ function Countdown(%timeMS)
|
|||
$countdownStarted = true;
|
||||
Game.matchStart = Game.schedule( %timeMS, "StartMatch" );
|
||||
|
||||
if (%timeMS > 30000)
|
||||
notifyMatchStart(%timeMS);
|
||||
if (%timeMS > 30000)
|
||||
notifyMatchStart(%timeMS);
|
||||
|
||||
if(%timeMS >= 30000)
|
||||
Game.thirtyCount = schedule(%timeMS - 30000, Game, "notifyMatchStart", 30000);
|
||||
|
|
@ -1785,7 +1816,7 @@ function CancelCountdown()
|
|||
|
||||
function CancelEndCountdown()
|
||||
{
|
||||
//cancel the mission end countdown...
|
||||
//cancel the mission end countdown...
|
||||
if(Game.endsixtyCount !$= "")
|
||||
cancel(Game.endsixtyCount);
|
||||
if(Game.endthirtyCount !$= "")
|
||||
|
|
@ -1824,38 +1855,53 @@ function resetServerDefaults()
|
|||
exec( "scripts/ServerDefaults.cs" );
|
||||
exec( "prefs/ServerPrefs.cs" );
|
||||
|
||||
loadMission( $CurrentMission, $CurrentMissionType );
|
||||
// kick all bots...
|
||||
removeAllBots();
|
||||
|
||||
// add bots back if they were there before..
|
||||
if( $Host::botsEnabled )
|
||||
initGameBots( $Host::Map, $Host::MissionType );
|
||||
|
||||
// load the missions
|
||||
loadMission( $Host::Map, $Host::MissionType );
|
||||
}
|
||||
|
||||
function removeAllBots()
|
||||
{
|
||||
while( ClientGroup.getCount() )
|
||||
{
|
||||
%client = ClientGroup.getObject(0);
|
||||
if(%client.isAIControlled())
|
||||
%client.drop();
|
||||
else
|
||||
%client.delete();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// Guid list maintenance functions:
|
||||
function addToServerGuidList( %guid )
|
||||
function getServerGUIDList()
|
||||
{
|
||||
%count = getFieldCount( $HostGuidList );
|
||||
%count = ClientGroup.getCount();
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
if ( getField( $HostGuidList, %i ) == %guid )
|
||||
return;
|
||||
}
|
||||
|
||||
$HostGuidList = $HostGuidList $= "" ? %guid : $HostGuidList TAB %guid;
|
||||
}
|
||||
|
||||
function removeFromServerGuidList( %guid )
|
||||
{
|
||||
%count = getFieldCount( $HostGuidList );
|
||||
for ( %i = 0; %i < %count; %i++ )
|
||||
{
|
||||
if ( getField( $HostGuidList, %i ) == %guid )
|
||||
%cl = ClientGroup.getObject( %i );
|
||||
if ( isObject( %cl ) && !%cl.isSmurf && !%cl.isAIControlled() )
|
||||
{
|
||||
$HostGuidList = removeField( $HostGuidList, %i );
|
||||
return;
|
||||
%guid = getField( %cl.getAuthInfo(), 3 );
|
||||
if ( %guid != 0 )
|
||||
{
|
||||
if ( %list $= "" )
|
||||
%list = %guid;
|
||||
else
|
||||
%list = %list TAB %guid;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Huh, didn't find it.
|
||||
return( %list );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
// will return the first admin found on the server
|
||||
function getAdmin()
|
||||
{
|
||||
|
|
@ -1874,20 +1920,20 @@ function getAdmin()
|
|||
|
||||
function serverCmdSetPDAPose(%client, %val)
|
||||
{
|
||||
// if client is in a vehicle, return
|
||||
if(%client.player.isMounted())
|
||||
return;
|
||||
// if client is in a vehicle, return
|
||||
if(%client.player.isMounted())
|
||||
return;
|
||||
|
||||
if(%val)
|
||||
{
|
||||
// play "PDA" animation thread on player
|
||||
%client.player.setActionThread("PDA", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// cancel PDA animation thread
|
||||
%client.player.setActionThread("root", true);
|
||||
}
|
||||
if(%val)
|
||||
{
|
||||
// play "PDA" animation thread on player
|
||||
%client.player.setActionThread("PDA", false);
|
||||
}
|
||||
else
|
||||
{
|
||||
// cancel PDA animation thread
|
||||
%client.player.setActionThread("root", true);
|
||||
}
|
||||
}
|
||||
|
||||
function serverCmdProcessGameLink(%client, %arg1, %arg2, %arg3, %arg4, %arg5)
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ $Host::Dedicated = 0;
|
|||
$Host::MissionType = "CTF";
|
||||
$Host::Map = "Katabatic";
|
||||
$Host::MaxPlayers = 64;
|
||||
$Host::TimeLimit = 20;
|
||||
$Host::TimeLimit = 30;
|
||||
$Host::BotCount = 2;
|
||||
$Host::BotsEnabled = 0;
|
||||
$Host::MinBotDifficulty = 0.5;
|
||||
|
|
@ -50,6 +50,8 @@ $Host::TournamentMode = 0;
|
|||
$Host::allowAdminPlayerVotes = 1;
|
||||
$Host::FloodProtectionEnabled = 1;
|
||||
$Host::MaxMessageLen = 120;
|
||||
$Host::VoteSpread = 20;
|
||||
$Host::TeamDamageOn = 0;
|
||||
|
||||
$MasterServerAddress = "IP:198.74.40.152:28000";
|
||||
|
||||
|
|
|
|||
|
|
@ -782,24 +782,24 @@ function StaticShapeData::damageObject(%data, %targetObject, %sourceObject, %pos
|
|||
if(%damageScale !$= "")
|
||||
%amount *= %damageScale;
|
||||
|
||||
//if team damage is off, cap the amount of damage so as not to disable the object...
|
||||
if (!$TeamDamage)
|
||||
{
|
||||
//see if the object is being shot by a friendly
|
||||
%srcClient = %sourceObject.client;
|
||||
if (isObject(%srcClient))
|
||||
{
|
||||
if (isTargetFriendly(%targetObject.getTarget(), %srcClient.getSensorGroup()))
|
||||
{
|
||||
%curDamage = %targetObject.getDamageLevel();
|
||||
%availableDamage = %targetObject.getDataBlock().disabledLevel - %curDamage - 0.05;
|
||||
if (%amount > %availableDamage)
|
||||
%amount = %availableDamage;
|
||||
}
|
||||
}
|
||||
}
|
||||
//if team damage is off, cap the amount of damage so as not to disable the object...
|
||||
if (!$TeamDamage && !%targetObject.getDataBlock().deployedObject && %targetObject.getDataBlock.getName $= "DeployedBeacon")
|
||||
{
|
||||
//see if the object is being shot by a friendly
|
||||
%srcClient = %sourceObject.client;
|
||||
if (isObject(%srcClient))
|
||||
{
|
||||
if (isTargetFriendly(%targetObject.getTarget() , %srcClient.getSensorGroup()))
|
||||
{
|
||||
%curDamage = %targetObject.getDamageLevel();
|
||||
%availableDamage = %targetObject.getDataBlock().disabledLevel - %curDamage - 0.05;
|
||||
if (%amount > %availableDamage)
|
||||
%amount = %availableDamage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//if there's still damage to apply
|
||||
// if there's still damage to apply
|
||||
if (%amount > 0)
|
||||
%targetObject.applyDamage(%amount);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,12 @@ function VehicleHud::onWake( %this )
|
|||
hudMap.blockBind( moveMap, toggleScoreScreen );
|
||||
hudMap.blockBind( moveMap, toggleCommanderMap );
|
||||
hudMap.bindCmd( keyboard, escape, "", "VehicleHud.onCancel();" );
|
||||
hudMap.bindCmd( keyboard, "1", "", "VehicleHud.quickBuy( 0 );" );
|
||||
hudMap.bindCmd( keyboard, "2", "", "VehicleHud.quickBuy( 1 );" );
|
||||
hudMap.bindCmd( keyboard, "3", "", "VehicleHud.quickBuy( 2 );" );
|
||||
hudMap.bindCmd( keyboard, "4", "", "VehicleHud.quickBuy( 3 );" );
|
||||
hudMap.bindCmd( keyboard, "5", "", "VehicleHud.quickBuy( 4 );" );
|
||||
hudMap.bindCmd( keyboard, "6", "", "VehicleHud.quickBuy( 5 );" );
|
||||
hudMap.push();
|
||||
}
|
||||
|
||||
|
|
@ -54,6 +60,17 @@ function VehicleHud::loadHud( %obj, %tag )
|
|||
$Hud[%tag].parent = VIN_Root;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function VehicleHud::quickBuy( %this, %id )
|
||||
{
|
||||
if ( isObject( $Hud['vehicleHud'].data[%id, 0] ) )
|
||||
{
|
||||
if ( %this.selId != %id )
|
||||
eval( $Hud['vehicleHud'].data[%id, 0].command );
|
||||
%this.onBuy();
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
function VehicleHud::onBuy( %this )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -236,7 +236,7 @@ function VehicleData::onDestroyed(%data, %obj, %prevState)
|
|||
%flingee.damage(0, %obj.getPosition(), 0.4, $DamageType::Explosion);
|
||||
}
|
||||
}
|
||||
%obj.schedule(300, "delete");
|
||||
%obj.schedule(600, "delete");
|
||||
}
|
||||
|
||||
function radiusVehicleExplosion(%data, %vehicle)
|
||||
|
|
@ -1087,7 +1087,7 @@ function VehicleData::damageObject(%data, %targetObject, %sourceObject, %positio
|
|||
else
|
||||
%sourceTeam = %sourceObject ? getTargetSensorGroup(%sourceObject.getTarget()) : -1;
|
||||
|
||||
if(!$teamDamage && (%targetTeam == %sourceTeam))
|
||||
if(!$teamDamage && (%targetTeam == %sourceTeam) && %targetObject.getDamagePercent() > 0.5)
|
||||
return;
|
||||
|
||||
// Scale damage type & include shield calculations...
|
||||
|
|
|
|||
|
|
@ -672,6 +672,7 @@ function FlashGrenadeThrown::onThrow(%this, %gren)
|
|||
|
||||
function detonateFlashGrenade(%hg)
|
||||
{
|
||||
%thrower = %hg.sourceObject.client;
|
||||
%hg.setDamageState(Destroyed);
|
||||
%hgt = %hg.getTransform();
|
||||
%plX = firstword(%hgt);
|
||||
|
|
@ -720,7 +721,17 @@ function detonateFlashGrenade(%hg)
|
|||
%dotFactor = ((1.0 - ((%difAcos - 45.0) / 15.0)) * 0.5) + 0.5;
|
||||
|
||||
%totalFactor = %dotFactor * %distFactor;
|
||||
%damage.setWhiteOut(%damage.getWhiteOut() + %totalFactor);
|
||||
%prevWhiteOut = %damage.getWhiteOut();
|
||||
|
||||
if(!%prevWhiteOut)
|
||||
if(!$teamDamage)
|
||||
{
|
||||
error("checking for message");
|
||||
if(%damage.client != %thrower && %damage.client.team == %thrower.team)
|
||||
messageClient(%damage.client, 'teamWhiteOut', '\c1You were hit by %1\'s whiteout grenade.', getTaggedString(%thrower.name));
|
||||
}
|
||||
|
||||
%damage.setWhiteOut( %prevWhiteOut + %totalFactor);
|
||||
}
|
||||
%hg.schedule(500, "delete");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// mine script
|
||||
// ----------------------------------------------
|
||||
|
||||
$TeamDeployableMax[MineDeployed] = 15;
|
||||
$TeamDeployableMax[MineDeployed] = 20;
|
||||
|
||||
// ----------------------------------------------
|
||||
// force-feedback datablocks
|
||||
|
|
@ -339,87 +339,3 @@ datablock ItemData(Mine)
|
|||
|
||||
};
|
||||
|
||||
//--------------------------------------
|
||||
//datablock ItemData(MineAirDeployed)
|
||||
//{
|
||||
// className = Weapon;
|
||||
// shapeFile = "mine_anti_air.dts";
|
||||
// mass = 1;
|
||||
// elasticity = 0.2;
|
||||
// friction = 0.9;
|
||||
// pickupRadius = 3;
|
||||
// maxDamage = 0.1;
|
||||
// explosion = MineExplosion;
|
||||
// indirectDamage = 1.3;
|
||||
// damageRadius = 15.0;
|
||||
// radiusDamageType = $DamageType::Mine;
|
||||
// kickBackStrength = 3000;
|
||||
//};
|
||||
//
|
||||
//datablock ItemData(MineAir)
|
||||
//{
|
||||
// className = HandInventory;
|
||||
// catagory = "Handheld";
|
||||
// shapeFile = "mine_anti_air.dts";
|
||||
// mass = 1;
|
||||
// elasticity = 0.2;
|
||||
// friction = 0.8;
|
||||
// pickupRadius = 1;
|
||||
//};
|
||||
|
||||
//--------------------------------------
|
||||
//datablock ItemData(MineLandDeployed)
|
||||
//{
|
||||
// className = Weapon;
|
||||
// shapeFile = "mine_anti_land.dts";
|
||||
// mass = 7;
|
||||
// elasticity = 0.2;
|
||||
// friction = 0.8;
|
||||
// pickupRadius = 3;
|
||||
// maxDamage = 0.1;
|
||||
// explosion = MineExplosion;
|
||||
// indirectDamage = 1.3;
|
||||
// damageRadius = 15.0;
|
||||
// radiusDamageType = $DamageType::Mine;
|
||||
// kickBackStrength = 3000;
|
||||
//};
|
||||
//
|
||||
//datablock ItemData(MineLand)
|
||||
//{
|
||||
// className = HandInventory;
|
||||
// catagory = "Handheld";
|
||||
// shapeFile = "mine_anti_land.dts";
|
||||
// mass = 3;
|
||||
// elasticity = 0.2;
|
||||
// friction = 0.7;
|
||||
// pickupRadius = 1;
|
||||
//};
|
||||
|
||||
//--------------------------------------
|
||||
//datablock ItemData(MineStickyDeployed)
|
||||
//{
|
||||
// className = Weapon;
|
||||
// shapeFile = "mine_sticky.dts";
|
||||
// mass = 7;
|
||||
// elasticity = 0.2;
|
||||
// friction = 0.8;
|
||||
// pickupRadius = 3;
|
||||
// maxDamage = 0.1;
|
||||
// explosion = MineExplosion;
|
||||
// indirectDamage = 1.3;
|
||||
// damageRadius = 15.0;
|
||||
// radiusDamageType = $DamageType::Mine;
|
||||
// kickBackStrength = 3000;
|
||||
//};
|
||||
//
|
||||
//datablock ItemData(MineSticky)
|
||||
//{
|
||||
// className = HandInventory;
|
||||
// catagory = "Handheld";
|
||||
// shapeFile = "mine_sticky.dts";
|
||||
// mass = 3;
|
||||
// elasticity = 0.2;
|
||||
// friction = 0.7;
|
||||
// pickupRadius = 1;
|
||||
//};
|
||||
|
||||
|
|
|
|||
|
|
@ -211,27 +211,28 @@ function GetProfileHdr(%type, %line)
|
|||
TProfileHdr.appending = getField(%line,3);
|
||||
TProfileHdr.recruiting = getField(%line,4);
|
||||
TProfileHdr.tribegfx = getField(%line,5);
|
||||
TProfileHdr.twa = 0;
|
||||
TProfileHdr.Desc = "";
|
||||
|
||||
TL_Profile.setVisible(1);
|
||||
TL_Roster.setVisible(1);
|
||||
TProfileHdr.twa = getField(%line,6);
|
||||
|
||||
for(%checkID=0;%checkID<getField(getRecord($GuidTribes,0),0);%checkID++)
|
||||
{
|
||||
if(getField(getRecord($GuidTribes,1+%checkID),3) == 1401)
|
||||
TProfileHdr.twa = 4;
|
||||
else if(TProfileHdr.tribe_id == getField(getRecord($GuidTribes,1+%checkID),3))
|
||||
if(TProfileHdr.twa == 0)
|
||||
TProfileHdr.twa = getField(getRecord($GuidTribes,1+%checkID),4);
|
||||
}
|
||||
|
||||
TL_News.setVisible(TProfileHdr.twa);
|
||||
TL_Invites.setVisible(TProfileHdr.twa);
|
||||
switch (TProfileHdr.twa)
|
||||
{
|
||||
case 0:
|
||||
TW_Admin.setVisible(0);
|
||||
case 1:
|
||||
TW_Admin.setVisible(0);
|
||||
case 2:
|
||||
TW_Admin.setVisible(1);
|
||||
case 3:
|
||||
TW_Admin.setVisible(1);
|
||||
case 4:
|
||||
TW_Admin.setVisible(1);
|
||||
default:
|
||||
TW_Admin.setVisible(0);
|
||||
}
|
||||
|
||||
if(TProfileHdr.twa > 1)
|
||||
TW_Admin.setVisible(1);
|
||||
else
|
||||
TW_Admin.setVisible(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -249,18 +250,23 @@ function GetProfileHdr(%type, %line)
|
|||
if(getField(getRecord(WonGetAuthInfo(),0),3)==getField(%line,3))
|
||||
TProfileHdr.twa = 1;
|
||||
|
||||
for(%i=0;%i<getField(getRecord(wonGetAuthInfo,1),0);%i++)
|
||||
{
|
||||
if(getField(getRecord(wonGetAuthInfo(),2+%i),3)==1401 && getField(getRecord(wonGetAuthInfo(),2+%i),4) >= 2)
|
||||
TProfileHdr.twa = 1;
|
||||
}
|
||||
for(%checkID=0;%checkID<getField(getRecord($GuidTribes,0),0);%checkID++)
|
||||
{
|
||||
if(getField(getRecord($GuidTribes,1+%checkID),3) == 1401 && getField(getRecord($GuidTribes,1+%checkID),4) >= 2)
|
||||
TProfileHdr.twa = 1;
|
||||
}
|
||||
|
||||
W_Profile.setVisible(1);
|
||||
W_History.setVisible(1);
|
||||
W_Tribes.setVisible(1);
|
||||
|
||||
%isMe = getField(getRecord(wonGetAuthInfo(),0),0)$=twbTitle.name;
|
||||
TProfileHdr.isMe = %isMe;
|
||||
if(%isMe)
|
||||
|
||||
// if(!TProfileHdr.twa)
|
||||
TProfileHdr.twa = TProfileHdr.isMe;
|
||||
|
||||
if(TProfileHdr.twa)
|
||||
{
|
||||
W_BuddyList.setText("BUDDYLIST");
|
||||
W_BuddyList.setVisible(1);
|
||||
|
|
@ -361,6 +367,7 @@ function LinkEditWarriorDesc(%player, %handler)
|
|||
//-----------------------------------------------------------------------------
|
||||
function LinkEditMember(%player, %tribe, %pv, %title,%owner)
|
||||
{
|
||||
// initialize buttons
|
||||
tb_onProbation.setVisible(true);
|
||||
tb_tribeMember.setVisible(false);
|
||||
tb_tribeAdmin.setVisible(false);
|
||||
|
|
@ -372,6 +379,7 @@ function LinkEditMember(%player, %tribe, %pv, %title,%owner)
|
|||
tb_tribeAdmin.setValue(false);
|
||||
tb_tribeController.setValue(false);
|
||||
tb_sysAdmin.setValue(false);
|
||||
|
||||
%owner.vTribe = %tribe;
|
||||
%owner.vPlayer = %player;
|
||||
t_whois.setValue(%player);
|
||||
|
|
@ -382,7 +390,7 @@ function LinkEditMember(%player, %tribe, %pv, %title,%owner)
|
|||
// Get callers rank in members tribe
|
||||
for(%i=0;%i<getfield(getRecord(%ai,1),0);%i++)
|
||||
{
|
||||
if( getField(getRecord(%ai,2+%i),0) == %tribe || (getField(getRecord(%ai,2+%i),3)==1401 && getField(getRecord(%ai,2+%i),4)>1))
|
||||
if( getField(getRecord(%ai,2+%i),0) $= %tribe || (getField(getRecord(%ai,2+%i),3)==1401 && getField(getRecord(%ai,2+%i),4)>1))
|
||||
{
|
||||
%callerPv = getField(getRecord(%ai,2+%i),4);
|
||||
break;
|
||||
|
|
@ -573,9 +581,10 @@ function SetMemberProfile()
|
|||
TribeAdminMemberDlg.key = LaunchGui.key++;
|
||||
TribeAdminMemberDlg.state = "setMemberProfile";
|
||||
canvas.SetCursor(ArrowWaitCursor);
|
||||
%title = E_Title.getValue();
|
||||
DatabaseQuery(21,TribeAdminMemberDlg.vTribe TAB
|
||||
TribeAdminMemberDlg.vPlayer TAB
|
||||
E_Title.getValue() TAB
|
||||
%title TAB
|
||||
TribeAdminMemberDlg.vPerm,
|
||||
TribeAdminMemberDlg,
|
||||
TribeAdminMemberDlg.key);
|
||||
|
|
@ -1038,6 +1047,74 @@ function GuiMLTextCtrl::onURL(%this, %url)
|
|||
|
||||
case "gamelink":
|
||||
commandToServer('ProcessGameLink', %fld[1], %fld[2], %fld[3], %fld[4], %fld[5]);
|
||||
// THESE ARE EMAIL RELATED MODERATOR LINKS
|
||||
case "moderatorTopicKill":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopic";
|
||||
databaseQuery(62, 0 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicWarn":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
error("MTW: " @ %url);
|
||||
databaseQuery(62, 1 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicBan24":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
error("MTB24: " @ %url);
|
||||
databaseQuery(62, 2 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicBan48":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
databaseQuery(62, 3 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicBan72":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
databaseQuery(62, 4 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicBan7Days":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
databaseQuery(62, 5 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicBan30Days":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
databaseQuery(62, 6 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
case "moderatorTopicBanForever":
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopicPlus";
|
||||
databaseQuery(62, 7 TAB getField(%url,1) TAB getField(%url,2), TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
|
||||
case "moderatorPostKill":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePost";
|
||||
databaseQuery(63, 0 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostWarn":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 1 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostBan24":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 2 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostBan48":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 3 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostBan72":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 4 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostBan7Days":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 5 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostBan30Days":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 6 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
case "moderatorPostBanForever":
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePostPlus";
|
||||
databaseQuery(63, 7 TAB getFields(%url,1), PostsPopupDlg, PostsPopupDlg.key);
|
||||
|
||||
//if there is an unknown URL type, treat it as a weblink..
|
||||
default:
|
||||
|
|
@ -1195,7 +1272,10 @@ function TribePane::onDatabaseQueryResult(%this, %status, %resultString , %key)
|
|||
%this.linecount--;
|
||||
%this.MList = "";
|
||||
if(getField(%resultString,0)>0)
|
||||
{
|
||||
%this.state = "tribeRoster";
|
||||
%this.rosterRowcount = getField(%resultString,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
%this.state="done";
|
||||
|
|
@ -1279,7 +1359,7 @@ function TribePane::onDatabaseRow(%this, %row, %isLastRow, %key)
|
|||
{
|
||||
MemberList.AddMember(%wid,%name,%adminLevel,%editkick,%row);
|
||||
MemberList.AddRow(%wid,%name TAB %title TAB %adminLevel);
|
||||
MemberList.setRowStylebyID( %wid, !%onLine );
|
||||
// MemberList.setRowStylebyID( %wid, !%onLine );
|
||||
}
|
||||
|
||||
if(%this.linecount <= 0)
|
||||
|
|
@ -1293,6 +1373,16 @@ function TribePane::onDatabaseRow(%this, %row, %isLastRow, %key)
|
|||
if(%name !$= "")
|
||||
%this.MList = %this.MList @ %name @ ",";
|
||||
%this.linecount++;
|
||||
|
||||
if(%isLastRow)
|
||||
{
|
||||
MemberList.GetOnlineStatus();
|
||||
if(%this.needRefresh)
|
||||
{
|
||||
%this.needRefresh = 0;
|
||||
TL_ROSTER.setValue(1);
|
||||
}
|
||||
}
|
||||
|
||||
case "tribeNews":
|
||||
%this.articleID = getField(%row,0);
|
||||
|
|
@ -1316,11 +1406,8 @@ function TribePane::onDatabaseRow(%this, %row, %isLastRow, %key)
|
|||
MemberList.AddInvite(%inviteID,%invitedQuad,%invitorQuad,%isOwned,%row);
|
||||
MemberList.AddRow(%inviteID, getField(%invitedQuad,0) TAB %inviteDate);
|
||||
MemberList.setRowStylebyID( %inviteId, !%onLine );
|
||||
}
|
||||
if(%isLastRow && %this.needRefresh)
|
||||
{
|
||||
%this.needRefresh = 0;
|
||||
TL_ROSTER.setValue(1);
|
||||
if(%isLastRow)
|
||||
MemberList.GetOnlineStatus();
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1464,7 +1551,7 @@ function PlayerPane::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
|||
PlayerPix.setBitmap($PlayerGfx);
|
||||
%profileText = "<just:left><lmargin:10><color:ADFFFA><Font:Univers Condensed:10> \n<Font:Univers Condensed:18>";
|
||||
%profileText = %profileText @ "Registered:<color:FFAA00>" SPC TProfileHdr.registered @ "<color:ADFFFA>\n";
|
||||
%profileText = %profileText @ "Online: " SPC (TProfileHdr.onLine ? "<color:33FF33>YES":"<color:FF3333>NO") @ "<color:ADFFFA>\n";
|
||||
// %profileText = %profileText @ "Online: " SPC (TProfileHdr.onLine ? "<color:33FF33>YES":"<color:FF3333>NO") @ "<color:ADFFFA>\n";
|
||||
|
||||
if(trim(TProfileHdr.playerURL) !$= "")
|
||||
%profileText = %profileText @ "WebSite: " SPC "<spush><color:CCAA33><a:wwwlink\t" @ TProfileHdr.playerURL @ ">"@TProfileHdr.playerURL@"</a><spop>\n\n";
|
||||
|
|
@ -1569,7 +1656,8 @@ function PlayerPane::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
|||
MessageBoxOK("CONFIRMED",getField(%status,1));
|
||||
case "changePlayerName":
|
||||
%this.state = "done";
|
||||
// echo("wus:"@WonUpdateCertificate());
|
||||
IRCClient::quit();
|
||||
WonUpdateCertificate();
|
||||
TProfileHdr.playername = NewNameEdit.getValue();
|
||||
wp_currentname.setText(NewNameEdit.getValue());
|
||||
twbTabView.setTabText(twbTabView.getSelectedId(),NewNameEdit.getValue());
|
||||
|
|
@ -1623,7 +1711,9 @@ function PlayerPane::onDatabaseRow(%this,%row,%isLastRow,%key)
|
|||
case "warriorBuddyList":
|
||||
W_MemberList.AddInvite(getField(%row,3),getFields(%row,0,3),getFields(%row,0,3),4,%row);
|
||||
W_MemberList.AddRow(getField(%row,3),getField(%row,0) TAB getField(%row,4));
|
||||
W_MemberList.setRowStyleByID(getField(%row,3),!getField(%row,5));
|
||||
if(%isLastRow)
|
||||
W_MemberList.getOnlineStatus();
|
||||
// W_MemberList.setRowStyleByID(getField(%row,3),!getField(%row,5));
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1693,10 +1783,10 @@ function PlayerPane::ButtonClick( %this, %senderid )
|
|||
%row = getRecord(%ai,2+%ix);
|
||||
%wid = getField(%row,2);
|
||||
%name = getField(%row,0);
|
||||
%title = getField(%row,4);
|
||||
%title = getField(%row,5);
|
||||
if(%title $= "")
|
||||
%title = "Not Shown";
|
||||
%adminLevel = getField(%row,3);
|
||||
%adminLevel = getField(%row,4);
|
||||
%editkick = %adminLevel >= 2;
|
||||
W_MemberList.AddMember(%wid,%name,%adminLevel,%editkick,%row);
|
||||
W_MemberList.AddRow(%wid,%name TAB %title TAB %adminLevel);
|
||||
|
|
@ -1793,10 +1883,39 @@ function W_MemberList::onRightMouseDown( %this, %column, %row, %mousePos )
|
|||
error( "Member/Invite Locate Error!" );
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function w_MemberList::onAdd(%this)
|
||||
{
|
||||
W_MemberList.addStyle( 1, "Univers", 12 , "150 150 150", "200 200 200", "60 60 60" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function W_MemberList::GetOnlineStatus(%this)
|
||||
{
|
||||
%this.key = LaunchGui.key++;
|
||||
%this.status = "getOnline";
|
||||
for(%oStat=0;%oStat<%this.RowCount();%oStat++)
|
||||
{
|
||||
if(%oStat == 0)
|
||||
%roster = %this.getRowID(%oStat);
|
||||
else
|
||||
%roster = %roster TAB %this.getRowID(%oStat);
|
||||
}
|
||||
databaseQuery(69,%roster, %this,%this.key);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function W_MemberList::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
||||
{
|
||||
if(%key != %this.key)
|
||||
return;
|
||||
switch$(%this.status)
|
||||
{
|
||||
case "getOnline": if(getField(%status,0) == 0)
|
||||
for(%str=0;%str<strLen(%resultString);%str++)
|
||||
{
|
||||
%this.setRowStyle( %str, !getSubStr(%resultString,%str,1) );
|
||||
}
|
||||
}
|
||||
}
|
||||
//==--------------------------------------------------------------------------
|
||||
function WarriorPopupDlg::onWake( %this )
|
||||
{
|
||||
|
|
@ -1882,7 +2001,7 @@ function WarriorPopupDlg::onSleep(%this)
|
|||
TribeAndWarriorBrowserGui.WDialogOpen = false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function MemberList::ClearList()
|
||||
function MemberList::ClearList(%this)
|
||||
{
|
||||
if(isObject(MemberListGroup))
|
||||
MemberListGroup.Delete();
|
||||
|
|
@ -1934,11 +2053,40 @@ function MemberList::onRightMouseDown( %this, %column, %row, %mousePos )
|
|||
else
|
||||
error( "Member/Invite Locate Error!" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function Memberlist::onAdd(%this)
|
||||
{
|
||||
MemberList.addStyle( 1, "Univers", 12 , "150 150 150", "200 200 200", "60 60 60" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function MemberList::GetOnlineStatus(%this)
|
||||
{
|
||||
MemberList.key = LaunchGui.key++;
|
||||
MemberList.status = "getOnline";
|
||||
for(%oStat=0;%oStat<%this.RowCount();%oStat++)
|
||||
{
|
||||
if(%oStat == 0)
|
||||
%roster = MemberList.getRowID(%oStat);
|
||||
else
|
||||
%roster = %roster TAB MemberList.getRowID(%oStat);
|
||||
}
|
||||
databaseQuery(69,%roster, MemberList,MemberList.key);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function MemberList::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
||||
{
|
||||
if(%key != %this.key)
|
||||
return;
|
||||
switch$(%this.status)
|
||||
{
|
||||
case "getOnline": if(getField(%status,0) == 0)
|
||||
for(%str=0;%str<strLen(%resultString);%str++)
|
||||
{
|
||||
MemberList.setRowStyle( %str, !getSubStr(%resultString,%str,1) );
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function TribeMemberPopupDlg::onWake( %this )
|
||||
{
|
||||
TribeWarriorBrowserGui.TDialogOpen = true;
|
||||
|
|
|
|||
|
|
@ -605,6 +605,39 @@ function StrToList(%listName, %str, %delim)
|
|||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function LC_BigList::onAdd(%this)
|
||||
{
|
||||
LC_BigList.addStyle( 1, "Univers", 12 , "150 150 150", "200 200 200", "60 60 60" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function LC_BigList::GetOnlineStatus(%this)
|
||||
{
|
||||
%this.key = LaunchGui.key++;
|
||||
%this.status = "getOnline";
|
||||
for(%oStat=0;%oStat<%this.RowCount();%oStat++)
|
||||
{
|
||||
if(%oStat == 0)
|
||||
%roster = %this.getRowID(%oStat);
|
||||
else
|
||||
%roster = %roster TAB %this.getRowID(%oStat);
|
||||
}
|
||||
databaseQuery(69,%roster, %this,%this.key);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function LC_BigList::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
||||
{
|
||||
if(%key != %this.key)
|
||||
return;
|
||||
switch$(%this.status)
|
||||
{
|
||||
case "getOnline": if(getField(%status,0) == 0)
|
||||
for(%str=0;%str<strLen(%resultString);%str++)
|
||||
{
|
||||
%this.setRowStyle( %str, !getSubStr(%resultString,%str,1) );
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function AddressDlg::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
||||
{
|
||||
if(%this.key != %key)
|
||||
|
|
@ -1235,9 +1268,6 @@ function EmailGui::dumpCache( %this )
|
|||
//-----------------------------------------------------------------------------
|
||||
function EmailGui::onSleep( %this )
|
||||
{
|
||||
// EMailGui.checkingEMail = false;
|
||||
// %this.checkSchedule = schedule(1000 * 0 * 1, 0, CheckEmail, true);
|
||||
Canvas.popDialog( LaunchToolbarDlg );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function EMailGui::getEmail(%this,%fromSchedule)
|
||||
|
|
|
|||
|
|
@ -38,6 +38,8 @@ $ForumColumnName[2] = "Date Posted";
|
|||
$ForumColumnRange[2] = "50 300";
|
||||
$ForumColumnCount++;
|
||||
|
||||
$GuidTribes = 0;
|
||||
|
||||
// format of a forum post is:
|
||||
// Post ID
|
||||
// Parent Post ID
|
||||
|
|
@ -70,10 +72,91 @@ if(!isObject(ForumsMessageVector))
|
|||
new MessageVector(ForumsMessageVector);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
if($GuidTribes == 0)
|
||||
{
|
||||
%ai = wonGetAuthInfo();
|
||||
$GuidTribes = getRecords(%ai,1);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function isModerator()
|
||||
{
|
||||
%result = 0;
|
||||
for(%checkID=0;%checkID<getField(getRecord($GuidTribes,0),0);%checkID++)
|
||||
{
|
||||
%vID = getField(getRecord($GuidTribes,1+%checkID),3);
|
||||
if(%vID == 11739 || %vID == 1401)
|
||||
%result = 1;
|
||||
}
|
||||
return %result;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function isT2Admin()
|
||||
{
|
||||
%result = 0;
|
||||
for(%checkID=0;%checkID<getField(getRecord($GuidTribes,0),0);%checkID++)
|
||||
{
|
||||
%vID = getField(getRecord($GuidTribes,1+%checkID),3);
|
||||
if(%vID == 1401)
|
||||
%result = 1;
|
||||
}
|
||||
return %result;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function updateTopicPageBtn(%prev,%next)
|
||||
{
|
||||
FTPrevBtn.setActive( %prev );
|
||||
FTNextBtn.setActive( %next );
|
||||
FTPrevBtn.setVisible( 0 );
|
||||
FTNextBtn.setVisible( 0 );
|
||||
// FTPrevBtn.setActive( %prev );
|
||||
// FTNextBtn.setActive( %next );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function updatePostBtn(%selectedID,%authorID)
|
||||
{
|
||||
// %selectedID = ForumsList.getSelectedID();
|
||||
|
||||
%vCanAdmin = 0;
|
||||
|
||||
FO_RejectBtn.visible = 0;
|
||||
FO_EditBtn.visible = 0;
|
||||
FO_AcceptBtn.visible = 0;
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_EditBtn.text = "EDIT";
|
||||
FO_AcceptBtn.text = "ACCEPT";
|
||||
|
||||
if(%selectedID == -1402)
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
|
||||
if(%authorID==getField(getRecord(wonGetAuthInfo(),0),3))
|
||||
%vCanAdmin = 1;
|
||||
|
||||
if(%selectedID < 0)
|
||||
{
|
||||
%selectedID = -%selectedID;
|
||||
for(%checkID=0;%checkID<getField(getRecord($GuidTribes,0),0);%checkID++)
|
||||
{
|
||||
if(getField(getRecord($GuidTribes,1+%checkID),3) == 1401)
|
||||
%vCanAdmin = 1;
|
||||
else if(%selectedID == getField(getRecord($GuidTribes,1+%checkID),3) && getField(getRecord($GuidTribes,1+%checkID),4) > 1)
|
||||
%vCanAdmin = 1;
|
||||
}
|
||||
|
||||
if(%selectedID == 1402)
|
||||
FO_AcceptBtn.setVisible(%vCanAdmin);
|
||||
}
|
||||
else
|
||||
{
|
||||
for(%checkID=0;%checkID<getField(getRecord($GuidTribes,0),0);%checkID++)
|
||||
{
|
||||
if(getField(getRecord($GuidTribes,1+%checkID),3) == 1401)
|
||||
%vCanAdmin = 1;
|
||||
else if(%selectedID == getField(getRecord($GuidTribes,1+%checkID),3) && getField(getRecord($GuidTribes,1+%checkID),4) > 1)
|
||||
%vCanAdmin = 1;
|
||||
}
|
||||
}
|
||||
|
||||
FO_EditBtn.setVisible(%vCanAdmin);
|
||||
FO_RejectBtn.setVisible(%vCanAdmin);
|
||||
canvas.repaint();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function DateStrCompare(%date1,%date2)
|
||||
|
|
@ -169,7 +252,6 @@ function CacheForumTopic()
|
|||
%newGroup = TopicsListGroup.getObject(ForumsTopicsList.getSelectedRow());
|
||||
ForumsMessageList.lastID = %newGroup.updateid;
|
||||
%latest = GetField(ForumsTopicsList.getRowTextbyID(ForumsTopicsList.getSelectedID()),3);
|
||||
|
||||
ForumsMessageVector.dump( $ForumCachePath @ "tpc" @ ForumsMessageVector.tid , ForumsMessageList.lastID TAB $ForumCacheVersion TAB %allRead TAB %latest);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -177,6 +259,7 @@ function ForumsAcceptPost()
|
|||
{
|
||||
%parentId = ForumsMessageList.getSelectedId();
|
||||
%text = ForumsMessageVector.getLineTextByTag(%parentId);
|
||||
%index = ForumsMessageVector.getLineIndexByTag( %parentId );
|
||||
%author = getRecord( %text, 4 );
|
||||
%dev = getLinkName(%author);
|
||||
%date = getRecord(%text, 5);
|
||||
|
|
@ -195,6 +278,8 @@ function ForumsAcceptPost()
|
|||
NewsPostBodyText.setValue("submitted by " @ %dev @ "\n\n" @ ForumsGetTextDisplay(%body));
|
||||
NewsPostDlg.postID = -1;
|
||||
NewsPostDlg.action = "News";
|
||||
NewsPostDlg.Findex = %index;
|
||||
NewsPostDlg.FromForums = true;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsEditPost()
|
||||
|
|
@ -260,7 +345,7 @@ function ForumsMessageAddRow(%text)
|
|||
%ref = getRecord(%text, 6);
|
||||
%oldRow = ForumsMessageList.getRowNumById(%id);
|
||||
%selId = ForumsMessageList.getSelectedId();
|
||||
|
||||
|
||||
if(!%selID)
|
||||
{
|
||||
%selID = ForumsGui.lastSelected;
|
||||
|
|
@ -315,9 +400,13 @@ function ForumsMessageAddRow(%text)
|
|||
break;
|
||||
}
|
||||
if(%i <= %rc)
|
||||
{
|
||||
ForumsMessageList.addRow(%id, %rowText, %i);
|
||||
}
|
||||
else
|
||||
{
|
||||
ForumsMessageList.addRow(%id, %rowText);
|
||||
}
|
||||
}
|
||||
ForumsMessageList.setRowStyleById( %id, !%isRead );
|
||||
|
||||
|
|
@ -445,7 +534,6 @@ function ForumsRejectPost() //forumsDeletePost()
|
|||
ForumsMessageList.key = LaunchGui.key++;
|
||||
ForumsMessageList.state = "deletePost";
|
||||
canvas.SetCursor(ArrowWaitCursor);
|
||||
// error("REJECT: " @ ForumsComposeDlg.parentPost);
|
||||
MessageBoxYesNo("CONFIRM", "Are you sure you wish to remove the selected post?",
|
||||
"DatabaseQuery(14," @ ForumsComposeDlg.parentPost @ "," @ ForumsMessagelist @ "," @ ForumsMessagelist.key @ ");", "canvas.SetCursor(defaultCursor);");
|
||||
}
|
||||
|
|
@ -468,7 +556,8 @@ function GetQuotedText()
|
|||
{
|
||||
if(ForumsComposeDlg.parentPost == 0)
|
||||
{
|
||||
ForumsBodyText.setValue("<spush><color:FFCCAA>ALL YOUR BASE ARE BELONG TO US<spop>\n\n");
|
||||
ForumsBodyText.setValue("");
|
||||
// ForumsBodyText.setValue("<spush><color:FFCCAA>ALL YOUR BASE ARE BELONG TO US<spop>\n\n");
|
||||
ForumsBodyText.MakeFirstResponder(1);
|
||||
ForumsBodyText.setCursorPosition(3600);
|
||||
}
|
||||
|
|
@ -504,32 +593,33 @@ function GetForumsList()
|
|||
//-----------------------------------------------------------------------------
|
||||
function GetTopicsList()
|
||||
{
|
||||
ForumsGui.key = LaunchGui.key++;
|
||||
ForumShell.setTitle($ForumsGetTopics);
|
||||
ForumsGui.state = "getTopicList";
|
||||
ForumsTopicsList.clear();
|
||||
canvas.SetCursor(ArrowWaitCursor);
|
||||
ForumsTopicsList.clear();
|
||||
ForumsTopicsList.clearList();
|
||||
DatabaseQueryArray(8,$currentForumPage,ForumsComposeDlg.forum,ForumsGui,ForumsGui.key,true);
|
||||
ForumsTopicsList.refreshFlag = 0;
|
||||
ForumsGui.key = LaunchGui.key++;
|
||||
ForumsGui.state = "getTopicList";
|
||||
DatabaseQueryArray(8,$currentForumPage,ForumsComposeDlg.forum,ForumsGui,ForumsGui.key,true);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function GetTopicPosts()
|
||||
{
|
||||
ForumsGui.key = LaunchGui.key++;
|
||||
ForumShell.setTitle($ForumsGetPosts);
|
||||
ForumsGui.state = "getPostList";
|
||||
canvas.SetCursor(ArrowWaitCursor);
|
||||
|
||||
ForumsThreadPane.setVisible(true);
|
||||
ForumsTopicsPane.setVisible(false);
|
||||
ForumsText.setValue("");
|
||||
|
||||
FO_TopicText.setValue(strupr(getField(ForumsTopicsList.getRowTextByID(ForumsComposeDlg.Topic),0)));
|
||||
ForumShell.setTitle($ForumsGetPosts);
|
||||
canvas.SetCursor(ArrowWaitCursor);
|
||||
ForumsGui.key = LaunchGui.key++;
|
||||
ForumsGui.state = "getPostList";
|
||||
ForumsText.setValue("");
|
||||
FO_TopicText.setValue(strupr(getField(ForumsTopicsList.getRowTextByID(ForumsComposeDlg.Topic),0)));
|
||||
|
||||
if(!ForumsComposeDlg.Topic)
|
||||
ForumsComposeDlg.topic = ForumsTopicsList.getSelectedID();
|
||||
|
||||
ForumsMessageList.clearList();
|
||||
ForumsMessageList.loadCache(getField(ForumsList.getRowTextByID(ForumsList.getSelectedID()),1));
|
||||
|
||||
if(ForumsMessageList.lastID == 0)
|
||||
{
|
||||
ForumsMessageVector.clear();
|
||||
|
|
@ -653,57 +743,6 @@ function ForumsGui::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
|||
|
||||
%this.bflag = %statFlag;
|
||||
|
||||
switch$ ( %this.bflag )
|
||||
{
|
||||
case 0:
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
case 1:
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
case 2:
|
||||
switch(%forumID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = true;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
FO_AcceptBtn.text = "ACCEPT";
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
case 3:
|
||||
switch(%forumID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = true;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
FO_AcceptBtn.text = "ACCEPT";
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
case 4:
|
||||
switch(%forumID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = true;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
FO_AcceptBtn.text = "ACCEPT";
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
}
|
||||
if(getField(%resultString,0)>0)
|
||||
{
|
||||
ForumShell.setTitle($ForumsGetPosts @ ": " @ getField(%resultString,0));
|
||||
|
|
@ -714,6 +753,7 @@ function ForumsGui::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
|||
else
|
||||
{
|
||||
%this.state = "done";
|
||||
ForumsMessageList.clearList();
|
||||
ForumsMessageList.loadCache(%forumID);
|
||||
}
|
||||
case "postNews":
|
||||
|
|
@ -829,6 +869,8 @@ function ForumsGui::onDatabaseRow(%this,%row,%isLastRow,%key)
|
|||
if(%isLastRow)
|
||||
{
|
||||
ForumsMessageVector.tid = ForumsTopicsList.getSelectedID();
|
||||
ForumsTopicsList.thread = TopicsListGroup.getObject(ForumsTopicsList.getSelectedRow());
|
||||
ForumsTopicsList.thread.updateID = %high;
|
||||
CacheForumTopic();
|
||||
ForumsMessageList.loadCache(ForumsTopicsList.getSelectedID());
|
||||
}
|
||||
|
|
@ -943,6 +985,8 @@ function ForumsTopicsList::onAdd( %this )
|
|||
%this.addStyle( 1, $ShellBoldFont, $ShellFontSize, "80 220 200", "30 255 225", "10 60 40" );
|
||||
// Add the "Ignored" style:
|
||||
%this.addStyle( 2, $ShellFont, $ShellFontSize, "100 100 100", "100 100 000", "100 100 100" );
|
||||
// Add the "LOCKED" style:
|
||||
%this.addStyle( 3, $ShellFont, $ShellFontSize, "200 50 50", "200 100 100", "200 50 50" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsTopicsList::AddTopic(%this, %id, %topicname, %date, %mid, %slevel, %vline)
|
||||
|
|
@ -987,9 +1031,26 @@ function TopicsPopupDlg::onWake( %this )
|
|||
{
|
||||
ForumsGui.TDialogOpen = true;
|
||||
TopicsPopupMenu.clear();
|
||||
TopicsPopupMenu.add( TopicsPopupMenu.topic.name SPC ": RESET CACHE", 0 );
|
||||
TopicsPopupMenu.add( TopicsPopupMenu.topic.name SPC ": IGNORE THIS TOPIC",1);
|
||||
TopicsPopupMenu.add( TopicsPopupMenu.topic.name SPC ": FLAG ALL READ",2);
|
||||
|
||||
TopicsPopupMenu.add( getSubstr(strupr(TopicsPopupMenu.topic.name),0,30) , -1);
|
||||
|
||||
for (%i = 0; %i < strlen(TopicsPopupMenu.topic.name)*2 && %i < 30; %i++)
|
||||
%line = %line @ "-";
|
||||
|
||||
TopicsPopupMenu.add(%line,-1);
|
||||
TopicsPopupMenu.add("Reset Cache", 0);
|
||||
TopicsPopupMenu.add("Flag Ignore", 1);
|
||||
TopicsPopupMenu.add("Flag All Read", 2);
|
||||
if(isModerator())
|
||||
TopicsPopupMenu.add(%line,-1);
|
||||
TopicsPopupMenu.add("Request Admin Review", 3);
|
||||
// TopicsPopupMenu.add("Unlock Topic", 5);
|
||||
if(isT2Admin())
|
||||
{
|
||||
TopicsPopupMenu.add("Lock Topic", 4);
|
||||
TopicsPopupMenu.add("Remove Topic", 10);
|
||||
}
|
||||
|
||||
Canvas.rePaint();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -1091,6 +1152,34 @@ function TopicsPopupMenu::onSelect( %this, %id, %text )
|
|||
ForumsTopicsList.UpdateReadStatus();
|
||||
// ForumsRefreshTopics();
|
||||
}
|
||||
case 3: //Request Admin Review
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "requestReview";
|
||||
%fieldData = ForumsList.getSelectedID() TAB ForumsTopicsList.getSelectedID() TAB getField(TopicsPopupMenu.topic.rcvrec,11);
|
||||
error("RR: " @ 60 TAB %fieldData);
|
||||
databaseQuery(60, %fieldData, TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
|
||||
case 4: //Lock Thread
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "lockTopic";
|
||||
%fieldData = TopicsPopupMenu.topic.id TAB "Locked at Admin Request";
|
||||
DatabaseQuery(66,%fieldData,topicsPopupDlg,topicsPopupDlg.key);
|
||||
case 5: //Unlock Thread
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 6: //Not Implemented
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 7: //Not Implemented
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 8: //Not Implemented
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 9: //Not Implemented
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 10: //Remove Topic
|
||||
TopicsPopupDlg.key = LaunchGui.key++;
|
||||
TopicsPopupDlg.state = "adminRemoveTopic";
|
||||
%fieldData = 0 TAB TopicsPopupMenu.topic.id TAB getField(TopicsPopupMenu.topic.rcvrec,11);
|
||||
error("RT: " @ 62 TAB %fieldData);
|
||||
databaseQuery(62, %fieldData, TopicsPopupDlg, TopicsPopupDlg.key);
|
||||
}
|
||||
canvas.popDialog(TopicsPopupDlg);
|
||||
}
|
||||
|
|
@ -1100,6 +1189,42 @@ function TopicsPopupDlg::onSleep(%this)
|
|||
ForumsGui.TDialogOpen = false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function TopicsPopupDlg::onDatabaseQueryResult(%this,%status,%recordCount,%key)
|
||||
{
|
||||
if(%this.key != %key)
|
||||
return;
|
||||
if(getField(%status,0)==0)
|
||||
if (%this.state $= "adminRemoveTopicPlus")
|
||||
{
|
||||
$EmailToAddress = getField(%status,3);
|
||||
$EmailCCAddress = "";
|
||||
switch(getField(%status,2))
|
||||
{
|
||||
case 1: $EmailSubject = "Policy Violation Warning";
|
||||
case 2: $EmailSubject = "Policy Violation Ban Notice : 24 hours";
|
||||
case 3: $EmailSubject = "Policy Violation Ban Notice : 48 hours";
|
||||
case 4: $EmailSubject = "Policy Violation Ban Notice : 72 hours";
|
||||
case 5: $EmailSubject = "Policy Violation Ban Notice : 7 Days";
|
||||
case 6: $EmailSubject = "Policy Violation Ban Notice : 30 Days";
|
||||
case 7: $EmailSubject = "Policy Violation Ban Notice : Indefinite";
|
||||
}
|
||||
EMailComposeDlg.state = "sendMail";
|
||||
Canvas.pushDialog(EmailComposeDlg);
|
||||
EmailBodyText.setValue("");
|
||||
Email_ToEdit.makeFirstResponder(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if(%this.state $= "lockTopic")
|
||||
{
|
||||
ForumsTopicsList.setRowStyle( getField(%recordCount,0), 3 );
|
||||
}
|
||||
MessageBoxOK("NOTICE",getField(%status,1));
|
||||
}
|
||||
else
|
||||
messageBoxOK("ERROR",getField(%status,1));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsTopicsList::onSetSortKey( %this, %sortKey, %isIncreasing )
|
||||
{
|
||||
$pref::Topics::SortColumnKey = %sortKey;
|
||||
|
|
@ -1167,6 +1292,28 @@ function ForumsTopicsList::updateReadStatus( %this )
|
|||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessageList::onAdd( %this )
|
||||
{
|
||||
new GuiControl(PostsPopupDlg) {
|
||||
profile = "GuiModelessDialogProfile";
|
||||
horizSizing = "width";
|
||||
vertSizing = "height";
|
||||
position = "0 0";
|
||||
extent = "640 480";
|
||||
minExtent = "8 8";
|
||||
visible = "1";
|
||||
setFirstResponder = "0";
|
||||
modal = "1";
|
||||
|
||||
new ShellPopupMenu( PostsPopupMenu ) {
|
||||
profile = "ShellPopupProfile";
|
||||
position = "0 0";
|
||||
extent = "0 0";
|
||||
minExtent = "0 0";
|
||||
visible = "1";
|
||||
maxPopupHeight = "200";
|
||||
noButtonStyle = "1";
|
||||
};
|
||||
};
|
||||
|
||||
// Add columns from the prefs:
|
||||
for ( %i = 0; %i < $ForumColumnCount; %i++ )
|
||||
%this.addColumn( %i,
|
||||
|
|
@ -1179,6 +1326,154 @@ function ForumsMessageList::onAdd( %this )
|
|||
%this.addStyle( 1, $ShellBoldFont, $ShellFontSize, "80 220 200", "30 255 225", "0 0 0" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessageList::AddPost(%this, %id, %postname, %authorID, %authorName, %date, %mid, %slevel, %vline)
|
||||
{
|
||||
if(!isObject(PostsListGroup))
|
||||
new SimGroup(PostsListGroup);
|
||||
%post = new scriptObject()
|
||||
{
|
||||
className = "TPost";
|
||||
Id = %id;
|
||||
name = %postname;
|
||||
author = %authorName;
|
||||
authorID = %authorID;
|
||||
date = %date;
|
||||
updateid = %mid;
|
||||
slevel = %slevel;
|
||||
rcvrec = %vline;
|
||||
};
|
||||
PostsListGroup.Add(%post);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessageList::ClearList()
|
||||
{
|
||||
if(isObject(PostsListGroup))
|
||||
PostsListGroup.Delete();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessageList::onRightMouseDown( %this, %column, %row, %mousePos )
|
||||
{
|
||||
ForumsMessageList.setSelectedRow(%row);
|
||||
PostsPopupMenu.post = PostsListGroup.getObject(%row);
|
||||
if ( trim(PostsPopupMenu.post.name) !$= "")
|
||||
{
|
||||
Canvas.pushDialog(PostsPopupDlg);
|
||||
PostsPopupMenu.position = %mousePos;
|
||||
PostsPopupDlg.onWake();
|
||||
PostsPopupMenu.forceOnAction();
|
||||
}
|
||||
else
|
||||
error( "Locate Error!" );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function PostsPopupDlg::onWake( %this )
|
||||
{
|
||||
ForumsGui.TDialogOpen = true;
|
||||
PostsPopupMenu.clear();
|
||||
PostsPopupMenu.add( strUpr(PostsPopupMenu.post.author),0);
|
||||
%line = "------------------------------------------------";
|
||||
%line2 = "................................................";
|
||||
PostsPopupMenu.add(%line,-1);
|
||||
PostsPopupMenu.add( "EMAIL", 1 );
|
||||
PostsPopupMenu.add( "ADD To BUDDYLIST",2);
|
||||
// PostsPopupMenu.add( "INVITE TO CHAT",3);
|
||||
// PostsPopupMenu.add( "INSTANT MESSAGE",4);
|
||||
// PostsPopupMenu.add( "FOLLOW TO GAME (if playing)",5);
|
||||
if(isModerator())
|
||||
{
|
||||
PostsPopupMenu.add(%line2,-1);
|
||||
PostsPopupMenu.add( getsubstr(PostsPopupMenu.post.name,0,20) SPC ": REQUEST ADMIN REVIEW",9);
|
||||
if(isT2Admin())
|
||||
PostsPopupMenu.add( getsubstr(PostsPopupMenu.post.name,0,20) SPC ": REMOVE POST",10);
|
||||
}
|
||||
Canvas.rePaint();
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function PostsPopupMenu::onSelect( %this, %id, %text )
|
||||
{
|
||||
// echo("TPM RECV: " @ %id TAB %text);
|
||||
switch( %id )
|
||||
{
|
||||
case 0: LinkBrowser( PostsPopupMenu.post.author , "Warrior");
|
||||
case 1: // 0 EMAIL Post Author
|
||||
LinkEMail(PostsPopupMenu.post.author);
|
||||
// MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 2: // 1 ADD Post Author to your BuddyList
|
||||
MessageBoxYesNo("CONFIRM","Add " @ PostsPopupMenu.post.author @ " to Buddy List?",
|
||||
"LinkAddBuddy(\"" @ PostsPopupMenu.post.author @ "\",TWBText,\"addBuddy\");","");
|
||||
// MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 3: // 2 INVITE Post Author To CHAT
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 4: // 3 IMSG Post Author
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 5: // 4 FOLLOW Post Author to game if is playing
|
||||
MessageBoxOK("NOTICE","Feature Not Yet Implemented");
|
||||
case 9: //Request Admin Review
|
||||
// FORUMID.TOPICID.POSTID.AUTHORID
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "requestPostReview";
|
||||
%fieldData = ForumsList.getSelectedID() TAB ForumsTopicsList.getSelectedID() TAB ForumsMessageList.getSelectedID() TAB PostsPopupMenu.post.authorID;
|
||||
databaseQuery(61, %fieldData, PostsPopupDlg, PostsPopupDlg.key);
|
||||
case 10: //Remove Post
|
||||
PostsPopupDlg.key = LaunchGui.key++;
|
||||
PostsPopupDlg.state = "adminRemovePost";
|
||||
%fieldData = 0 TAB ForumsList.getSelectedID() TAB ForumsTopicsList.getSelectedID() TAB ForumsMessageList.getSelectedID() TAB PostsPopupMenu.post.authorID;
|
||||
databaseQuery(63, %fieldData, PostsPopupDlg, PostsPopupDlg.key);
|
||||
}
|
||||
canvas.popDialog(PostsPopupDlg);
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function PostsPopupDlg::onSleep(%this)
|
||||
{
|
||||
ForumsGui.TDialogOpen = false;
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function PostsPopupDlg::onDatabaseQueryResult(%this,%status,%recordCount,%key)
|
||||
{
|
||||
if(%this.key != %key)
|
||||
return;
|
||||
if(getField(%status,0)==0)
|
||||
{
|
||||
%selRow = ForumsMessageList.getRowNumByID(PostsPopupMenu.post.id);
|
||||
if (%this.state $= "adminRemovePostPlus")
|
||||
{
|
||||
ForumsMessageVector.deleteLine( %selRow );
|
||||
ForumsMessageList.removeRow( %selRow );
|
||||
ForumsMessageList.setSelectedRow( %selRow );
|
||||
CacheForumTopic();
|
||||
$EmailToAddress = getField(%status,3);
|
||||
$EmailCCAddress = "";
|
||||
switch(getField(%status,2))
|
||||
{
|
||||
case 1: $EmailSubject = "Policy Violation Warning";
|
||||
case 2: $EmailSubject = "Policy Violation Ban Notice : 24 hours";
|
||||
case 3: $EmailSubject = "Policy Violation Ban Notice : 48 hours";
|
||||
case 4: $EmailSubject = "Policy Violation Ban Notice : 72 hours";
|
||||
case 5: $EmailSubject = "Policy Violation Ban Notice : 7 Days";
|
||||
case 6: $EmailSubject = "Policy Violation Ban Notice : 30 Days";
|
||||
case 7: $EmailSubject = "Policy Violation Ban Notice : Indefinite";
|
||||
}
|
||||
EMailComposeDlg.state = "sendMail";
|
||||
Canvas.pushDialog(EmailComposeDlg);
|
||||
EmailBodyText.setValue("");
|
||||
Email_ToEdit.makeFirstResponder(1);
|
||||
}
|
||||
else if (%this.state $= "requestPostReview")
|
||||
{
|
||||
MessageBoxOK("NOTICE",getField(%status,1));
|
||||
}
|
||||
else
|
||||
{
|
||||
ForumsMessageVector.deleteLine( %selRow );
|
||||
ForumsMessageList.removeRow( %selRow );
|
||||
ForumsMessageList.setSelectedRow( %selRow );
|
||||
CacheForumTopic();
|
||||
MessageBoxOK("NOTICE",getField(%status,1));
|
||||
}
|
||||
}
|
||||
else
|
||||
messageBoxOK("ERROR",getField(%status,1));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessageList::connectionTerminated(%this, %key)
|
||||
{
|
||||
|
|
@ -1189,66 +1484,13 @@ function ForumsMessageList::loadCache( %this, %forumTID)
|
|||
{
|
||||
ForumsMessageVector.clear();
|
||||
ForumsMessageList.clear();
|
||||
ForumsMessageVector.tid = %forumTID;
|
||||
switch( ForumsGui.bflag )
|
||||
{
|
||||
case 0:
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
case 1:
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
case 2:
|
||||
switch(%forumTID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = true;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
FO_AcceptBtn.visible = true;
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
case 3:
|
||||
switch(%forumTID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = true;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
FO_AcceptBtn.visible = true;
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
case 4:
|
||||
switch(%forumTID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = true;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
FO_AcceptBtn.visible = true;
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
}
|
||||
|
||||
ForumsMessageVector.tid = %forumTID;
|
||||
%this.lastId = 0;
|
||||
%this.highestUpdate = %this.lastID;
|
||||
%cacheFile = $ForumCachePath @ "tpc" @ ForumsComposeDlg.topic;
|
||||
%file = new FileObject();
|
||||
if ( %file.openForRead( %cacheFile ) )
|
||||
{
|
||||
// %newGroup = TopicsListGroup.getObject(ForumsTopicsList.getSelectedRow());
|
||||
if ( !%file.isEOF() )
|
||||
{
|
||||
// First line is the update id:
|
||||
|
|
@ -1276,22 +1518,6 @@ function ForumsMessageList::loadCache( %this, %forumTID)
|
|||
|
||||
// RESET THE FIELDS IF THE POST IS BEING VISITED BY THE AUTHOR.
|
||||
%ref = getRecord(%text,6);
|
||||
if(%ref > 1)
|
||||
{
|
||||
switch(%forumTID)
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = false;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
FO_AcceptBtn.visible = false;
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
}
|
||||
if(%this.allRead && DateStrCompare(%this.lastDate,%date))
|
||||
%text = setRecord( %text, 0, "1" );
|
||||
|
||||
|
|
@ -1312,6 +1538,24 @@ function ForumsMessageList::loadCache( %this, %forumTID)
|
|||
}
|
||||
if(ForumsMessageList.getSelectedId() == -1)
|
||||
ForumsMessageList.setSelectedRow(0);
|
||||
|
||||
for(%x=0;%x<%numLines;%x++)
|
||||
{
|
||||
%lineText = ForumsMessageVector.getLineTextbyTag( ForumsMessageList.getRowID(%x) );
|
||||
%ltID = getField(getRecord(%lineText,1),0);
|
||||
%ltSubject = getField(getRecord(%lineText,3),0);
|
||||
%ltAuthorID = getField(getRecord(%lineText,4),3);
|
||||
%ltAuthorName = getField(getRecord(%lineText,4),0);
|
||||
%ltDate = getField(getRecord(%lineText,5),0);
|
||||
%ltParentID = getField(getRecord(%lineText,2),0);
|
||||
|
||||
if(%ltParentID == 0)
|
||||
%ltParentID = %ltID;
|
||||
|
||||
%ltIsRead = getField(getRecord(%lineText,0),0);
|
||||
ForumsMessageList.addPost(%ltID, %ltSubject, %ltAuthorID, %ltAuthorName, %ltDate, %ltParentID, %ltIsRead, %lineText);
|
||||
}
|
||||
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessageList::onColumnResize( %this, %column, %newSize )
|
||||
|
|
@ -1346,39 +1590,7 @@ function ForumsMessageList::onSelect(%this, %id, %text)
|
|||
FO_NextBtn.setActive( true );
|
||||
FO_PreviousBtn.setActive( true );
|
||||
%ref = getRecord(%rawText,6);
|
||||
if(%ref > 0 && %ref > ForumsGui.bflag) //if this is the author
|
||||
{
|
||||
switch(getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),2))
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = false;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
FO_AcceptBtn.visible = false;
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = true;
|
||||
FO_EditBtn.visible = true;
|
||||
}
|
||||
}
|
||||
else if(ForumsGui.bflag == 0)
|
||||
{
|
||||
switch(getField(ForumsList.getRowTextbyID(ForumsList.getSelectedID()),2))
|
||||
{
|
||||
case 1402:
|
||||
FO_AcceptBtn.visible = false;
|
||||
FO_RejectBtn.text = "REJECT";
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
FO_AcceptBtn.visible = false;
|
||||
default:
|
||||
FO_RejectBtn.text = "DELETE";
|
||||
FO_RejectBtn.visible = false;
|
||||
FO_EditBtn.visible = false;
|
||||
}
|
||||
}
|
||||
|
||||
updatePostBtn(ForumsList.getSelectedID(),getField(getRecord(ForumsMessageVector.getLineTextbyTag(ForumsMessageList.getSelectedID()),4),3));
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function ForumsMessagelist::onDatabaseQueryResult(%this,%status,%resultString,%key)
|
||||
|
|
@ -1413,8 +1625,6 @@ function ForumsMessagelist::onDatabaseQueryResult(%this,%status,%resultString,%k
|
|||
ForumsTopicsList.refreshFlag = true;
|
||||
ForumsMessageVector.deleteLine( %index );
|
||||
CacheForumTopic();
|
||||
// ForumsMessageList.clear();
|
||||
// ForumsMessageList.loadCache();
|
||||
if ( %parent != 0 )
|
||||
{
|
||||
%row = ForumsMessageList.getRowNumById( %postId );
|
||||
|
|
|
|||
|
|
@ -4,14 +4,19 @@ addWebLink( "5 Assed Monkey", "www.5assedmonkey.com" );
|
|||
addWebLink( "Arc 2055", "www.arc2055.com" );
|
||||
addWebLink( "Atari Secret Society", "www.atarisecretsociety.org" );
|
||||
addWebLink( "BarrysWorld", "www.barrysworld.com" );
|
||||
addWebLink( "Bomb", "www.bomb.net" );
|
||||
addWebLink( "Clan Happytyme", "www.happytyme.com" );
|
||||
addWebLink( "ClanBase", "www.clanbase.com" );
|
||||
addWebLink( "ClanServ", "www.clanserv.com" );
|
||||
addWebLink( "Dopplegangers", "www.dopplegangers.com" );
|
||||
addWebLink( "Dutchbat Homeworld", "www.dutchbat-homeworld.com" );
|
||||
addWebLink( "EDome", "www.edome.net" );
|
||||
addWebLink( "Euro Tribesplayers", "www.euro-tribesplayers.com" );
|
||||
addWebLink( "eXtreme-Players", "www.eXtreme-players.de" );
|
||||
addWebLink( "Grave Diggers Union", "www.gravediggersunion.com" );
|
||||
addWebLink( "IanStorm", "www.ianstorm.com" );
|
||||
addWebLink( "IMGaming", "www.imgaming.com" );
|
||||
addWebLink( "Inquest Entertainment", "www.inguestentertainment.com" );
|
||||
addWebLink( "Long Dongles", "www.longdongles.com" );
|
||||
addWebLink( "MaxBaud.Net", "www.maxbaud.net" );
|
||||
addWebLink( "MoreGaming", "www.moregaming.com" );
|
||||
|
|
@ -20,14 +25,19 @@ addWebLink( "NGI", "www.ngi.it" );
|
|||
addWebLink( "PlanetTribes", "www.planettribes.com" );
|
||||
addWebLink( "Raging Angels", "www.ragingangels.org" );
|
||||
addWebLink( "Rogue Disciples", "www.roguedisciples.com" );
|
||||
addWebLink( "Supreme Tribes", "www.supremetribes.com" );
|
||||
addWebLink( "StrikeForce", "www.strikeforcecenter.com" );
|
||||
addWebLink( "TeamSound", "www.teamsound.com" );
|
||||
addWebLink( "Telepresence Heavy Assault Team", "www.that.co.nz" );
|
||||
addWebLink( "Temple of Blood", "www.templeofblood.com" );
|
||||
addWebLink( "The Ghostbear Tribe", "www.ghostbear.net" );
|
||||
addWebLink( "TribalWar", "www.tribalwar.com" );
|
||||
addWebLink( "Tribes2 Database", "www.tribes2database.com" );
|
||||
addWebLink( "ToKrZ", "www.tokrz.com" );
|
||||
addWebLink( "Tribes Attack", "www.tribesattack.com" );
|
||||
addWebLink( "Tribes Center", "www.tribescenter.com" );
|
||||
addWebLink( "Tribes 2 Database", "www.tribes2database.com" );
|
||||
addWebLink( "Tribes Gamers", "www.tribesgamers.com" );
|
||||
addWebLink( "TribesMaps", "www.tribesmaps.com" );
|
||||
addWebLink( "TribalWar", "www.tribalwar.com" );
|
||||
addWebLink( "Tribes Worlds", "www.tribesworlds.com" );
|
||||
addWebLink( "Tribes-Universe", "www.tribes-universe.com" );
|
||||
addWebLink( "WirePlay", "www.wireplay.com.au" );
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ function LaunchNews()
|
|||
//-----------------------------------------------------------------------------
|
||||
function updatePageBtn(%prev,%next)
|
||||
{
|
||||
NewsPrevBtn.setActive( %prev );
|
||||
NewsNextBtn.setActive( %next );
|
||||
NewsPrevBtn.setVisible( 0 );
|
||||
NewsNextBtn.setVisible( 0 );
|
||||
// NewsPrevBtn.setActive( %prev );
|
||||
// NewsNextBtn.setActive( %next );
|
||||
}
|
||||
//-----------------------------------------------------------------------------
|
||||
function NewsGui::onWake(%this)
|
||||
|
|
@ -228,8 +230,17 @@ function NewsPostDlg::onDatabaseQueryResult(%this, %status, %RowCount_Result, %k
|
|||
switch$(%this.state)
|
||||
{
|
||||
case "post":
|
||||
if(%this.FromForums)
|
||||
{
|
||||
%this.FromForums = false;
|
||||
ForumsMessageVector.deleteLine( %this.FIndex );
|
||||
ForumsTopicsList.refreshFlag = true;
|
||||
CacheForumTopic();
|
||||
ForumsGoTopics(0);
|
||||
}
|
||||
%this.state = "OK";
|
||||
MessageBoxOK("NOTICE","Your article has been submitted. You may need to refresh your Browser.");
|
||||
MessageBoxOK("NOTICE","Your article has been submitted. You may need to refresh your Browser.");
|
||||
|
||||
case "edit":
|
||||
%this.state = "OK";
|
||||
MessageBoxOK("NOTICE","Article Updated. You may need to refresh your Browser.");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue