com.iohao.game.bolt.broker.cluster.Broker Maven / Gradle / Ivy
/*
* ioGame
* Copyright (C) 2021 - present 渔民小镇 ([email protected]、[email protected]) . All Rights Reserved.
* # iohao.com . 渔民小镇
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*/
package com.iohao.game.bolt.broker.cluster;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.Accessors;
import lombok.experimental.FieldDefaults;
import java.io.Serial;
import java.io.Serializable;
/**
* broker (游戏网关)
*
* @author 渔民小镇
* @date 2022-05-14
*/
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
@Accessors(chain = true)
public class Broker implements Serializable {
@Serial
private static final long serialVersionUID = -221407958089075449L;
/**
* 服务器唯一标识
*
* 如果没设置,会随机分配一个
*
* 逻辑服的模块id,标记不同的逻辑服模块。
* 开发者随意定义,只要确保每个逻辑服的模块 id 不相同就可以
*
*/
String id;
final long startedAt;
/** broker (游戏网关) ip */
final String ip;
/** broker (游戏网关) port */
int port;
/** broker (游戏网关)地址 格式 ip:port */
String brokerAddress;
/** cluster 格式 ip:port */
String clusterAddress;
public Broker(String ip) {
this.ip = ip;
startedAt = System.currentTimeMillis();
}
}