* try to resolve merge conflict
* feat: TU19 (Dec 2014) Features & Content (#32)
* December 2014 files
* Working release build
* Fix compilation issues
* Add sound to Windows64Media
* Add DLC content and force Tutorial DLC
* Revert "Add DLC content and force Tutorial DLC"
This reverts commit 97a4399472.
* Disable broken light packing
* Disable breakpoint during DLC texture map load
Allows DLC loading but the DLC textures are still broken
* Fix post build not working
* ...
* fix vs2022 build
* fix cmake build
---------
Co-authored-by: Loki <lokirautio@gmail.com>
101 lines
2.1 KiB
C++
101 lines
2.1 KiB
C++
#pragma once
|
|
|
|
#include "stdafx.h"
|
|
|
|
class ClientInformationPacket : public Packet
|
|
{
|
|
#if 0
|
|
private String language;
|
|
private int viewDistance;
|
|
private int chatVisibility;
|
|
private boolean chatColors;
|
|
private int difficulty;
|
|
|
|
public ClientInformationPacket() {
|
|
}
|
|
|
|
public ClientInformationPacket(String language, int viewDistance, int chatVisibility, boolean chatColors, int difficulty, boolean showCape) {
|
|
this.language = language;
|
|
this.viewDistance = viewDistance;
|
|
this.chatVisibility = chatVisibility;
|
|
this.chatColors = chatColors;
|
|
this.difficulty = difficulty;
|
|
this.showCape = showCape;
|
|
}
|
|
|
|
@Override
|
|
public void read(DataInputStream dis) throws IOException {
|
|
language = readUtf(dis, 7);
|
|
viewDistance = dis.readByte();
|
|
|
|
int chat = dis.readByte();
|
|
chatVisibility = chat & 0x7;
|
|
chatColors = (chat & 0x8) == 0x8;
|
|
|
|
difficulty = dis.readByte();
|
|
showCape = dis.readBoolean();
|
|
}
|
|
|
|
@Override
|
|
public void write(DataOutputStream dos) throws IOException {
|
|
writeUtf(language, dos);
|
|
dos.writeByte(viewDistance);
|
|
dos.writeByte(chatVisibility | (chatColors ? 1 : 0) << 3);
|
|
dos.writeByte(difficulty);
|
|
dos.writeBoolean(showCape);
|
|
}
|
|
|
|
@Override
|
|
public void handle(PacketListener listener) {
|
|
listener.handleClientInformation(this);
|
|
}
|
|
|
|
@Override
|
|
public int getEstimatedSize() {
|
|
return 7;
|
|
}
|
|
|
|
public String getLanguage() {
|
|
return language;
|
|
}
|
|
|
|
public int getViewDistance() {
|
|
return viewDistance;
|
|
}
|
|
|
|
public int getChatVisibility() {
|
|
return chatVisibility;
|
|
}
|
|
|
|
public boolean getChatColors() {
|
|
return chatColors;
|
|
}
|
|
|
|
public int getDifficulty() {
|
|
return difficulty;
|
|
}
|
|
|
|
public boolean getShowCape() {
|
|
return showCape;
|
|
}
|
|
|
|
public void setDifficulty(int difficulty) {
|
|
this.difficulty = difficulty;
|
|
}
|
|
|
|
@Override
|
|
public String getDebugInfo() {
|
|
return String.format("lang='%s', view=%d, chat=%d, col=%b, difficulty=%d", language, viewDistance, chatVisibility, chatColors, difficulty);
|
|
}
|
|
|
|
@Override
|
|
public boolean canBeInvalidated() {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public boolean isInvalidatedBy(Packet packet) {
|
|
return true;
|
|
}
|
|
#endif
|
|
}; |