您当前位置: 天堂123 > 天堂架設 > 天堂私服使用指令進入GM房間

天堂私服使用指令進入GM房間

2021/12/11

效果:傳送到指定位置。
範例:

.gmroom ${位置名稱}
1.分析資料表:

先進入commands表,找到gmroom的指令。
class_name是L1GMRoom。

2.指令的分析:

啟動模擬器除錯模式,並啟動天堂遊戲登入。
使用移動的GM指令,分別參數帶入1~5對應5個預設的位置,該位置是寫死於程式中。
.gmroom 1

3.分析程式碼:

透過搜尋L1GMRoom開啟程式碼。
src/l1j/server/server/command/executor/L1GMRoom.java

註:程式碼內的L1Teleport的teleport方法,已於GM指令分析 (移動)分析完畢,此處將不再分析。

40~54行,判斷輸入的參數1~5對應輸入不同的預設座標與地圖編號。
56行,GMCommandsConfig.ROOMS的分析,不再特別分析,詳見註記。
註:GM指令分析 (創立套裝)此篇內的分析GMCommandsConfig.ITEM_SETS是相同行為。

56~60行,如果房間不存在,則傳送數據回客戶端做顯示xxx 未定義的Room~。
61行,將取得的房間參數帶入teleport方法,做傳送。
4.分析程式碼:

提供目前有設定的房間。
./data/xml/GmCommands/GMCommands.xml
直接在核心的資料夾內找到GMCommands.xml並開啟。
可以看到在GMCommands.xml內容,有ItemSetList和RoomList兩個大區塊。
目前我們只要注意到RoomList就好。
以下參數的使用範例:(傲慢之塔100樓)
.gmroom ToI100


<RoomList>
<!-- Town -->
<Room Name="Gludio" LocX="32612" LocY="32734" MapId="4"/>
<Room Name="Giran" LocX="33442" LocY="32797" MapId="4"/>
<Room Name="SI" LocX="32782" LocY="32756" MapId="68"/>
<Room Name="TI" LocX="32580" LocY="32931" MapId="0"/>
<Room Name="Aden" LocX="33966" LocY="33253" MapId="4"/>
<Room Name="Oren" LocX="34061" LocY="32276" MapId="4"/>
<Room Name="WW" LocX="32621" LocY="33169" MapId="4"/>
<Room Name="HV" LocX="32671" LocY="32836" MapId="69"/>
<Room Name="MT" LocX="33054" LocY="32323" MapId="4"/>
<Room Name="Kent" LocX="33050" LocY="32780" MapId="4"/>
<Room Name="Heine" LocX="33612" LocY="33268" MapId="4"/>
<Room Name="Werldern" LocX="33705" LocY="32504" MapId="4"/>
<Room Name="SKT" LocX="33080" LocY="33392" MapId="4"/>
<Room Name="GMShop" LocX="33079" LocY="33402" MapId="4"/>
<Room Name="IT" LocX="32771" LocY="32822" MapId="75"/>
<Room Name="SC" LocX="32854" LocY="32907" MapId="304"/>
<Room Name="OT" LocX="32715" LocY="32448" MapId="4"/>
<Room Name="Gunter" LocX="32669" LocY="32790" MapId="3"/>
<Room Name="Gypsy" LocX="33978" LocY="32927" MapId="4"/>
<Room Name="Bluedika" LocX="32739" LocY="32801" MapId="305"/>
<Room Name="Dicarding" LocX="32766" LocY="32797" MapId="77"/>

