Show Posts

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.


Topics - Xalos

Pages: 1 ... 3 4 5 6 7 [8] 9 10 11 12 13 ... 17
106
Modification Help / Naming is hard
« on: November 02, 2013, 07:00:37 PM »


I'm trying to figure out what to name the "Export" button (under Sort) that encompasses everything it actually does.

Does anyone have a name for it that encompasses everything that GUI up there at the top does?


I may also make a "Set Avatar" button that just sets your avatar to the copied data without having to save it first.

107
Suggestions & Requests / Default Admin Function Timeouts
« on: October 30, 2013, 08:16:32 PM »
Let's say I write a script that can do a few fairly simple things.

1.) It can tell if I have admin or not.
2.) It can tell if any Superadmins are on the server.
3.) It can get a list of all clients that are on the server and that are joining.


All of these are relatively simple things to do. Now I mate this up to an automatic banner.

Let's say a ban packet is sixteen bytes plus the length of its ASCII string.

The first byte is the packet type. In this case we'll say it's zero, for "command to server". Others could be "ping", "move", "trigger", so on.
The second and third bytes are a ushort representing the server command. In this case it's 'ban', which is 40.
The next four bytes are a presumably unsigned integer representing the object ID of the victim. We'll say it's 12345.
Then we have another integer, let's say it's signed this time, representing the Blockland ID of the victim. We'll say it's 11239.
The twelfth byte is the length of the victim's name, in this case 5.
Finally, we have another four bytes representing the ban time. Let's say it's -1 - which also means this one, at least, HAS to be a signed integer.

So here's what our final packet to ban that annoying Xalos might look like, in hexadecimal.
00 00 28 00 00 30 39 00 00 2B E7 05 58 61 6C 6F 73 FF FF FF FF

Let's take the worst case on the string and say that each player's name is 32 characters long. (The maximum displayed length for a server nameEDIT1 is 32, including host name, so that's where I'm getting this upper limit.) That means that we have 48 bytes per banned client. Multiplying 48 bytes byte 98 players (assuming a limit of 99 players and not banning ourselves), we get 4704 bytes, or ~4.6 kilobytes.

Assuming this host is working off a 56k modem (with 99 players?! WTF!!!), that means that I can ban every player on the server in roughly two thirds of a second - easily before any other admins can react to ban me. If I wrote the script to target admins first, then even slower network speeds could still be workable.


Now someone joins. My script instantly knows that they joined, and so bans them before they have time to even react. Any non-SAs are banned before they can ban me, meaning I can easily DoS a server by someone clicking the wrong button and giving me admin for what would have otherwise been only half a second.



TL;DR: We need a default timeout for bans.



Note that this post uses several assumptions, such as minimizing packet size for the /ban command but only to that of its (normal) userland arguments. If only the client ID were sent for clients which exist on the server, size could be reduced further. Since its arguments are actually transmitted as text, its actual size is probably much higher.

108
Off Topic / Atlas Park 33
« on: October 29, 2013, 05:04:37 PM »


City of Heroes was shut down eleven months ago, and yet I still want to log in and fly through Paragon City once more.

Anyone else on the forums a former Hero or Villain?


LONG LIVE THE CITY OF HEROES!!
VIVE LA VILLE DES HEROS!!
LANG LEBE DER STADT VON HELD!!

109
I'm trying to make an FTL gamemode that plays from the crew's prespectives, so I was wondering if it was possible to change a sound's volume while it's playing to make a mix track.

Is it possible or will I have to resort to hacky badness... again?

EDIT: Hurr this goes in Coding Help. WTF brain.

110
Modification Help / TorqueScript Authentication
« on: October 13, 2013, 02:43:06 AM »
I want to be able to authenticate a user logging into a service so that others can't get into his stuff. However, I also want to be able to have that same user be able to log into a webpage to view the same information.

The problem is that I ultimately come back to the same solution, which happens to be (as far as I can see) virtually impossible in TorqueScript - implement RSA or SSL into TorqueScript.


Does anyone have a method of authentication that will work for people logging in both from inside Blockland and from a webpage?
Or do I have to resort to hacky badness to get things working the way that I want?

