• R/O
  • SSH
  • HTTPS

mmosf: 提交


Commit MetaInfo

修訂101 (tree)
時間2010-02-16 01:27:30
作者msz006

Log Message

移動・停止リクエストの座標を無視する

Change Summary

差異

--- server/trunk/src/jp/sourceforge/mmosf/server/mobmove/MoveData.java (revision 100)
+++ server/trunk/src/jp/sourceforge/mmosf/server/mobmove/MoveData.java (revision 101)
@@ -1,8 +1,39 @@
1+/*
2+ * Copyright (c) 2007-2010, MMO Server Framework Project
3+ *
4+ * All rights reserved.
5+ *
6+ * Redistribution and use in source and binary forms, with or without modification,
7+ * are permitted provided that the following conditions are met:
8+ *
9+ * Redistributions of source code must retain the above copyright notice,
10+ * this list of conditions and the following disclaimer.
11+ *
12+ * Redistributions in binary form must reproduce the above copyright notice,
13+ * this list of conditions and the following disclaimer in the documentation
14+ * and/or other materials provided with the distribution.
15+ *
16+ * Neither the name of the MMO Server Framework Project nor the names of its
17+ * contributors may be used to endorse or promote products derived from this
18+ * software without specific prior written permission.
19+ *
20+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+ */
32+
133 package jp.sourceforge.mmosf.server.mobmove;
234
335 import jp.sourceforge.mmosf.server.object.Direction;
436 import jp.sourceforge.mmosf.server.object.Mob;
5-import jp.sourceforge.mmosf.server.object.PlayerCharactor;
637 import jp.sourceforge.mmosf.server.object.Position;
738 import jp.sourceforge.mmosf.server.object.Vector;
839 import jp.sourceforge.mmosf.server.packet.MovePacket;
@@ -24,28 +55,13 @@
2455
2556 public static MoveData create(Mob mob, MovePacket movePacket,long startTime) throws PacketFormatException{
2657 Vector vec = movePacket.getVector();
27- Position end = movePacket.getNext();
28-/*
58+// Position end = movePacket.getNext();
59+
2960 if(vec == null || vec.isZero()){
3061 return createEnd(mob, movePacket, startTime);
3162 }else{
32- if(end == null){
33- return createStart2End(mob, movePacket, startTime);
34- }
35-
3663 return createStart(mob, movePacket, startTime);
3764 }
38-*/
39- if(end != null){
40- return createStart2End(mob, movePacket, startTime);
41- }else{
42- if(vec == null || vec.isZero()){
43- return createEnd(mob, movePacket, startTime);
44- }else{
45- return createStart(mob, movePacket, startTime);
46- }
47-
48- }
4965 }
5066
5167 public static MoveData createStart2End(Mob mob, MovePacket movePacket,long startTime) throws PacketFormatException {
--- server/trunk/src/jp/sourceforge/mmosf/server/mobmove/MoveDataQueue.java (revision 100)
+++ server/trunk/src/jp/sourceforge/mmosf/server/mobmove/MoveDataQueue.java (revision 101)
@@ -1,7 +1,38 @@
1+/*
2+ * Copyright (c) 2007-2010, MMO Server Framework Project
3+ *
4+ * All rights reserved.
5+ *
6+ * Redistribution and use in source and binary forms, with or without modification,
7+ * are permitted provided that the following conditions are met:
8+ *
9+ * Redistributions of source code must retain the above copyright notice,
10+ * this list of conditions and the following disclaimer.
11+ *
12+ * Redistributions in binary form must reproduce the above copyright notice,
13+ * this list of conditions and the following disclaimer in the documentation
14+ * and/or other materials provided with the distribution.
15+ *
16+ * Neither the name of the MMO Server Framework Project nor the names of its
17+ * contributors may be used to endorse or promote products derived from this
18+ * software without specific prior written permission.
19+ *
20+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+ */
32+
133 package jp.sourceforge.mmosf.server.mobmove;
234
335 import java.util.LinkedList;
4-import java.util.List;
536
637 public class MoveDataQueue {
738 private LinkedList<MoveData> list;
--- server/trunk/src/jp/sourceforge/mmosf/server/mobmove/ProcessMove.java (revision 100)
+++ server/trunk/src/jp/sourceforge/mmosf/server/mobmove/ProcessMove.java (revision 101)
@@ -140,7 +140,7 @@
140140 old.setEndTime(getNowTime());
141141 old.setVector(Vector.ZERO);
142142
143- Packet sendPacket = PacketFactory.createMovePacket(old);
143+ Packet sendPacket = PacketFactory.createMoveResponse(old);
144144
145145 pc.conn.send(sendPacket);
146146 return;
@@ -156,7 +156,7 @@
156156 }
157157 pc.setVector(v);
158158 // Packet response = PacketFactory.createMoveResponsePacket(pc.moving);
159- Packet response = PacketFactory.createMovePacket(data);
159+ Packet response = PacketFactory.createMoveResponse(data);
160160 pc.conn.send(response);
161161 }
162162
--- server/trunk/src/jp/sourceforge/mmosf/server/mobmove/ProcessMove2.java (revision 100)
+++ server/trunk/src/jp/sourceforge/mmosf/server/mobmove/ProcessMove2.java (revision 101)
@@ -1,5 +1,5 @@
11 /*
2- * Copyright (c) 2007, MMO Server Framework Project
2+ * Copyright (c) 2007-2010, MMO Server Framework Project
33 *
44 * All rights reserved.
55 *
@@ -34,15 +34,11 @@
3434
3535 import java.io.IOException;
3636
37-import org.apache.commons.logging.Log;
38-import org.apache.commons.logging.LogFactory;
39-
4037 import jp.sourceforge.mmosf.server.MatchingServer;
4138 import jp.sourceforge.mmosf.server.Perception;
4239 import jp.sourceforge.mmosf.server.object.Mob;
4340 import jp.sourceforge.mmosf.server.object.MoveObject;
4441 import jp.sourceforge.mmosf.server.object.Moving;
45-import jp.sourceforge.mmosf.server.object.MovingVector;
4642 import jp.sourceforge.mmosf.server.object.PlayerCharactor;
4743 import jp.sourceforge.mmosf.server.object.Position;
4844 import jp.sourceforge.mmosf.server.object.Vector;
@@ -51,6 +47,9 @@
5147 import jp.sourceforge.mmosf.server.packet.PacketFactory;
5248 import jp.sourceforge.mmosf.server.packet.PacketFormatException;
5349
50+import org.apache.commons.logging.Log;
51+import org.apache.commons.logging.LogFactory;
52+
5453 public class ProcessMove2 {
5554 private static final Log log = LogFactory.getLog(ProcessMove.class);
5655 /**
@@ -69,7 +68,7 @@
6968 recordTime(packet, pc);
7069
7170 MovePacket movePacket = (MovePacket)packet;
72-
71+// System.out.println("move packet:"+new String(movePacket.toBytes().array()));
7372 MoveData data = MoveData.create(pc, movePacket, time);
7473 getMoveDataQueue(pc).add(data);
7574 }
@@ -135,6 +134,7 @@
135134 long span = nowTime - moveData.getStartTme();
136135
137136 Position newPos = moveData.getMovedPosition(span);
137+ newPos = new Position(newPos.getX()+0.5,newPos.getY()+0.5,newPos.getZ()+0.5);
138138
139139 MoveObject mo = new MoveObject(oldPos,newPos,mob.getId());
140140 if(!perception.isEnableMove(mo)){
@@ -175,7 +175,7 @@
175175
176176 private void sendMoveResponse(Mob mob, MoveData moveData) {
177177 if(mob instanceof PlayerCharactor ){
178- Packet packet = PacketFactory.createMovePacket(moveData);
178+ Packet packet = PacketFactory.createMoveResponse(moveData);
179179 try{
180180 ((PlayerCharactor)mob).conn.send(packet);
181181 }catch(Exception e){
--- server/trunk/src/jp/sourceforge/mmosf/server/mobmove/NPCMoveRND.java (revision 100)
+++ server/trunk/src/jp/sourceforge/mmosf/server/mobmove/NPCMoveRND.java (revision 101)
@@ -1,9 +1,39 @@
1+/*
2+ * Copyright (c) 2007-2010, MMO Server Framework Project
3+ *
4+ * All rights reserved.
5+ *
6+ * Redistribution and use in source and binary forms, with or without modification,
7+ * are permitted provided that the following conditions are met:
8+ *
9+ * Redistributions of source code must retain the above copyright notice,
10+ * this list of conditions and the following disclaimer.
11+ *
12+ * Redistributions in binary form must reproduce the above copyright notice,
13+ * this list of conditions and the following disclaimer in the documentation
14+ * and/or other materials provided with the distribution.
15+ *
16+ * Neither the name of the MMO Server Framework Project nor the names of its
17+ * contributors may be used to endorse or promote products derived from this
18+ * software without specific prior written permission.
19+ *
20+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
27+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
28+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+ */
32+
133 package jp.sourceforge.mmosf.server.mobmove;
234
335 import java.util.Random;
436
5-import org.apache.log4j.Logger;
6-
737 import jp.sourceforge.mmosf.server.Perception;
838 import jp.sourceforge.mmosf.server.object.Direction;
939 import jp.sourceforge.mmosf.server.object.Mob;
@@ -10,10 +40,9 @@
1040 import jp.sourceforge.mmosf.server.object.MoveObject;
1141 import jp.sourceforge.mmosf.server.object.Position;
1242 import jp.sourceforge.mmosf.server.object.Vector;
13-import jp.sourceforge.mmosf.server.packet.MovePacket;
14-import jp.sourceforge.mmosf.server.packet.PacketFactory;
15-import jp.sourceforge.mmosf.server.packet.PacketFormatException;
1643
44+import org.apache.log4j.Logger;
45+
1746 public class NPCMoveRND {
1847 static private Random rd = null;
1948 private int command_id = 0;
Show on old repository browser