• 0

    posted a message on Omni Editor

    @midiway: Go

    I r, as long as I stay interested in it =). It would be coolest if other people helped too, it'll all be on github >.<. So far though, nobody has joined, so I'm solo :\, meaning that it will likely never be finished as I'll get bored with it.

    Anyways, it would be better if you loaded up both dlls and jar files

    http://stackoverflow.com/questions/8850202/use-jar-file-in-c-c

    Posted in: Third Party Tools
  • 0

    posted a message on Omni Editor

    How will plugging into the intellisense work? I'd also really love it to support use stuff, like Visual Studio does.

    Might you have a look at Antlr 4? It's not that difficult to do when using that, heh.

    Posted in: Third Party Tools
  • 0

    posted a message on Omni Editor

    Does this support plugins, like custom translators from some language to Galaxy? Furthermore, does it have support for highlighting keywords for those custom translators?

    Does this find user defined functions for the intellisense and what not?

    Probably going to do a Galaxy OO language using Antlr 4. This is a pretty cool tool, but it doesn't appear to support custom stuff atm :\.

    Galaxy OO current notes
    https://github.com/HiveWorkshop/Galaxy-Code/tree/master/Galaxy%20OO

    proof of concept for classes in Galaxy
    https://github.com/HiveWorkshop/Galaxy-Code/tree/master/Class%20Example

    edit
    would also be nice to support version control for teams, like git

    Posted in: Third Party Tools
  • 0

    posted a message on Gemini Project - Galaxy Editor dll Injector
    Quote from midiway: Go

    @nestharus: Go

    What are you talking about? Gemini has, in a sense, nothing to do with the Galaxy language, it is not a preprocessor or compiler or text-editor ...

    @Frizi: Go

    I am quite familiar with them, I use all my string in Unicode format, like L"My String Wooww"

    uh huh, Frizi just made it sound like he was updating this and taking over Galaxy or something ;o.

    eh nvm then =).

    Posted in: Third Party Tools
  • 0

    posted a message on Galaxy++ editor
    Quote from grim001: Go

    Cosmos is coming...

    Oh? It's probably going to be awesome since it's coming from you : ).

    Posted in: Third Party Tools
  • 0

    posted a message on Gemini Project - Galaxy Editor dll Injector
    Quote from Frizi: Go

    @nestharus: Go

    Err... wait. Cool heap allocator implementation, but this is more or less a galaxy library. You can post it as an asset.

    but, it'd be best supported in the background of a language so that you have nice syntax with it (treating pointers as arrays/scalars, etc). It's kind of eh to use memory read/write methods :\.

    Posted in: Third Party Tools
  • 0

    posted a message on Gemini Project - Galaxy Editor dll Injector

    For when you update, I think that the stuff like Galaxy should probably use something more like this for memory allocation/deallocation as it's much faster =).

    The array refs in SC2 are relatively useless since they are so static D:.

    Could actually do a sizeof thing here, though it could refer to the array size =).

    //debug purposes only
    void print(string msg) {
        TriggerDebugOutput(1, StringToText(msg), true);
    }
    
    static int[9] powers;
    static const int MEMORY_SIZE = 8192;
    static int[MEMORY_SIZE] memory;
    static byte[MEMORY_SIZE/8] deallocatedCollections;
    
    static const int TYPE_INT = 1;
    
    static int allocatedMemory = 0;
    static int freedMemory = 0;
    static int releasedMemory = 0;
    
    static bool initialized = false;
    
    static bool getDeallocated(int pointer) { return 1 == (deallocatedCollections[pointer/8]/powers[pointer%8])%2; }
    static void setDeallocated(int pointer, bool val) {
        //position: pointer/8
        //index: pointer%8
        //number: deallocatedCollections[position]
        //left: number/powers[index + 1]
        //middle: number/powers[index]%2
        //rightSize: powers[index]
        //right: number%rightSize
        //number = (left*2 + BoolToInt(val))*rightSize + right
        deallocatedCollections[pointer/8] = (deallocatedCollections[pointer/8]/powers[pointer%8 + 1]*2 + BoolToInt(val))*powers[pointer%8] + deallocatedCollections[pointer/8]%powers[pointer%8];
    }
    
    int read(int pointer) { return memory[pointer - TYPE_INT]; }
    void write(int pointer, int value) { memory[pointer - TYPE_INT] = value; }
    
    int getArraySize(int pointer) { return DataTableGetInt(true, "ARR_SIZE" + IntToString(pointer)); }
    static void setArraySize(int pointer, int size) { DataTableSetInt(true, "ARR_SIZE" + IntToString(pointer), size); }
    
    static int getMemorySize(int pointer) { return DataTableGetInt(true, "MEM_SIZE" + IntToString(pointer)); }
    static void setMemorySize(int pointer, int size) { DataTableSetInt(true, "MEM_SIZE" + IntToString(pointer), size); }
    
    static int getPosition(int pointer) { return DataTableGetInt(true, "HEAP_POSITION" + IntToString(pointer)); }
    static int getPointer(int position) { return DataTableGetInt(true, "HEAP_POINTER" + IntToString(position)); }
    static void setPosition(int pointer, int position) { DataTableSetInt(true, "HEAP_POSITION" + IntToString(pointer), position); }
    static void setPointer(int position, int pointer) { DataTableSetInt(true, "HEAP_POINTER" + IntToString(position), pointer); }
    
    static int getParentPosition(int position) { return position/2; }
    static int getLeftPosition(int position) { return position*2; }
    static int getRightPosition(int position) { return position*2 + 1; }
    
    static void link(int pointer, int pointerPosition) {
        setPointer(pointerPosition, pointer);
        setPosition(pointer, pointerPosition);
    }
    
    static void initialize() {
        if (!initialized) {
            initialized = true;
    
            powers[0] = 1;
            powers[1] = 2;
            powers[2] = 4;
            powers[3] = 8;
            powers[4] = 16;
            powers[5] = 32;
            powers[6] = 64;
            powers[7] = 128;
            powers[8] = 256;
        } //if
    }
    
    //debug purposes only
    void printMemory() {
        print("Used  Memory: " + IntToString(allocatedMemory - releasedMemory));
        print("Heap Size: " + IntToString(freedMemory));
    }
    
    static void bubbleUp(int pointer) {
        int pointerSize = getMemorySize(pointer);
        int pointerPosition = getPosition(pointer);
        int parentPosition = getParentPosition(pointerPosition);
        int parentPointer = getPointer(parentPosition);
    
        while (0 != parentPosition && getMemorySize(parentPointer) < pointerSize) {
            link(parentPointer, pointerPosition);
    
            pointerPosition = parentPosition;
            parentPosition = getParentPosition(pointerPosition);
            parentPointer = getPointer(parentPosition);
        }
    
        link(pointer, pointerPosition);
    }
    
    static void bubbleDown(int pointer) {
        int pointerSize  = getMemorySize(pointer);
        int pointerPosition = getPosition(pointer);
    
        int leftPosition = getLeftPosition(pointerPosition);
        int rightPosition = getRightPosition(pointerPosition);
    
        int leftPointer = getPointer(leftPosition);
        int rightPointer = getPointer(rightPosition);
    
        int leftSize = getMemorySize(leftPointer);
        int rightSize = getMemorySize(rightPointer);
    
        while ((0 != leftPointer && leftSize > pointerSize) || (0 != rightPointer && rightSize > pointerSize)) {
            if (0 == rightPointer || (0 != leftPointer && leftSize > rightSize)) {
                link(leftPointer, pointerPosition);
    
                pointerPosition = leftPosition;
            }
            else {
                link(rightPointer, pointerPosition);
    
                pointerPosition = rightPosition;
            }
    
            leftPosition = getLeftPosition(pointerPosition);
            rightPosition = getRightPosition(pointerPosition);
    
            leftPointer = getPointer(leftPosition);
            rightPointer = getPointer(rightPosition);
    
            leftSize = getMemorySize(leftPointer);
            rightSize = getMemorySize(rightPointer);
        }
    
        link(pointer, pointerPosition);
    }
    
    static void recycle(int pointerPosition) {
        int pointer = getPointer(freedMemory);
    
        setPointer(freedMemory, 0);
    
        link(pointer, pointerPosition);
    
        if (pointerPosition != 1) {
            bubbleUp(pointer);
        } //if
    
        bubbleDown(pointer);
    
        freedMemory = freedMemory - 1;
    }
    
    static void defragment(int pointer) {
        int pointerPosition = getPosition(pointer);
        int size = getMemorySize(pointer);
        int mergeSize;
    
        if (0 != pointer && getDeallocated(pointer - 1)) {
            setDeallocated(pointer, false);
            setMemorySize(pointer, 0);
    
            mergeSize = getMemorySize(pointer - 1);
            TriggerDebugOutput(1, StringToText("(") + IntToText(pointer - mergeSize) + StringToText(" .. ") + IntToText(pointer - 1) + StringToText(") + (") + IntToText(pointer) + StringToText(" .. ") + IntToText(pointer + size - 1) + StringToText(")"), true);
            size = size + mergeSize;
    
            if (1 < mergeSize) {
                setDeallocated(pointer - 1, false);
                setMemorySize(pointer - 1, 0);
            } //if
    
            pointer = pointer - mergeSize;
    
            recycle(getPosition(pointer));
        }
    
        if (pointer + size < MEMORY_SIZE && getDeallocated(pointer + size)) {
            setDeallocated(pointer + size - 1, false);
            setMemorySize(pointer + size - 1, 0);
    
            mergeSize = getMemorySize(pointer + size);
            TriggerDebugOutput(1, StringToText("(") + IntToText(pointer) + StringToText(" .. ") + IntToText(pointer + size - 1) + StringToText(") + (") + IntToText(pointer + size) + StringToText(" .. ") + IntToText(pointer + size + mergeSize - 1) + StringToText(")"), true);
            size = size + mergeSize;
    
            if (1 < mergeSize) {
                setDeallocated(pointer + size, false);
                setMemorySize(pointer + size, 0);
            } //if
    
            recycle(getPosition(pointer + size));
        }
    
        setMemorySize(pointer, size);
        setMemorySize(pointer + size - 1, size);
    
        link(pointer, pointerPosition);
    
        bubbleUp(pointer);
    }
    
    int allocate(int size) {
        int pointer = getPointer(1);
        int memorySize = getMemorySize(pointer);
    
        int pointerPosition;
    
        initialize();
    
        if (0 == freedMemory || memorySize < size) {
            if (allocatedMemory + size >= MEMORY_SIZE) {
                TriggerDebugOutput(1, StringToText("ALLOCATE OVERFLOW"), true);
                return 0;
            } //if
    
            pointer = allocatedMemory;
            allocatedMemory = allocatedMemory + size;
        } //if
        else {
            setMemorySize(pointer, 0);
            setDeallocated(pointer, false);
    
            setMemorySize(pointer + size, memorySize - size);
            setMemorySize(pointer + memorySize - 1, memorySize - size);
    
            if (0 == memorySize - size) {
                recycle(1);
    
                setDeallocated(pointer + memorySize - 1, false);
            }
            else {
                link(pointer + size, 1);
                setDeallocated(pointer + size, true);
    
                bubbleDown(pointer + size);
            }
    
            releasedMemory = releasedMemory - size;
        }
    
        pointer = pointer + TYPE_INT;
        setArraySize(pointer, size);
    
        return pointer;
    }
    
    void deallocate(int pointer) {
        int size = getArraySize(pointer);
    
        pointer = pointer - TYPE_INT;
        
        if (0 == size) {
            TriggerDebugOutput(1, StringToText("ATTEMPT TO DEALLOCATE NULL POINTER"), true);
            return;
        } //if
    
        setMemorySize(pointer, size);
        setArraySize(pointer + TYPE_INT, 0);
    
        releasedMemory = releasedMemory + size;
    
        freedMemory = freedMemory + 1;
        link(pointer, freedMemory);
        bubbleUp(pointer);
    
        setDeallocated(pointer, true);
        setDeallocated(pointer + size - 1, true);
    
        setMemorySize(pointer + size - 1, size);
    
        defragment(pointer);
    }
    
    Posted in: Third Party Tools
  • 0

    posted a message on How to make can anti-block

    The idea of the unit anti blocker doesn't work. A person can just build/sell.

    Try using A* Pathing Algorithm. If there is no path between 2 points, then the path is blocked.

    Posted in: Triggers
  • 0

    posted a message on [Library] STARCODE v1.4

    There are actually some really good encryption algorithms for wc3 that you could use in this (granted you rewrite them in Galaxy or w/e). There are also some new compression techniques =).

    http://www.hiveworkshop.com/forums/jass-functions-413/snippet-scrambler-189766/ http://www.hiveworkshop.com/forums/spells-569/encoder-3-0-1-2-a-189883

    Also, it might be smart to run this on something like a BigInt. Rather than doing math with strings, you can do it with arrays digit by digit ; ). That'll truly pack as much data as possible into the code ; P.

    Furthermore, look at Encoder's tree structure. StarCode could be drastically improved by moving to a tree structure =).

    And Scrambler would work on numbers like 60 with passwords that were the same towards the start ;P. It also scrambles better since it scrambles in a set of different bases.

    There are still many improvements that can be made to your resource ;p.

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on [Library] STARCODE v1.4

    I'm just saying that since there is no overhead in the code size, you could just add an Encrypt function or w/e over a Convert function or something.

    I guess the overall architecture would need to change a bit to promote modularity ; ).

    I know with something I was working on, I just had number stacks that could have their bases converted, meaning you could really do w/e.

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on [Library] STARCODE v1.4

    thus making it extremely difficult to decrypt without increasing the code size, even with the base key ;).

    Posted in: Trigger Libraries & Scripts
  • 0

    posted a message on [Library] STARCODE v1.4

    Could you generate a set of keys based on a cipher and encrypt the thing with those keys?

    Here is my precise thought-
    you have your base (like base 87)
    You have a cipher (like the person's account name)
    For each character of the code, you do an algorithm using the current base and the cipher

    For example, first base would be a base derived from the default base and the cipher and applied to character 1 of the code. The next base would be derived from the previous base and the cipher and applied to character 2, etc.

    After this point, you do shuffling by putting the code into a uniform matrix + a linear matrix (anything extra after uniform is just put into the line). You go in steps of 2x2 matrices and rotate each one clockwise/counter clockwise (including the linear matrix, which would make each matrix like a 2x2 + 1 matrix). You would go column by column, row by row, so like..

    column+=add;
    if (column == matrixSize-1 || column == 0) { add*=-1; column+= add; row+=add2; if (row == matrixSize-1 || row == 0) { add2*=-1; row+=add; } }

    Posted in: Trigger Libraries & Scripts
  • To post a comment, please or register a new account.