<!-- Castle -->
<Room Name="AdenGT" LocX="34090" LocY="33261" MapId="4"/>
<!-- Field -->
<Room Name="Oasis" LocX="32861" LocY="33255" MapId="4"/>
<!-- Dungeon -->
<Room Name="CC1" LocX="32746" LocY="32787" MapId="72"/>
<Room Name="CC2" LocX="32755" LocY="32871" MapId="73"/>
<Room Name="CC3" LocX="32731" LocY="32854" MapId="74"/>
<Room Name="DVC1" LocX="32740" LocY="32777" MapId="30"/>
<Room Name="DVC2" LocX="32760" LocY="32781" MapId="31"/>
<Room Name="DVC3" LocX="32709" LocY="32818" MapId="32"/>
<Room Name="DVC4" LocX="32669" LocY="32869" MapId="33"/>
<Room Name="DVC5" LocX="32746" LocY="32802" MapId="35"/>
<Room Name="DVC6" LocX="32663" LocY="32846" MapId="36"/>
<Room Name="DVC7" LocX="32668" LocY="32867" MapId="37"/>
<Room Name="MLC3" LocX="32798" LocY="32754" MapId="9"/>
<Room Name="MLC4" LocX="32764" LocY="32773" MapId="10"/>
<Room Name="MLC5" LocX="32729" LocY="32724" MapId="11"/>
<Room Name="MLC6" LocX="32805" LocY="32725" MapId="12"/>
<Room Name="MLC7" LocX="32730" LocY="32726" MapId="13"/>
<Room Name="AC1" LocX="32738" LocY="32799" MapId="49"/>
<Room Name="AC2" LocX="32740" LocY="32802" MapId="50"/>
<Room Name="AC3" LocX="32764" LocY="32828" MapId="51"/>
<Room Name="IT5" LocX="32772" LocY="32805" MapId="79"/>
<Room Name="IT6" LocX="32748" LocY="32802" MapId="80"/>
<Room Name="IT7" LocX="32766" LocY="32849" MapId="81"/>
<Room Name="IT8" LocX="32742" LocY="32798" MapId="82"/>
<Room Name="GC2" LocX="32809" LocY="32793" MapId="54"/>
<Room Name="GC3" LocX="32734" LocY="32728" MapId="55"/>
<Room Name="GC4" LocX="32770" LocY="32730" MapId="56"/>
<Room Name="SKTC2" LocX="32802" LocY="32815" MapId="26"/>
<Room Name="SKTC3" LocX="32807" LocY="32812" MapId="27"/>
<Room Name="SKTC4" LocX="32799" LocY="32798" MapId="28"/>
<Room Name="KC1" LocX="32720" LocY="33088" MapId="240"/>
<Room Name="KC2" LocX="32759" LocY="32884" MapId="241"/>
<Room Name="KC3" LocX="32808" LocY="32918" MapId="242"/>
<Room Name="KC4" LocX="32742" LocY="32857" MapId="243"/>
<Room Name="WC1" LocX="32810" LocY="32723" MapId="23"/>
<Room Name="WC2" LocX="32809" LocY="32812" MapId="24"/>
<Room Name="DI" LocX="32633" LocY="32817" MapId="303"/>
<Room Name="FI" LocX="32828" LocY="32848" MapId="70"/>
<!-- ToI -->
<Room Name="ToI11" LocX="32631" LocY="32935" MapId="111"/>
<Room Name="ToI21" LocX="32631" LocY="32935" MapId="121"/>
<Room Name="ToI31" LocX="32631" LocY="32935" MapId="131"/>
<Room Name="ToI41" LocX="32631" LocY="32935" MapId="141"/>
<Room Name="ToI51" LocX="32669" LocY="32814" MapId="151"/>
<Room Name="ToI61" LocX="32669" LocY="32814" MapId="161"/>
<Room Name="ToI71" LocX="32669" LocY="32814" MapId="171"/>
<Room Name="ToI81" LocX="32669" LocY="32814" MapId="181"/>
<Room Name="ToI91" LocX="32669" LocY="32814" MapId="191"/>
<Room Name="ToI10" LocX="32800" LocY="32800" MapId="110"/>
<Room Name="ToI20" LocX="32800" LocY="32800" MapId="120"/>
<Room Name="ToI30" LocX="32800" LocY="32800" MapId="130"/>
<Room Name="ToI40" LocX="32800" LocY="32800" MapId="140"/>
<Room Name="ToI50" LocX="32796" LocY="32796" MapId="150"/>
<Room Name="ToI60" LocX="32720" LocY="32821" MapId="160"/>
<Room Name="ToI70" LocX="32720" LocY="32821" MapId="170"/>
<Room Name="ToI80" LocX="32724" LocY="32822" MapId="180"/>
<Room Name="ToI90" LocX="32722" LocY="32827" MapId="190"/>
<Room Name="ToI100" LocX="32731" LocY="32856" MapId="200"/>
<!-- Four dragon -->
<Room Name="Valakas" LocX="32723" LocY="32796" MapId="67"/>
<Room Name="Fafurion" LocX="32769" LocY="32833" MapId="65"/>
<Room Name="Lindvior" LocX="34035" LocY="33011" MapId="4"/>
<Room Name="Antharas" LocX="32668" LocY="32867" MapId="37"/>
<!-- Other -->
<Room Name="Hell" LocX="32701" LocY="32777" MapId="666"/>
<Room Name="GMRoom" LocX="32737" LocY="32796" MapId="99"/>
</RoomList>
結論
程式碼:
src/l1j/server/server/command/executor/L1GMRoom.java
處理客戶端來的GM指令gmroom的處理。
結語
其實所謂的GM房間指令,就是使用了傳送加上預設參數的方式來處理