acer9999 發表於 2026-1-21 23:40

行動視窗的組隊不生效

本帖最後由 acer9999 於 2026-1-21 23:41 編輯

請教一下381行動視窗上的組隊點選對方不生效該從那個方向去修正?

ctrl+D那個組隊項

滅龍猛虎紫電 發表於 2026-1-22 03:40

本帖最後由 滅龍猛虎紫電 於 2026-1-22 04:22 編輯

客端與伺服器端封包對不上
組隊部分 客端送type=5   服務器端只處裡0跟1
// 封包格式:type=5
l1j.server.server.clientpackets:C_CreateParty.JAVA

                else if (type == 5) {
                        String name = readS();
                        L1PcInstance targetPc = L1World.getInstance().getPlayer(name);
                        if (targetPc == null) {
                              // 沒有叫%0的人。
                              pc.sendPackets(new S_ServerMessage(109));
                              return;
                        }
                        if (pc.getId() == targetPc.getId()) {
                              return;
                        }
                        if ((!pc.getLocation().isInScreen(targetPc.getLocation())
                                        || (pc.getLocation().getTileLineDistance(targetPc.getLocation()) > 7))) {
                              // 邀請組隊時,對象不再螢幕內或是7步內
                              pc.sendPackets(new S_ServerMessage(L1SystemMessageId.$952));
                              return;
                        }
                        if (targetPc.isInParty()) {
                              // 您無法邀請已經參加其他隊伍的人。
                              pc.sendPackets(new S_ServerMessage(415));
                              return;
                        }

                        // 這裡視同一般組隊邀請(type=0)
                        if (pc.isInParty()) {
                              if (pc.getParty().isLeader(pc)) {
                                        targetPc.setPartyType(0);
                                        targetPc.setPartyID(pc.getId());
                                        // 玩家 %0%s 邀請您加入隊伍?(Y/N)
                                        targetPc.sendPackets(new S_Message_YN(953, pc.getName()));
                              } else {
                                        // 只有領導者才能邀請其他的成員。
                                        pc.sendPackets(new S_ServerMessage(416));
                              }
                        } else {
                              pc.setPartyType(0);
                              targetPc.setPartyID(pc.getId());
                              // 玩家 %0%s 邀請您加入隊伍?(Y/N)
                              targetPc.sendPackets(new S_Message_YN(953, pc.getName()));
                        }
                }

                // 隊長委任   上面加入即可

acer9999 發表於 2026-1-22 12:52

感謝指點迷津,381好幾個版本貌似都不行

yasioukon 發表於 2026-1-22 18:13

改核心C_CreateParty那邊

最簡單就是強制改type

如果type等於5就讓type變2

或者你的是case寫法
就補一個case 5跟case 2放一起這樣

滅龍猛虎紫電 發表於 2026-1-22 21:17

yasioukon 發表於 2026-1-22 18:13
改核心C_CreateParty那邊

最簡單就是強制改type


你的方式比較好,簡潔有力

yasioukon 發表於 2026-1-22 21:36

滅龍猛虎紫電 發表於 2026-1-22 21:17
你的方式比較好,簡潔有力

l1j本來就比較多if的寫法


像是 他所有道具都寫在同一個檔案if


不像現在幾乎都一個道具獨立一個檔案
頁: [1]
查看完整版本: 行動視窗的組隊不生效