- 註冊
- 2022-08-27
- 文章
- 13
- 評分
- 4
- 聲望
- 0
如何新增vip等級 底下已新增方法 自行詳閱(提取楓樂園)
上線登入VIP歡迎提醒狀態

上線登入非VIP換頻提醒狀態

換頻非VIP顯示狀態

伺服器端顯示(無錯誤)

[Java] syntaxhighlighter_viewsource syntaxhighlighter_copycode
InterServerHandler.java
[Java] syntaxhighlighter_viewsource syntaxhighlighter_copycode
setting.ini設置
[JavaScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode
[轉發自 小馬論壇 台哥大]
上線登入VIP歡迎提醒狀態

上線登入非VIP換頻提醒狀態

換頻非VIP顯示狀態

伺服器端顯示(無錯誤)

[Java] syntaxhighlighter_viewsource syntaxhighlighter_copycode
JavaScript:
新增
private int VIPch;
找到
cashRate = Integer.parseInt(ServerProperties.getProperty("tms.Cash"));
下面新曾
VIPch = Integer.parseInt(ServerProperties.getProperty("tms.VIPch"));//新增VIP頻道設置
任一位置新增
public int getVIPch() {
return VIPch;
}
[Java] syntaxhighlighter_viewsource syntaxhighlighter_copycode
JavaScript:
新增
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
找到
public class InterServerHandler {
新增
private static final Logger log = LoggerFactory.getLogger(InterServerHandler .class);
找到
final ChannelServer channelServer = c.getChannelServer();
下面新增
ChannelServer VIP = c.getChannelServer();
MapleCharacter player;
找到
channelServer.addPlayer(player);
下面新增
ChannelServer cserv = ChannelServer.getInstance(c.getChannel());//其實可以不用新增
MapleCharacter chr = player;
找到
c.getSession().write(MaplePacketCreator.getCharInfo(player));
下面新增
log.info("玩家 [ " + c.getPlayer().getName() + " ] 嘗試檢查服務器連接成功.");
if ((player.getVIPLevel() < 1) && c.getChannel() == VIP.getVIPch()) {
String mg = "親愛的玩家:" + c.getPlayer().getName() + " 您好 \r\n第" + VIP.getVIPch()
chr.dropMessage(5, mg);
chr.dropMessage(1, mg);
setting.ini設置
[JavaScript] syntaxhighlighter_viewsource syntaxhighlighter_copycode
JavaScript:
tms.VIPch = 2
[轉發自 小馬論壇 台哥大]