This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@NotNull | |
@Override | |
public User find(byte[] bytes) { | |
byte[] decrypted; | |
try { | |
decrypted = decrypter.doFinal(bytes); | |
} catch (Exception e) { | |
throw new RuntimeException(e); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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._ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.mambo.protocol | |
import org.mambo.core.io.Buffer | |
/** | |
* @author Blackrush | |
*/ | |
trait Serializable { | |
val deserializer: Deserializer | |
def serialize(buf: Buffer) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ 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" #> | |
<#+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated on 04/24/2013 16:31:20 | |
// Scala version by Blackrush | |
package org.mambo.protocol.Messages.messages | |
import org.mambo.core.io.Buffer | |
import org.mambo.protocol.Messages.{Serializable, Deserializer, EmptyMessage} | |
import org.mambo.protocol.Messages.types.* | |
import org.mambo.protocol.Messages.enums.* | |
case object HelloGameMessage extends EmptyMessage(101) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object Kernel { | |
implicit class Times(val n: Int) extends AnyVal { | |
def times[T](block: => T) = for (i <- 1 to n) yield block | |
def times[T](block: Int => T) = for (i <- 1 to n) yield block(i) | |
} | |
implicit class RunnableConversion(block: => Unit) extends Runnable { | |
def run = block | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string UnderscoreToCamel(string input, bool upperCamel) | |
{ | |
var sb = new StringBuilder(); | |
bool upper = upperCamel; | |
foreach (var character in input.ToLower()) | |
{ | |
if (character == '_') | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Generated on 05/03/2013 17:14:40 | |
// Scala version by Blackrush | |
package org.mambo.protocol.messages | |
import org.mambo.core.io._ | |
import org.mambo.protocol.{Message => BaseMessage, _} | |
import org.mambo.protocol.types._ | |
import org.mambo.protocol.enums._ | |
trait AdminQuietCommandMessage extends AdminCommandMessage { |