111
Modification Help / Modular Roads
« on: October 04, 2013, 01:34:20 AM »
It may seem like the title "Modular Roads" means that whatever thing I'm talking about, it's redundant.
We already have modular roads - they're the default baseplate roads! Well, yeah, but that's not what I mean.




The default roads don't have any real way to make a parking lot - the roads themselves won't work, and if you try to connect to them then you're going to have a horrible-looking transition. So that leaves you with only one real option, which makes the brickcount shoot right up: Make your own roads.

For this pack, on the other hand, I plan to have pieces for pretty much everything you could think of - and if I don't cover something you need, there'll be a tab you can use for the parts of the road that don't line up otherwise - like the yellow and white lines on that road up there.


Also, these roads have the sidewalk elevated above the road itself. So realism. Yay!


Post thoughts/suggestions/comments/random flaming below.

112
Off Topic / Strange street sign
« on: September 22, 2013, 03:08:30 PM »
There's a very odd street sign I saw recently, bearing the text "YRNT SQZT APXL". Some of the letters were red, some blue. Google's stumped, and my theory is that it's the world's subtlest ARG.

Any ideas what it means?

113
Modification Help / [Resource] AI Recycler
« on: September 09, 2013, 05:17:26 AM »
There was and probably still is a problem wherein if you create too many AIConnections, even if you only ever have a few at a time, the server eventually crashes.

A long time ago, I made a solution for this problem but never actually released it. The solution is an AI Recycler. Instead of creating your own AI clients, you ask for one:

Code: (AI Recycler.cs) [Select]
package AIRecycler
{
function GameConnection::onDeath(%cl, %col, %killer, %damageType, %damageArea)
{
if(%cl.getClassName() $= "AIConnection")
{
if(!isObject(AIRecycler))
new SimSet(AIRecycler);
%cl.player.client = "";
if(%cl.recycleOnDeath)
%cl.recycle();
}
Parent::onDeath(%cl, %col, %killer, %damageType, %damageArea);
}
};
activatePackage("AIRecycler");

function CreateAIClient(%persistent)
{
if(AIRecycler.getCount() != 0)
{
%cl = AIRecycler.getObject(0);
%cl.recycleOnDeath = !%persistent;
AIRecycler.remove(%cl);
return %cl;
}
return new AIConnection() { recycleOnDeath = !%persistent; };
}

//.recycle courtesy of Greek2Me
function AiConnection::recycle(%this)
{
if(isObject(%this.minigame))
%this.minigame.removeMember(%this);

if(isObject(%this.camera))
%this.camera.delete();
if(isObject(%this.player))
%this.player.delete();
if(isObject(%this.tempBrick))
%this.tempBrick.delete();
if(isObject(%this.brickGroup) && %this.brickGroup.client == %this)
%this.brickGroup.client = -1;

%index = 0;
while((%field = %this.getTaggedField(%index)) !$= "")
{
//some fields cannot be changed once set.... Thanks, Badspot.
if(%lastField $= %field)
{
%index ++;
continue;
}
%lastField = %field;
%field = getField(%field,0);

//Prevent people from breaking things
if(%field !$= stripChars(%field," `~!@#$%^&*()-=+[{]}\\|;:\'\",<.>/?"))
{
error("ERROR (AiConnection::recycle): Invalid field! Skipping...");
%index ++;
continue;
}

eval(%this @ "." @ %field SPC "= \"\";");
}

if(!isObject(aiRecycler))
{
new SimSet(aiRecycler);
missionCleanup.add(aiRecycler);
}

aiRecycler.add(%this);
}


