Re-adds some bits from the old templates that were missed when doing the BaseGame template.

This commit is contained in:
Areloch 2017-03-26 17:53:01 -05:00
parent 9c7b5eec73
commit ea595143e8
25 changed files with 3278 additions and 381 deletions

View file

@ -0,0 +1,41 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
function kick(%client)
{
messageAll( 'MsgAdminForce', '\c2The Admin has kicked %1.', %client.playerName);
if (!%client.isAIControlled())
BanList::add(%client.guid, %client.getAddress(), $Pref::Server::KickBanTime);
%client.delete("You have been kicked from this server");
}
function ban(%client)
{
messageAll('MsgAdminForce', '\c2The Admin has banned %1.', %client.playerName);
if (!%client.isAIControlled())
BanList::add(%client.guid, %client.getAddress(), $Pref::Server::BanTime);
%client.delete("You have been banned from this server");
}

View file

@ -33,6 +33,7 @@ function initServer()
exec( "data/clientServer/scripts/server/audio.cs" );
exec( "data/clientServer/scripts/server/commands.cs" );
exec( "data/clientServer/scripts/server/kickban.cs" );
exec( "data/clientServer/scripts/server/message.cs" );
exec( "data/clientServer/scripts/server/levelDownload.cs" );
exec( "data/clientServer/scripts/server/levelLoad.cs" );
@ -219,8 +220,11 @@ function destroyServer()
deleteDataBlocks();
// Save any server settings
%prefPath = getPrefpath();
echo( "Exporting server prefs..." );
export( "$Pref::Server::*", "data/clientServer/scripts/server/prefs.cs", false );
export( "$Pref::Server::*", %prefPath@"/serverPrefs.cs", false );
BanList::Export(%prefPath@"/banlist.cs");
// Increase the server session number. This is used to make sure we're
// working with the server session we think we are.