46
Modification Help / Differences between SimSets and SimGroups?
« on: July 05, 2012, 11:38:28 PM »
as far as I can tell they are identical. am i missing something?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Bump with V2.
I've repaired the issue that wordy pointed out, and apparently the add-on was nested.
so, that means that the file structure was this
Tool_Ownershipper.zip
-Tool_Ownershipper - Folder
--server.cs
--description.txt
instead of this
Tool_Ownershipper.zip
-server.cs
-description.txt
fascinating that no one complained, cause that usually prevents add-ons from executing.
for(%i = 99; %i > 0; %i--)
{
%n = %i-1;
if(%i == 1)
echo(%i SPC "bottle of beer on the wall ~");
else
echo(%i SPC "bottles of beer on the wall ~");
echo("Take one down, pass it around,");
if(%n == 1)
echo(%n SPC "bottle of beer on the wall.");
else
echo(%n SPC "bottles of beer on the wall.");
}
%file = new fileObject();
%file.openForRead(%filepath);
while(!%file.isEOF())
$allfile = $allfile @ %file.readline();
%file.close();
%file.delete();
////////////////////////////////////////
// Base64 Pack by Truce //
////////////////////////////////////////
function convertBase(%val,%atype,%btype)
{
%vlen = strLen(%val);
%alen = strLen(%atype);
%blen = strLen(%btype);
for(%i = 0; %i < %vlen; %i++)
%sum += striPos(%atype,getSubStr(%val,%i,1)) * mPow(%alen,%vlen - %i - 1);
while(1)
{
%rem = %sum % %blen;
%new = getSubStr(%btype,%rem,1) @ %new;
%sum = mFloor(%sum / %blen);
if(!%sum)
break;
}
return %new;
}
function base64Encode(%str)
{
%base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
%asciimap = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" @
"OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
%len = strLen(%str);
for(%i = 0; %i < %len; %i++)
{
%chr = getSubStr(%str,%i,1);
%ascii = strPos(%asciimap,%chr) + 32;
%bin = convertBase(%ascii,"0123456789","01");
while(strLen(%bin) < 8)
%bin = "0" @ %bin;
%all = %all @ %bin;
}
%len = strLen(%all);
for(%i = 0; %i < %len; %i += 6)
{
%pack = getSubStr(%all,%i,6);
while(strLen(%pack) < 6)
%pack = %pack @ "0";
%dec = convertBase(%pack,"01","0123456789");
%new = %new @ getSubStr(%base64map,%dec,1);
}
while(strLen(%new) % 4 > 0)
%new = %new @ "=";
return %new;
}
function base64Decode(%str)
{
%base64map = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
%asciimap = " !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMN" @
"OPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
while(getSubStr(%str,strLen(%str) - 1,1) $= "=")
%str = getSubStr(%str,0,strLen(%str) - 1);
%len = strLen(%str);
for(%i = 0; %i < %len; %i++)
{
%chr = getSubStr(%str,%i,1);
%pos = strPos(%base64map,%chr);
%bin = convertBase(%pos,"0123456789","01");
while(strLen(%bin) < 6)
%bin = "0" @ %bin;
%all = %all @ %bin;
}
while(strLen(%all) % 8 > 0)
%all = getSubStr(%all,0,strLen(%all) - 1);
%len = strLen(%all);
for(%i = 0; %i < %len; %i += 8)
{
%bin = getSubStr(%all,%i,8);
%dec = convertBase(%bin,"01","0123456789") - 32;
%chr = getSubStr(%asciiMap,%dec,1);
%new = %new @ %chr;
}
return %new;
}
new TCPObject(lugsTCPServ);
function lugsTCPServ::onConnectRequest(%this, %ip, %socket)
{
if(isObject(%this.connection[%ip]))
{
echo(%this.getName() @ ": Got duplicate connection from" SPC %ip);
%this.connection[%ip].disconnect();
%this.connection[%ip].delete();
}
echo(%this.getName() @ ": Creating connection to" SPC %ip);
%this.connection[%ip] = new TCPobject("Client", %socket) { class = lugsTCPServ; parent = %this;};
}
function lugsTCPServ::onConnected(%this)
{
echo("SRVR:Connected");
}
function lugsTCPServ::onConnectFailed(%this)
{
echo("SRVR:Connection Failed");
}
function lugsTCPServ::onDisconnect(%this)
{
echo("SRVR:Disconnected");
}
function lugsTCPServ::onLine(%this, %line)
{
echo(%this);
echo(%line);
%mode = getword(%line, 0);
echo(%mode);
%msg = strReplace(%line, getword(%line, 0), "");
echo(%msg);
switch$(%mode)
{
case "CHAT:":
echo("SRVR:CHAT:" SPC %msg);
case "WARNMSG":
warn("SRVR:WARN:" SPC %msg);
default:
echo("SRVR:Message received, unknown mode:" SPC %line);
}
return;
}
lugsTCPServ.listen(8675);