Add Command SetLevel (#8)

* Add Remote Command API (Use KEY)

* Clean up HttpServer by removing unused code

Removed commented-out code

* Add SetLevel Command (need to restart the game for it to take effect)

* Add Proto Request Change Level (Not Work)

* Update setlevel command

---------

Co-authored-by: Melledy <121644117+Melledy@users.noreply.github.com>
This commit is contained in:
RaidenShogun503
2025-11-27 10:45:45 +07:00
committed by GitHub
parent 2acd506245
commit 6d9e28963d
7 changed files with 58 additions and 10 deletions

View File

@@ -201,7 +201,17 @@ public class Player implements GameDatabaseObject {
public boolean hasSession() {
return this.session != null;
}
public void setLevel(int level) {
this.level = level;
Nebula.getGameDatabase().update(this, this.getUid(), "level", this.level);
}
public void setExp(int exp) {
this.exp = exp;
Nebula.getGameDatabase().update(this, this.getUid(), "exp", this.exp);
}
public void setRemoteToken(String token) {
// Skip if tokens are the same
if (this.remoteToken == null) {
@@ -898,4 +908,4 @@ public class Player implements GameDatabaseObject {
return proto;
}
}
}