Skip to content

Instantly share code, notes, and snippets.

View neikeq's full-sized avatar
🪐
Working from Saturn

Ignacio Roldán Etcheverry neikeq

🪐
Working from Saturn
  • Madrid
View GitHub Profile
@neikeq
neikeq / compression.py
Last active November 19, 2016 18:07
Compress and decompress KicksOnline resources. Requires package: https://gist.github.com/neikeq/211f7826d3589a641c0b#file-bwriter-py
import zlib
from bwriter import BinaryWriter
class Compressor:
header_version = 108311
header_len = 48
header = [
@neikeq
neikeq / breader.py
Last active August 29, 2015 14:13
Simple byte buffer sequential reader/writer.
# The MIT License (MIT)
#
# Copyright (c) 2015 Ignacio Roldán Etcheverry
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
@neikeq
neikeq / synchronize.bat
Last active August 29, 2015 14:17
Synchronize the forked repo without removing the local changes nor pushing them to origin. This code assumes that the local changes are in the private-changes branch and that master does not have changes to commit.
:: git remote add neikeq https://github.com/neikeq/KicksEmu.git
:: Create a branch for our local changes if it does not exists
git checkout -b private-changes
:: Fetch the updates from neikeq
git fetch neikeq
:: Commit all the changes from private-changes branch and merge updates
git checkout private-changes
@neikeq
neikeq / check_items.sql
Last active August 29, 2015 14:18
Selects invalid items in the table.
-- check days-based expiration items where the days left to expire is greater than the expiration-type limit
select * from items where expiration = 9201007 and timestampdiff(day, current_timestamp, timestamp_expire) > 7;
select * from items where expiration = 9201030 and timestampdiff(day, current_timestamp, timestamp_expire) > 30;
-- check usage items with more usages left than its limit
select * from items where expiration = 9101010 and usages > 10;
select * from items where expiration = 9101050 and usages > 50;
select * from items where expiration = 9101100 and usages > 100;
-- check if there is a default-cloth item
@neikeq
neikeq / delete_item_duplicates.sql
Last active August 29, 2015 14:18
Deletes items with duplicate inventory_id on a player's inventory. This script won't delete permanent items.
DROP PROCEDURE IF EXISTS delete_duplicates;
delimiter |
CREATE PROCEDURE delete_duplicates()
BEGIN
DECLARE done INT;
DECLARE playerid INT;
DECLARE inventoryid INT;
DECLARE countnum INT;
@neikeq
neikeq / checkstats.py
Last active August 29, 2015 14:20
Kicks project script to find players with invalid stats.
from __future__ import print_function
import mysql.connector
from mysql.connector import errorcode
level_offset = 1
config = {
'user': 'root',
@neikeq
neikeq / codes.h
Created May 27, 2015 13:00
XKick packets stuff
#ifndef _CODES_H_
#define _CODES_H_
#define ID_STS_LOGIN 101
#define ID_CERTIFY_LOGIN 1000
#define ID_INSTANT_LOGIN 1001
#define ID_CERTIFY_EXIT 1002
#define ID_MEMBER_INFO 1100
#define ID_CHARACTER_INFO 1200
func tileset_from_scene(scene, library, merge):
"""
@scene Node - The input scene
@library TileSet - The output tileset
@merge bool - Preserve old tiles
"""
if merge:
library.clear()
for child in scene.get_children():
@neikeq
neikeq / pan.gd
Last active August 2, 2016 15:41
WARNING: Should modify the camera offset instead of its position. Check: https://gist.github.com/blurymind/18c08bd2a617eeb102ed237c0d62ae85
extends Camera2D
var dragging = false
var drag_from = Vector2()
func _ready():
set_process_unhandled_input(true)
func _unhandled_input(event):

API Differences

@GDScript

Methods

Some of the remaining methods may fit well in the Godot class.

GDScript C#