Skip to content

Instantly share code, notes, and snippets.

View volgar1x's full-sized avatar

Antoine Chauvin volgar1x

View GitHub Profile
<#@ assembly name="System.dll" #>
<#@ import namespace="System" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text.RegularExpressions" #>
<#@ import namespace="DofusProtocolBuilder" #>
<#@ import namespace="DofusProtocolBuilder.Parsing" #>
<#@ import namespace="DofusProtocolBuilder.XmlPatterns" #>
<#+
package org.mambo.protocol
import org.mambo.core.io.Buffer
/**
* @author Blackrush
*/
trait Serializable {
val deserializer: Deserializer
def serialize(buf: Buffer)
package org.mambo.core.io
import java.nio.charset.Charset
import java.nio.{CharBuffer, ByteBuffer}
/**
* @author Blackrush
*/
class BigEndianBuffer(private var buf: Array[Byte], var offset: Int = 0) extends Buffer {
import BigEndianBuffer._
package org.mambo.core
import akka.actor._
import akka.util.ByteString
import scala.collection.mutable
/**
* @author Blackrush
*/
class LoginActor(port: Int) extends Actor with ActorLogging {
package org.mojito.core
import collection.mutable
/**
* @author Blackrush
* @todo implement Iterable[(Seq[K], V)]
*/
class NavigableTree[K, V](val key: K, val value: Option[V] = None, val parent: Option[NavigableTree[K, V]] = None) {
type This = NavigableTree[K, V]
@NotNull
@Override
public User find(byte[] bytes) {
byte[] decrypted;
try {
decrypted = decrypter.doFinal(bytes);
} catch (Exception e) {
throw new RuntimeException(e);
}
def create
@errors = []
@user = User.authenticate(params[:username], params[:password])
respond_to do |format|
if @user.nil?
@errors << t("authentication_error")
format.html { render :new }
format.json { render json: @errors }
Error: Decrypt error - padding function returned null!
at com.hurlant.crypto.rsa::RSAKey/_decrypt()
at com.hurlant.crypto.rsa::RSAKey/verify()
at com.ankamagames.dofus.logic.connection.managers::AuthentificationManager/setPublicKey()
at com.ankamagames.dofus.logic.connection.frames::AuthentificationFrame/process()
at com.ankamagames.jerakine.messages::Worker/processMessage()
at com.ankamagames.jerakine.messages::Worker/processMessages()
at com.ankamagames.jerakine.messages::Worker/onEnterFrame()
@volgar1x
volgar1x / gist:4132843
Created November 22, 2012 20:37
Dalesbred QueryBuilder enhancement
/*
* Copyright (c) 2012 Evident Solutions Oy
*
* 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:
*
interface ManyNetworkHandlerFactory {
Set<NetworkHandler> create(NetworkClient client);
}
class NetworkHandlersModule extends AbstractModule {
protected void configure() {
install(new ManyFactoryModuleBuilder(NetworkClient.class)
.bind(AuthenticationHandler.class)
.build());
}