// Path: BiliLiveLib/src/main/java/charlie/bililivelib/Globals.java
// public class Globals {
//     private static final String BILI_PASSPORT_HOST_ROOT = "passport.bilibili.com";
//     private static final String BILI_LIVE_HOST_ROOT = "live.bilibili.com";
//     @Getter
//     private static int CONNECTION_ALIVE_TIME_SECOND = 10;
//     private static Globals instance;
//     @Getter
//     private HttpHost biliLiveRoot;
//     @Getter
//     private HttpHost biliPassportHttpsRoot;
//     private ThreadLocal<Gson> gson;
// 
//     private HttpClientConnectionManager connectionPool;
//     @Getter
//     private SSLContext bilibiliSSLContext;
// 
//     public static Globals get() {
//         if (instance == null) {
//             instance = new Globals();
//             instance.init();
//         }
//         return instance;
//     }
// 
//     private void init() {
//         biliLiveRoot = new HttpHost(BILI_LIVE_HOST_ROOT);
//         //Visit bilibili passport via https. 443 is the https port.
//         biliPassportHttpsRoot = new HttpHost(BILI_PASSPORT_HOST_ROOT, 443, "https");
//         gson = ThreadLocal.withInitial(() -> new GsonBuilder()
//                 .setLenient()
//                 .create());
// 
//         try {
//             bilibiliSSLContext = SSLContextBuilder.create()
//                     .loadTrustMaterial(new BilibiliTrustStrategy())
//                     .build();
//         } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
//             throw new AssertionError("failed initializing bilibili ssl context!");
//         }
//     }
// 
//     public Gson gson() {
//         return gson.get();
//     }
// 
//     public HttpClientConnectionManager getConnectionPool() {
//         if (connectionPool == null) {
//             reInitializeConnectionPool();
//         }
//         return connectionPool;
//     }
// 
//     public void reInitializeConnectionPool() {
//         connectionPool = new PoolingHttpClientConnectionManager(CONNECTION_ALIVE_TIME_SECOND, TimeUnit.SECONDS);
//     }
// 
//     public void setConnectionAliveTimeSecond(int connectionAliveTimeSecond) {
//         CONNECTION_ALIVE_TIME_SECOND = connectionAliveTimeSecond;
//         reInitializeConnectionPool();
//     }
// 
// 
// }


import charlie.bililivelib.Globals;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;
package charlie.bililivelib.danmaku.datamodel;


/**
 * 用于封装加入服务器的请求信息。仅内部使用。
 *
 * @author Charlie Jiang
 * @since rv1
 */
@Data
@AllArgsConstructor
public class JoinServerJson {
    @SerializedName("roomid")
    private int roomID;
    @SerializedName("uid")
    private long userID;

    private String generateJSON() {
// Path: BiliLiveLib/src/main/java/charlie/bililivelib/Globals.java
// public class Globals {
//     private static final String BILI_PASSPORT_HOST_ROOT = "passport.bilibili.com";
//     private static final String BILI_LIVE_HOST_ROOT = "live.bilibili.com";
//     @Getter
//     private static int CONNECTION_ALIVE_TIME_SECOND = 10;
//     private static Globals instance;
//     @Getter
//     private HttpHost biliLiveRoot;
//     @Getter
//     private HttpHost biliPassportHttpsRoot;
//     private ThreadLocal<Gson> gson;
// 
//     private HttpClientConnectionManager connectionPool;
//     @Getter
//     private SSLContext bilibiliSSLContext;
// 
//     public static Globals get() {
//         if (instance == null) {
//             instance = new Globals();
//             instance.init();
//         }
//         return instance;
//     }
// 
//     private void init() {
//         biliLiveRoot = new HttpHost(BILI_LIVE_HOST_ROOT);
//         //Visit bilibili passport via https. 443 is the https port.
//         biliPassportHttpsRoot = new HttpHost(BILI_PASSPORT_HOST_ROOT, 443, "https");
//         gson = ThreadLocal.withInitial(() -> new GsonBuilder()
//                 .setLenient()
//                 .create());
// 
//         try {
//             bilibiliSSLContext = SSLContextBuilder.create()
//                     .loadTrustMaterial(new BilibiliTrustStrategy())
//                     .build();
//         } catch (NoSuchAlgorithmException | KeyManagementException | KeyStoreException e) {
//             throw new AssertionError("failed initializing bilibili ssl context!");
//         }
//     }
// 
//     public Gson gson() {
//         return gson.get();
//     }
// 
//     public HttpClientConnectionManager getConnectionPool() {
//         if (connectionPool == null) {
//             reInitializeConnectionPool();
//         }
//         return connectionPool;
//     }
// 
//     public void reInitializeConnectionPool() {
//         connectionPool = new PoolingHttpClientConnectionManager(CONNECTION_ALIVE_TIME_SECOND, TimeUnit.SECONDS);
//     }
// 
//     public void setConnectionAliveTimeSecond(int connectionAliveTimeSecond) {
//         CONNECTION_ALIVE_TIME_SECOND = connectionAliveTimeSecond;
//         reInitializeConnectionPool();
//     }
// 
// 
// }


// Path: BiliLiveLib/src/main/java/charlie/bililivelib/danmaku/datamodel/JoinServerJson.java
import charlie.bililivelib.Globals;
import com.google.gson.annotations.SerializedName;
import lombok.AllArgsConstructor;
import lombok.Data;

package charlie.bililivelib.danmaku.datamodel;


/**
 * 用于封装加入服务器的请求信息。仅内部使用。
 *
 * @author Charlie Jiang
 * @since rv1
 */
@Data
@AllArgsConstructor
public class JoinServerJson {
    @SerializedName("roomid")
    private int roomID;
    @SerializedName("uid")
    private long userID;

    private String generateJSON() {
        return Globals.get().gson().toJson(this);