forked from openrs2/openrs2
OK needs a bit more work as I need to decide where the StaffModLevel enum will live. Signed-off-by: Graham <gpe@openrs2.org>
parent
827e6262a9
commit
f31b2519f9
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class BadSessionIdCodec : EmptyPacketCodec<LoginResponse.BadSessionId>( |
||||
packet = LoginResponse.BadSessionId, |
||||
opcode = 10 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class BannedCodec : EmptyPacketCodec<LoginResponse.Banned>( |
||||
packet = LoginResponse.Banned, |
||||
opcode = 4 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class ClientMembersOnlyCodec : EmptyPacketCodec<LoginResponse.ClientMembersOnly>( |
||||
packet = LoginResponse.ClientMembersOnly, |
||||
opcode = 30 |
||||
) |
@ -0,0 +1,22 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import io.netty.buffer.ByteBuf |
||||
import org.openrs2.crypto.StreamCipher |
||||
import org.openrs2.protocol.FixedPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class DisallowedByScriptCodec : FixedPacketCodec<LoginResponse.DisallowedByScript>( |
||||
type = LoginResponse.DisallowedByScript::class.java, |
||||
opcode = 29, |
||||
length = 1 |
||||
) { |
||||
override fun decode(input: ByteBuf, cipher: StreamCipher): LoginResponse.DisallowedByScript { |
||||
val reason = input.readUnsignedByte().toInt() |
||||
return LoginResponse.DisallowedByScript(reason) |
||||
} |
||||
|
||||
override fun encode(input: LoginResponse.DisallowedByScript, output: ByteBuf, cipher: StreamCipher) { |
||||
output.writeByte(input.reason) |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class DuplicateCodec : EmptyPacketCodec<LoginResponse.Duplicate>( |
||||
packet = LoginResponse.Duplicate, |
||||
opcode = 5 |
||||
) |
@ -0,0 +1,22 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import io.netty.buffer.ByteBuf |
||||
import org.openrs2.crypto.StreamCipher |
||||
import org.openrs2.protocol.FixedPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class ExchangeSessionKeyCodec : FixedPacketCodec<LoginResponse.ExchangeSessionKey>( |
||||
type = LoginResponse.ExchangeSessionKey::class.java, |
||||
opcode = 0, |
||||
length = 8 |
||||
) { |
||||
override fun decode(input: ByteBuf, cipher: StreamCipher): LoginResponse.ExchangeSessionKey { |
||||
val key = input.readLong() |
||||
return LoginResponse.ExchangeSessionKey(key) |
||||
} |
||||
|
||||
override fun encode(input: LoginResponse.ExchangeSessionKey, output: ByteBuf, cipher: StreamCipher) { |
||||
output.writeLong(input.key) |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class ForcePasswordChangeCodec : EmptyPacketCodec<LoginResponse.ForcePasswordChange>( |
||||
packet = LoginResponse.ForcePasswordChange, |
||||
opcode = 11 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class FullscreenMembersOnlyCodec : EmptyPacketCodec<LoginResponse.FullscreenMembersOnly>( |
||||
packet = LoginResponse.FullscreenMembersOnly, |
||||
opcode = 19 |
||||
) |
@ -0,0 +1,22 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import io.netty.buffer.ByteBuf |
||||
import org.openrs2.crypto.StreamCipher |
||||
import org.openrs2.protocol.FixedPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class HopBlockedCodec : FixedPacketCodec<LoginResponse.HopBlocked>( |
||||
type = LoginResponse.HopBlocked::class.java, |
||||
opcode = 21, |
||||
length = 1 |
||||
) { |
||||
override fun decode(input: ByteBuf, cipher: StreamCipher): LoginResponse.HopBlocked { |
||||
val time = input.readUnsignedByte().toInt() |
||||
return LoginResponse.HopBlocked(time) |
||||
} |
||||
|
||||
override fun encode(input: LoginResponse.HopBlocked, output: ByteBuf, cipher: StreamCipher) { |
||||
output.writeByte(input.time) |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class InvalidLoginPacketCodec : EmptyPacketCodec<LoginResponse.InvalidLoginPacket>( |
||||
packet = LoginResponse.InvalidLoginPacket, |
||||
opcode = 22 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class InvalidLoginServerCodec : EmptyPacketCodec<LoginResponse.InvalidLoginServer>( |
||||
packet = LoginResponse.InvalidLoginServer, |
||||
opcode = 20 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class InvalidSaveCodec : EmptyPacketCodec<LoginResponse.InvalidSave>( |
||||
packet = LoginResponse.InvalidSave, |
||||
opcode = 13 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class InvalidUsernameOrPasswordCodec : EmptyPacketCodec<LoginResponse.InvalidUsernameOrPassword>( |
||||
packet = LoginResponse.InvalidUsernameOrPassword, |
||||
opcode = 3 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class IpBlockedCodec : EmptyPacketCodec<LoginResponse.IpBlocked>( |
||||
packet = LoginResponse.IpBlocked, |
||||
opcode = 26 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class LockedCodec : EmptyPacketCodec<LoginResponse.Locked>( |
||||
packet = LoginResponse.Locked, |
||||
opcode = 18 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class LoginServerLoadErrorCodec : EmptyPacketCodec<LoginResponse.LoginServerLoadError>( |
||||
packet = LoginResponse.LoginServerLoadError, |
||||
opcode = 24 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class LoginServerOfflineCodec : EmptyPacketCodec<LoginResponse.LoginServerOffline>( |
||||
packet = LoginResponse.LoginServerOffline, |
||||
opcode = 8 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class MapMembersOnlyCodec : EmptyPacketCodec<LoginResponse.MapMembersOnly>( |
||||
packet = LoginResponse.MapMembersOnly, |
||||
opcode = 17 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class NeedMembersAccountCodec : EmptyPacketCodec<LoginResponse.NeedMembersAccount>( |
||||
packet = LoginResponse.NeedMembersAccount, |
||||
opcode = 12 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class NoReplyFromLoginServerCodec : EmptyPacketCodec<LoginResponse.NoReplyFromLoginServer>( |
||||
packet = LoginResponse.NoReplyFromLoginServer, |
||||
opcode = 23 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class ReconnectOkCodec : EmptyPacketCodec<LoginResponse.ReconnectOk>( |
||||
packet = LoginResponse.ReconnectOk, |
||||
opcode = 15 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class ServiceUnavailableCodec : EmptyPacketCodec<LoginResponse.ServiceUnavailable>( |
||||
packet = LoginResponse.ServiceUnavailable, |
||||
opcode = 27 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class ShowVideoAdCodec : EmptyPacketCodec<LoginResponse.ShowVideoAd>( |
||||
packet = LoginResponse.ShowVideoAd, |
||||
opcode = 1 |
||||
) |
@ -0,0 +1,22 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import io.netty.buffer.ByteBuf |
||||
import org.openrs2.crypto.StreamCipher |
||||
import org.openrs2.protocol.FixedPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class SwitchWorldCodec : FixedPacketCodec<LoginResponse.SwitchWorld>( |
||||
type = LoginResponse.SwitchWorld::class.java, |
||||
opcode = 101, |
||||
length = 2 |
||||
) { |
||||
override fun decode(input: ByteBuf, cipher: StreamCipher): LoginResponse.SwitchWorld { |
||||
val id = input.readUnsignedShort() |
||||
return LoginResponse.SwitchWorld(id) |
||||
} |
||||
|
||||
override fun encode(input: LoginResponse.SwitchWorld, output: ByteBuf, cipher: StreamCipher) { |
||||
output.writeShort(input.id) |
||||
} |
||||
} |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class TooManyAttemptsCodec : EmptyPacketCodec<LoginResponse.TooManyAttempts>( |
||||
packet = LoginResponse.TooManyAttempts, |
||||
opcode = 16 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class UnknownReplyFromLoginServerCodec : EmptyPacketCodec<LoginResponse.UnknownReplyFromLoginServer>( |
||||
packet = LoginResponse.UnknownReplyFromLoginServer, |
||||
opcode = 25 |
||||
) |
@ -0,0 +1,10 @@ |
||||
package org.openrs2.protocol.login.downstream |
||||
|
||||
import org.openrs2.protocol.EmptyPacketCodec |
||||
import javax.inject.Singleton |
||||
|
||||
@Singleton |
||||
public class UpdateInProgressCodec : EmptyPacketCodec<LoginResponse.UpdateInProgress>( |
||||
packet = LoginResponse.UpdateInProgress, |
||||
opcode = 14 |
||||
) |
Loading…
Reference in new issue