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.


Messages - jesus

Pages: [1]
1
Staff Applications / jesus's staff application!
« on: August 01, 2012, 01:54:32 pm »


In-game Name: jesus

How long have you been apart of densitypk?: 1 day! but i have recently owned a server!

Why do you think you should be staff?: i have plenty of coding, owner, co owner, admin ,and mod experience! i can code fairly well!

What time-zone are you?: i live in the u.s. texas!

Extra info that says you should be staff?:ok here is some of the coding i do...
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.DataInputStream;
import java.io.BufferedWriter;
import java.io.FileWriter;

public class EconomyReset
{

private static File charDir = new File("Data/characters/");

public static void main(String[] args)
{
if(charDir.exists() && charDir.isDirectory())
{
File[] charFiles = charDir.listFiles();
for(int i = 0; i < charFiles.length; i++)
{
resetEcoChar(charFiles);
System.out.println("Reset player economy levels for... "+charFiles.toString());
}
}
}

private static void resetEcoChar(File charFile)
{
try
{

String cheatStatus, tempData, tempAdd = ""; int curEquip = 0, curItem = 0, curBank = 0;
File tempCharFile = new File(charDir.toString()+"ECOBOOST$TEMP");
DataInputStream fileStream = new DataInputStream(new FileInputStream(charFile));
BufferedWriter tempOut = new BufferedWriter(new FileWriter(tempCharFile));

while((tempData = fileStream.readLine()) != null)
{
if((!tempData.trim().startsWith("character-item =")) && (!tempData.trim().startsWith("character-bank =")))
{
tempAdd = tempData.trim();

if(tempData.trim().startsWith("character-equip ="))
{
tempAdd = "character-equip = "+curEquip+"\t-1\t0";
curEquip++;
}
tempOut.write(tempAdd); tempOut.newLine();
}
}
fileStream.close(); tempOut.close();
charFile.delete();
tempCharFile.renameTo(charFile);
}
catch(Exception e) { e.printStackTrace();
}
}
}

Thanks,
Tamethefame.





Pages: [1]