When you need a new AI client, you call "CreateAIClient();" instead of making your own. If you want the AI client to be persistent (AKA it's able to respawn like a player client without losing its statistics), call "CreateAIClient(1);" instead.

114
Drama / Betelgeuse (BL_ID: 12368)
« on: September 01, 2013, 01:49:14 AM »

Your spam is bad and you should feel bad!

I call grudge.

115
...well, one new brick and its mirrored counterpart.
As ever, I'm horrible at naming bricks. So I must ask you, once again: What are these bricks called?


I was bored so I made a lot of them.

116
I made the following test code to try setting up a simple TCP server.
Code: [Select]
new TCPObject(TCPListener);
$ListenOn = 31337;

function TCPListener::onConnectionRequest(%this, %addr, %id)
{ echo("Got a connection from {"@%addr@"}: "@%id); }
function TCPListener::onLine(%this, %line)
{ echo("Got line \""@%line@"\"."); }
TCPListener.listen($ListenOn);

new TCPObject(TCPTalker);

function TCPTalker::onConnected(%this)
{
echo("Successfully connected.");
%this.send("Test\r\n");
}

function TCPTalker::onDisconnect(%this)
{ echo("Got disconnected."); }

However, when I try to connect to the listener, I get this:
Quote from: Console
==>TCPTalker.connect("10.1.1.44:31337");
Successfully connected.
Got bad connected receive event.


Does anyone know what the problem is?

117
I have (non-looping) music that I want to play using Play2D when a specific event occurs. The problem is, I've already had to do some fiddling with the sounds to make sure all of them are under the one-megabyte limit (I think. Correct me if I'm wrong), so I don't want to have to convert them back to .wav unless absolutely necessary.

Is there any way to play a .ogg file without having it be looped?

118
Games / Airfix Dogfighter
« on: July 24, 2013, 02:01:38 AM »


Airfix Dogfighter is a game where you fly around a house, shooting enemy planes and tanks. You fire crayon missiles, drop marker bombs, and use battery tesla coils to crush your opposition (whichever it is; you can choose between the Allied and Axis campaigns). Despite being made thirteen years ago, it still runs just fine on a modern computer.

Does anyone here play ADF, or am I the only one?

119
Modification Help / Line distortion
« on: July 03, 2013, 02:02:56 PM »
I'm trying to implement a 'radar' for a gamemode I'm working on, but after testing it with a non-existant runway, I noticed that lines distort wildly if you get close to them.

Code: [Select]
%loc = vectorSub(DirRadarHUD.realPos[%i], %pos);
if((%ang = vectorDot(vectorNormalize(%loc), %for)) < 0.642787)
{ if(isObject(%dot = DirRadarHUD.dot[%i])) %toDelete[-1+%toDelete++] = %dot; continue; }
%rel = SC_Solve3DMatrix(%loc, %for, %left, %up);
if(%rel $= "Unsolvable")
{ %toDelete[-1+%toDelete++] = %dot; continue; }

//V1: Way, way off
//%mult = (%ang - 1) / -0.642787;
//%rel = vectorScale(getWords(%rel, 1, 2), %mult);

//V2: Distortion near dots
%rel = vectorNormalize(getWords(%rel, 1, 2));
%rel = getWords(%rel, 1, 2);

//V3: Mathematically the same as V2 -_-
//%len = vectorLen(getWords(%rel, 1, 2));
//%mag = vectorNormalize(getWord(%rel, 0) SPC %len);
//%rel = vectorScale(vectorNormalize(getWords(%rel, 1, 2)), getWord(%mag, 1));

%x = mFloatLength(getWord(%rel, 0) * -130.541, 0) + 110;
%y = mFloatLength(getWord(%rel, 1) * -130.541, 0) + 110;

%dot = DirRadarHUD.realDot[%i];
if(!isObject(%dot))
{
DirRadarHUD.add(%dot = new GuiBitmapCtrl()
{
position = (%x - 2) SPC (%y - 2);
extent = "4 4"; minExtent = "4 4";
bitmap = "Add-Ons/Client_SpaceRadar/Dot";
index = %i;
});
}
else %dot.resize(%x - 2, %y - 2, 4, 4);
%dot.setColor(DirRadarHUD.realColor[%i]);

Attached is an image of the runway. The runway is built of five straight lines. Note that two of the three visible here are clearly distorted into something normally known as a 'curve'.

I want these to be lines. Straight lines, not curved lines.


Any ideas on how to fix this?

120
Modification Help / RTBGS Invite Failed Message
« on: June 24, 2013, 11:25:59 PM »
ARGH, they all suck!!! FFFS

If you have any better ideas, post below.

Pages: 1 ... 3 4 5 6 7 [8] 9 10 11 12 13 ... 17