[QUOTE=Robert64;28969066][QUOTE=Robber;28968829]Can it load MC levels? And yes, FP has been down for me too.[/QUOTE]
Not yet, I want to focus on getting entities in first and fixing a couple of bugs. But that's what I hope to achieve eventually.[/QUOTE]
I recently wrote a library for efficiently parsing NBT: [url=http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/SharpNbt.zip]SharpNbt.zip[/url]
Part of it is a bit unoptimized (search for //TODO), but otherwise it's working fine. Use whatever you like :smile:
[csharp]
private static void GetPrivateMembers(StreamWriter output, object scan, object lastLevel, bool iterate, int startLevel, int levels)
{
if (startLevel > levels)
{
return;
}
Type type = scan.GetType();
foreach (FieldInfo info in type.GetFields(BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.FlattenHierarchy))
{
object obj = type.InvokeMember(info.Name, BindingFlags.GetField | BindingFlags.NonPublic
| BindingFlags.Instance | BindingFlags.FlattenHierarchy, null, scan, null);
if (obj != null && obj != lastLevel)
{
output.WriteLine("".PadLeft(startLevel * 2) + info.Name + " : " + obj.GetType().FullName + " : " + obj.ToString());
switch (obj.GetType().FullName)
{
case "System.Int32[]":
int[] array = (int[])obj;
foreach (int item in array)
{
output.WriteLine(" ".PadLeft(startLevel * 2) + item.ToString());
}
break;
case "System.Char[]":
char[] array2 = (char[])obj;
foreach (char item in array2)
{
if (item != 0)
{
output.WriteLine(" ".PadLeft(startLevel * 2) + (int)item);
}
}
break;
case "System.Byte[]":
byte[] array3 = (byte[])obj;
foreach (byte item in array3)
{
if (item != 0)
{
output.WriteLine(" ".PadLeft(startLevel * 2) + (int)item);
}
}
break;
case "System.Int32":
case "System.Int64":
case "System.IntPtr":
case "System.Char":
case "System.Boolean":
case "System.String":
break;
default:
if (iterate && startLevel < levels)
{
GetPrivateMembers(output, obj, scan, true, startLevel + 1, levels);
}
break;
}
}
}
}
[/csharp]
Just a little cute code I wrote that makes a visual studio style field tree but just for privates. Quite a bit of the code is hacked together so do not expect this to be the best code in the world.
The usage is pretty simple but if you are having problems...
[csharp]
/// <summary>
/// Gets the private fields of a class and writes them to a file
/// </summary>
/// <param name="filename">The relative file path to write to</param>
/// <param name="scan">The object in question</param>
/// <param name="iterate">Should it iterate though the objects members</param>
/// <param name="iterate_levels">How many levels should it iterate through, do not make this more then about 100</param>
private static void GetPrivateMembers(string filename, object scan, bool iterate, int iterate_levels)
{
StreamWriter output = new StreamWriter("output.log");
GetPrivateMembers(output, scan, null, iterate, 0, iterate_levels);
output.Close();
}
[/csharp]
And here is some sample output from a StreamWriter...
[code]
stream : System.IO.FileStream : System.IO.FileStream
_fileName : System.String : c:\users\joshua\documents\visual studio 2010\Projects\PrivateDePrivate\PrivateDePrivate\bin\Debug\out.txt
_isAsync : System.Boolean : False
_canRead : System.Boolean : False
_canWrite : System.Boolean : True
_canSeek : System.Boolean : True
_exposedHandle : System.Boolean : False
_isPipe : System.Boolean : False
_readPos : System.Int32 : 0
_readLen : System.Int32 : 0
_writePos : System.Int32 : 0
_bufferSize : System.Int32 : 4096
_handle : Microsoft.Win32.SafeHandles.SafeFileHandle : Microsoft.Win32.SafeHandles.SafeFileHandle
handle : System.IntPtr : 916
_pos : System.Int64 : 0
_appendStart : System.Int64 : -1
encoding : System.Text.UTF8Encoding : System.Text.UTF8Encoding
emitUTF8Identifier : System.Boolean : False
isThrowException : System.Boolean : True
m_codePage : System.Int32 : 65001
m_deserializedFromEverett : System.Boolean : False
encoderFallback : System.Text.EncoderExceptionFallback : System.Text.EncoderExceptionFallback
bIsMicrosoftBestFitFallback : System.Boolean : False
decoderFallback : System.Text.DecoderExceptionFallback : System.Text.DecoderExceptionFallback
bIsMicrosoftBestFitFallback : System.Boolean : False
encoder : System.Text.UTF8Encoding+UTF8Encoder : System.Text.UTF8Encoding+UTF8Encoder
surrogateChar : System.Int32 : 0
charLeftOver : System.Char :
m_encoding : System.Text.UTF8Encoding : System.Text.UTF8Encoding
emitUTF8Identifier : System.Boolean : False
isThrowException : System.Boolean : True
m_codePage : System.Int32 : 65001
m_deserializedFromEverett : System.Boolean : False
encoderFallback : System.Text.EncoderExceptionFallback : System.Text.EncoderExceptionFallback
bIsMicrosoftBestFitFallback : System.Boolean : False
decoderFallback : System.Text.DecoderExceptionFallback : System.Text.DecoderExceptionFallback
bIsMicrosoftBestFitFallback : System.Boolean : False
m_mustFlush : System.Boolean : False
m_throwOnOverflow : System.Boolean : False
m_charsUsed : System.Int32 : 0
m_fallback : System.Text.EncoderExceptionFallback : System.Text.EncoderExceptionFallback
bIsMicrosoftBestFitFallback : System.Boolean : False
byteBuffer : System.Byte[] : System.Byte[]
charBuffer : System.Char[] : System.Char[]
72
101
108
108
111
44
32
87
111
114
108
100
13
10
charPos : System.Int32 : 14
charLen : System.Int32 : 1024
autoFlush : System.Boolean : False
haveWrittenPreamble : System.Boolean : False
closable : System.Boolean : True
mdaHelper : System.IO.MdaHelper : System.IO.MdaHelper
CoreNewLine : System.Char[] : System.Char[]
13
10
[/code]
@ everyone saying they use Linux
In my post I said "consumer" which I meant as average-Joe. Sorry, that's my fault; bad choice of words. Obviously you as programmers will be comfortable with editing config files and fixing things if/when they break.
The returns for netbooks from Samsung and Acer with Linux preloaded on were so high that they eventually stopped selling those SKUs and just sold solely XP Home. If you think about the "average" PC users who have Smiley Central, The Sims 2 and AntiVirus 2009 installed, they are a total morons and literally incapable of fixing all but the smallest problems.
This is why Linux will never catch on in the main stream; it's designed for people with logical minds who have a task to accomplish. Sadly, 80% of the population don't fall in to this category.
[QUOTE=CarlBooth;28971969]In my post I said "consumer" which I meant as average-Joe. Sorry, that's my fault; bad choice of words. Obviously you as programmers will be comfortable with editing config files and fixing things if/when they break.[/QUOTE]
My apologies then. If that's the case, then I would agree completely. Also, as much as I like Linux, I'm not sure that going mainstream exactly fits with its design goals. One of the things that makes it so attractive is how open it is, but without sacrificing that quality, it's difficult to make it user-friendly for the average-Joe.
[QUOTE=Vbits;28971955]
Just a little cute code I wrote that makes a visual studio style field tree but just for privates. Quite a bit of the code is hacked together so do not expect this to be the best code in the world.
The usage is pretty simple but if you are having problems...
[/QUOTE]
You can replace
[csharp]object obj = type.InvokeMember(info.Name, BindingFlags.GetField | BindingFlags.NonPublic
| BindingFlags.Instance | BindingFlags.FlattenHierarchy, null, scan, null);[/csharp]
with
[csharp]object obj = info.GetValue(scan);[/csharp]
[QUOTE=CarlBooth;28971969]Obviously you as programmers will be comfortable with editing config files and fixing things if/when they break.[/QUOTE]
Contrary to popular belief, things generally don't break unless you break them. (Or you use Gentoo)
Initial configuration can be a pain, but you don't need to do it very often. Linux doesn't suffer from crufty registry syndrome, so an install can last for several years.
[QUOTE=vepa;28971348]Personally I feel much more comfortable programming on a *nix platform ([b]easier to compile libraries & software, all the command-line utilities, cygwin just feels hacky, etc.[/b]), but the lack of some games I play and decent ATi drivers turned me back to Windows.
I don't think that a hacker counts as a regular "consumer".[/QUOTE]
This. Every time I try to compile something written in C++ I spend hours setting up the environment and fixing dependencies and most of the time it still doesn't work.
[editline]Black Magick Cake
Ingredients
1 3/4 cups all-purpose flour
2 cups white sugar
3/4 cup unsweetened cocoa powder
2 teaspoons baking soda
1 teaspoon baking powder
1 teaspoon salt
2 eggs
1 cup strong brewed coffee
1 cup buttermilk
1/2 cup vegetable oil
1 teaspoon vanilla extract
Directions
Preheat oven to 350 degrees F (175 degrees C). Grease and flour two 9 inch round cake pans or one 9x13 inch pan.
In large bowl combine flour, sugar, cocoa, baking soda, baking powder and salt. Make a well in the center.
Add eggs, coffee, buttermilk, oil and vanilla. Beat for 2 minutes on medium speed. Batter will be thin. Pour into prepared pans.
Bake at 350 degrees F (175 degrees C) for 30 to 40 minutes, or until toothpick inserted into center of cake comes out clean. Cool for 10 minutes, then remove from pans and finish cooling on a wire rack. Fill and frost as desired.
[/editline]
[QUOTE=ROBO_DONUT;28972192]Contrary to popular belief, things generally don't break unless you break them. (Or you use Gentoo)
Initial configuration can be a pain, but you don't need to do it very often. Linux doesn't suffer from crufty registry syndrome, so an install can last for several years.[/QUOTE]
Newer versions of windows don't do this either, it's just easier to install lots of garbage than on Linux.
[QUOTE=Tamschi;28972216]This. Every time I try to compile something written in C++ I spend hours setting up the environment and fixing dependencies and most of the time it still doesn't work.[/QUOTE]
It really depends on the information they give you. And it's all their fault as well. For example when you download this cool library that depends on boost to work and then you're using this old outdated tutorial(if there is any) which doesn't tell you which version of boost it worked with and then you have to CMake and git the doop de fucking doo
But I have yet to try linux, I'm not into that scene
I BROKE THE AUTOMERGE
I WIN!
[QUOTE=Tamschi;28972216] it's just easier to install lots of garbage than on Linux.[/QUOTE]
very debatable
I mean the number of packages I've installed for a one-off and then just left lying around by the package manager in some giant folder full of other shit I'll never find or remember again...
[QUOTE=CarlBooth;28971969]This is why Linux will never catch on in the main stream.[/QUOTE]
[url=http://en.wikipedia.org/wiki/Android_(operating_system)]It already has, but not in the way you'd think[/url].
[QUOTE=CarlBooth;28971969]This is why Linux will never catch on in the main stream.[/QUOTE]
[url=http://en.wikipedia.org/wiki/Android_(operating_system)]It already has, but not in the way you'd think[/url].
(fucking double posts!)
[QUOTE=vepa;28972516][url=http://en.wikipedia.org/wiki/Android_(operating_system)]It already has, but not in the way you'd think[/url].[/QUOTE]
Read my original post, I said Destkop OS.
[QUOTE=CarlBooth;28972583]Read my original post, I said Destkop OS.[/QUOTE]
I know, just saying.
[QUOTE=Catdaemon;28972432]very debatable
I mean the number of packages I've installed for a one-off and then just left lying around by the package manager in some giant folder full of other shit I'll never find or remember again...[/QUOTE]
It's a lot more common for software on Windows to register themselves somewhere as explorer plugins or to do this:
[img]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Systray.png[/img]
Five of these have no autorun setting.
[QUOTE=Tamschi;28972216]
Newer versions of windows don't do this either, it's just easier to install lots of garbage than on Linux.[/QUOTE]
You wouldn't believe how much useless shit was cluttering my $HOME before I organized it a couple of days ago :v:
[editline]3rd April 2011[/editline]
[QUOTE=Tamschi;28972799]It's a lot more common for software on Windows to do this:
[img_thumb]http://dl.dropbox.com/u/5013896/forum/Facepunch/Programming%20WAYWO/Systray.png[/img_thumb]
or register themselves somewhere as explorer plugins.[/QUOTE]
How is this even relevant..?
[QUOTE=ROBO_DONUT;28972192]Contrary to popular belief, things generally don't break unless you break them. (Or you use Gentoo)
Initial configuration can be a pain, but you don't need to do it very often. Linux doesn't suffer from crufty registry syndrome, so an install can last for several years.[/QUOTE]
You say that things dont break on their own, but even trying to install normal packages, display drivers and just using the default chat/msn client have all broken for me.
[QUOTE=Icedshot;28972902]You say that things dont break on their own, but even trying to install normal packages, display drivers and just using the default chat/msn client have all broken for me.[/QUOTE]
Only after using pacman for a while I realized how hilariously broken dpkg is.
Well, actually I sorta realized it after an update [B]broke the kernel[/B].
(No, I don't think Ubuntu builds a fallback kernel either)
I used ubuntu for several months working at an internship, and I found the experience quite pleasurable. The only times I had problems was when I was doing programmer stuff.
Sure, your average joe wouldn't have any clue how to solve the problems I ran into, but he also wouldn't have any clue how to create the problems I ran into.
[QUOTE=esalaka;28972801]You wouldn't believe how much useless shit was cluttering my $HOME before I organized it a couple of days ago :v:
[editline]3rd April 2011[/editline]
How is this even relevant..?[/QUOTE]
I was talking about garbage software that slows the system down. I use half of these only infrequently, but without autostart some of them don't run at all.
That crossed out phone uses 100 MB ram on standby and the messenger on the left is much worse.
The problem is not the memory, but that it loads all this stuff in the first place.
I need to throw away some files too, I only have 51 of 863 GB left on my largest partition.
I have nothing against Linux, I quite enjoyed using it the few times I bothered. The reason(s) I stick with Windows are simply that I've never had any serious problems with Windows (not with W7 at least) and the problems I have had have been really simple to fix. The main reason however is that if I WAS using some Linux distro, I'd have to keep Windows in my dual boot so I can still play games and so on. Considering how there's nothing on, say, Ubuntu that makes it significantly better to use for anything else, I don't find it worth the effort of dual booting. Might as well just boot straight into Windows where I can do everything I need to.
Eh, the only reason I don't use Linux is because I really have this dream of selling at least one game on steam, and doing all of my developing on linux would make that a bit more complicated than I really desire.
hey guys what are you working on
[img]http://i.imgur.com/7zNFc.png[/img]
right now you just mine for gold and use your rocket boots to fly back up to refuel (i'll add the refuel station in a bit..)
[QUOTE=CarlBooth;28971969]This is why Linux will never catch on in the main stream; it's designed for people with logical minds who have a task to accomplish. Sadly, 80% of the population don't fall in to this category.[/QUOTE]
[media]http://www.youtube.com/watch?v=2Q6gOm39V-s[/media]
Guys, we just had a page-long amicable discussion about the relative benefits of using Linux without a single flaming post.
Group hug.
linux sucks fags mac is better than anything else idiots fags dicks
[QUOTE=esalaka;28972971]Only after using pacman for a while I realized how hilariously broken dpkg is.[/QUOTE]
Pacman kicks ass but has one huge problem: no package signing!
Linux sucks for dual-monitors (ATi Drivers + Compositing = fuck you)
In other news, I just finished a system for a mini-scene graph inside actors in my engine so actors can be made out of collections of meshes and particles and shit! Not the most complicated thing in the world but I like how it works.
Here's a pretty shitty actor file to show how those things are defined.
[code]actor
{
node: model
{
model: Ogre.mesh
node: model
{
offset: 5 2 0
model: Ogre.mesh
node: model
{
offset: 5 2 0
model: Ogre.mesh
}
}
node: model
{
offset: 5 2 0
model: Ogre.mesh
}
}
}[/code]
Elegant to the minimum!
C++ coding project.
Rigid body physics simulation.
Sweep & prune broad phase collision detection technique using a hash table.
512 spheres used.
Time is O(n), where n is the number of object in the scene, oppose to O(n^3) with naive method, checking each and every object.
[media]http://www.youtube.com/watch?v=_uznn2HLHfc[/media]
Back on topic perhaps?
The sudden revival of the OS's people are working on has made me want to try out assembly.
Here is the result
[img]http://www.adamncasey.co.uk/upload/image/3089/d/o/[/img]
Yep, I'm manually typing all out all strings :smithicide:
understanding how to deal with strings is next on my list
Sorry, you need to Log In to post a reply to this thread.