cn.nukkit.event.server.QueryRegenerateEvent Java Examples

The following examples show how to use cn.nukkit.event.server.QueryRegenerateEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RakNetInterface.java    From Jupiter with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setName(String name) {
    QueryRegenerateEvent info = this.server.getQueryInformation();
    String[] names = name.split("!@#");  //Split double names within the program
    this.handler.sendOption("name",
            "MCPE;" + Utils.rtrim(names[0].replace(";", "\\;"), '\\') + ";" +
                    ProtocolInfo.CURRENT_PROTOCOL + ";" +
                    ProtocolInfo.MINECRAFT_VERSION_NETWORK + ";" +
                    info.getPlayerCount() + ";" +
                    info.getMaxPlayerCount() + ";" +
                    this.server.getServerUniqueId().toString() + ";" +
                    (names.length > 1 ? Utils.rtrim(names[1].replace(";", "\\;"), '\\') : "") + ";" +
                    Server.getGamemodeString(this.server.getDefaultGamemode(), true) + ";");
}
 
Example #2
Source File: RakNetInterface.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setName(String name) {
    QueryRegenerateEvent info = this.server.getQueryInformation();
    String[] names = name.split("!@#");  //Split double names within the program
    this.handler.sendOption("name",
            "MCPE;" + Utils.rtrim(names[0].replace(";", "\\;"), '\\') + ";" +
                    ProtocolInfo.CURRENT_PROTOCOL + ";" +
                    ProtocolInfo.MINECRAFT_VERSION_NETWORK + ";" +
                    info.getPlayerCount() + ";" +
                    info.getMaxPlayerCount() + ";" +
                    this.server.getServerUniqueId().toString() + ";" +
                    (names.length > 1 ? Utils.rtrim(names[1].replace(";", "\\;"), '\\') : "") + ";" +
                    Server.getGamemodeString(this.server.getDefaultGamemode(), true) + ";");
}
 
Example #3
Source File: RakNetInterface.java    From Nukkit with GNU General Public License v3.0 5 votes vote down vote up
@Override
public void setName(String name) {
    QueryRegenerateEvent info = this.server.getQueryInformation();
    String[] names = name.split("!@#");  //Split double names within the program
    this.handler.sendOption("name",
            "MCPE;" + Utils.rtrim(names[0].replace(";", "\\;"), '\\') + ";" +
                    ProtocolInfo.CURRENT_PROTOCOL + ";;" +
                    info.getPlayerCount() + ";" +
                    info.getMaxPlayerCount() + ";" +
                    this.server.getServerUniqueId().toString() + ";" +
                    (names.length > 1 ? Utils.rtrim(names[1].replace(";", "\\;"), '\\') : "") + ";" +
                    Server.getGamemodeString(this.server.getDefaultGamemode(), true) + ";");
}
 
Example #4
Source File: QueryHandler.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public void regenerateInfo() {
    QueryRegenerateEvent ev = this.server.getQueryInformation();
    this.longData = ev.getLongQuery();
    this.shortData = ev.getShortQuery();
    this.timeout = System.currentTimeMillis() + ev.getTimeout();
}
 
Example #5
Source File: Server.java    From Jupiter with GNU General Public License v3.0 4 votes vote down vote up
public QueryRegenerateEvent getQueryInformation() {
    return this.queryRegenerateEvent;
}
 
Example #6
Source File: QueryHandler.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public void regenerateInfo() {
    QueryRegenerateEvent ev = this.server.getQueryInformation();
    this.longData = ev.getLongQuery(this.longData);
    this.shortData = ev.getShortQuery(this.shortData);
    this.timeout = System.currentTimeMillis() + ev.getTimeout();
}
 
Example #7
Source File: Server.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public QueryRegenerateEvent getQueryInformation() {
    return this.queryRegenerateEvent;
}
 
Example #8
Source File: QueryHandler.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public void regenerateInfo() {
    QueryRegenerateEvent ev = this.server.getQueryInformation();
    this.longData = ev.getLongQuery(this.longData);
    this.shortData = ev.getShortQuery(this.shortData);
    this.timeout = System.currentTimeMillis() + ev.getTimeout();
}
 
Example #9
Source File: Server.java    From Nukkit with GNU General Public License v3.0 4 votes vote down vote up
public QueryRegenerateEvent getQueryInformation() {
    return this.queryRegenerateEvent;
}