Skip to content

Commit

Permalink
Generate UIMode from enums.steamd
Browse files Browse the repository at this point in the history
  • Loading branch information
LossyDragon committed Jul 31, 2024
1 parent 3f114fa commit 7789698
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package in.dragonbra.javasteamsamples._8UnifiedMessages;

import in.dragonbra.javasteam.enums.EResult;
import in.dragonbra.javasteam.enums.EUIMode;
import in.dragonbra.javasteam.protobufs.steamclient.SteammessagesFriendmessagesSteamclient.CFriendMessages_IncomingMessage_Notification;
import in.dragonbra.javasteam.protobufs.steamclient.SteammessagesPlayerSteamclient.*;
import in.dragonbra.javasteam.rpc.service.Player;
Expand All @@ -10,7 +11,6 @@
import in.dragonbra.javasteam.steam.handlers.steamuser.ChatMode;
import in.dragonbra.javasteam.steam.handlers.steamuser.LogOnDetails;
import in.dragonbra.javasteam.steam.handlers.steamuser.SteamUser;
import in.dragonbra.javasteam.steam.handlers.steamuser.UiMode;
import in.dragonbra.javasteam.steam.handlers.steamuser.callback.LoggedOffCallback;
import in.dragonbra.javasteam.steam.handlers.steamuser.callback.LoggedOnCallback;
import in.dragonbra.javasteam.steam.steamclient.SteamClient;
Expand Down Expand Up @@ -125,7 +125,7 @@ private void onConnected(ConnectedCallback callback) {
LogOnDetails details = new LogOnDetails();
details.setUsername(user);
details.setPassword(pass);
details.setUiMode(UiMode.DEFAULT);
details.setUiMode(EUIMode.Unknown);
details.setChatMode(ChatMode.NEW_STEAM_CHAT);

// Set LoginID to a non-zero value if you have another client connected using the same account,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package in.dragonbra.javasteam.steam.handlers.steamuser;

import in.dragonbra.javasteam.enums.EOSType;
import in.dragonbra.javasteam.enums.EUIMode;
import in.dragonbra.javasteam.steam.authentication.AuthPollResult;
import in.dragonbra.javasteam.steam.authentication.SteamAuthentication;
import in.dragonbra.javasteam.types.SteamID;
Expand Down Expand Up @@ -42,7 +43,7 @@ public class LogOnDetails {

private ChatMode chatMode;

private UiMode uiMode;
private EUIMode uiMode;

public LogOnDetails() {
accountInstance = SteamID.DESKTOP_INSTANCE;
Expand All @@ -58,7 +59,7 @@ public LogOnDetails() {
machineName = envName + " (JavaSteam)";

chatMode = ChatMode.DEFAULT;
uiMode = UiMode.DEFAULT;
uiMode = EUIMode.Unknown;
}

/**
Expand Down Expand Up @@ -353,18 +354,18 @@ public void setChatMode(ChatMode chatMode) {
/**
* Gets the ui mode.
*
* @return the {@link UiMode}
* @return the {@link EUIMode}
*/
public UiMode getUiMode() {
public EUIMode getUiMode() {
return uiMode;
}

/**
* Sets the ui mode.
*
* @param uiMode the ui mode {@link UiMode}
* @param uiMode the ui mode {@link EUIMode}
*/
public void setUiMode(UiMode uiMode) {
public void setUiMode(EUIMode uiMode) {
this.uiMode = uiMode;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import in.dragonbra.javasteam.enums.EAccountType;
import in.dragonbra.javasteam.enums.EMsg;
import in.dragonbra.javasteam.enums.EResult;
import in.dragonbra.javasteam.enums.EUIMode;
import in.dragonbra.javasteam.generated.MsgClientLogOnResponse;
import in.dragonbra.javasteam.generated.MsgClientLoggedOff;
import in.dragonbra.javasteam.generated.MsgClientLogon;
Expand Down Expand Up @@ -132,8 +133,8 @@ public void logOn(LogOnDetails details) {
logon.getBody().setChatMode(details.getChatMode().getMode());
}

if (details.getUiMode() != UiMode.DEFAULT) {
logon.getBody().setUiMode(details.getUiMode().getMode());
if (details.getUiMode() != EUIMode.Unknown) {
logon.getBody().setUiMode(details.getUiMode().code());
}

// steam guard
Expand Down

This file was deleted.

12 changes: 12 additions & 0 deletions src/main/steamd/in/dragonbra/javasteam/enums.steamd
Original file line number Diff line number Diff line change
Expand Up @@ -1661,3 +1661,15 @@ enum ELauncherType
SingleApp = 8;
GameServer = 9;
}

public enum EUIMode
{
Unknown = -1;
VGUI = 0;
Tenfoot = 1;
Mobile = 2;
Web = 3;
ClientUI = 4;
MobileChat = 5;
EmbeddedClient = 6;
}

0 comments on commit 7789698

Please sign in to comment.