Search in sources :

Example 11 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project service-proxy by membrane.

the class StreamInfo method receivedEndStream.

public synchronized void receivedEndStream(boolean fromDataFrame) {
    if (state == StreamState.OPEN)
        setState(StreamState.HALF_CLOSED_REMOTE);
    if (state == StreamState.HALF_CLOSED_LOCAL)
        setState(StreamState.CLOSED);
    if (!fromDataFrame) {
        // fake 0-length data frame so that the body is terminated
        Frame frame = new Frame();
        frame.fill(TYPE_DATA, FLAG_END_STREAM, streamId, null, 0, 0);
        dataFramesReceived.add(frame.asData());
    }
}
Also used : DataFrame(com.predic8.membrane.core.transport.http2.frame.DataFrame) Frame(com.predic8.membrane.core.transport.http2.frame.Frame)

Example 12 with Frame

use of dev.hypnotic.ui.clickgui2.frame.Frame in project Hypnotic-Client by Hypnotic-Development.

the class SaveLoad method load.

public void load() {
    ArrayList<String> lines = new ArrayList<String>();
    try {
        BufferedReader reader = new BufferedReader(new FileReader(this.dataFile));
        String line = reader.readLine();
        while (line != null) {
            lines.add(line);
            line = reader.readLine();
        }
        reader.close();
    } catch (Exception e) {
        e.printStackTrace();
    }
    for (String s : lines) {
        String[] args = s.split(":");
        if (s.toLowerCase().startsWith("mod:")) {
            Mod m = ModuleManager.INSTANCE.getModuleByName(args[1]);
            if (m != null) {
                m.setKey(Integer.parseInt(args[3]));
            }
        } else if (s.toLowerCase().startsWith("friend:")) {
            FriendManager.INSTANCE.add(new Friend(args[1]));
        } else if (s.toLowerCase().startsWith("frame:")) {
            for (Frame frame : ClickGUI.INSTANCE.frames) {
                if (frame.name.equalsIgnoreCase(args[1])) {
                    frame.setX(Integer.parseInt(args[2]));
                    frame.setY(Integer.parseInt(args[3]));
                    frame.setExtended(Boolean.parseBoolean(args[4]));
                }
            }
            HudEditorScreen.INSTANCE.frame.setX(Integer.parseInt(args[2]));
            HudEditorScreen.INSTANCE.frame.setY(Integer.parseInt(args[3]));
            HudEditorScreen.INSTANCE.frame.setExtended(Boolean.parseBoolean(args[4]));
        } else if (s.toLowerCase().startsWith("waypoint:")) {
            for (Waypoint waypoint : WaypointManager.INSTANCE.waypoints) {
                if (waypoint.getName().equalsIgnoreCase(args[1])) {
                    int x = Integer.parseInt(args[2]);
                    int y = Integer.parseInt(args[3]);
                    int z = Integer.parseInt(args[4]);
                    waypoint.setX(x);
                    waypoint.setY(y);
                    waypoint.setZ(z);
                    waypoint.setPos(new BlockPos(x, y, z));
                }
            }
        } else if (s.toLowerCase().startsWith("clickgui:")) {
            dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.x = Integer.parseInt(args[2]);
            dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.y = Integer.parseInt(args[4]);
        } else if (s.toLowerCase().startsWith("settingpos:")) {
            for (ModuleButton mb : dev.hypnotic.ui.clickgui.ClickGUI.INSTANCE.buttons) {
                if (mb.mod.name.equalsIgnoreCase(args[1])) {
                    mb.settingsWindow.x = Integer.parseInt(args[3]);
                    mb.settingsWindow.y = Integer.parseInt(args[5]);
                }
            }
        }
    /*else if (s.toLowerCase().startsWith("message:")) {
            	ModuleManager.INSTANCE.chatSpammer.custom.add(args[1]);
            }*/
    }
}
Also used : Frame(dev.hypnotic.ui.clickgui2.frame.Frame) Mod(dev.hypnotic.module.Mod) ArrayList(java.util.ArrayList) IOException(java.io.IOException) FileNotFoundException(java.io.FileNotFoundException) Friend(dev.hypnotic.config.friends.Friend) ModuleButton(dev.hypnotic.ui.clickgui.ModuleButton) BufferedReader(java.io.BufferedReader) FileReader(java.io.FileReader) Waypoint(dev.hypnotic.waypoint.Waypoint) BlockPos(net.minecraft.util.math.BlockPos)

Aggregations

Frame (com.predic8.membrane.core.transport.http2.frame.Frame)9 HeadersFrame (com.predic8.membrane.core.transport.http2.frame.HeadersFrame)4 ArrayList (java.util.ArrayList)4 Frame (dev.hypnotic.ui.clickgui2.frame.Frame)3 SettingsFrame (com.predic8.membrane.core.transport.http2.frame.SettingsFrame)2 Friend (dev.hypnotic.config.friends.Friend)2 Mod (dev.hypnotic.module.Mod)2 Waypoint (dev.hypnotic.waypoint.Waypoint)2 FileNotFoundException (java.io.FileNotFoundException)2 IOException (java.io.IOException)2 Message (com.predic8.membrane.core.http.Message)1 Request (com.predic8.membrane.core.http.Request)1 Response (com.predic8.membrane.core.http.Response)1 AbstractHttpHandler.generateErrorResponse (com.predic8.membrane.core.transport.http.AbstractHttpHandler.generateErrorResponse)1 DataFrame (com.predic8.membrane.core.transport.http2.frame.DataFrame)1 EndOfStreamException (com.predic8.membrane.core.util.EndOfStreamException)1 HeaderListener (com.twitter.hpack.HeaderListener)1 HudModule (dev.hypnotic.module.hud.HudModule)1 ModuleButton (dev.hypnotic.ui.clickgui.ModuleButton)1 BufferedReader (java.io.BufferedReader)1