Forums Index >> Modding >> Does /ban work on Macs?
Page : <1> :
The only thing I can think is that maybe macs don't allow the file to be written to with the /ban?
TT has a bug, that macs cannot append to a file. They can create a new file and write to it, but not append. Dash's script uses it. The chatlogger had the fix if I remember right, and so does ACAS (fix originaly created by me XD)...
So find this file in your dash codes:(admin code.cs)
If(%banlist.openForAppend($pref::Server::BanlistFile))
Try changing it too:
If(%banlist.macFileAppend($pref::Server::BanlistFile))
See if that works.
Here's the stuff I found in codes.cs:
Function bankick(%sender,%target_nm)
{
if(!ClientIsAdmin(%sender,"/ban command failed you are not admin"))
return;
%match = matchClientName(%target_nm);
%client = firstword(%match);
%status_msg = restWords(%match);
If(%client == -1)
{
schedule(1000,false,"CommandToClient", %sender,'CenterPrint', %status_msg,4,3);
return;
}
If(isobject(%client) )
{
%netAddress = %client.getAddress();
%ip = scrub_ip(%netAddress);
%banlist = new FileObject();
%nm = %client.nameBase;
if(%banlist.openForAppend("game/server/dash/banlist.cs"))
{
schedule(1000,false,"centerprintall",%nm SPC $pref::Server::BanAnnouncement, 4,3);
%banlist.writeLine(%nm@"|"@%ip);
%banlist.close();
%client.delete($pref::Server::BanMessage);
return;
}
else
{
schedule(1000,false,"commandToClient",'centerprint', "BAN FAILED,TRYING KICK ",4,4);
%client.delete("YOU HAVE BEEN KICKED FOR BAD BEHAVIOR.");
schedule(1000,false,"centerprintall",%nm SPC $pref::Server::KickAnnouncement, 4,3);
return;
}
}
schedule(1000,false,"commandToClient",%sender,'centerprint', "BAN FAILED",4,4);
}
---------
I changed the "openFor"
to "macFile"
and it didn't fix anything but also didn't break anything.
Thanks for the help. I don't really want to fix /ban on the Macs I just wondered if it worked for anybody else.
I don't thik that it does work for macs because of the bug art pointed out. Which version of dash codes do you have?
I found this in there as well,
function macFileAppend(%filePath,%msg)
{
%i = 0;
%file = new FileObject();
if(%file.openForRead(%filePath))
{
while(!%file.isEOF())
{
%line = %file.readLine();
%linenum[%i] = %line;
%i++;
}
}
else
{
echo("file:" SPC %file_path SPC "not valid");
return;
}
%file.close();
%i2 = 0;
if (%file.openForWrite(%filePath))
{
while(%i2 != %i)
{
%file.writeline(%linenum[%i2]);
%i2++;
}
%file.writeline(%msg);
}
%file.close();
Looks like dash created that function. Try adding that to the file?
I don't think dash created that function, as it's almost exactly like the one I created for ACAS, and seeing I was the first to create it, and then Warfare used it on his chatlogger... I'd supose you have Warfare's logger :)
Btw, you made a little mistake on pasting the whole function...
f
unction macFileAppend(%file_path,%msg)
{
%i = 0;
%file = new FileObject();
if(%file.openForRead(%file_path))
{
while(!%file.isEOF())
{
%line = %file.readLine();
%linenum[%i] = %line;
%i++;
}
}
else
{
echo("file:" SPC %file_path SPC "not valid");
return;
}
%file.close();
%i2 = 0;
if (%file.openForWrite(%file_path))
{
while(%i2 != %i)
{
%file.writeline(%linenum[%i2]);
%i2++;
}
%file.writeline(%msg);
}
%file.close();
}
Last edited: Wednesday, October 18, 2006 at 9:50:58 AM
Page : <1> :
I'm using dash's admin script and I've never been able to get /ban to work on my Mac. I can maually add IP addresses to the banlist.cs but not by using /ban in-game.
I have the chatlogger disabled because it causes lag. Could that be the problem?
Has anyone ever had the /ban work on a Mac dedicated server with dash's admin script?