mirror of
https://github.com/2006-Scape/apollo.git
synced 2026-07-07 00:38:46 +00:00
Merge remote-tracking branch 'origin/master' into kotlin-experiments
This commit is contained in:
@@ -19,4 +19,22 @@ Apollo is now ready, and can be started using `gradle run`. You may wish to chan
|
|||||||
|
|
||||||
### Contributing
|
### Contributing
|
||||||
|
|
||||||
Please see [contributing to Apollo](#CONTRIBUTING.md).
|
Please see [contributing to Apollo](CONTRIBUTING.md).
|
||||||
|
|
||||||
|
### Acknowledgements
|
||||||
|
|
||||||
|
We'd like to thank the list of service providers/development tool vendors below for offering their products to the Apollo project free of charge.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
#### [](https://www.yourkit.com/java/profiler/index.jsp)
|
||||||
|
|
||||||
|
YourKit supports open source projects with its full-featured Java Profiler.
|
||||||
|
YourKit, LLC is the creator of <a href="https://www.yourkit.com/java/profiler/">YourKit Java Profiler</a>
|
||||||
|
and <a href="https://www.yourkit.com/.net/profiler/">YourKit .NET Profiler</a>,
|
||||||
|
innovative and intelligent tools for profiling Java and .NET applications.
|
||||||
|
|
||||||
|
#### [Travis CI](https://travis-ci.org)
|
||||||
|
|
||||||
|
Travis CI is a Continuous Integration platform that allows for setup of automated testing with minimal configuration.
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ class SpellAction < Action
|
|||||||
|
|
||||||
def check_skill
|
def check_skill
|
||||||
required = @spell.level
|
required = @spell.level
|
||||||
if required > mob.skill_set.skill(Skill::MAGIC).current_level
|
if required > mob.skill_set.getSkill(Skill::MAGIC).current_level
|
||||||
mob.send_message("You need a Magic level of at least #{required} to cast this spell.")
|
mob.send_message("You need a Magic level of at least #{required} to cast this spell.")
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.math.BigInteger;
|
|||||||
import java.net.InetSocketAddress;
|
import java.net.InetSocketAddress;
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
import org.apollo.cache.FileSystemConstants;
|
import org.apollo.cache.FileSystemConstants;
|
||||||
import org.apollo.net.NetworkConstants;
|
import org.apollo.net.NetworkConstants;
|
||||||
@@ -27,6 +28,11 @@ import com.google.common.net.InetAddresses;
|
|||||||
*/
|
*/
|
||||||
public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState> {
|
public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The logger for this class.
|
||||||
|
*/
|
||||||
|
private static final Logger logger = Logger.getLogger(LoginDecoder.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The secure random number generator.
|
* The secure random number generator.
|
||||||
*/
|
*/
|
||||||
@@ -110,6 +116,7 @@ public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState>
|
|||||||
int type = buffer.readUnsignedByte();
|
int type = buffer.readUnsignedByte();
|
||||||
|
|
||||||
if (type != LoginConstants.TYPE_STANDARD && type != LoginConstants.TYPE_RECONNECTION) {
|
if (type != LoginConstants.TYPE_STANDARD && type != LoginConstants.TYPE_RECONNECTION) {
|
||||||
|
logger.fine("Failed to decode login header.");
|
||||||
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -137,6 +144,7 @@ public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState>
|
|||||||
|
|
||||||
int memoryStatus = payload.readUnsignedByte();
|
int memoryStatus = payload.readUnsignedByte();
|
||||||
if (memoryStatus != 0 && memoryStatus != 1) {
|
if (memoryStatus != 0 && memoryStatus != 1) {
|
||||||
|
logger.fine("Login memoryStatus (" + memoryStatus + ") not in expected range of [0, 1].");
|
||||||
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -150,6 +158,7 @@ public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState>
|
|||||||
|
|
||||||
int length = payload.readUnsignedByte();
|
int length = payload.readUnsignedByte();
|
||||||
if (length != loginLength - 41) {
|
if (length != loginLength - 41) {
|
||||||
|
logger.fine("Login packet unexpected length (" + length + ")");
|
||||||
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -162,6 +171,7 @@ public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState>
|
|||||||
|
|
||||||
int id = secure.readUnsignedByte();
|
int id = secure.readUnsignedByte();
|
||||||
if (id != 10) {
|
if (id != 10) {
|
||||||
|
logger.fine("Unable to read id from secure payload.");
|
||||||
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -169,6 +179,7 @@ public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState>
|
|||||||
long clientSeed = secure.readLong();
|
long clientSeed = secure.readLong();
|
||||||
long reportedSeed = secure.readLong();
|
long reportedSeed = secure.readLong();
|
||||||
if (reportedSeed != serverSeed) {
|
if (reportedSeed != serverSeed) {
|
||||||
|
logger.fine("Reported seed differed from server seed.");
|
||||||
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
writeResponseCode(ctx, LoginConstants.STATUS_LOGIN_SERVER_REJECTED_SESSION);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -180,6 +191,7 @@ public final class LoginDecoder extends StatefulFrameDecoder<LoginDecoderState>
|
|||||||
String hostAddress = InetAddresses.toAddrString(socketAddress.getAddress());
|
String hostAddress = InetAddresses.toAddrString(socketAddress.getAddress());
|
||||||
|
|
||||||
if (password.length() < 6 || password.length() > 20 || username.isEmpty() || username.length() > 12) {
|
if (password.length() < 6 || password.length() > 20 || username.isEmpty() || username.length() > 12) {
|
||||||
|
logger.fine("Username ('" + username + "') or password did not pass validation.");
|
||||||
writeResponseCode(ctx, LoginConstants.STATUS_INVALID_CREDENTIALS);
|
writeResponseCode(ctx, LoginConstants.STATUS_INVALID_CREDENTIALS);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
+11
-1
@@ -10,4 +10,14 @@ dependencies {
|
|||||||
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: bouncycastleVersion
|
implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: bouncycastleVersion
|
||||||
|
|
||||||
testImplementation group: 'junit', name: 'junit', version: junitVersion
|
testImplementation group: 'junit', name: 'junit', version: junitVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task(genRsa, dependsOn: classes, type: JavaExec) {
|
||||||
|
def utilSubproject = project(':util')
|
||||||
|
def utilClasspath = utilSubproject.sourceSets.main.runtimeClasspath
|
||||||
|
|
||||||
|
main = 'org.apollo.util.tools.RsaKeyGenerator'
|
||||||
|
classpath = utilClasspath
|
||||||
|
jvmArgs = ['-Xmx1024M']
|
||||||
|
workingDir = project.rootDir
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user